特殊日历表

parent 5b0e9061
package com.aps.entity;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
public class SpecialCalendar {
private Long id;
private LocalDateTime creationTime;
private BigDecimal creatorUserId;
private LocalDateTime lastModificationTime;
private BigDecimal lastModifierUserId;
private BigDecimal deleterUserId;
private LocalDateTime deletionTime;
private Short isDeleted;
private String code;
private String name;
private String remark;
}
\ No newline at end of file
package com.aps.entity;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
public class SpecialCalendarDetail {
private Long id;
private LocalDateTime creationTime;
private BigDecimal creatorUserId;
private LocalDateTime lastModificationTime;
private BigDecimal lastModifierUserId;
private BigDecimal deleterUserId;
private LocalDateTime deletionTime;
private Short isDeleted;
private Long holidayId;
private String holidayCode;
private String holidayName;
private LocalDateTime startTime;
private LocalDateTime endTime;
private Long specialCalendarId;
}
\ No newline at end of file
package com.aps.mapper;
import com.aps.entity.SpecialCalendarDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 特殊日历详情表 Mapper 接口
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-26
*/
public interface SpecialCalendarDetailMapper extends BaseMapper<SpecialCalendarDetail> {
}
package com.aps.mapper;
import com.aps.entity.SpecialCalendar;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 特殊日历表 Mapper 接口
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-26
*/
public interface SpecialCalendarMapper extends BaseMapper<SpecialCalendar> {
}
...@@ -321,11 +321,11 @@ if(routingIds.size()==0) ...@@ -321,11 +321,11 @@ if(routingIds.size()==0)
Map<Long, String> routingDetailIdToExecIdMap = processExecList.stream() Map<String, String> routingDetailIdToExecIdMap = processExecList.stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
ProdProcessExec::getRoutingDetailId, exec -> exec.getRoutingDetailId() + "_" + exec.getOrderId(), // 复合键:工序ID_订单ID
ProdProcessExec::getExecId, ProdProcessExec::getExecId,
(existing, replacement) -> existing)); (existing, replacement) -> existing)); // 处理重复key的情况
if(connections==null) if(connections==null)
{ {
......
...@@ -46,11 +46,13 @@ public interface LanuchService { ...@@ -46,11 +46,13 @@ public interface LanuchService {
List<RoutingDetailEquip> routingDetailEquips, List<RoutingDetailEquip> routingDetailEquips,
String sceneId,List<ProdProcessExec> processExecList,Boolean isSave); String sceneId,List<ProdProcessExec> processExecList,Boolean isSave);
List<ProdOrderProcess> createProcessRelations(ProdLaunchOrder prodOrderMain, String sceneId, Map<Long, String> routingDetailIdToExecIdMap); List<ProdOrderProcess> createProcessRelations(ProdLaunchOrder prodOrderMain, String sceneId, Map<String, String> routingDetailIdToExecIdMap);
ProdOrderProcess createProcessRelation(ProdLaunchOrder prodOrderMain, ProdOrderProcess createProcessRelation(ProdLaunchOrder prodOrderMain,
RoutingDetailConnect connection, RoutingDetailConnect connection,
String sceneId, String sceneId,
Map<Long, String> routingDetailIdToExecIdMap); Map<String, String> routingDetailIdToExecIdMap);
} }
\ No newline at end of file
package com.aps.service;
import com.aps.entity.SpecialCalendarDetail;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 特殊日历详情表 服务类
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-26
*/
public interface SpecialCalendarDetailService extends IService<SpecialCalendarDetail> {
}
package com.aps.service;
import com.aps.entity.SpecialCalendar;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 特殊日历表 服务类
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-26
*/
public interface SpecialCalendarService extends IService<SpecialCalendar> {
}
...@@ -124,12 +124,17 @@ public class LanuchServiceImpl implements LanuchService { ...@@ -124,12 +124,17 @@ public class LanuchServiceImpl implements LanuchService {
.collect(Collectors.toList()); .collect(Collectors.toList());
List<ApsOrder> apsOrders = apsOrderService.lambdaQuery() List<ApsOrder> apsOrders;
.eq(ApsOrder::getIsdeleted, 0) if (apsOrderIds.isEmpty()) {
.eq(ApsOrder::getSchedulestatus, 1) apsOrders = new ArrayList<>();
} else {
apsOrders = apsOrderService.lambdaQuery()
.eq(ApsOrder::getIsdeleted, 0)
.eq(ApsOrder::getSchedulestatus, 1)
// .eq(ApsOrder::getCreatoruserid, username) // .eq(ApsOrder::getCreatoruserid, username)
.in(ApsOrder::getId, apsOrderIds) .in(ApsOrder::getId, apsOrderIds)
.list(); .list();
}
if (CollectionUtils.isEmpty(apsOrders)) { if (CollectionUtils.isEmpty(apsOrders)) {
throw new SceneGenerationException("工单列表不能为空"); throw new SceneGenerationException("工单列表不能为空");
} }
...@@ -711,9 +716,9 @@ public class LanuchServiceImpl implements LanuchService { ...@@ -711,9 +716,9 @@ public class LanuchServiceImpl implements LanuchService {
.list(); .list();
// 构建routingDetailId到execId的映射 // 构建routingDetailId到execId的映射
Map<Long, String> routingDetailIdToExecIdMap = processExecList.stream() Map<String, String> routingDetailIdToExecIdMap = processExecList.stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
ProdProcessExec::getRoutingDetailId, exec -> exec.getRoutingDetailId() + "_" + exec.getOrderId(), // 复合键:工序ID_订单ID
ProdProcessExec::getExecId, ProdProcessExec::getExecId,
(existing, replacement) -> existing)); // 处理重复key的情况 (existing, replacement) -> existing)); // 处理重复key的情况
...@@ -733,7 +738,7 @@ public class LanuchServiceImpl implements LanuchService { ...@@ -733,7 +738,7 @@ public class LanuchServiceImpl implements LanuchService {
◦ @param sceneId 场景ID ◦ @param sceneId 场景ID
*/ */
public void generateProcessRelations(List<ProdLaunchOrder> prodOrderMains, String sceneId, Map<Long, String> routingDetailIdToExecIdMap) { public void generateProcessRelations(List<ProdLaunchOrder> prodOrderMains, String sceneId, Map<String, String> routingDetailIdToExecIdMap) {
if (CollectionUtils.isEmpty(prodOrderMains)) { if (CollectionUtils.isEmpty(prodOrderMains)) {
return; return;
} }
...@@ -777,7 +782,7 @@ public class LanuchServiceImpl implements LanuchService { ...@@ -777,7 +782,7 @@ public class LanuchServiceImpl implements LanuchService {
◦ @return 工序关系列表 ◦ @return 工序关系列表
*/ */
public List<ProdOrderProcess> createProcessRelations(ProdLaunchOrder prodOrderMain, String sceneId, Map<Long, String> routingDetailIdToExecIdMap) { public List<ProdOrderProcess> createProcessRelations(ProdLaunchOrder prodOrderMain, String sceneId, Map<String, String> routingDetailIdToExecIdMap) {
LambdaQueryWrapper<RoutingDetailConnect> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<RoutingDetailConnect> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(RoutingDetailConnect::getRoutingHeaderId, prodOrderMain.getRoutingId()) wrapper.eq(RoutingDetailConnect::getRoutingHeaderId, prodOrderMain.getRoutingId())
.eq(RoutingDetailConnect::getIsdeleted, 0) .eq(RoutingDetailConnect::getIsdeleted, 0)
...@@ -805,12 +810,12 @@ public class LanuchServiceImpl implements LanuchService { ...@@ -805,12 +810,12 @@ public class LanuchServiceImpl implements LanuchService {
public ProdOrderProcess createProcessRelation(ProdLaunchOrder prodOrderMain, public ProdOrderProcess createProcessRelation(ProdLaunchOrder prodOrderMain,
RoutingDetailConnect connection, RoutingDetailConnect connection,
String sceneId, String sceneId,
Map<Long, String> routingDetailIdToExecIdMap) { Map<String, String> routingDetailIdToExecIdMap) {
ProdOrderProcess prodOrderProcess = new ProdOrderProcess(); ProdOrderProcess prodOrderProcess = new ProdOrderProcess();
String execId = routingDetailIdToExecIdMap.get(connection.getSourceoperationid()); String execId = routingDetailIdToExecIdMap.get(connection.getSourceoperationid() + "_" + prodOrderMain.getOrderId());
String targetExecId = routingDetailIdToExecIdMap.get(connection.getDestoperationid()); String targetExecId = routingDetailIdToExecIdMap.get(connection.getDestoperationid() + "_" + prodOrderMain.getOrderId());
if (connection.getDestoperationid() !=null && connection.getSourceoperationid() != null && execId != null && targetExecId != null) { if (connection.getDestoperationid() !=null && connection.getSourceoperationid() != null && execId != null && targetExecId != null) {
prodOrderProcess.setTaskSeq(getTaskSeqFromRoutingDetail(connection.getSourceoperationid(), connection.getSourceoperation())); prodOrderProcess.setTaskSeq(getTaskSeqFromRoutingDetail(connection.getSourceoperationid(), connection.getSourceoperation()));
...@@ -826,8 +831,6 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid() ...@@ -826,8 +831,6 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
// prodOrderProcess.setTargetTaskSeq(connection.getDestoperation()); // prodOrderProcess.setTargetTaskSeq(connection.getDestoperation());
prodOrderProcess.setId(String.valueOf(SnowFlackIdWorker.getId())); prodOrderProcess.setId(String.valueOf(SnowFlackIdWorker.getId()));
if (execId != null) { if (execId != null) {
prodOrderProcess.setExecId(execId); prodOrderProcess.setExecId(execId);
} }
......
package com.aps.service.impl;
import com.aps.entity.SpecialCalendarDetail;
import com.aps.mapper.SpecialCalendarDetailMapper;
import com.aps.service.SpecialCalendarDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 特殊日历详情表 服务实现类
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-26
*/
@Service
public class SpecialCalendarDetailServiceImpl extends ServiceImpl<SpecialCalendarDetailMapper, SpecialCalendarDetail> implements SpecialCalendarDetailService {
}
package com.aps.service.impl;
import com.aps.entity.SpecialCalendar;
import com.aps.mapper.SpecialCalendarMapper;
import com.aps.service.SpecialCalendarService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 特殊日历表 服务实现类
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-26
*/
@Service
public class SpecialCalendarServiceImpl extends ServiceImpl<SpecialCalendarMapper, SpecialCalendar> implements SpecialCalendarService {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aps.mapper.SpecialCalendarDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.aps.entity.SpecialCalendarDetail">
<id column="ID" property="id" />
<result column="CREATION_TIME" property="creationTime" />
<result column="CREATOR_USER_ID" property="creatorUserId" />
<result column="LAST_MODIFICATION_TIME" property="lastModificationTime" />
<result column="LAST_MODIFIER_USER_ID" property="lastModifierUserId" />
<result column="DELETER_USER_ID" property="deleterUserId" />
<result column="DELETION_TIME" property="deletionTime" />
<result column="IS_DELETED" property="isDeleted" />
<result column="HOLIDAY_ID" property="holidayId" />
<result column="HOLIDAY_CODE" property="holidayCode" />
<result column="HOLIDAY_NAME" property="holidayName" />
<result column="START_TIME" property="startTime" />
<result column="END_TIME" property="endTime" />
<result column="SPECIAL_CALENDAR_ID" property="specialCalendarId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID, CREATION_TIME, CREATOR_USER_ID, LAST_MODIFICATION_TIME, LAST_MODIFIER_USER_ID, DELETER_USER_ID, DELETION_TIME, IS_DELETED, HOLIDAY_ID, HOLIDAY_CODE, HOLIDAY_NAME, START_TIME, END_TIME, SPECIAL_CALENDAR_ID
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aps.mapper.SpecialCalendarMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.aps.entity.SpecialCalendar">
<id column="ID" property="id" />
<result column="CREATION_TIME" property="creationTime" />
<result column="CREATOR_USER_ID" property="creatorUserId" />
<result column="LAST_MODIFICATION_TIME" property="lastModificationTime" />
<result column="LAST_MODIFIER_USER_ID" property="lastModifierUserId" />
<result column="DELETER_USER_ID" property="deleterUserId" />
<result column="DELETION_TIME" property="deletionTime" />
<result column="IS_DELETED" property="isDeleted" />
<result column="CODE" property="code" />
<result column="NAME" property="name" />
<result column="REMARK" property="remark" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID, CREATION_TIME, CREATOR_USER_ID, LAST_MODIFICATION_TIME, LAST_MODIFIER_USER_ID, DELETER_USER_ID, DELETION_TIME, IS_DELETED, CODE, NAME, REMARK
</sql>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment