فهرست منبع

Merge remote-tracking branch 'origin/mode-min-unit' into mode-min-unit

xiahan 10 ماه پیش
والد
کامیت
1f2bbeff1f
20فایلهای تغییر یافته به همراه132 افزوده شده و 102 حذف شده
  1. 10 12
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsBlankOrderServiceImpl.java
  2. 1 1
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductDetailServiceImpl.java
  3. 1 1
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductionOrderServiceImpl.java
  4. 2 2
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportOutputServiceImpl.java
  5. 3 3
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportRecordsServiceImpl.java
  6. 27 17
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsServiceImpl.java
  7. 1 1
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/GanttServiceImpl.java
  8. 1 1
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/utils/ApsUtils.java
  9. 30 48
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsBlankOrderDo.java
  10. 12 0
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsBlankOrderHistoryDo.java
  11. 19 4
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsScheduleConfigDo.java
  12. 5 0
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ProduceOrder.java
  13. 5 0
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ProductionScheduleVo.java
  14. 1 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/config/EquMaintenanceStandardListener.java
  15. 2 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquFrockTestRecordServiceImpl.java
  16. 2 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquOverhaulPlanningTasksServiceImpl.java
  17. 4 3
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/MaintenanceServiceImpl.java
  18. 1 1
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafeAttachmentsServiceImpl.java
  19. 3 3
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafetyPerformanceAppraisalServiceImpl.java
  20. 2 2
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/CheckItemsServiceImpl.java

+ 10 - 12
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsBlankOrderServiceImpl.java

@@ -40,14 +40,12 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.Collator;
-import java.text.SimpleDateFormat;
 import java.time.ZoneId;
 import java.util.*;
 import java.util.stream.Collectors;
 
 import static com.rongwei.bscommon.sys.service.impl.ApsProductionOrderServiceImpl.ERROR_MSG;
 import static com.rongwei.bscommon.sys.utils.ApsUtils.addNewConflictsDesc;
-import static com.rongwei.safecommon.utils.SaveConstans.DatePattern.DATE_PATTERN_YMDHMS;
 import static com.rongwei.safecommon.utils.SaveConstans.ForcedConflictsDescription.EXCEEDING_THE_PROMISED_DELIVERY_DEADLINE;
 import static com.rongwei.safecommon.utils.SaveConstans.LockmarkType.LOCKMARK_N;
 import static com.rongwei.safecommon.utils.SaveConstans.LockmarkType.LOCKMARK_Y;
@@ -331,9 +329,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
     @Transactional(rollbackFor = Exception.class)
     public R insertOrder(Map<String, Object> params) throws Exception {
         String blankOrderId = params.get("BLANKORDERID").toString();
-        String deliveryDateStr = params.get("DELIVERYDATE").toString();
-        SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN_YMDHMS);
-        Date deliveryDate = formatter.parse(deliveryDateStr);
+        String expecteddays = params.get("EXPECTEDDAYS").toString();
 
         //撤回发布该作业的坯料计划的排程结果
         publishCancel(Arrays.asList(blankOrderId));
@@ -349,9 +345,9 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
                 currentUser == null ? "" : currentUser.getId(),
                 currentUser == null ? "" : currentUser.getName());
 
-        // 保存坯料需求的期望交货
+        // 保存坯料需求的期望交货天数(天)
         boolean bool1 = this.update(new LambdaUpdateWrapper<ApsBlankOrderDo>().eq(ApsBlankOrderDo::getId, blankOrderId)
-                .set(ApsBlankOrderDo::getDeliverydate, deliveryDate)
+                .set(ApsBlankOrderDo::getExpecteddays, Integer.parseInt(expecteddays))
                 .set(ApsBlankOrderDo::getLockmark, LOCKMARK_N));
 
         // 解锁该坯料计划所有作业明细,设置是否锁定=否
@@ -520,7 +516,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
         //获取当前用户的所属工厂
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
         ApsUtils.checkScheduling(currentUser);
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
 
 //        List<ApsBlankOrderVo> notLockOrders = apsBlankOrderDao.getNotLockOrders(tenantId);
         List<ApsBlankOrderVo> notLockOrders = new ArrayList<>();
@@ -581,8 +577,10 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
     public void apsAfter(ProductionScheduleRetVo productionScheduleRetVo, List<ApsBlankOrderVo> apsBlankOrders) {
         // 先删除所有作业的明细
         List<String> blankids = apsBlankOrders.stream().map(v -> v.getId()).collect(Collectors.toList());
+//        processOperationProcessEquService.remove(new LambdaUpdateWrapper<ApsProcessOperationProcessEquDo>()
+//                .in(ApsProcessOperationProcessEquDo::getBlankid, blankids).eq(ApsProcessOperationProcessEquDo::getLockmark, "n"));
         processOperationProcessEquService.remove(new LambdaUpdateWrapper<ApsProcessOperationProcessEquDo>()
-                .in(ApsProcessOperationProcessEquDo::getBlankid, blankids).eq(ApsProcessOperationProcessEquDo::getLockmark, "n"));
+                .in(ApsProcessOperationProcessEquDo::getBlankid, blankids));
         logger.info("作业明细删除结束..: " + blankids);
         // 排程结果保存
         List<ApsProcessOperationProcessEquDo> apsProcessOperationProcessEquDos = new ArrayList<>();
@@ -1542,7 +1540,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
         //获取当前用户信息
         //获取当前用户的所属工厂
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
 
 
         //=============校验坯料长度=================
@@ -2060,7 +2058,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
         //获取当前用户信息
         //获取当前用户的所属工厂
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
 
 
         //=============校验坯料长度=================
@@ -2816,7 +2814,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
 
         //当前用户所属工厂
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
         param.setTenantId(tenantId);
 
         Page<ProductPlanReportVo> queryPage = new Page<>(current, size);

+ 1 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductDetailServiceImpl.java

@@ -465,7 +465,7 @@ public class ApsProductDetailServiceImpl extends ServiceImpl<ApsProductDetailDao
     public R updateOrSaveProductDetails(List<ApsProductDetailDo> req) {
         // 当前等路人所属工厂
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
         if (ObjectUtil.isNotEmpty(req) && req.size() > 0) {
             for (ApsProductDetailDo apsProductDetailDo : req) {
                 apsProductDetailDo.setTenantid(tenantId);

+ 1 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductionOrderServiceImpl.java

@@ -328,7 +328,7 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
         if (req.getIsNeedSave()) {
             //获取当前用户的所属工厂
             SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-            String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+            String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
 
             //保存主表信息
             apsProductionOrderDo.setTenantid(tenantId);

+ 2 - 2
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportOutputServiceImpl.java

@@ -203,7 +203,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
         //获取当前用户信息
         //获取当前用户的所属工厂
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
         for (ApsReportOutputDo apsReportOutputDo : resList) {
             apsReportOutputDo.setTenantid(tenantId);
         }
@@ -317,7 +317,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
 //        //获取当前用户信息
 //        //获取当前用户的所属工厂
 //        SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-//        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+//        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
 //        for (ApsReportOutputDo apsReportOutputDo : resList) {
 //            apsReportOutputDo.setTenantid(tenantId);
 //        }

+ 3 - 3
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportRecordsServiceImpl.java

@@ -366,7 +366,7 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
 
         //获取当前用户相关信息
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
 
         //查询此工序对应工艺步骤中,对应设备的设备参数
         String equparames = "";
@@ -988,7 +988,7 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
             workInProgressInventoryDo.setId(SecurityUtil.getUUID());
             //获取当前用户相关信息
             SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-            String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+            String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
             workInProgressInventoryDo.setTenantid(tenantId);
             //报工输出物料的批次号
             workInProgressInventoryDo.setBlankbatchnumber(apsReportOutputDo.getOutputnumber());
@@ -1093,7 +1093,7 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
 
         //当前登录用户信息
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
 
         //查询此工序对应工艺步骤中,对应设备的设备参数
         String equparames = "";

+ 27 - 17
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsServiceImpl.java

@@ -86,7 +86,7 @@ public class ApsServiceImpl implements ApsService {
         if(currentUser == null){
             currentUser = CXCommonUtils.getCurrentUser();
         }
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
         if (StringUtils.isBlank(tenantId)) {
             throw new CustomException("所属工厂不能为空");
         }
@@ -754,6 +754,7 @@ public class ApsServiceImpl implements ApsService {
             productionScheduleVo.setWashingtime(apsScheduleConfig.getWashingtime());
             productionScheduleVo.setStandingtime(apsScheduleConfig.getStandingtime());
             productionScheduleVo.setStandingyield(apsScheduleConfig.getStandingyield());
+            productionScheduleVo.setExpecteddays(apsScheduleConfig.getExpecteddays());
             if(productionScheduleVo.getStandingyield() == null){
                 productionScheduleVo.setStandingyield(60);
             }
@@ -798,6 +799,11 @@ public class ApsServiceImpl implements ApsService {
                 // 坯料计划订单
                 ProduceOrder produceOrder = new ProduceOrder(apsBlankOrderVo.getId(), apsBlankOrderVo.getMaterialname(), apsBlankOrderVo.getDeliverydate() == null ? null : DateUtil.offsetHour(apsBlankOrderVo.getDeliverydate(), -apsBlankOrderVo.getDeliverytime()));
                 produceOrder.setMaxheatroll(apsBlankOrderVo.getMaxheatroll());
+                // 期望交货天数
+                produceOrder.setExpecteddays(productionScheduleVo.getExpecteddays());
+                if(apsBlankOrderVo.getExpecteddays() != null && apsBlankOrderVo.getExpecteddays()>0){
+                    produceOrder.setExpecteddays(apsBlankOrderVo.getExpecteddays());
+                }
                 // 获取所有订单工序
                 List<ApsProcessOperationDo> operationDos = apsProcessOperationService.list(new LambdaQueryWrapper<ApsProcessOperationDo>()
                         .eq(ApsProcessOperationDo::getBlankid, apsBlankOrderVo.getId()));
@@ -860,7 +866,7 @@ public class ApsServiceImpl implements ApsService {
         if (StringUtils.isNotBlank(operationDo.getCanchoosedeviceid())) {
             String[] sbIds = operationDo.getCanchoosedeviceid().split(",");
             for (String equIds : sbIds) {
-                if(equIds.equals("0001be252874536843730b100055")){
+                if(equIds.equals("0001be252874536843730b100052")){
                     System.out.println(equIds);
                 }
                 AspCheckItemsDo checkItemsD = eqMaps.get(equIds);
@@ -981,6 +987,8 @@ public class ApsServiceImpl implements ApsService {
 
                             }
                         }
+                        // 设备占用时间段
+                        List<EquipmentRunTime> equipmentRunTimes = new ArrayList<>();
                         // 查询相关工序作业
                         Set<String> processIds = new HashSet<>();
                         if (processEqus != null && processEqus.size() > 0) {
@@ -995,7 +1003,7 @@ public class ApsServiceImpl implements ApsService {
                             //
                             List<ApsProcessOperationOutMaterDo> outMaterDosAll = apsProcessOperationOutMaterService.list(new LambdaQueryWrapper<ApsProcessOperationOutMaterDo>()
                                     .in(ApsProcessOperationOutMaterDo::getMainid, processIds));
-                            List<EquipmentRunTime> equipmentRunTimes = new ArrayList<>();
+
                             for (ApsProcessOperationProcessEquDo equs : processEqus) {
                                 EquipmentRunTime er = new EquipmentRunTime();
                                 er.setStartRunTime(equs.getPlanstartdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
@@ -1034,22 +1042,24 @@ public class ApsServiceImpl implements ApsService {
                                 }
                                 equipmentRunTimes.add(er);
                             }
-                            // 设备日历不可用时间段
-                            List<ApsEquipmentCalendarDo> equipmentCalendarDos = apsEquipmentCalendarService.list(
-                                    new LambdaQueryWrapper<ApsEquipmentCalendarDo>().ge(ApsEquipmentCalendarDo::getSdstarttime, apsPlanStartDate)
-                                            .eq(ApsEquipmentCalendarDo::getProcessdeviceid, equipment.getBsEquipmentId()));
-                            if (equipmentCalendarDos != null && equipmentCalendarDos.size() > 0) {
-                                for (ApsEquipmentCalendarDo equipmentCalendarDo : equipmentCalendarDos) {
-                                    EquipmentRunTime er = new EquipmentRunTime();
-                                    er.setStartRunTime(equipmentCalendarDo.getSdstarttime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
-                                    er.setEndRunTime(equipmentCalendarDo.getSdendtime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
-                                    er.setOccupyType("maintenance");
-                                    equipmentRunTimes.add(er);
-                                }
+                        }
+                        // 设备日历不可用时间段
+                        List<ApsEquipmentCalendarDo> equipmentCalendarDos = apsEquipmentCalendarService.list(
+                                new LambdaQueryWrapper<ApsEquipmentCalendarDo>().ge(ApsEquipmentCalendarDo::getSdendtime, apsPlanStartDate)
+                                        .eq(ApsEquipmentCalendarDo::getProcessdeviceid, equipment.getBsEquipmentId()));
+                        if (equipmentCalendarDos != null && equipmentCalendarDos.size() > 0) {
+                            for (ApsEquipmentCalendarDo equipmentCalendarDo : equipmentCalendarDos) {
+                                EquipmentRunTime er = new EquipmentRunTime();
+                                er.setStartRunTime(equipmentCalendarDo.getSdstarttime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
+                                er.setEndRunTime(equipmentCalendarDo.getSdendtime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
+                                er.setOccupyType("maintenance");
+                                equipmentRunTimes.add(er);
                             }
-
+                        }
+                        if(equipmentRunTimes != null && equipmentRunTimes.size()>0){
                             equipment.setEquipmentRunTimes(equipmentRunTimes);
                         }
+
                         equipmentList.add(equipment);
                     }
                 }
@@ -1158,7 +1168,7 @@ public class ApsServiceImpl implements ApsService {
             // 锁定的作业
             if(LOCKMARK_Y.equals(operationDo.getLockmark())){
                 List<ApsProcessOperationProcessEquDo> processDetails = processOperationProcessEquService.list(new LambdaQueryWrapper<ApsProcessOperationProcessEquDo>()
-                        .eq(ApsProcessOperationProcessEquDo::getProcessid, operationDo.getId()));
+                        .eq(ApsProcessOperationProcessEquDo::getProcessid, operationDo.getId()).orderByAsc(ApsProcessOperationProcessEquDo::getPlanstartdate));
                 for (ApsProcessOperationProcessEquDo processDetail : processDetails) {
                     ProductionProcesses processes = productionProcessesDetailInit(operationDo, produceOrder, optionalEquipments,outMaterDos,apsBlankOrderVo);
                     processes.setIfLock(true);

+ 1 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/GanttServiceImpl.java

@@ -150,7 +150,7 @@ public class GanttServiceImpl implements GanttService {
         log.info("开始获取排程状态");
         if (StringUtils.isBlank(factoryId)) {
             SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-            factoryId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+            factoryId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
         }
         log.debug("判断工厂:{}是否正在排程", factoryId);
         RLock rLock = redissonClient.getLock(factoryId);

+ 1 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/utils/ApsUtils.java

@@ -69,7 +69,7 @@ public class ApsUtils {
         if(currentUser==null){
             currentUser = CXCommonUtils.getCurrentUser();
         }
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
         if (StringUtils.isBlank(tenantId)) {
             throw new CustomException("当前用户所属工厂信息为空");
         }

+ 30 - 48
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsBlankOrderDo.java

@@ -1,10 +1,10 @@
 package com.rongwei.bsentity.domain;
 
 import java.math.BigDecimal;
-import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.rongwei.rwcommon.base.BaseDo;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author fpy
- * @since 2024-04-08
+ * @since 2024-09-18
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -172,153 +172,135 @@ public class ApsBlankOrderDo extends BaseDo {
      */
     @TableField("LOCKMARK")
     private String lockmark;
-
     /**
      * 是否暂存
      */
     @TableField("ISSTAG")
     private String isstag;
-
     /**
      * 排程状态
      */
     @TableField("SCHEDULINGSTATUS")
     private String schedulingstatus;
-
     /**
      * 预计来料日期
      */
-    @TableField(value = "PLANHAVEMATERIALDATE")
+    @TableField("PLANHAVEMATERIALDATE")
     private Date planhavematerialdate;
-
     /**
      * 期望交货日期
      */
     @TableField("DELIVERYDATE")
     private Date deliverydate;
-
     /**
      * 排程交货日期-起
      */
     @TableField("SCHEDULEDATESTART")
     private Date scheduledatestart;
-
     /**
      * 排程交货日期-止
      */
     @TableField("SCHEDULEDATEEND")
     private Date scheduledateend;
-
     /**
      * 承诺交货日期-起
      */
     @TableField("PROMISEDATESTART")
     private Date promisedatestart;
-
     /**
-     * 承诺交货日期-止排程
+     * 承诺交货日期-止
      */
     @TableField("PROMISEDATEEND")
     private Date promisedateend;
+    /**
+     * 计划排产车间
+     */
+    @TableField("PLANNEDPRODUCTIONWORKSHOP")
+    private String plannedproductionworkshop;
     /**
      * 坯料输出物料类型
      */
     @TableField("BLANKOUTMATERTYPE")
     private String blankoutmatertype;
-
-
     /**
      * 坯料输出物料规格
      */
     @TableField("BLANKOUTMATERSPECIFICATION")
     private String blankoutmaterspecification;
-
     /**
      * 工艺输出物料规格
      */
     @TableField("PROCESSOUTMATERSPECIFICATION")
     private String processoutmaterspecification;
-    /**
-     * 计划排产车间
-     */
-    @TableField("PLANNEDPRODUCTIONWORKSHOP")
-    private String plannedproductionworkshop;
     /**
      * 路线产品类型
      */
-    @TableField(value = "ROUTEPRODUCTTYPEID")
+    @TableField("ROUTEPRODUCTTYPEID")
     private String routeproducttypeid;
-
     /**
      * 路线合金
      */
-    @TableField(value = "ROUTEMETAL")
+    @TableField("ROUTEMETAL")
     private String routemetal;
-
     /**
      * 路线合金状态
      */
-    @TableField(value = "ROUTEMETALSTATE")
+    @TableField("ROUTEMETALSTATE")
     private String routemetalstate;
-
     /**
      * 路线厚度-起(mm)
      */
-    @TableField(value = "ROUTETHICKSTR")
-    private BigDecimal routethinckstr;
-
+    @TableField("ROUTETHICKSTR")
+    private BigDecimal routethickstr;
     /**
      * 路线厚度-止(mm)
      */
-    @TableField(value = "ROUTETHICKEND")
+    @TableField("ROUTETHICKEND")
     private BigDecimal routethickend;
-
     /**
      * 路线宽度-起(mm)
      */
-    @TableField(value = "ROUTEWIDTHSTR")
-    private BigDecimal routewodthstr;
-
+    @TableField("ROUTEWIDTHSTR")
+    private BigDecimal routewidthstr;
     /**
      * 路线宽度-止(mm)
      */
-    @TableField(value = "ROUTEWIDTHEND")
+    @TableField("ROUTEWIDTHEND")
     private BigDecimal routewidthend;
-
     /**
      * 路线长度-起(mm)
      */
-    @TableField(value = "ROUTELENGTHSTR")
+    @TableField("ROUTELENGTHSTR")
     private BigDecimal routelengthstr;
-
     /**
      * 路线长度-止(mm)
      */
-    @TableField(value = "ROUTELENGTHEND")
+    @TableField("ROUTELENGTHEND")
     private BigDecimal routelengthend;
-
     /**
      * 坯料外观类型
      */
-    @TableField(value = "BLANKAPPEARANCE")
+    @TableField("BLANKAPPEARANCE")
     private String blankappearance;
-
     /**
      * 最大装炉卷数
      */
-    @TableField(value = "MAXHEATROLL")
+    @TableField("MAXHEATROLL")
     private Integer maxheatroll;
-
     /**
      * 坯料来源
      */
-    @TableField(value = "BLANKCOMEFROM")
+    @TableField("BLANKCOMEFROM")
     private String blankcomefrom;
-
     /**
      * 是否要更新工序作业1-要 0-不需要
      */
-    @TableField(value = "UPDATEPROCESS")
+    @TableField("UPDATEPROCESS")
     private String updateprocess;
+    /**
+     * 期望交货天数(天)
+     */
+    @TableField("EXPECTEDDAYS")
+    private Integer expecteddays;
 
 }

+ 12 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsBlankOrderHistoryDo.java

@@ -237,4 +237,16 @@ public class ApsBlankOrderHistoryDo extends BaseDo {
      */
     @TableField(value = "BLANKCOMEFROM")
     private String blankcomefrom;
+
+    /**
+     * 是否要更新工序作业1-要 0-不需要
+     */
+    @TableField(value = "UPDATEPROCESS")
+    private String updateprocess;
+
+    /**
+     * 期望交货天数(天)
+     */
+    @TableField(value = "EXPECTEDDAYS")
+    private Integer expecteddays;
 }

+ 19 - 4
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsScheduleConfigDo.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author fpy
- * @since 2024-07-11
+ * @since 2024-09-18
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -137,16 +137,31 @@ public class ApsScheduleConfigDo extends BaseDo {
      */
     @TableField("STANDINGTIME")
     private Integer standingtime;
+    /**
+     * 排程速度
+     */
+    @TableField("PCSPEED")
+    private Integer pcspeed;
     /**
      * 立板产量(吨)
      */
     @TableField("STANDINGYIELD")
     private Integer standingyield;
     /**
-     * 排程速度
+     * 中退组炉度差(毫米)
      */
-    @TableField("PCSPEED")
-    private Integer pcspeed;
+    @TableField("MIDDIFFERENCE")
+    private Integer middifference;
+    /**
+     * 成退组炉度差(毫米)
+     */
+    @TableField("FURNACEDIFFERENCE")
+    private Integer furnacedifference;
+    /**
+     * 期望交货天数(天)
+     */
+    @TableField("EXPECTEDDAYS")
+    private Integer expecteddays;
 
 
 }

+ 5 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ProduceOrder.java

@@ -48,4 +48,9 @@ public class ProduceOrder {
      */
     private Integer maxheatroll;
 
+    /**
+     * 除铸轧外期望交货天数
+     */
+    private Integer expecteddays;
+
 }

+ 5 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ProductionScheduleVo.java

@@ -89,4 +89,9 @@ public class ProductionScheduleVo {
      */
     private Integer pcspeed;
 
+    /**
+     * 除铸轧外期望交货天数
+     */
+    private Integer expecteddays;
+
 }

+ 1 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/config/EquMaintenanceStandardListener.java

@@ -82,7 +82,7 @@ public class EquMaintenanceStandardListener extends AnalysisEventListener<EquMai
                 .setCreatedate(date)
                 .setModifydate(date)
                 .setId(SecurityUtil.getUUID())
-                // .setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1])
+                // .setTenantid(CXCommonUtils.getCurrentUserFactoryId(currentUser))
                 .setTenantid(PlantEnum.idOf(equMaintenanceStandardTemplate.getPlantName()))
                 .setPlant(equMaintenanceStandardTemplate.getPlantName())
                 //                .setTenantid("0001S31000000000J0TR")

+ 2 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquFrockTestRecordServiceImpl.java

@@ -13,6 +13,7 @@ import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.rwcommon.utils.StringUtils;
+import com.rongwei.safecommon.utils.CXCommonUtils;
 import org.apache.poi.ss.usermodel.DataFormatter;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -164,7 +165,7 @@ public class EquFrockTestRecordServiceImpl extends ServiceImpl<EquFrockTestRecor
                     allStrBuilder.append("第").append(i + 1).append("行").append(stringBuilder).append("<br>");
                 } else {
                     equFrockTestRecordDo.setId(SecurityUtil.getUUID())
-                            .setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1])
+                            .setTenantid(CXCommonUtils.getCurrentUserFactoryId(currentUser))
                             .setCreatedate(date)
                             .setModifydate(date)
                             .setCreateusername(currentUser.getName())

+ 2 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquOverhaulPlanningTasksServiceImpl.java

@@ -18,6 +18,7 @@ import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.rwcommon.utils.StringUtils;
+import com.rongwei.safecommon.utils.CXCommonUtils;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
@@ -74,7 +75,7 @@ public class EquOverhaulPlanningTasksServiceImpl extends ServiceImpl<EquOverhaul
             for (int i = 1; i <= lastRowNum; i++) {
                 StringBuilder stringBuilder = new StringBuilder();
                 String taskNumber = "";
-                String factoryId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+                String factoryId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
                 List<SysOrganizationVo> resultList = factoryList.stream().filter(p -> p.getId().equals(factoryId)).collect(Collectors.toList());
                 String factory = resultList.get(0).getFullname();
                 EquOverhaulPlanningTasksDo equOverhaulPlanningTasksDo = new EquOverhaulPlanningTasksDo();

+ 4 - 3
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/MaintenanceServiceImpl.java

@@ -20,6 +20,7 @@ import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.rwcommonentity.commonservers.vo.SysSerialVo;
+import com.rongwei.safecommon.utils.CXCommonUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -296,7 +297,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
                 Object data = serialNumberCode.getData();
                 maintenanceStandard.setStandardid(JSONObject.parseObject(JSONObject.toJSONString(data), Map.class).get("code").toString());
             }
-            maintenanceStandard.setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1])
+            maintenanceStandard.setTenantid(CXCommonUtils.getCurrentUserFactoryId(currentUser))
                     .setCreatedate(date)
                     .setModifydate(date)
                     .setCreateuserid(currentUser.getId())
@@ -439,7 +440,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
         // 遍历计划部位
         for (EquMaintenancePartDo maintenancePart : maintenancePartList) {
             SysSerialVo sysSerialVo = new SysSerialVo();
-            // String plantSimp = PlantEnum.addrOf(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
+            // String plantSimp = PlantEnum.addrOf(CXCommonUtils.getCurrentUserFactoryId(currentUser));
             String plantSimp = PlantEnum.addrOf(maintenancePart.getTenantid());
             sysSerialVo.setModulecode("equ_maintenance_task_aq_code_" + plantSimp);
             sysSerialVo.setResetrule("date:yyyy");
@@ -497,7 +498,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
                             .setModifyuserid(currentUser.getId())
                             .setModifyusername(currentUser.getName())
                             .setModifydate(newDate)
-                            .setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
+                            .setTenantid(CXCommonUtils.getCurrentUserFactoryId(currentUser));
                     return equPartsSetoutTaskDo;
                 }).collect(Collectors.toList())).flatMap(Collection::stream).distinct().collect(Collectors.toList());
     }

+ 1 - 1
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafeAttachmentsServiceImpl.java

@@ -263,7 +263,7 @@ public class AspSafeAttachmentsServiceImpl extends ServiceImpl<AspSafeAttachment
         List<AspSafeAttachmentsDo> saveList = new ArrayList<>();
         ImportAspSafeAttachmentsVo importAspSafeAttachmentsVo;
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
         //获取区域信息
         Map<String, String> checkAreaMap = saveCheckCommonDao.getCheckArea(tenantId).stream().collect(Collectors.toMap(CheckAreaVo::getName, CheckAreaVo::getId, (v1, v2) -> v1));
         // 获取组织机构信息

+ 3 - 3
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafetyPerformanceAppraisalServiceImpl.java

@@ -245,7 +245,7 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
             main.setModifydate(date);
             //获取当前用户的tenantId
 //            main.setTenantid(currentUser.getTenantid());
-            main.setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
+            main.setTenantid(CXCommonUtils.getCurrentUserFactoryId(currentUser));
             this.save(main);
 
             List<AspSafetyPerformanceAppraisalDetail> res = new ArrayList<>();
@@ -456,7 +456,7 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     detail.setModifydate(date);
                     //获取当前用户的tenantId
 //                  detail.setTenantid(currentUser.getTenantid());
-                    detail.setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
+                    detail.setTenantid(CXCommonUtils.getCurrentUserFactoryId(currentUser));
 
                     res.add(detail);
                 } else {
@@ -611,7 +611,7 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     detail.setModifydate(date);
                     //获取当前用户的tenantId
 //                  detail.setTenantid(currentUser.getTenantid());
-                    detail.setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
+                    detail.setTenantid(CXCommonUtils.getCurrentUserFactoryId(currentUser));
 
                     res.add(detail);
                 }

+ 2 - 2
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/CheckItemsServiceImpl.java

@@ -232,7 +232,7 @@ public class CheckItemsServiceImpl extends ServiceImpl<CheckItemsDao, CheckItems
                             }
                         }
                     }
-                } else if (daysBetween <= 90) {
+                } else if (daysBetween <= 60) {
                     alertUser = userInfO.stream().filter(user -> SPECIAL_EQUIPMENT_ADMINISTRATOR.equals(user.getRoleCode())).map(UserMailOrgVo::getId).collect(Collectors.toList());
                     data.setReminderstate(MIDDLE);
                     sendNotifyMap.put(data, alertUser);
@@ -359,7 +359,7 @@ public class CheckItemsServiceImpl extends ServiceImpl<CheckItemsDao, CheckItems
         List<CheckItemsDo> saveList = new ArrayList<>();
         ImportCheckItemsVo importCheckItemsVo;
         SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        String tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
         //获取区域信息
         Map<String, String> checkAreaMap = saveCheckCommonDao.getCheckArea(tenantId).stream().collect(Collectors.toMap(CheckAreaVo::getName, CheckAreaVo::getId, (v1, v2) -> v1));
         // 获取组织机构信息