Prechádzať zdrojové kódy

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

fangpy 1 rok pred
rodič
commit
f414272d0d
49 zmenil súbory, kde vykonal 2251 pridanie a 291 odobranie
  1. 96 39
      bs-common/src/main/java/com/rongwei/safecommon/utils/SaveConstans.java
  2. 8 0
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/dao/ApsProductionTechnicalRequirementDao.java
  3. 4 0
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/ApsBlankOrderService.java
  4. 6 2
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/ApsProcessOperationService.java
  5. 9 0
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/ApsProductionTechnicalRequirementService.java
  6. 1 1
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/GanttService.java
  7. 176 9
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsBlankOrderServiceImpl.java
  8. 5 4
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProcessOperationProcessEquServiceImpl.java
  9. 318 27
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProcessOperationServiceImpl.java
  10. 8 6
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductionOrderServiceImpl.java
  11. 20 0
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductionTechnicalRequirementServiceImpl.java
  12. 35 23
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportRecordsServiceImpl.java
  13. 33 17
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/GanttServiceImpl.java
  14. 4 4
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ReportCheckServiceImpl.java
  15. 39 25
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/utils/ApsUtils.java
  16. 19 15
      cx-aps/cx-aps-common/src/main/resources/mybatis/ApsProcessOperationProcessEquDao.xml
  17. 180 0
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsProcessOutputProductDo.java
  18. 75 2
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsProductionOrderDo.java
  19. 239 0
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsProductionTechnicalRequirementDo.java
  20. 17 0
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/GanttVos.java
  21. 4 0
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ProcessGanttListVo.java
  22. 4 0
      cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ScheduleGanttVo.java
  23. 16 0
      cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsBlankOrderController.java
  24. 37 6
      cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsProcessOperationController.java
  25. 1 1
      cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsProductionOrderController.java
  26. 1 1
      cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/GanttController.java
  27. 15 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/AspSafeAttachmentsDao.java
  28. 15 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/AspSpecialEquipmentCertificateDao.java
  29. 2 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/SaveCheckCommonDao.java
  30. 12 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/AspSafeAttachmentsService.java
  31. 7 1
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/AspSafetyProductObjectiveService.java
  32. 12 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/AspSpecialEquipmentCertificateService.java
  33. 3 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/CheckItemsService.java
  34. 108 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafeAttachmentsServiceImpl.java
  35. 119 93
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafetyPerformanceAppraisalServiceImpl.java
  36. 29 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafetyProductObjectiveServiceImpl.java
  37. 110 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSpecialEquipmentCertificateServiceImpl.java
  38. 92 5
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/CheckItemsServiceImpl.java
  39. 19 0
      cx-safe-check/cx-save-check-common/src/main/resources/mybatis/SaveCheckCommonDao.xml
  40. 161 0
      cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspSafeAttachmentsDo.java
  41. 8 0
      cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspSafetyPerformanceAppraisalDetail.java
  42. 81 0
      cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspSpecialEquipmentCertificateDo.java
  43. 4 1
      cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/CheckItemsDo.java
  44. 2 0
      cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/vo/UserMailOrgVo.java
  45. 34 0
      cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/AspSafeAttachmentsController.java
  46. 12 4
      cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/AspSafetyProductObjectiveController.java
  47. 34 0
      cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/AspSpecialEquipmentCertificateController.java
  48. 8 0
      cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/CheckItemsController.java
  49. 9 5
      rw-training/training-common/src/main/java/com/rongwei/trainingcommon/sys/service/impl/ExportQuestionnaireRecordingsServiceImpl.java

+ 96 - 39
bs-common/src/main/java/com/rongwei/safecommon/utils/SaveConstans.java

@@ -63,7 +63,11 @@ public class SaveConstans {
          */
         put("0001S31000000000J0TR", "BC");
     }};
+    public static final List<String> MERGE_PRODUCE_PROCESS = new ArrayList<>();
 
+    static {
+        MERGE_PRODUCE_PROCESS.add("");
+    }
 
     /**
      * 问卷调查状态
@@ -196,6 +200,18 @@ public class SaveConstans {
          * 报工不合格提醒
          */
         public static final String REPORTUNQUALIFY_REMIND = "reportunqualify";
+        /**
+         * 安全观察指标提醒
+         */
+        public static final String OBSERVATION_AUDIT = "observation";
+        /**
+         * 安全附件
+         */
+        public static final String SAFETY_ATTACHMENT_VERIFICATION = "safeAttachments";
+        /**
+         * 特种设备作业人员证书提醒
+         */
+        public static final String PERSONNEL_CERTIFICATES="PersonnelCertificates";
     }
 
     public static class NotifyTitle {
@@ -316,11 +332,27 @@ public class SaveConstans {
         /**
          * 特种设备提醒
          */
-        public static final String SPECIALEQUIPMENT_TITLE="特种设备提醒";
+        public static final String SPECIALEQUIPMENT_TITLE = "特种设备提醒";
         /**
          * 报工不合格提醒
          */
-        public static final String REPORTUNQUALIFY_TITLE="订单作业报工不合格";
+        public static final String REPORTUNQUALIFY_TITLE = "订单作业报工不合格";
+        /**
+         * 安全观察指标提醒
+         */
+        public static final String OBSERVATION_TITLE = "安全观察指标提醒";
+        /**
+         * 安全附件检验提醒
+         */
+        public static final String SAFETY_ATTACHMENT_VERIFICATION_TITLE = "安全附件检验提醒";
+        /**
+         * 特种设备作业人员证书提醒
+         */
+        public static final String PERSONNEL_CERTIFICATES_TITLE="特种设备人员证书年检提醒";
+        /**
+         * 设备年检
+         */
+        public static final String EQUIPMENT_CHECK_TITLE="设备年检提醒";
     }
 
     public static class NotifyContent {
@@ -436,15 +468,33 @@ public class SaveConstans {
         /**
          * 特种设备提醒内容前缀
          */
-        public static final String SPECIALEQUIPMENT_CONTENT_PREFIX="【设备年检提醒】,您好,有如下设备即将年检到期,请及时处理";
+        public static final String SPECIALEQUIPMENT_CONTENT_PREFIX = "【设备年检提醒】,您好,有如下设备即将年检到期,请及时处理";
         /**
          * 特种设备提醒内容
          */
-        public static final String SPECIALEQUIPMENT_CONTENT="设备类型:【%s】,设备编号:【%s】,设备名称:【%s】,年检日期:【%s】";
+        public static final String SPECIALEQUIPMENT_CONTENT = "设备类型:【%s】,设备编号:【%s】,设备名称:【%s】,年检日期:【%s】";
         /**
          * 报工不合格提醒
          */
         public static final String REPORTUNQUALIFY_CONTENT = "报工检验不合格,请及时调整计划,详情参见邮件提醒";
+
+        /**
+         * 安全观察指标提醒
+         */
+        public static final String OBSERVATION_CONTENT = "新的安全观察目标值【%s】已下达,请及时完成!";
+        /**
+         * 安全附件
+         */
+        public static final String SAFETY_ATTACHMENT_VERIFICATION_CONTENT = " 您好,有如下安全附件即将年检到期,请及时处理!  名称:【%s】,编号:【%s】,检验/更换日期:【%tF】,下次检验/更换日期:【%tF】,负责人:【%s】";
+        /**
+         * 特种设备作业人员证书提醒
+         */
+        public static final String PERSONNEL_CERTIFICATES_CONTENT="您好,有如下人员证书即将到期,请及时处理 姓名:【%s】,所属部门:【%s】证书类别:【%s】,复审日期:【%tF】";
+
+        /**
+         * 设备年检
+         */
+        public static final String EQUIPMENT_CHECK_CONTENT=" 您好,有如下设备即将年检到期,请及时处理! 设备类型:【%s】,设备编号:【%s】,设备名称:【%s】,年检日期:【%tF】";
     }
 
     /**
@@ -549,12 +599,6 @@ public class SaveConstans {
         public static final String HIDDEN_DANGER_STATUS = "hidden_danger_status";
     }
 
-    public static final List<String> MERGE_PRODUCE_PROCESS = new ArrayList<>();
-
-    static {
-        MERGE_PRODUCE_PROCESS.add("");
-    }
-
     /**
      * 加工方式
      */
@@ -693,27 +737,27 @@ public class SaveConstans {
         /**
          * 工序作业所需的设备必须在工序的可选设备之内
          */
-        public static final String EQ_TYPE_SAME="工序作业所需的设备必须在工序的可选设备之内";
+        public static final String EQ_TYPE_SAME = "工序作业所需的设备必须在工序的可选设备之内";
         /**
          * 第一步工序作业要小于开始排程时间
          */
-        public static final String NO_PRE_GB_AFTER_NOW="第一步工序作业要小于开始排程时间";
+        public static final String NO_PRE_GB_AFTER_NOW = "第一步工序作业要小于开始排程时间";
         /**
          * 当前工序作业开始时间违反上一步工序作业最大等待时间限制
          */
-        public static final String HAS_ONE_PRE_GB_AFTER_NOW="当前工序作业开始时间违反上一步工序作业最大等待时间限制";
+        public static final String HAS_ONE_PRE_GB_AFTER_NOW = "当前工序作业开始时间违反上一步工序作业最大等待时间限制";
         /**
          * 加工设备该加工时间段不可用
          */
-        public static final String EQUIPMENT_RUN_TIME="加工设备该加工时间段不可用";
+        public static final String EQUIPMENT_RUN_TIME = "加工设备该加工时间段不可用";
         /**
          * 上一工序作业流转时间不能大于上一工序作业最大等待时间
          */
-        public static final String LZ_TIME_LESS_MAX_WAIT="上一工序作业流转时间不能大于上一工序作业最大等待时间";
+        public static final String LZ_TIME_LESS_MAX_WAIT = "上一工序作业流转时间不能大于上一工序作业最大等待时间";
         /**
          * 与加工设备其他作业加工时间重叠
          */
-        public static final String EQ_TIME_CROSS="与加工设备其他作业加工时间重叠";
+        public static final String EQ_TIME_CROSS = "与加工设备其他作业加工时间重叠";
 
     }
 
@@ -724,12 +768,13 @@ public class SaveConstans {
         /**
          * 订单交货期不满足
          */
-        public static final String DELIVERY_DATE="订单交货期不满足";
+        public static final String DELIVERY_DATE = "订单交货期不满足";
         /**
          * 订单的连续生产要求不满足
          */
-        public static final String SERIES_PRODUCE="订单的连续生产要求不满足";
+        public static final String SERIES_PRODUCE = "订单的连续生产要求不满足";
     }
+
     /**
      * 产品类型的外观 字典ID
      */
@@ -745,23 +790,10 @@ public class SaveConstans {
 
     }
 
-    /**
-     * 初始化数量单位
-     */
-    public static final Map<String, String> QUANTITY_UNIT_MAP = new HashMap<String, String>() {{
-        /**
-         * 公斤
-         */
-        put("kg", "公斤");
-        /**
-         * 吨
-         */
-        put("ton", "吨");
-    }};
     /**
      * 枚举数量单位
      */
-    public static class CountUnit{
+    public static class CountUnit {
         /**
          * 千克、公斤
          */
@@ -775,7 +807,7 @@ public class SaveConstans {
     /**
      * 在制品状态
      */
-    public static class WorkInProgressStatus{
+    public static class WorkInProgressStatus {
         /**
          * 待检验
          */
@@ -793,23 +825,48 @@ public class SaveConstans {
          */
         public static final String WAITING = "备料中";
     }
-    public static class CheckLevel{
+
+    public static class CheckLevel {
         /**
          * B级
          */
-        public static final String B="B级";
+        public static final String B = "B级";
         /**
          * BC级
          */
-        public static final String B_C="BC级";
+        public static final String B_C = "BC级";
         /**
          * 待判
          */
-        public static final String WAITING_JUDGMENT="待判";
+        public static final String WAITING_JUDGMENT = "待判";
     }
-
+    /**
+     * 初始化数量单位
+     */
+    public static final Map<String, String> QUANTITY_UNIT_MAP = new HashMap<String, String>() {{
+        /**
+         * 公斤
+         */
+        put("kg", "公斤");
+        /**
+         * 吨
+         */
+        put("ton", "吨");
+    }};
     /**
      * 初始化月份代号
      */
-    public static final List<String> MONTH_CODE_LIST = Arrays.asList("1","2","3","4","5","6","7","8","9","X","Y","Z");
+    public static final List<String> MONTH_CODE_LIST = Arrays.asList("1", "2", "3", "4", "5", "6", "7", "8", "9", "X", "Y", "Z");
+    /**
+     * 高
+     */
+    public static final String HIGH = "高";
+    /**
+     * 中
+     */
+    public static final String MIDDLE = "中";
+    /**
+     * 低
+     */
+    public static final String LOW = "低";
 }

+ 8 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/dao/ApsProductionTechnicalRequirementDao.java

@@ -0,0 +1,8 @@
+package com.rongwei.bscommon.sys.dao;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.ApsProductionTechnicalRequirementDo;
+
+public interface ApsProductionTechnicalRequirementDao extends BaseMapper<ApsProductionTechnicalRequirementDo> {
+}

+ 4 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/ApsBlankOrderService.java

@@ -2,6 +2,7 @@ package com.rongwei.bscommon.sys.service;
 
 import com.rongwei.bsentity.domain.ApsBlankOrderDo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.ApsProductionTechnicalRequirementDo;
 import com.rongwei.bsentity.vo.*;
 import com.rongwei.rwcommon.base.R;
 import java.util.List;
@@ -34,6 +35,7 @@ public interface ApsBlankOrderService extends IService<ApsBlankOrderDo> {
     void blankApsCancel(List<String> apsBlankIds);
 
     R publish(List<String> blankIds);
+
     R publishCancel(List<String> blankIds);
 
     R insertOrder(Map<String, Object> params) throws Exception;
@@ -45,4 +47,6 @@ public interface ApsBlankOrderService extends IService<ApsBlankOrderDo> {
     void removeBlankOrderAndChild(ApsBlankOrderDo req);
 
     void apsAfter(ProductionScheduleRetVo productionScheduleRetVo,List<ApsBlankOrderVo> apsBlankOrders);
+
+    R checkAndUpdateBlankAndOutput(ApsProductionTechnicalRequirementDo req);
 }

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

@@ -1,7 +1,7 @@
 package com.rongwei.bscommon.sys.service;
 
-import com.rongwei.bsentity.domain.ApsProcessOperationDo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.ApsProcessOperationDo;
 import com.rongwei.bsentity.domain.ApsProcessOperationOutMaterDo;
 import com.rongwei.rwcommon.base.R;
 
@@ -23,6 +23,8 @@ public interface ApsProcessOperationService extends IService<ApsProcessOperation
      */
     R resetCraftRoute(Map<String, Object> params);
 
+    R chooseHistoryRoute(Map<String, Object> params);
+
     /*
     清除工艺路线
      */
@@ -35,7 +37,7 @@ public interface ApsProcessOperationService extends IService<ApsProcessOperation
     /*
     更新后面所有工序信息
      */
-    List<ApsProcessOperationOutMaterDo> resetProcessOperation(List<ApsProcessOperationOutMaterDo> apsProcessOperationOutMaterDoList);
+    R resetProcessOperation(List<ApsProcessOperationOutMaterDo> apsProcessOperationOutMaterDoList);
 
     R updateBorrowProcess(Map<String, Object> params);
 
@@ -44,4 +46,6 @@ public interface ApsProcessOperationService extends IService<ApsProcessOperation
     R backupRestoreProcessOperation();
 
     R cancelConflict(List<String> ids);
+
+    R updateProcess(Map<String, Object> params);
 }

+ 9 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/ApsProductionTechnicalRequirementService.java

@@ -0,0 +1,9 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.ApsProductionTechnicalRequirementDo;
+
+
+public interface ApsProductionTechnicalRequirementService extends IService<ApsProductionTechnicalRequirementDo> {
+
+}

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

@@ -13,6 +13,6 @@ import java.util.List;
  */
 public interface GanttService {
 
-    R getListByCondition(Date searchDate, String factoryId, List<String> workshopId, List<String> orderNo,
+    R getListByCondition(Date startDate,Date endDate, String factoryId, List<String> workshopId, List<String> orderNo,
                          List<String> productionLineId,List<String> equId);
 }

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

@@ -5,15 +5,12 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.json.JSONConfig;
-import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
 import com.rongwei.bscommon.sys.dao.*;
-import com.rongwei.bscommon.sys.fegin.RwApsServer;
 import com.rongwei.bscommon.sys.service.*;
 import com.rongwei.bscommon.sys.utils.ApsUtils;
 import com.rongwei.bsentity.domain.*;
@@ -26,8 +23,6 @@ import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.rwcommon.utils.StringUtils;
 import com.rongwei.safecommon.utils.CXCommonUtils;
 import com.rongwei.safecommon.utils.SaveConstans;
-import org.redisson.api.RLock;
-import org.redisson.api.RedissonClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,10 +32,8 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
-import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.util.*;
-import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import static com.rongwei.bscommon.sys.service.impl.ApsProductionOrderServiceImpl.ERROR_MSG;
@@ -102,6 +95,8 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
     private ApsEquipmentCalendarService apsEquipmentCalendarService;
     @Autowired
     private ApsService apsService;
+    @Autowired
+    private ApsProductionTechnicalRequirementService apsProductionTechnicalRequirementService;
 
 
     @Override
@@ -145,6 +140,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void blankApsCancel(List<String> apsBlankIds) {
+        ApsUtils.checkScheduling();
         if (ObjectUtil.isEmpty(apsBlankIds)) {
             log.debug("坯料计划排程取消参数为空");
             return;
@@ -165,6 +161,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R publish(List<String> blankIds) {
+        ApsUtils.checkScheduling();
         if (blankIds == null || blankIds.isEmpty()) {
             log.debug("坯料计划为空");
             return R.error("坯料计划id 必传");
@@ -232,6 +229,10 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
         List<String> collect = apsBlankOrderDos.stream().map(ApsBlankOrderDo::getProductionorderid).distinct().collect(Collectors.toList());
         // 更新工序作业的状态
         apsProcessOperationDao.publish(collect);
+        // 更新订单表的生产状态
+        blankIds.forEach(blankId->{
+            processOperationProcessEquService.updateOrder(blankId);
+        });
         // 根据坯料ID 删除 备份数据
         ApsUtils.clearBackup(null);
         return R.ok();
@@ -246,6 +247,7 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R publishCancel(List<String> blankIds) {
+        ApsUtils.checkScheduling();
         if (blankIds == null || blankIds.isEmpty()) {
             log.debug("坯料计划为空");
             return R.error("坯料计划id 必传");
@@ -284,6 +286,10 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
         // 更新工序作业的状态
         apsProcessOperationDao.publishCancel(collect);
         // 根据坯料ID 删除 备份数据
+        // 更新订单表的生产状态
+        blankIds.forEach(blankId->{
+            processOperationProcessEquService.updateOrder(blankId);
+        });
         ApsUtils.clearBackup(null);
         return R.ok();
     }
@@ -422,8 +428,8 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
                     .set(ApsProcessOperationDo::getProcessstatus, "20")
             );
             apsBlankOrderService.update(new LambdaUpdateWrapper<ApsBlankOrderDo>()
-                    .in(ApsBlankOrderDo::getId,blackOrderId)
-                    .set(ApsBlankOrderDo::getSchedulingstatus,"20"));
+                    .in(ApsBlankOrderDo::getId, blackOrderId)
+                    .set(ApsBlankOrderDo::getSchedulingstatus, "20"));
         }
         // 回传坯料计划ID 用于前段更新锁定状态
         return R.ok(blackOrderId);
@@ -1513,6 +1519,31 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
                 return R.error("输出成品:" + apsProcessOutputProductDo.getProductname() + " 已修改或已删除,并已开工,计划输出订单重量 不能大于 0");
             }
         }
+        //如果存在订单产品和输出单卷重都相同坯料输出成品,错误提示:以下坯料输出成品重复:{订单产品1}{输出单卷重}{数量单位},{订单产品2}{输出单卷重}{数量单位}
+        //组装一下list
+        List<String> processOutputDesList = apsProcessOutputProductDoList.stream().map(item -> {
+            String unit = "吨";
+            if (item.getCountunit().equals(SaveConstans.CountUnit.KG)) {
+                unit = "千克";
+            }
+            return item.getProductname() + item.getOutputonerollweigth() + unit;
+        }).collect(Collectors.toList());
+
+        //用于判断是否重复
+        List<String> checkOutputDesList = new LinkedList<>();
+        //有重复数据订单产品的数组
+        List<String> endCheckOutputDesList = new LinkedList<>();
+        for (String s : processOutputDesList) {
+            if (checkOutputDesList.contains(s)) {
+                endCheckOutputDesList.add(s);
+            } else {
+                checkOutputDesList.add(s);
+            }
+        }
+        if (endCheckOutputDesList.size() > 0) {
+            String join = String.join(",", endCheckOutputDesList);
+            return R.error("以下坯料输出成品重复:" + join);
+        }
 
         //===========坯料计划保存之前的校验=============
         //校验坯料需求
@@ -1839,4 +1870,140 @@ public class ApsBlankOrderServiceImpl extends ServiceImpl<ApsBlankOrderDao, ApsB
         //逻辑删除坯料计划的工艺路线
         this.baseMapper.removeMindMappingByBlankId(req.getId());
     }
+
+    @Override
+    @Transactional
+    public R checkAndUpdateBlankAndOutput(ApsProductionTechnicalRequirementDo req) {
+        String id = req.getId();
+        //查询技术要求
+        ApsProductionTechnicalRequirementDo apsProductionTechnicalRequirementDo = apsProductionTechnicalRequirementService.getById(id);
+        //获取对应的产品明细IDs
+        String orderdetailids = apsProductionTechnicalRequirementDo.getOrderdetailids();
+        if (ObjectUtil.isEmpty(orderdetailids)) {
+            return R.error("技术要求对应的产品明细不能为空");
+        }
+        //查询产品明细对应的输出成品
+        List<String> orderDetailIdList = Arrays.asList(orderdetailids.split(","));
+        List<ApsProcessOutputProductDo> apsProcessOutputProductDoList = apsProcessOutputProductService.list(new QueryWrapper<ApsProcessOutputProductDo>().lambda().in(ApsProcessOutputProductDo::getProductid, orderDetailIdList));
+        //查询涉及到的坯料计划ID
+        List<String> blankIdlist = apsProcessOutputProductDoList.stream().map(ApsProcessOutputProductDo::getBlankid).distinct().collect(Collectors.toList());
+        if (ObjectUtil.isEmpty(blankIdlist)) {
+            return R.ok();
+        }
+        //查询坯料计划详情
+        List<ApsBlankOrderDo> apsBlankOrderDoList = apsBlankOrderService.list(new QueryWrapper<ApsBlankOrderDo>().lambda().in(ApsBlankOrderDo::getId, blankIdlist));
+
+        //如果坯料计划的生产状态为:待排程(10),待发布(20),待开工(30)
+        //筛选出需要更新的坯料计划
+        List<ApsBlankOrderDo> needUpdateBlankList = apsBlankOrderDoList.stream().filter(item -> Arrays.asList(TO_BE_SCHEDULED, TO_BE_PUBLISHED, TO_BE_STARTED).contains(item.getProductstatus())).collect(Collectors.toList());
+
+        //最终需要更新的数组集合
+        List<ApsBlankOrderDo> endNeedUpdateBlankList = new LinkedList<>();
+
+        for (ApsBlankOrderDo apsBlankOrderDo : needUpdateBlankList) {
+            //是否需要更新坯料计划的 输出产品订单字段
+            boolean isNeedUpdateBlank = false;
+
+            //筛选出需要更新的输出成品
+            List<ApsProcessOutputProductDo> needUpdateProductOutputList = apsProcessOutputProductDoList.stream().filter(item -> item.getBlankid().equals(apsBlankOrderDo.getId())).collect(Collectors.toList());
+            for (ApsProcessOutputProductDo apsProcessOutputProductDo : needUpdateProductOutputList) {
+                //获取当前组装输出成品 使用的 字段,(包含替换字段)
+                String alloy = ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getAlloy()) ? apsProcessOutputProductDo.getAlloy() : "";
+                String alloystatus = ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getAlloystatus()) ? apsProcessOutputProductDo.getAlloystatus() : "";
+                String producttype = ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getProducttype()) ? apsProcessOutputProductDo.getProducttype() : "";
+                if (ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getChangealloy())) {
+                    alloy = apsProcessOutputProductDo.getChangealloy();
+                }
+                if (ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getChangealloystatus())) {
+                    alloystatus = apsProcessOutputProductDo.getChangealloystatus();
+                }
+                if (ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getChangeproducttype())) {
+                    producttype = apsProcessOutputProductDo.getChangeproducttype();
+                }
+
+                ApsProcessOutputProductDo endUpdateOutput = BeanUtil.copyProperties(apsProductionTechnicalRequirementDo, ApsProcessOutputProductDo.class);
+                endUpdateOutput.setId(apsProcessOutputProductDo.getId());
+                endUpdateOutput.setProducttype(apsProductionTechnicalRequirementDo.getOrderproducttype());
+                endUpdateOutput.setProducttypeid(apsProductionTechnicalRequirementDo.getOrderproducttypeid());
+                //新的产品类型
+                String newProductType = endUpdateOutput.getProducttype();
+                if (ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getChangeproducttype())) {
+                    newProductType = apsProcessOutputProductDo.getChangeproducttype();
+                }
+                //如果技术要求中的 订单产品类型 不等于 输出成品的 产品类型 , 需要重新组装输出成品
+                if (!producttype.equals(newProductType)) {
+                    String outputResult = "";
+                    outputResult += (alloy + alloystatus + newProductType + " ");
+                    //获取长宽高
+                    String thickness = ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getThickness()) ? removeExtraZerosAndDecimal(apsProcessOutputProductDo.getThickness()) : "";
+                    String prowidth = ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getProwidth()) ? removeExtraZerosAndDecimal(apsProcessOutputProductDo.getProwidth()) : "";
+                    String prolength = ObjectUtil.isNotEmpty(apsProcessOutputProductDo.getProlength()) ? removeExtraZerosAndDecimal(apsProcessOutputProductDo.getProlength()) : "";
+                    outputResult += ("厚" + thickness + "*宽" + prowidth);
+                    if (ObjectUtil.isNotEmpty(prolength)) {
+                        outputResult += ("*长" + prolength);
+                    }
+                    outputResult += ("mm * " + apsProcessOutputProductDo.getPlanoutputorderroll() + "卷");
+
+                    endUpdateOutput.setOutputresult(outputResult);
+                    isNeedUpdateBlank = true;
+                }
+                apsProcessOutputProductService.updateById(endUpdateOutput);
+            }
+            if (isNeedUpdateBlank) {
+                //如果坯料计划是暂存,不做处理
+                if (apsBlankOrderDo.getIsstag().equals("是")) {
+                    continue;
+                }
+                ApsBlankOrderDo endUpdateBlank = new ApsBlankOrderDo();
+                endUpdateBlank.setId(apsBlankOrderDo.getId());
+                //=============更新坯料计划的 输出订单产品 和 输出成品===========
+                //查询坯料计划对应的输出成品
+                List<ApsProcessOutputProductDo> processOutputProductDoList = apsProcessOutputProductService.list(new QueryWrapper<ApsProcessOutputProductDo>().lambda().eq(ApsProcessOutputProductDo::getBlankid, apsBlankOrderDo.getId()));
+                if (processOutputProductDoList != null && processOutputProductDoList.size() > 0) {
+                    //获取所有输出成品的输出成品
+                    List<String> outputFinishList = processOutputProductDoList.stream().map(ApsProcessOutputProductDo::getOutputresult).sorted(String::compareTo).collect(Collectors.toList());
+                    //输出成品
+                    String outputFinishProduct = "";
+
+                    for (int i = 0; i < outputFinishList.size(); i++) {
+                        outputFinishProduct += "[" + (i + 1) + "]" + outputFinishList.get(i);
+                        if (i < outputFinishList.size() - 1) {
+                            outputFinishProduct += ",\r\n";
+                        }
+                    }
+                    endUpdateBlank.setOutputfinishproduct(outputFinishProduct);
+
+                    //输出订单产品
+                    String outputOrderProduct = "";
+                    //获取所有输出成品的输出订单产品
+                    List<String> outputOrderProductList = processOutputProductDoList.stream().map(item -> {
+                        String outputresult = item.getOutputresult();
+                        String[] s = outputresult.split(" ");
+                        return s[0] + " " + s[1] + " " + removeExtraZerosAndDecimal(item.getOutputonerollweigth()) + " * " + item.getPlanoutputorderroll() + "卷 = " + removeExtraZerosAndDecimal(item.getPlanoutputonerollweight());
+                    }).sorted(String::compareTo).collect(Collectors.toList());
+
+                    for (int i = 0; i < outputOrderProductList.size(); i++) {
+                        outputOrderProduct += "[" + (i + 1) + "]" + outputOrderProductList.get(i);
+                        if (i < outputOrderProductList.size() - 1) {
+                            outputOrderProduct += ",\r\n";
+                        }
+                    }
+                    endUpdateBlank.setOutputorderproduct(outputOrderProduct);
+                } else {
+                    throw new CustomException("没有找到该坯料计划的输出成品");
+                }
+                endNeedUpdateBlankList.add(endUpdateBlank);
+            }
+        }
+        if (endNeedUpdateBlankList.size() > 0) {
+            apsBlankOrderService.updateBatchById(endNeedUpdateBlankList);
+        }
+
+        return R.ok();
+    }
+
+    public static String removeExtraZerosAndDecimal(BigDecimal bd) {
+        bd = bd.stripTrailingZeros();
+        return bd.toPlainString();
+    }
 }

+ 5 - 4
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProcessOperationProcessEquServiceImpl.java

@@ -131,7 +131,7 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
         return R.ok();
     }
 
-    private void updateProcess(String processOperationEquId) {
+    public void updateProcess(String processOperationEquId) {
         String processOperationId = updateProcessByProcessEquId(processOperationEquId);
 
         if (ObjectUtil.isEmpty(processOperationId)) {
@@ -216,6 +216,7 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R changingWires(List<ChangingWiresVo> changingWiresVos) {
+        ApsUtils.checkScheduling();
         if (changingWiresVos.isEmpty()) {
             log.error("换线作业的工序作业不为空");
             return R.error("工序作业不能为空");
@@ -524,7 +525,7 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
         return R.ok();
     }
 
-    private void updateBlank(String processOperationId) {
+    public void updateBlank(String processOperationId) {
         //查询此工序的所属订单ID
         String orderId = this.baseMapper.selectOrderIdByProcessOperationId(processOperationId);
 
@@ -618,7 +619,7 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
     }
 
 
-    private void updateOrder(String blankId) {
+    public void updateOrder(String blankId) {
         //查询此坯料计划的所属订单的最小生产状态和订单ID
         CommonUpdateProductionStatusReq three = this.baseMapper.selectBlankMinAndMaxStatus(blankId);
         if (ObjectUtil.isEmpty(three)) {
@@ -641,7 +642,7 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
         updateProductDetail(orderId);
     }
 
-    private void updateProductDetail(String orderId) {
+    public void updateProductDetail(String orderId) {
         List<ApsProductDetailDo> list = apsProductDetailService.list(new QueryWrapper<ApsProductDetailDo>().lambda().eq(ApsProductDetailDo::getMainid, orderId));
         if (list.size() > 0) {
             List<String> productIdList = list.stream().map(ApsProductDetailDo::getId).collect(Collectors.toList());

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 318 - 27
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProcessOperationServiceImpl.java


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

@@ -277,18 +277,20 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
             apsProductDetailService.saveOrUpdateBatch(productDetailDoList);
 
             //保存合并订单子表
-            for (ApsProductionMergeOrderDo apsProductionMergeOrderDo : apsProductionMergeOrderDoList) {
-                apsProductionMergeOrderDo.setTenantid(tenantId);
+            if (ObjectUtil.isNotEmpty(apsProductionMergeOrderDoList)) {
+                for (ApsProductionMergeOrderDo apsProductionMergeOrderDo : apsProductionMergeOrderDoList) {
+                    apsProductionMergeOrderDo.setTenantid(tenantId);
+                }
+                apsProductionMergeOrderService.saveOrUpdateBatch(apsProductionMergeOrderDoList);
             }
         }
 
         if (req.getIsNeedPublish()) {
             //=============发布排程================
-            List<String> productOrderIdList = new LinkedList<>();
-            productOrderIdList.add(apsProductionOrderDo.getId());
-            R publish = this.publish(productOrderIdList);
+            List<String> blankIds = apsBlankOrderDoList.stream().map(ApsBlankOrderDo::getId).collect(Collectors.toList());
+            R publish = apsBlankOrderService.publish(blankIds);
             if (!publish.getCode().equals("200")) {
-                return R.error(publish.getMsg());
+                throw new RuntimeException(publish.getMsg());
             }
         }
 

+ 20 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductionTechnicalRequirementServiceImpl.java

@@ -0,0 +1,20 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.sys.dao.ApsProductionTechnicalRequirementDao;
+import com.rongwei.bscommon.sys.service.ApsProductionTechnicalRequirementService;
+import com.rongwei.bsentity.domain.ApsProductionTechnicalRequirementDo;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ */
+@Service
+public class ApsProductionTechnicalRequirementServiceImpl extends ServiceImpl<ApsProductionTechnicalRequirementDao, ApsProductionTechnicalRequirementDo>
+        implements ApsProductionTechnicalRequirementService {
+
+}
+
+
+
+

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

@@ -199,9 +199,10 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
         //查询此工序对应工艺步骤中,对应设备的设备参数
         String equparames = "";
         //查询工序步骤
-        String process = apsProcessOperationDo.getProcess();
-        String processname = apsProcessOperationDo.getProcessname();
-        ApsCraftStepDo craftStepDo = apsCraftStepService.getOne(new QueryWrapper<ApsCraftStepDo>().lambda().eq(ApsCraftStepDo::getProcess, process).eq(ApsCraftStepDo::getProcessname, processname));
+//        String process = apsProcessOperationDo.getProcess();
+//        String processname = apsProcessOperationDo.getProcessname();
+        String stepnum = apsProcessOperationDo.getStepnum();
+        ApsCraftStepDo craftStepDo = apsCraftStepService.getOne(new QueryWrapper<ApsCraftStepDo>().lambda().eq(ApsCraftStepDo::getStepnum, stepnum));
         if (ObjectUtil.isNotEmpty(craftStepDo)) {
             //查询设备参数子表
             ApsCraftEquDo apsCraftEquDo = apsCraftEquService.getOne(new QueryWrapper<ApsCraftEquDo>().lambda().eq(ApsCraftEquDo::getMainid, craftStepDo.getId()).eq(ApsCraftEquDo::getResourceid, apsProcessOperationProcessEquDo.getProcessdeviceid()));
@@ -296,31 +297,41 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
             //根据工序查询其工序的加工参数
             List<ApsParameterDo> parameterDoList = this.baseMapper.selectApsParameterByProcess(apsProcessOperationDo.getProcess());
             List<ApsReportMachiningDo> needInsertApsReportMachingList = new LinkedList<>();
-            for (ApsParameterDo apsParameterDo : parameterDoList) {
-                ApsReportMachiningDo apsReportMachiningDo = new ApsReportMachiningDo();
-                apsReportMachiningDo.setId(SecurityUtil.getUUID());
-                apsReportMachiningDo.setTenantid(tenantId);
-                apsReportMachiningDo.setMainid(apsReportRecordsDo.getId());
-                apsReportMachiningDo.setMatching(apsParameterDo.getParameter());
-                needInsertApsReportMachingList.add(apsReportMachiningDo);
-            }
-            if (ObjectUtil.isNotEmpty(needInsertApsReportMachingList)) {
-                apsReportMachiningService.saveBatch(needInsertApsReportMachingList);
+            if (ObjectUtil.isNotEmpty(parameterDoList)) {
+                for (ApsParameterDo apsParameterDo : parameterDoList) {
+                    if (ObjectUtil.isEmpty(apsParameterDo)) {
+                        continue;
+                    }
+                    ApsReportMachiningDo apsReportMachiningDo = new ApsReportMachiningDo();
+                    apsReportMachiningDo.setId(SecurityUtil.getUUID());
+                    apsReportMachiningDo.setTenantid(tenantId);
+                    apsReportMachiningDo.setMainid(apsReportRecordsDo.getId());
+                    apsReportMachiningDo.setMatching(apsParameterDo.getParameter());
+                    needInsertApsReportMachingList.add(apsReportMachiningDo);
+                }
+                if (ObjectUtil.isNotEmpty(needInsertApsReportMachingList)) {
+                    apsReportMachiningService.saveBatch(needInsertApsReportMachingList);
+                }
             }
 
             //根据工序查询其工序的检查项目
             List<ApsCheckParameterDo> checkParameterDoList = this.baseMapper.selectApsCheckParameterByProcess(apsProcessOperationDo.getProcess());
             List<ApsReportCheckoutDo> needInsertApsReportCheckList = new LinkedList<>();
-            for (ApsCheckParameterDo apsCheckParameterDo : checkParameterDoList) {
-                ApsReportCheckoutDo apsReportCheckoutDo = new ApsReportCheckoutDo();
-                apsReportCheckoutDo.setId(SecurityUtil.getUUID());
-                apsReportCheckoutDo.setTenantid(tenantId);
-                apsReportCheckoutDo.setMainid(apsReportRecordsDo.getId());
-                apsReportCheckoutDo.setCheckitem(apsCheckParameterDo.getCheckparameter());
-                needInsertApsReportCheckList.add(apsReportCheckoutDo);
-            }
-            if (ObjectUtil.isNotEmpty(needInsertApsReportCheckList)) {
-                apsReportCheckoutService.saveBatch(needInsertApsReportCheckList);
+            if (ObjectUtil.isNotEmpty(checkParameterDoList)) {
+                for (ApsCheckParameterDo apsCheckParameterDo : checkParameterDoList) {
+                    if (ObjectUtil.isEmpty(apsCheckParameterDo)) {
+                        continue;
+                    }
+                    ApsReportCheckoutDo apsReportCheckoutDo = new ApsReportCheckoutDo();
+                    apsReportCheckoutDo.setId(SecurityUtil.getUUID());
+                    apsReportCheckoutDo.setTenantid(tenantId);
+                    apsReportCheckoutDo.setMainid(apsReportRecordsDo.getId());
+                    apsReportCheckoutDo.setCheckitem(apsCheckParameterDo.getCheckparameter());
+                    needInsertApsReportCheckList.add(apsReportCheckoutDo);
+                }
+                if (ObjectUtil.isNotEmpty(needInsertApsReportCheckList)) {
+                    apsReportCheckoutService.saveBatch(needInsertApsReportCheckList);
+                }
             }
 
         }
@@ -379,6 +390,7 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
             for (ApsReportBlankCompentDo apsReportBlankCompentDo : apsReportBlankCompentDoList) {
                 ApsReportBlankCompentDo needAdd = new ApsReportBlankCompentDo();
                 needAdd.setId(SecurityUtil.getUUID());
+                needAdd.setTenantid(tenantId);
                 needAdd.setMainid(apsReportRecordsDo.getId());
                 needAdd.setCompent(apsReportBlankCompentDo.getCompent());
                 needAdd.setStartproportion(apsReportBlankCompentDo.getStartproportion());

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

@@ -38,17 +38,21 @@ public class GanttServiceImpl implements GanttService {
 
     @Autowired
     private ApsProcessOperationProcessEquDao apsProcessOperationProcessEquDao;
-    public static final String GANTT_ITEM_NAME = "%s %d卷 %tF";
+    public static final String GANTT_ITEM_NAME = "%s %d卷 %s %s %tF";
     public static final String GANTT_ITEM_NAME_PREFIX = "%s %s";
     public static final String GANTT_DESC_PREFIX = " 计划时间:%s-%s </br>" +
             "实际时间:%s-%s </br>" +
-            "设备:%s/%s </br>";
-    public static final String GANTT_DESC = "订单产品:%s </br>" +
-            "交货期:%tF </br>" +
+            "加工设备:%s/%s </br>";
+    public static final String GANTT_DESC =
+            "输入物料:%s %d卷</br>" +
             "工序:%s </br>" +
-            "计划加工卷数:%d卷</br>" +
-            "完成情况:已开工 %d/已报工 %d/已检验 %d/未完工 %d</br>" +
-            "作业状态:%s";
+            "作业状态:%s </br>"+
+            "完成情况:已开工 %d/已报工 %d/已检验 %d/未完工 %d </br>"+
+            "客户订单号:%s </br>"+
+            "客户名称:%s </br>"+
+            "交货期:%tF </br>" +
+            "订单产品:%s </br>";
+
 
     public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
@@ -69,16 +73,23 @@ public class GanttServiceImpl implements GanttService {
      * @return
      */
     @Override
-    public R getListByCondition(Date searchDate, String factoryId,
+    public R getListByCondition(Date startDate,
+                                Date endDate,
+                                String factoryId,
                                 List<String> workShopIdList,
                                 List<String> orderNoList,
                                 List<String> productionLineId,
                                 List<String> equId) {
         log.info("甘特图查询开始时间:"+ DateUtil.now());
-        List<Date> searchDateList = getSearchDate(searchDate);
+        if(endDate == null && startDate !=null){
+            List<Date> searchDateList = getSearchDate(startDate);
+            startDate = searchDateList.get(0);
+            endDate = searchDateList.get(1);
+        }
+
         List<GanttVos> apsProcessOperationProcessEquDos = apsProcessOperationProcessEquDao.getGanttDataList(
-                searchDateList==null?null:searchDateList.get(0),
-                searchDateList==null?null:searchDateList.get(1),
+                startDate,
+                endDate,
                 factoryId,
                 workShopIdList,
                 orderNoList,
@@ -123,6 +134,7 @@ public class GanttServiceImpl implements GanttService {
                 deviceVo.setOpen(true);
                 deviceVo.setType(DEFAULT_TYPE);
                 deviceVo.setParent(workShopVo.getId());
+                deviceVo.setDevicetype(deviceEntry.getValue().get(0).getDevicetype());
                 deviceVo.setRender(DEFAULT_RENDER);
                 deviceVo.setStart_date(deviceEntry.getValue().get(0).getPlanstartdate());
                 resultVo.add(deviceVo);
@@ -137,9 +149,10 @@ public class GanttServiceImpl implements GanttService {
                     LinkedHashMap<String, List<GanttVos>> collect = ganttVos.stream().collect(Collectors.groupingBy(GanttVos::getId, LinkedHashMap::new, Collectors.toList()));
 
                     String itemName = collect.values().stream().map(info -> {
-                        String prefix = info.stream().map(data -> String.format(GANTT_ITEM_NAME_PREFIX, data.getCustomerabbreviation(), data.getProductname()))
-                                .collect(Collectors.joining(","));
-                        return String.format(GANTT_ITEM_NAME, prefix, info.get(0).getPlanprocessrall(), info.get(0).getDeliverydate());
+//                        String prefix = info.stream().map(data -> String.format(GANTT_ITEM_NAME_PREFIX, data.getCustomerabbreviation(), data.getProductname()))
+//                                .collect(Collectors.joining(","));
+                        return String.format(GANTT_ITEM_NAME, info.get(0).getInmatercondition(), info.get(0).getPlanprocessrall(),
+                                info.get(0).getCustomorderno(),info.get(0).getCustomerabbreviation(),info.get(0).getDeliverydate());
                     }).collect(Collectors.joining("</br>"));
                     itemNames.add(itemName);
 
@@ -150,9 +163,12 @@ public class GanttServiceImpl implements GanttService {
                             dateFormat(ganttVos.get(0).getActualfinishdate()),
                             ganttVos.get(0).getProcessworkshop(),ganttVos.get(0).getProcessdevice());
                     String itemDesc= ganttVos.stream().map(info->{
-                        return String.format(GANTT_DESC, info.getProductname(),info.getDeliverydate(),
-                                info.getProcessname(),info.getPlanprocessrall(),info.getStartingroll(),info.getReportroll(),
-                                info.getCheckoutroll(),info.getUnfinishroll(),info.getWorkstatus() );
+                        return String.format(GANTT_DESC,info.getInmatercondition(), info.getPlanprocessrall(),
+                                info.getProcessname(),info.getWorkstatus(),
+                                info.getStartingroll(),info.getReportroll(),
+                                info.getCheckoutroll(),info.getUnfinishroll(),
+                                info.getCustomorderno(),info.getCustomerabbreviation(),
+                                info.getDeliverydate(),info.getOutputorderproduct());
                     }).collect(Collectors.joining("</br>"));
                     dateVo = new ScheduleGanttVo();
                     dateVo.setId(workShopIndex++);

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

@@ -84,10 +84,10 @@ public class ReportCheckServiceImpl implements ReportCheckService {
             log.error("无法根据ID:{}获取到报工记录", id);
             return R.error("无法获取到报工记录");
         }
-        if (VERIFIED.equals(reportRecordsDo.getCheckstatus())) {
-            log.error("当前报工记录已检验无法再次检验");
-            return R.error("当前报工记录已检验无法再次检验");
-        }
+//        if (VERIFIED.equals(reportRecordsDo.getCheckstatus())) {
+//            log.error("当前报工记录已检验无法再次检验");
+//            return R.error("当前报工记录已检验无法再次检验");
+//        }
         // 获取当前报工记录对应的工序作业记录
         ApsProcessOperationProcessEquDo currentProcessOperationEqu = apsProcessOperationProcessEquService.getById(reportRecordsDo.getProcessequid());
         if(currentProcessOperationEqu==null){

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

@@ -2,27 +2,18 @@ package com.rongwei.bscommon.sys.utils;
 
 import com.rongwei.bscommon.sys.dao.ApsProcessOperationBackupDao;
 import com.rongwei.bscommon.sys.dao.ApsProcessOperationProcessEquBackupDao;
-import com.rongwei.commonservice.serial.service.SysSerialNumberService;
-import com.rongwei.commonservice.service.RedisService;
-import com.rongwei.rwadmincommon.system.domain.SysOrganizationDo;
-import com.rongwei.rwadmincommon.system.vo.SysOrganizationVo;
 import com.rongwei.rwadmincommon.system.vo.SysUserVo;
+import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommon.utils.StringUtils;
-import com.rongwei.safecommon.fegin.CXAdminFeginClient;
-import com.rongwei.safecommon.fegin.CXCommonFeginClient;
 import com.rongwei.safecommon.utils.CXCommonUtils;
-import lombok.Data;
+import org.redisson.api.RLock;
+import org.redisson.api.RedissonClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static com.rongwei.safecommon.utils.SaveConstans.MINUS_ONE;
 
 /**
  * ApsUtils class
@@ -33,35 +24,58 @@ import static com.rongwei.safecommon.utils.SaveConstans.MINUS_ONE;
 @Component
 public class ApsUtils {
     private static final Logger log = LoggerFactory.getLogger(ApsUtils.class.getName());
+    private static ApsProcessOperationBackupDao apsProcessOperationBackupDao;
+    private static ApsProcessOperationProcessEquBackupDao apsProcessOperationProcessEquBackupDao;
+    private static RedissonClient redissonClient;
     @Autowired
     private ApsProcessOperationBackupDao autoApsProcessOperationBackupDao;
     @Autowired
     private ApsProcessOperationProcessEquBackupDao autoApsProcessOperationProcessEquBackupDao;
-
-
-    private static ApsProcessOperationBackupDao apsProcessOperationBackupDao;
-    private static ApsProcessOperationProcessEquBackupDao apsProcessOperationProcessEquBackupDao;
-
-
-    @PostConstruct
-    public void info() {
-        apsProcessOperationBackupDao = autoApsProcessOperationBackupDao;
-        apsProcessOperationProcessEquBackupDao = autoApsProcessOperationProcessEquBackupDao;
-    }
+    @Autowired
+    private RedissonClient autoredissonClient;
 
     /**
      * 删除当前员工所属工厂的排程备份信息
+     *
      * @param currentUser
      */
     public static void clearBackup(SysUserVo currentUser) {
-        if(currentUser==null){
+        if (currentUser == null) {
             currentUser = CXCommonUtils.getCurrentUser();
         }
         String factoryId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
-        log.info("开始删除工厂:{}的排除备份数据",factoryId);
+        log.info("开始删除工厂:{}的排除备份数据", factoryId);
         // 先删除
         apsProcessOperationBackupDao.deletedByBlankId(null, factoryId);
         apsProcessOperationProcessEquBackupDao.deletedByBlankId(null, factoryId);
     }
 
+    /**
+     * 校验当前是否正在排程中
+     * 正在排程的情况下抛出异常
+     */
+    public static void checkScheduling() {
+        // 当前等路人所属工厂
+        SysUserVo currentUser = CXCommonUtils.getCurrentUser();
+        String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        if (StringUtils.isBlank(tenantId)) {
+            throw new CustomException("当前用户所属工厂信息为空");
+        }
+        // 按照所属工厂加锁
+        RLock rLock = redissonClient.getLock(tenantId);
+        boolean isLocked = rLock.isLocked();
+        // 锁是否被占用
+        if (isLocked) {
+            throw new CustomException("正在排程、请稍等一会!");
+        }
+    }
+
+    @PostConstruct
+    public void info() {
+        apsProcessOperationBackupDao = autoApsProcessOperationBackupDao;
+        apsProcessOperationProcessEquBackupDao = autoApsProcessOperationProcessEquBackupDao;
+        redissonClient = autoredissonClient;
+    }
+
+
 }

+ 19 - 15
cx-aps/cx-aps-common/src/main/resources/mybatis/ApsProcessOperationProcessEquDao.xml

@@ -178,7 +178,11 @@
         or ((a6.PROMISEDELIVERYDATE is null or DATE(a6.SCHEDULEDELIVERYDATE) &lt;= DATE(a6.PROMISEDELIVERYDATE)) and
         DATE(a6.SCHEDULEDELIVERYDATE)> DATE(a6.DELIVERYDATE)
         ),1,0) as conflict,
-        a1.SOFTCONFLICTDES
+        a1.SOFTCONFLICTDES,
+        a2.INMATERCONDITION,
+        a6.CUSTOMORDERNO,
+        a3.OUTPUTORDERPRODUCT,
+        c.NAME AS DEVICETYPE
         FROM
         aps_process_operation_process_equ a1
         LEFT JOIN aps_process_operation a2 ON a1.PROCESSID = a2.ID
@@ -187,6 +191,8 @@
         LEFT JOIN aps_product_detail a5 ON a4.PRODUCTID = a5.ID
         LEFT JOIN aps_production_order a6 on a6.ID= a5.MAINID
         LEFT JOIN aps_customer_management a7 on a6.CUSTOMID= a7.ID
+        left join asp_check_items b  on a1.PROCESSDEVICEID =b.ID
+        left join sys_dict c on c.DICTTYPE='asp_check_item_type' AND b.CHECKITEMTYPE =c.VALUE
         <if test="productionLineIds != null and productionLineIds.size()>0">
             LEFT JOIN aps_resources_equipment ape on ape.EQUIPMENTID = a1.PROCESSDEVICEID
             LEFT JOIN aps_production_line apl on ape.MAINID =apl.ID
@@ -233,7 +239,7 @@
             </if>
             <if test="processids != null ">and a1.PROCESSID in (${processids})</if>
         </where>
-        order by a1.PLANSTARTDATE asc,a1.PLANENDDATE asc
+        order by a1.PLANSTARTDATE asc,a1.PLANENDDATE,c.VALUE asc
     </select>
     <select id="selectNeedUpdate" resultType="com.rongwei.bsentity.vo.CommonUpdateProductionStatusReq">
         SELECT
@@ -344,31 +350,29 @@
     </update>
     <select id="getOptionalEquipmentById" resultType="com.rongwei.bsentity.vo.OptionalEquipmentVo">
         SELECT
-            CONCAT(IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ),'/',aci.ID) AS value,
-            CONCAT(IFNULL( aci.USEDEPTNAME, arg.RESOURCEWORKSHOP ),'/',aci.CHECKITEMNAME) as label
+        CONCAT(aci.USEDEPTID, '/', aci.ID ) AS value ,
+        CONCAT(aci.USEDEPTNAME, '/', aci.CHECKITEMNAME) AS label
         FROM
-            aps_process_operation_process_equ apope
-                LEFT JOIN aps_process_operation apo ON apope.PROCESSID = apo.ID
-                AND apo.DELETED = '0'
-                LEFT JOIN aps_process_operation_equ apoe ON apoe.MAINID = apo.ID
-                AND apoe.DELETED = '0'
-                LEFT JOIN asp_check_items aci ON apoe.RESOURCEID = aci.ID
-                AND aci.DELETED = '0'
-                LEFT JOIN aps_resource_group arg ON apoe.RESOURCEID = arg.ID
+        aps_process_operation_process_equ apope
+        LEFT JOIN aps_process_operation apo ON apope.PROCESSID = apo.ID
+        LEFT JOIN asp_check_items aci ON FIND_IN_SET(aci.ID,apo.CANCHOOSEDEVICEID)
+        left join sys_dict c on c.DICTTYPE='asp_check_item_type' AND aci.CHECKITEMTYPE =c.VALUE
+        AND aci.DELETED = '0'
         <where>
             apope.DELETED = '0'
             <if test="idList !=null and idList.size() >0">
-            AND apope.ID IN
+                AND apope.ID IN
                 <foreach collection="idList" item="id" open="(" close=")" separator=",">
                     #{id}
                 </foreach>
             </if>
-            GROUP BY IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ),aci.ID
+            GROUP BY  aci.ID
             <if test="idList !=null and idList.size() >1">
                 <!-- 存在多选工序作业时 筛选共有的设备 -->
-                <bind name="idLength" value="idList.size()" />
+                <bind name="idLength" value="idList.size()"/>
                 HAVING count(*)>=#{idLength}
             </if>
+            order by c.VALUE,aci.CHECKITEMNAME asc
         </where>
     </select>
     <select id="checkConflict" resultType="java.lang.String">

+ 180 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsProcessOutputProductDo.java

@@ -213,5 +213,185 @@ public class ApsProcessOutputProductDo extends BaseDo {
      */
     private String changealloystatus;
 
+    /**
+     * 技术要求详情
+     */
+    private String technicalrequirement;
+
+    /**
+     * 坯料类型
+     */
+    private String blanktype;
+
+    /**
+     * 成分调整
+     */
+    private String compositionchange;
+
+    /**
+     * 调整方案
+     */
+    private String changeremark;
+
+    /**
+     * 坯料厚度
+     */
+    private String blamkthickness;
+
+    /**
+     * 坯料均质
+     */
+    private String blankhomogenization;
+
+    /**
+     * 终轧温度
+     */
+    private String finishtemperature;
+
+    /**
+     * 厚度公差(H)
+     */
+    private String thicknesstolerance;
+
+    /**
+     * 宽度公差(W)
+     */
+    private String widthtolerance;
+
+    /**
+     * 长度公差(L)
+     */
+    private String lengthtolerance;
+
+    /**
+     * 折弯要求
+     */
+    private String bendrequirement;
+
+    /**
+     * 接头(率)
+     */
+    private String joint;
+
+    /**
+     * 刷水/达因值
+     */
+    private String swabbing;
+
+    /**
+     * 抗拉强度
+     */
+    private String tensilestrength;
+
+    /**
+     * 屈服强度
+     */
+    private String yieldstrength;
+
+    /**
+     * 延伸率
+     */
+    private String elongationrate;
+
+    /**
+     * 针孔
+     */
+    private String pinhole;
+
+    /**
+     * 杯突
+     */
+    private String cupping;
+
+    /**
+     * 制耳
+     */
+    private String earing;
+
+    /**
+     * 管内芯直径(mm)
+     */
+    private BigDecimal innercorediameter;
+
+    /**
+     * 管芯材质
+     */
+    private String corematerial;
+
+    /**
+     * 包装方式
+     */
+    private String packagingmethod;
+
+    /**
+     * 包装要求
+     */
+    private String packagingrequirement;
+
+    /**
+     * 托盘要求
+     */
+    private String pallentrequirements;
+
+    /**
+     * 标签要求
+     */
+    private String tag;
+
+    /**
+     * 正反面
+     */
+    private String frontandbacksides;
+
+    /**
+     * 亮暗面
+     */
+    private String surfacerequirement;
+
+    /**
+     * 是否过拉矫
+     */
+    private String istensionlevelling;
+
+    /**
+     * 表面硬度
+     */
+    private String surfacehardness;
+
+    /**
+     * 其他订单执行标准
+     */
+    private String otherorderstandard;
+
+    /**
+     * 是否成熟工艺
+     */
+    private String idmatureprocess;
+
+    /**
+     * 其他注意事项
+     */
+    private String otherprecaution;
+
+    /**
+     * 订单产品类型名称
+     */
+    private String orderproducttype;
+
+    /**
+     * 坯料产品类型名称
+     */
+    private String blankproducttype;
+
+    /**
+     * 订单产品类型
+     */
+    private String orderproducttypeid;
+
+    /**
+     * 坯料产品类型
+     */
+    private String blankproducttypeid;
+
     private static final long serialVersionUID = 1L;
 }

+ 75 - 2
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsProductionOrderDo.java

@@ -389,13 +389,11 @@ public class ApsProductionOrderDo extends BaseDo implements Serializable {
     /**
      * 是否需要质量评审
      */
-    @Deprecated
     private String needqualityreview;
 
     /**
      * 是否需要部长评审
      */
-    @Deprecated
     private String needreview;
 
     /**
@@ -534,6 +532,81 @@ public class ApsProductionOrderDo extends BaseDo implements Serializable {
      */
     private String isback;
 
+    /**
+     * 是否提交工艺评审
+     */
+    private String issubmitprocessreview;
+
+    /**
+     * 生产计划员ID
+     */
+    private String productplannerid;
+
+    /**
+     * 生产计划员名称
+     */
+    private String productplannername;
+
+    /**
+     * 工艺员ID
+     */
+    private String processmemberid;
+
+    /**
+     * 工艺员名称
+     */
+    private String processmembername;
+
+    /**
+     * 工艺质量经理ID
+     */
+    private String processquailtyid;
+
+    /**
+     * 工艺质量经理名称
+     */
+    private String processquailtyname;
+
+    /**
+     * 工艺工程师ID
+     */
+    private String processengineerid;
+
+    /**
+     * 工艺工程师名称
+     */
+    private String processengineername;
+
+    /**
+     * 技质部部长ID
+     */
+    private String departmentownerid;
+
+    /**
+     * 技质部部长名称
+     */
+    private String departmentownername;
+
+    /**
+     * 生产计划主任ID
+     */
+    private String planingownerid;
+
+    /**
+     * 生产计划主任名称
+     */
+    private String planingownername;
+
+    /**
+     * 副总ID
+     */
+    private String deputygeneralmanagerid;
+
+    /**
+     * 副总名称
+     */
+    private String deputygeneralmanagername;
+
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 }

+ 239 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsProductionTechnicalRequirementDo.java

@@ -0,0 +1,239 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.rongwei.rwcommon.base.BaseDo;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * aps_production_technical_requirement
+ * @author 
+ */
+@Data
+@TableName("aps_production_technical_requirement")
+public class ApsProductionTechnicalRequirementDo extends BaseDo implements Serializable {
+    /**
+     * 主键
+     */
+    private String id;
+
+    /**
+     * 所属租户ID
+     */
+    private String tenantid;
+
+    /**
+     * 扩展json格式配置
+     */
+    private String roption;
+
+    /**
+     * 订单ID
+     */
+    private String orderid;
+
+    /**
+     * 产品明细ID
+     */
+    private String orderdetailids;
+
+    /**
+     * 订单产品
+     */
+    private String orderdetailnames;
+
+    /**
+     * 技术要求详情
+     */
+    private String technicalrequirement;
+
+    /**
+     * 坯料类型
+     */
+    private String blanktype;
+
+    /**
+     * 成分调整
+     */
+    private String compositionchange;
+
+    /**
+     * 调整方案
+     */
+    private String changeremark;
+
+    /**
+     * 坯料厚度
+     */
+    private String blamkthickness;
+
+    /**
+     * 坯料均质
+     */
+    private String blankhomogenization;
+
+    /**
+     * 终轧温度
+     */
+    private String finishtemperature;
+
+    /**
+     * 厚度公差(H)
+     */
+    private String thicknesstolerance;
+
+    /**
+     * 宽度公差(W)
+     */
+    private String widthtolerance;
+
+    /**
+     * 长度公差(L)
+     */
+    private String lengthtolerance;
+
+    /**
+     * 折弯要求
+     */
+    private String bendrequirement;
+
+    /**
+     * 接头(率)
+     */
+    private String joint;
+
+    /**
+     * 刷水/达因值
+     */
+    private String swabbing;
+
+    /**
+     * 抗拉强度
+     */
+    private String tensilestrength;
+
+    /**
+     * 屈服强度
+     */
+    private String yieldstrength;
+
+    /**
+     * 延伸率
+     */
+    private String elongationrate;
+
+    /**
+     * 针孔
+     */
+    private String pinhole;
+
+    /**
+     * 杯突
+     */
+    private String cupping;
+
+    /**
+     * 制耳
+     */
+    private String earing;
+
+    /**
+     * 管内芯直径(mm)
+     */
+    private BigDecimal innercorediameter;
+
+    /**
+     * 管芯材质
+     */
+    private String corematerial;
+
+    /**
+     * 包装方式
+     */
+    private String packagingmethod;
+
+    /**
+     * 包装要求
+     */
+    private String packagingrequirement;
+
+    /**
+     * 托盘要求
+     */
+    private String pallentrequirements;
+
+    /**
+     * 标签要求
+     */
+    private String tag;
+
+    /**
+     * 正反面
+     */
+    private String frontandbacksides;
+
+    /**
+     * 亮暗面
+     */
+    private String surfacerequirement;
+
+    /**
+     * 是否过拉矫
+     */
+    private String istensionlevelling;
+
+    /**
+     * 表面硬度
+     */
+    private String surfacehardness;
+
+    /**
+     * 成品外径(废弃)
+     */
+    private String nomod;
+
+    /**
+     * 卷重要求(废弃)
+     */
+    private String rollweightrequirement;
+
+    /**
+     * 其他订单执行标准
+     */
+    private String otherorderstandard;
+
+    /**
+     * 是否成熟工艺
+     */
+    private String idmatureprocess;
+
+    /**
+     * 其他注意事项
+     */
+    private String otherprecaution;
+
+    /**
+     * 订单产品类型名称
+     */
+    private String orderproducttype;
+
+    /**
+     * 坯料产品类型名称
+     */
+    private String blankproducttype;
+
+    /**
+     * 订单产品类型
+     */
+    private String orderproducttypeid;
+
+    /**
+     * 坯料产品类型
+     */
+    private String blankproducttypeid;
+
+    private static final long serialVersionUID = 1L;
+}

+ 17 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/GanttVos.java

@@ -151,4 +151,21 @@ public class GanttVos {
      * 强制冲突描述
      */
     private String softconflictdes  ="";
+    /**
+     * 输入物料描述
+     */
+    private String inmatercondition="";
+    /**
+     * 客户订单号
+     */
+    private String customorderno="";
+    /**
+     * 批量需求的输出订单产品
+     */
+    private String outputorderproduct;
+    /**
+     * 设备类型
+     */
+    private String devicetype;
+
 }

+ 4 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ProcessGanttListVo.java

@@ -14,6 +14,10 @@ public class ProcessGanttListVo {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date startTime;
 
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date endTime;
+
     private String factoryId;
     /**
      * 车间

+ 4 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ScheduleGanttVo.java

@@ -107,6 +107,10 @@ public class ScheduleGanttVo {
      * 订单ID
      */
     private String productionorderid;
+    /**
+     * 设备类型
+     */
+    private String devicetype;
     /**
      * 详细对象
      */

+ 16 - 0
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsBlankOrderController.java

@@ -3,6 +3,7 @@ package com.rongwei.bsserver.controller;
 
 import com.rongwei.bscommon.sys.service.ApsBlankOrderService;
 import com.rongwei.bsentity.domain.ApsBlankOrderDo;
+import com.rongwei.bsentity.domain.ApsProductionTechnicalRequirementDo;
 import com.rongwei.bsentity.vo.ApsPlanVo;
 import com.rongwei.bsentity.vo.CheckAndSaveOrUpdateBlankReq;
 import com.rongwei.bsentity.vo.OrderLockVo;
@@ -152,5 +153,20 @@ public class ApsBlankOrderController {
         log.info("removeBlankOrder 取消ID为:{}的坯料计划", req.getId());
         return apsBlankOrderService.removeBlankOrder(req);
     }
+
+    /**
+     * 保存技术要求之后,是否更新坯料计划的输出成品
+     */
+    @PostMapping("/checkAndUpdateBlankAndOutput")
+    public R checkAndUpdateBlankAndOutput(@RequestBody ApsProductionTechnicalRequirementDo req) {
+        try {
+            log.info("checkAndUpdateBlankAndOutput 保存技术要求后更新,技术要求id为:{}相关的坯料计划和输出成品", req.getId());
+            return apsBlankOrderService.checkAndUpdateBlankAndOutput(req);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.error("更新输出成品失败");
+        }
+
+    }
 }
 

+ 37 - 6
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsProcessOperationController.java

@@ -46,6 +46,22 @@ public class ApsProcessOperationController {
         }
     }
 
+    /*
+    选择历史工艺路线自动生成工序作业
+     */
+    @PostMapping("/chooseHistoryRoute")
+    public R chooseHistoryRoute(@RequestBody Map<String, Object> params) {
+        try {
+            log.info("选择历史工艺路线;参数为:{}", params);
+            R resData = apsProcessOperationService.chooseHistoryRoute(params);
+            return resData;
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.info("选择历史工艺路线异常:" + e.getMessage());
+            return R.error("选择历史工艺路线异常:" + e.getMessage());
+        }
+    }
+
     /*
     清除工艺路线
      */
@@ -82,10 +98,7 @@ public class ApsProcessOperationController {
     public R resetProcessOperation(@RequestBody List<ApsProcessOperationOutMaterDo> apsProcessOperationOutMaterDoList) {
         try {
             log.info("更新后面所有工序信息;参数为:{}", apsProcessOperationOutMaterDoList);
-            List<ApsProcessOperationOutMaterDo> resData = apsProcessOperationService.resetProcessOperation(apsProcessOperationOutMaterDoList);
-            if (resData != null && resData.size() > 0) {
-                resetProcessOperation(resData);
-            }
+            apsProcessOperationService.resetProcessOperation(apsProcessOperationOutMaterDoList);
             return R.ok();
         } catch (Exception e) {
             e.printStackTrace();
@@ -95,7 +108,21 @@ public class ApsProcessOperationController {
     }
 
     /**
-     *坯料计划使用备料保存后,更新被借调工序的所有后续工序
+     * 坯料计划修改卷数和单卷重后,更新工序作业相关信息
+     */
+    @PostMapping("/updateProcess")
+    public R updateProcess(@RequestBody Map<String, Object> params) {
+        try {
+            log.info("更新坯料计划的工序;参数为:{}", params);
+            return apsProcessOperationService.updateProcess(params);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.error("更新坯料计划的工序失败:" + e.getMessage());
+        }
+    }
+
+    /**
+     * 坯料计划使用备料保存后,更新被借调工序的所有后续工序
      */
     @PostMapping("/updateBorrowProcess")
     public R updateBorrowProcess(@RequestBody Map<String, Object> params) {
@@ -110,6 +137,7 @@ public class ApsProcessOperationController {
 
     /**
      * 工序作业备份
+     *
      * @return
      */
     @PostMapping("/backup")
@@ -117,8 +145,10 @@ public class ApsProcessOperationController {
         log.info("开始备份工序作业");
         return apsProcessOperationService.backupProcessOperation();
     }
+
     /**
      * 工序作业备份恢复
+     *
      * @return
      */
     @PostMapping("/backup/restore")
@@ -129,11 +159,12 @@ public class ApsProcessOperationController {
 
     /**
      * 取消工序作业的冲突
+     *
      * @return
      */
     @PostMapping("/cancel/conflict")
     public R cancelConflict(@RequestBody List<String> ids) {
-        log.info("开始根据ID:{}忽略作业冲突信息",ids);
+        log.info("开始根据ID:{}忽略作业冲突信息", ids);
         return apsProcessOperationService.cancelConflict(ids);
     }
 

+ 1 - 1
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsProductionOrderController.java

@@ -68,7 +68,7 @@ public class ApsProductionOrderController {
     }
 
     /**
-     * 调整订单时打开编辑页之前的操作
+     * 调整订单时打开编辑页之前的操作(废弃)
      */
     @PostMapping("/changeOrder")
     public R changeOrder(@RequestBody ApsProductionOrderDo req){

+ 1 - 1
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/GanttController.java

@@ -48,7 +48,7 @@ public class GanttController {
      */
     @PostMapping("/processGanttList")
     public R processGanttList(@RequestBody ProcessGanttListVo processGanttListVo) {
-        return ganttService.getListByCondition(processGanttListVo.getStartTime(), processGanttListVo.getFactoryId(),
+        return ganttService.getListByCondition(processGanttListVo.getStartTime(),processGanttListVo.getEndTime(), processGanttListVo.getFactoryId(),
                 processGanttListVo.getWorkshopId(), processGanttListVo.getOrderNo(),
                 processGanttListVo.getProductionLineId(), processGanttListVo.getEquId());
     }

+ 15 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/AspSafeAttachmentsDao.java

@@ -0,0 +1,15 @@
+package com.rongwei.sfcommon.sys.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwe.scentity.domian.AspSafeAttachmentsDo;
+
+/**
+ * @Entity com.rongwei.training.domain.AspSafeAttachments
+ */
+public interface AspSafeAttachmentsDao extends BaseMapper<AspSafeAttachmentsDo> {
+
+}
+
+
+
+

+ 15 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/AspSpecialEquipmentCertificateDao.java

@@ -0,0 +1,15 @@
+package com.rongwei.sfcommon.sys.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwe.scentity.domian.AspSpecialEquipmentCertificateDo;
+
+/**
+ * @Entity com.rongwei.training.domain.AspSpecialEquipmentCertificate
+ */
+public interface AspSpecialEquipmentCertificateDao extends BaseMapper<AspSpecialEquipmentCertificateDo> {
+
+}
+
+
+
+

+ 2 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/SaveCheckCommonDao.java

@@ -28,4 +28,6 @@ public interface SaveCheckCommonDao {
     List<String> getUserIdByRoleCodeAndOrgIdAndTenantId(@Param("roleCodes") List<String> roleCode,
                                                         @Param("orgIds") List<String> orgIds,
                                                         @Param("tenantId") String tenantId);
+
+    List<UserMailOrgVo> getUserInfoByTenantIdAndRoleCode(@Param("tenantId") String tenantId,@Param("roleCodes") List<String> roleCodes);
 }

+ 12 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/AspSafeAttachmentsService.java

@@ -0,0 +1,12 @@
+package com.rongwei.sfcommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwe.scentity.domian.AspSafeAttachmentsDo;
+import com.rongwei.rwcommon.base.R;
+
+/**
+ *
+ */
+public interface AspSafeAttachmentsService extends IService<AspSafeAttachmentsDo> {
+  R stateUpdateScheduledTasks();
+}

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

@@ -3,7 +3,13 @@ package com.rongwei.sfcommon.sys.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwe.scentity.domian.AspSafetyProductObjective;
 
+import java.util.List;
+import java.util.Map;
+
 public interface AspSafetyProductObjectiveService extends IService<AspSafetyProductObjective> {
     void safetyResult();
-
+    /**
+     * 安全观察指标提醒
+     */
+    void reportObservationConfig(List<String> list);
 }

+ 12 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/AspSpecialEquipmentCertificateService.java

@@ -0,0 +1,12 @@
+package com.rongwei.sfcommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwe.scentity.domian.AspSpecialEquipmentCertificateDo;
+import com.rongwei.rwcommon.base.R;
+
+/**
+ *
+ */
+public interface AspSpecialEquipmentCertificateService extends IService<AspSpecialEquipmentCertificateDo> {
+    R stateUpdateScheduledTasks();
+}

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwe.scentity.domian.CheckItemsDo;
+import com.rongwei.rwcommon.base.R;
 
 import java.util.List;
 
@@ -22,5 +23,7 @@ public interface CheckItemsService extends IService<CheckItemsDo> {
     IPage<CheckItemsDo> spareList(Page page);
 
     void reportEquMessage();
+
+    R stateUpdateScheduledTasks();
 }
 

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

@@ -0,0 +1,108 @@
+package com.rongwei.sfcommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwe.scentity.domian.AspSafeAttachmentsDo;
+import com.rongwe.scentity.vo.UserMailOrgVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.safecommon.utils.CXCommonUtils;
+import com.rongwei.sfcommon.sys.dao.AspSafeAttachmentsDao;
+import com.rongwei.sfcommon.sys.dao.SaveCheckCommonDao;
+import com.rongwei.sfcommon.sys.service.AspSafeAttachmentsService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.rongwei.safecommon.utils.SaveConstans.*;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.SAFETY_ATTACHMENT_VERIFICATION_CONTENT;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.SAFETY_ATTACHMENT_VERIFICATION_TITLE;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.SAFETY_ATTACHMENT_VERIFICATION;
+
+/**
+ *
+ */
+@Service
+public class AspSafeAttachmentsServiceImpl extends ServiceImpl<AspSafeAttachmentsDao, AspSafeAttachmentsDo>
+        implements AspSafeAttachmentsService {
+    /**
+     * 组织机构代码
+     */
+    public static final List<String> ROLE_CODE_LIST = new ArrayList<String>() {{
+        add("code-safe");
+        add("role031");
+    }};
+    /**
+     * 特种设备管理员
+     */
+    public static final String SPECIAL_EQUIPMENT_ADMINISTRATOR = "role031";
+
+    private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
+    @Autowired
+    private SaveCheckCommonDao saveCheckCommonDao;
+
+    @Override
+    public R stateUpdateScheduledTasks() {
+        // 获取所有的安全附件
+        List<AspSafeAttachmentsDo> safeAttachmentsDos = this.list();
+        if (safeAttachmentsDos.isEmpty()) {
+            return R.ok("暂无安全附件");
+        }
+        // 对数据按照租户ID 分组
+        Map<String, List<AspSafeAttachmentsDo>> dataMap = safeAttachmentsDos.stream().collect(Collectors.groupingBy(AspSafeAttachmentsDo::getTenantid));
+        List<AspSafeAttachmentsDo> saveData = new ArrayList<>();
+        // 发送消息提醒的参数
+        Map<AspSafeAttachmentsDo, List<String>> sendNotifyMap = new HashMap<AspSafeAttachmentsDo, List<String>>();
+        dataMap.forEach((k, v) -> {
+            //获取工厂对应的 安全管理员和特种设备管理员
+            List<UserMailOrgVo> userInfO = saveCheckCommonDao.getUserInfoByTenantIdAndRoleCode(k, ROLE_CODE_LIST);
+            Date manufacturedate;
+            long daysBetween;
+            List<String> alertUser;
+            for (AspSafeAttachmentsDo data : v) {
+                manufacturedate = data.getNextinspectiondate();
+                LocalDate date1 = manufacturedate.toInstant()
+                        .atZone(ZoneId.systemDefault())
+                        .toLocalDate();
+                daysBetween = ChronoUnit.DAYS.between(LocalDate.now(), date1);
+                if (daysBetween <= 30) {
+                    data.setReminderstate(HIGH);
+                    alertUser = userInfO.stream().map(UserMailOrgVo::getId).collect(Collectors.toList());
+                    sendNotifyMap.put(data, alertUser);
+                } else if (daysBetween <= 90) {
+                    alertUser = userInfO.stream().filter(user -> SPECIAL_EQUIPMENT_ADMINISTRATOR.equals(user.getRoleCode())).map(UserMailOrgVo::getId).collect(Collectors.toList());
+                    sendNotifyMap.put(data, alertUser);
+                    data.setReminderstate(MIDDLE);
+                } else {
+
+                    data.setReminderstate(LOW);
+                }
+
+                saveData.add(data);
+            }
+        });
+        this.updateBatchById(saveData);
+        sendNotify(sendNotifyMap);
+        return R.ok();
+    }
+
+    public void sendNotify(Map<AspSafeAttachmentsDo, List<String>> sendNotifyMap) {
+        sendNotifyMap.forEach((k, v) -> {
+            // 发送消息提醒
+            CXCommonUtils.sendNotify(SAFETY_ATTACHMENT_VERIFICATION_TITLE,
+                    String.format(SAFETY_ATTACHMENT_VERIFICATION_CONTENT, k.getName(), k.getNumber(), k.getInspectiondate(),
+                            k.getNextinspectiondate(), k.getResponsible()), null, v.stream().distinct().collect(Collectors.toList()),
+                    k.getId(), SAFETY_ATTACHMENT_VERIFICATION, false);
+        });
+    }
+}
+
+
+
+

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

@@ -58,41 +58,41 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
             if (!name4.equals("公司内部安全监管(10分)")) {
                 return R.error("第2行,第11列,表头模板有误!");
             }
-            String name5 = row1.getCell(18) == null ? "" : row1.getCell(18).toString().trim();
+            String name5 = row1.getCell(19) == null ? "" : row1.getCell(19).toString().trim();
             if (!name5.equals("车间自我安全管理(10分)")) {
-                return R.error("第2行,第19列,表头模板有误!");
+                return R.error("第2行,第20列,表头模板有误!");
             }
-            String name6 = row1.getCell(21) == null ? "" : row1.getCell(21).toString().trim();
+            String name6 = row1.getCell(22) == null ? "" : row1.getCell(22).toString().trim();
             if (!name6.equals("工伤管理(50分)")) {
-                return R.error("第2行,第22列,表头模板有误!");
+                return R.error("第2行,第23列,表头模板有误!");
             }
-            String name7 = row1.getCell(26) == null ? "" : row1.getCell(26).toString().trim();
+            String name7 = row1.getCell(27) == null ? "" : row1.getCell(27).toString().trim();
             if (!name7.equals("车间、部门安全工作配合情况")) {
-                return R.error("第2行,第27列,表头模板有误!");
+                return R.error("第2行,第28列,表头模板有误!");
             }
-            String name8 = row1.getCell(30) == null ? "" : row1.getCell(30).toString().trim();
+            String name8 = row1.getCell(31) == null ? "" : row1.getCell(31).toString().trim();
             if (!name8.equals("扣分合计")) {
-                return R.error("第2行,第31列,表头模板有误!");
+                return R.error("第2行,第32列,表头模板有误!");
             }
-            String name9 = row1.getCell(31) == null ? "" : row1.getCell(31).toString().trim();
+            String name9 = row1.getCell(32) == null ? "" : row1.getCell(32).toString().trim();
             if (!name9.equals("车间名称")) {
-                return R.error("第2行,第32列,表头模板有误!");
+                return R.error("第2行,第33列,表头模板有误!");
             }
-            String name10 = row1.getCell(32) == null ? "" : row1.getCell(32).toString().trim();
+            String name10 = row1.getCell(33) == null ? "" : row1.getCell(33).toString().trim();
             if (!name10.equals("车间人数")) {
-                return R.error("第2行,第33列,表头模板有误!");
+                return R.error("第2行,第34列,表头模板有误!");
             }
-            String name11 = row1.getCell(33) == null ? "" : row1.getCell(33).toString().trim();
+            String name11 = row1.getCell(34) == null ? "" : row1.getCell(34).toString().trim();
             if (!name11.equals("加分项")) {
-                return R.error("第2行,第34列,表头模板有误!");
+                return R.error("第2行,第35列,表头模板有误!");
             }
-            String name12 = row1.getCell(39) == null ? "" : row1.getCell(39).toString().trim();
+            String name12 = row1.getCell(42) == null ? "" : row1.getCell(42).toString().trim();
             if (!name12.equals("加分合计")) {
-                return R.error("第2行,第40列,表头模板有误!");
+                return R.error("第2行,第41列,表头模板有误!");
             }
-            String name13 = row1.getCell(40) == null ? "" : row1.getCell(40).toString().trim();
+            String name13 = row1.getCell(43) == null ? "" : row1.getCell(43).toString().trim();
             if (!name13.equals("综合得分情况")) {
-                return R.error("第2行,第41列,表头模板有误!");
+                return R.error("第2行,第44列,表头模板有误!");
             }
             //分析第2行
             Row row2 = sheet.getRow(2);
@@ -140,83 +140,91 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
             if (!name20_2.equals("高低压二氧化碳灭火系统检查")) {
                 return R.error("第3行,第13列,表头模板有误!");
             }
-            String name21 = row2.getCell(13) == null ? "" : row2.getCell(13).toString().trim();
-            if (!name21.equals("安全部日常巡查条数")) {
+            String name20_3 = row2.getCell(13) == null ? "" : row2.getCell(13).toString().trim();
+            if (!name20_3.equals("危废仓库安全检查")) {
                 return R.error("第3行,第14列,表头模板有误!");
             }
-            String name22 = row2.getCell(14) == null ? "" : row2.getCell(14).toString().trim();
-            if (!name22.equals("复查整改率")) {
+            String name21 = row2.getCell(14) == null ? "" : row2.getCell(14).toString().trim();
+            if (!name21.equals("安全部日常巡查条数")) {
                 return R.error("第3行,第15列,表头模板有误!");
             }
-            String name23 = row2.getCell(15) == null ? "" : row2.getCell(15).toString().trim();
-            if (!name23.equals("车间员工违章率(违章次数/车间总人数)")) {
+            String name22 = row2.getCell(15) == null ? "" : row2.getCell(15).toString().trim();
+            if (!name22.equals("复查整改率")) {
                 return R.error("第3行,第16列,表头模板有误!");
             }
-            String name24 = row2.getCell(17) == null ? "" : row2.getCell(17).toString().trim();
+            String name23 = row2.getCell(16) == null ? "" : row2.getCell(16).toString().trim();
+            if (!name23.equals("车间员工违章率(违章次数/车间总人数)")) {
+                return R.error("第3行,第17列,表头模板有误!");
+            }
+            String name24 = row2.getCell(18) == null ? "" : row2.getCell(18).toString().trim();
             if (!name24.equals("公司考核通报(50元/扣0.5分)")) {
-                return R.error("第3行,第18列,表头模板有误!");
+                return R.error("第3行,第19列,表头模板有误!");
             }
-            String name25 = row2.getCell(18) == null ? "" : row2.getCell(18).toString().trim();
+            String name25 = row2.getCell(19) == null ? "" : row2.getCell(19).toString().trim();
             if (!name25.equals("公司对车间提问合格率")) {
-                return R.error("第3行,第19列,表头模板有误!");
+                return R.error("第3行,第20列,表头模板有误!");
             }
-            String name26 = row2.getCell(19) == null ? "" : row2.getCell(19).toString().trim();
+            String name26 = row2.getCell(20) == null ? "" : row2.getCell(20).toString().trim();
             if (!name26.equals("车间自查违章率")) {
-                return R.error("第3行,第20列,表头模板有误!");
+                return R.error("第3行,第21列,表头模板有误!");
             }
-            String name27 = row2.getCell(20) == null ? "" : row2.getCell(20).toString().trim();
+            String name27 = row2.getCell(21) == null ? "" : row2.getCell(21).toString().trim();
             if (!name27.equals("车间级隐患排查条数")) {
-                return R.error("第3行,第21列,表头模板有误!");
+                return R.error("第3行,第22列,表头模板有误!");
             }
-            String name28 = row2.getCell(21) == null ? "" : row2.getCell(21).toString().trim();
+            String name28 = row2.getCell(22) == null ? "" : row2.getCell(22).toString().trim();
             if (!name28.equals("安全事件或未遂事件起数")) {
-                return R.error("第3行,第22列,表头模板有误!");
+                return R.error("第3行,第23列,表头模板有误!");
             }
-            String name29 = row2.getCell(22) == null ? "" : row2.getCell(22).toString().trim();
+            String name29 = row2.getCell(23) == null ? "" : row2.getCell(23).toString().trim();
             if (!name29.equals("费用(元)")) {
-                return R.error("第3行,第23列,表头模板有误!");
+                return R.error("第3行,第24列,表头模板有误!");
             }
-            String name30 = row2.getCell(23) == null ? "" : row2.getCell(23).toString().trim();
+            String name30 = row2.getCell(24) == null ? "" : row2.getCell(24).toString().trim();
             if (!name30.equals("工伤事故起数")) {
-                return R.error("第3行,第24列,表头模板有误!");
+                return R.error("第3行,第25列,表头模板有误!");
             }
-            String name31 = row2.getCell(24) == null ? "" : row2.getCell(24).toString().trim();
+            String name31 = row2.getCell(25) == null ? "" : row2.getCell(25).toString().trim();
             if (!name31.equals("费用(元)")) {
-                return R.error("第3行,第25列,表头模板有误!");
+                return R.error("第3行,第26列,表头模板有误!");
             }
-            String name32 = row2.getCell(25) == null ? "" : row2.getCell(25).toString().trim();
+            String name32 = row2.getCell(26) == null ? "" : row2.getCell(26).toString().trim();
             if (!name32.equals("千人工伤率(‰)")) {
-                return R.error("第3行,第26列,表头模板有误!");
+                return R.error("第3行,第27列,表头模板有误!");
             }
-            String name33 = row2.getCell(26) == null ? "" : row2.getCell(26).toString().trim();
+            String name33 = row2.getCell(27) == null ? "" : row2.getCell(27).toString().trim();
             if (!name33.equals("专项开展不到位、不及时、效果不佳情况")) {
-                return R.error("第3行,第27列,表头模板有误!");
+                return R.error("第3行,第28列,表头模板有误!");
             }
-            String name34 = row2.getCell(28) == null ? "" : row2.getCell(28).toString().trim();
+            String name34 = row2.getCell(29) == null ? "" : row2.getCell(29).toString().trim();
             if (!name34.equals("车间、部门上交的资料质量差、标准低情况")) {
-                return R.error("第3行,第29列,表头模板有误!");
+                return R.error("第3行,第30列,表头模板有误!");
             }
-            String name35 = row2.getCell(33) == null ? "" : row2.getCell(33).toString().trim();
+            String name35 = row2.getCell(34) == null ? "" : row2.getCell(34).toString().trim();
             if (!name35.equals("车间自行组织预防安全培训、活动等/次数")) {
-                return R.error("第3行,第34列,表头模板有误!");
+                return R.error("第3行,第35列,表头模板有误!");
             }
-            String name36 = row2.getCell(35) == null ? "" : row2.getCell(35).toString().trim();
+            String name36 = row2.getCell(36) == null ? "" : row2.getCell(36).toString().trim();
             if (!name36.equals("迎接外部检查无隐患问题/次数")) {
-                return R.error("第3行,第36列,表头模板有误!");
+                return R.error("第3行,第37列,表头模板有误!");
             }
-            String name37 = row2.getCell(37) == null ? "" : row2.getCell(37).toString().trim();
+            String name37 = row2.getCell(38) == null ? "" : row2.getCell(38).toString().trim();
             if (!name37.equals("车间、部门承接公司安全活动次数")) {
-                return R.error("第3行,第38列,表头模板有误!");
+                return R.error("第3行,第39列,表头模板有误!");
+            }
+            String name37_1 = row2.getCell(40) == null ? "" : row2.getCell(40).toString().trim();
+            if (!name37_1.equals("集团公司、公司奖励(50元/加0.5分)")) {
+                return R.error("第3行,第41列,表头模板有误!");
             }
             //分析第3行
             Row row3 = sheet.getRow(3);
-            String name38 = row3.getCell(15) == null ? "" : row3.getCell(15).toString().trim();
+            String name38 = row3.getCell(16) == null ? "" : row3.getCell(16).toString().trim();
             if (!name38.equals("违章考核起数")) {
-                return R.error("第4行,第16列,表头模板有误!");
+                return R.error("第4行,第17列,表头模板有误!");
             }
-            String name39 = row3.getCell(16) == null ? "" : row3.getCell(16).toString().trim();
+            String name39 = row3.getCell(17) == null ? "" : row3.getCell(17).toString().trim();
             if (!name39.equals("人员违章率")) {
-                return R.error("第4行,第17列,表头模板有误!");
+                return R.error("第4行,第18列,表头模板有误!");
             }
             //================表头分析结束================
 
@@ -263,27 +271,30 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     String monthlysafetyinspection = row.getCell(10) == null ? "" : row.getCell(10).toString().trim();
                     String dangerouschemicalcheck = row.getCell(11) == null ? "" : row.getCell(11).toString().trim();
                     String lowpressurecheck = row.getCell(12) == null ? "" : row.getCell(12).toString().trim();
-                    String dailyinspection = row.getCell(13) == null ? "" : row.getCell(13).toString().trim();
-                    String reviewrate = row.getCell(14) == null ? "" : row.getCell(14).toString().trim();
-                    String violationassessment = row.getCell(15) == null ? "" : row.getCell(15).toString().trim();
-                    String personnelviolationrate = row.getCell(16) == null ? "" : row.getCell(16).toString().trim();
-                    String commpanyassessmentreport = row.getCell(17) == null ? "" : row.getCell(17).toString().trim();
-                    String rateforworkshopquestion = row.getCell(18) == null ? "" : row.getCell(18).toString().trim();
-                    String workshopselfrate = row.getCell(19) == null ? "" : row.getCell(19).toString().trim();
-                    String numberofworkshoplevel = row.getCell(20) == null ? "" : row.getCell(20).toString().trim();
-                    String numberofsafetyincident = row.getCell(21) == null ? "" : row.getCell(21).toString().trim();
-                    String cost1 = row.getCell(22) == null ? "" : row.getCell(22).toString().trim();
-                    String numberofaccident = row.getCell(23) == null ? "" : row.getCell(23).toString().trim();
-                    String cost2 = row.getCell(24) == null ? "" : row.getCell(24).toString().trim();
-                    String thousandartificialinjuryrate = row.getCell(25) == null ? "" : row.getCell(25).toString().trim();
-                    String numberofspecialproject = row.getCell(26) == null ? "" : row.getCell(26).toString().trim();
-                    String numberofbadmatterials = row.getCell(28) == null ? "" : row.getCell(28).toString().trim();
-                    String totaldeductionpoints = row.getCell(30) == null ? "" : row.getCell(30).toString().trim();
-                    String trainingbyself = row.getCell(33) == null ? "" : row.getCell(33).toString().trim();
-                    String trainingbyout = row.getCell(35) == null ? "" : row.getCell(35).toString().trim();
-                    String trainingbycompany = row.getCell(37) == null ? "" : row.getCell(37).toString().trim();
-                    String totalbonuspoints = row.getCell(39) == null ? "" : row.getCell(39).toString().trim();
-                    String totalscore = row.getCell(40) == null ? "" : row.getCell(40).toString().trim();
+                    String hazardouswarehouse = row.getCell(13) == null ? "" : row.getCell(13).toString().trim();
+                    String dailyinspection = row.getCell(14) == null ? "" : row.getCell(14).toString().trim();
+                    String reviewrate = row.getCell(15) == null ? "" : row.getCell(15).toString().trim();
+                    String violationassessment = row.getCell(16) == null ? "" : row.getCell(16).toString().trim();
+                    String personnelviolationrate = row.getCell(17) == null ? "" : row.getCell(17).toString().trim();
+                    String commpanyassessmentreport = row.getCell(18) == null ? "" : row.getCell(18).toString().trim();
+                    String rateforworkshopquestion = row.getCell(19) == null ? "" : row.getCell(19).toString().trim();
+                    String workshopselfrate = row.getCell(20) == null ? "" : row.getCell(20).toString().trim();
+                    String numberofworkshoplevel = row.getCell(21) == null ? "" : row.getCell(21).toString().trim();
+                    String numberofsafetyincident = row.getCell(22) == null ? "" : row.getCell(22).toString().trim();
+                    String cost1 = row.getCell(23) == null ? "" : row.getCell(23).toString().trim();
+                    String numberofaccident = row.getCell(24) == null ? "" : row.getCell(24).toString().trim();
+                    String cost2 = row.getCell(25) == null ? "" : row.getCell(25).toString().trim();
+                    String thousandartificialinjuryrate = row.getCell(26) == null ? "" : row.getCell(26).toString().trim();
+                    String numberofspecialproject = row.getCell(27) == null ? "" : row.getCell(27).toString().trim();
+                    String numberofbadmatterials = row.getCell(29) == null ? "" : row.getCell(29).toString().trim();
+                    String totaldeductionpoints = row.getCell(31) == null ? "" : row.getCell(31).toString().trim();
+                    String trainingbyself = row.getCell(34) == null ? "" : row.getCell(34).toString().trim();
+                    String trainingbyout = row.getCell(36) == null ? "" : row.getCell(36).toString().trim();
+                    String trainingbycompany = row.getCell(38) == null ? "" : row.getCell(38).toString().trim();
+                    String companyrewards = row.getCell(40) == null ? "" : row.getCell(40).toString().trim();
+
+                    String totalbonuspoints = row.getCell(42) == null ? "" : row.getCell(42).toString().trim();
+                    String totalscore = row.getCell(43) == null ? "" : row.getCell(43).toString().trim();
 
                     if (ObjectUtil.isEmpty(departname)) {
                         return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
@@ -324,6 +335,9 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     if (ObjectUtil.isEmpty(lowpressurecheck)) {
                         return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
                     }
+                    if(ObjectUtil.isEmpty(hazardouswarehouse)){
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
                     if (ObjectUtil.isEmpty(dailyinspection)) {
                         return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
                     }
@@ -381,6 +395,9 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     if (ObjectUtil.isEmpty(trainingbycompany)) {
                         return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
                     }
+                    if(ObjectUtil.isEmpty(companyrewards)){
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
                     if (ObjectUtil.isEmpty(totalbonuspoints)) {
                         return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
                     }
@@ -401,6 +418,7 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     detail.setMonthlysafetyinspection(monthlysafetyinspection);
                     detail.setDangerouschemicalcheck(dangerouschemicalcheck);
                     detail.setLowpressurecheck(lowpressurecheck);
+                    detail.setHazardouswarehouse(hazardouswarehouse);
                     detail.setDailyinspection(dailyinspection);
                     detail.setReviewrate(reviewrate);
                     detail.setViolationassessment(violationassessment);
@@ -423,6 +441,7 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     detail.setTrainingbyself(trainingbyself);
                     detail.setTrainingbyout(trainingbyout);
                     detail.setTrainingbycompany(trainingbycompany);
+                    detail.setCompanyrewards(companyrewards);
                     detail.setTotalbonuspoints(totalbonuspoints);
                     detail.setTotalscore(totalscore);
                     detail.setType(((i / 2) - 1) + ".1");
@@ -452,22 +471,24 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     String monthlysafetyinspection = row.getCell(10) == null ? "" : row.getCell(10).toString().trim();
                     String dangerouschemicalcheck = row.getCell(11) == null ? "" : row.getCell(11).toString().trim();
                     String lowpressurecheck = row.getCell(12) == null ? "" : row.getCell(12).toString().trim();
-                    String dailyinspection = row.getCell(13) == null ? "" : row.getCell(13).toString().trim();
-                    String reviewrate = row.getCell(14) == null ? "" : row.getCell(14).toString().trim();
-                    String violationscore = row.getCell(15) == null ? "" : row.getCell(15).toString().trim();
-                    String commpanyassessmentreport = row.getCell(17) == null ? "" : row.getCell(17).toString().trim();
-                    String rateforworkshopquestion = row.getCell(18) == null ? "" : row.getCell(18).toString().trim();
-                    String workshopselfrate = row.getCell(19) == null ? "" : row.getCell(19).toString().trim();
-                    String numberofworkshoplevel = row.getCell(20) == null ? "" : row.getCell(20).toString().trim();
-                    String score1 = row.getCell(21) == null ? "" : row.getCell(21).toString().trim();
-                    String score2 = row.getCell(23) == null ? "" : row.getCell(23).toString().trim();
-                    String thousandartificialinjuryrate = row.getCell(25) == null ? "" : row.getCell(25).toString().trim();
-                    String numberofspecialproject = row.getCell(26) == null ? "" : row.getCell(26).toString().trim();
-                    String numberofbadmatterials = row.getCell(28) == null ? "" : row.getCell(28).toString().trim();
+                    String hazardouswarehouse = row.getCell(13) == null ? "" : row.getCell(13).toString().trim();
+                    String dailyinspection = row.getCell(14) == null ? "" : row.getCell(14).toString().trim();
+                    String reviewrate = row.getCell(15) == null ? "" : row.getCell(15).toString().trim();
+                    String violationscore = row.getCell(16) == null ? "" : row.getCell(16).toString().trim();
+                    String commpanyassessmentreport = row.getCell(18) == null ? "" : row.getCell(18).toString().trim();
+                    String rateforworkshopquestion = row.getCell(19) == null ? "" : row.getCell(19).toString().trim();
+                    String workshopselfrate = row.getCell(20) == null ? "" : row.getCell(20).toString().trim();
+                    String numberofworkshoplevel = row.getCell(21) == null ? "" : row.getCell(21).toString().trim();
+                    String score1 = row.getCell(22) == null ? "" : row.getCell(22).toString().trim();
+                    String score2 = row.getCell(24) == null ? "" : row.getCell(24).toString().trim();
+                    String thousandartificialinjuryrate = row.getCell(26) == null ? "" : row.getCell(26).toString().trim();
+                    String numberofspecialproject = row.getCell(27) == null ? "" : row.getCell(27).toString().trim();
+                    String numberofbadmatterials = row.getCell(29) == null ? "" : row.getCell(29).toString().trim();
 //                    String totaldeductionpoints = row.getCell(26) == null ? "" : row.getCell(26).toString().trim();
-                    String trainingbyself = row.getCell(33) == null ? "" : row.getCell(33).toString().trim();
-                    String trainingbyout = row.getCell(35) == null ? "" : row.getCell(35).toString().trim();
-                    String trainingbycompany = row.getCell(37) == null ? "" : row.getCell(37).toString().trim();
+                    String trainingbyself = row.getCell(34) == null ? "" : row.getCell(34).toString().trim();
+                    String trainingbyout = row.getCell(36) == null ? "" : row.getCell(36).toString().trim();
+                    String trainingbycompany = row.getCell(38) == null ? "" : row.getCell(38).toString().trim();
+                    String companyrewards = row.getCell(40) == null ? "" : row.getCell(40).toString().trim();
 //                    String totalbonuspoints = row.getCell(35) == null ? "" : row.getCell(35).toString().trim();
 //                    String totalscore = row.getCell(36) == null ? "" : row.getCell(36).toString().trim();
 
@@ -537,6 +558,9 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     if (ObjectUtil.isEmpty(trainingbycompany)) {
                         return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
                     }
+                    if(ObjectUtil.isEmpty(companyrewards)){
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
 
 
 //                    detail.setDepartname(departname);
@@ -552,6 +576,7 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     detail.setMonthlysafetyinspection(monthlysafetyinspection);
                     detail.setDangerouschemicalcheck(dangerouschemicalcheck);
                     detail.setLowpressurecheck(lowpressurecheck);
+                    detail.setHazardouswarehouse(hazardouswarehouse);
                     detail.setDailyinspection(dailyinspection);
                     detail.setReviewrate(reviewrate);
 //                    detail.setViolationassessment(violationassessment);
@@ -573,6 +598,7 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
                     detail.setTrainingbyself(trainingbyself);
                     detail.setTrainingbyout(trainingbyout);
                     detail.setTrainingbycompany(trainingbycompany);
+                    detail.setCompanyrewards(companyrewards);
                     detail.setType(((i / 2) - 1) + ".2");
                     detail.setMainid(id);
                     detail.setId(SecurityUtil.getUUID());
@@ -592,7 +618,7 @@ public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSaf
 
 
             }
-            if (res.size() > 0) {
+            if (!res.isEmpty()) {
                 aspSafetyPerformanceAppraisalDetailService.saveBatch(res);
             }
         } catch (IOException e) {

+ 29 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafetyProductObjectiveServiceImpl.java

@@ -23,6 +23,10 @@ import org.springframework.stereotype.Service;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.OBSERVATION_CONTENT;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.OBSERVATION_TITLE;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.OBSERVATION_AUDIT;
+
 /**
  * @author :sc
  * @since :2023/12/7
@@ -112,6 +116,31 @@ public class AspSafetyProductObjectiveServiceImpl extends ServiceImpl<AspSafetyP
 
     }
 
+    @Override
+    public void reportObservationConfig(List<String> list) {
+        if(!list.isEmpty()){
+            // {"ad8106741bf547778d01d556e371ac98/34d64aaae0344b109ad8909f3afa4d40/69"}
+            for (String str : list) {
+                String[] split = str.split("/");
+                if(split.length<3){
+                    return;
+                }
+                String value = split[0];
+                String userId = split[1];
+                String count = split[2];
+                //系统通知(移动端和PC端个人工作台)
+                CXCommonUtils.sendNotify(OBSERVATION_TITLE,
+                        String.format(OBSERVATION_CONTENT, count),
+                        null,
+                        Collections.singletonList(userId),
+                        value,
+                        OBSERVATION_AUDIT,
+                        false);
+
+            }
+        }
+    }
+
     private void sendMessage(List<AspSafetyProductObjectiveResult> mainResList) {
         //维护指标级别对应的角色ID
         //objectivelevel:指标级别。

+ 110 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSpecialEquipmentCertificateServiceImpl.java

@@ -0,0 +1,110 @@
+package com.rongwei.sfcommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwe.scentity.domian.AspSpecialEquipmentCertificateDo;
+import com.rongwe.scentity.vo.UserMailOrgVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.safecommon.utils.CXCommonUtils;
+import com.rongwei.sfcommon.sys.dao.AspSpecialEquipmentCertificateDao;
+import com.rongwei.sfcommon.sys.dao.SaveCheckCommonDao;
+import com.rongwei.sfcommon.sys.service.AspSpecialEquipmentCertificateService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.rongwei.safecommon.utils.SaveConstans.*;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.PERSONNEL_CERTIFICATES_CONTENT;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.SAFETY_ATTACHMENT_VERIFICATION_CONTENT;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.PERSONNEL_CERTIFICATES_TITLE;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.SAFETY_ATTACHMENT_VERIFICATION_TITLE;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.PERSONNEL_CERTIFICATES;
+
+/**
+ *
+ */
+@Service
+public class AspSpecialEquipmentCertificateServiceImpl extends ServiceImpl<AspSpecialEquipmentCertificateDao, AspSpecialEquipmentCertificateDo>
+        implements AspSpecialEquipmentCertificateService {
+    /**
+     * 组织机构代码
+     */
+    public static final List<String> ROLE_CODE_LIST = new ArrayList<String>() {{
+        add("code-safe");
+        add("role031");
+    }};
+    /**
+     * 特种设备管理员
+     */
+    public static final String SPECIAL_EQUIPMENT_ADMINISTRATOR = "role031";
+
+    private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
+    @Autowired
+    private SaveCheckCommonDao saveCheckCommonDao;
+
+    @Override
+    public R stateUpdateScheduledTasks() {
+        // 获取所有的安全附件
+        List<AspSpecialEquipmentCertificateDo> safeAttachmentsDos = this.list();
+        if (safeAttachmentsDos.isEmpty()) {
+            return R.ok("暂无安全附件");
+        }
+        // 对数据按照租户ID 分组
+        Map<String, List<AspSpecialEquipmentCertificateDo>> dataMap = safeAttachmentsDos.stream().collect(Collectors.groupingBy(AspSpecialEquipmentCertificateDo::getTenantid));
+        List<AspSpecialEquipmentCertificateDo> saveData = new ArrayList<>();
+        // 发送消息提醒的参数
+        Map<AspSpecialEquipmentCertificateDo, List<String>> sendNotifyMap = new HashMap<>();
+        dataMap.forEach((k, v) -> {
+            //获取工厂对应的 安全管理员和特种设备管理员
+            List<UserMailOrgVo> userInfO = saveCheckCommonDao.getUserInfoByTenantIdAndRoleCode(k, ROLE_CODE_LIST);
+            Date manufacturedate;
+            long daysBetween;
+            List<String> alertUser;
+            for (AspSpecialEquipmentCertificateDo data : v) {
+                manufacturedate = data.getReviewdate();
+                LocalDate date1 = manufacturedate.toInstant()
+                        .atZone(ZoneId.systemDefault())
+                        .toLocalDate();
+                daysBetween = ChronoUnit.DAYS.between(LocalDate.now(), date1);
+                if (daysBetween <= 30) {
+                    data.setReminderstate(HIGH);
+                    alertUser = userInfO.stream().map(UserMailOrgVo::getId).collect(Collectors.toList());
+                    sendNotifyMap.put(data, alertUser);
+                } else if (daysBetween <= 90) {
+                    alertUser = userInfO.stream().filter(user -> SPECIAL_EQUIPMENT_ADMINISTRATOR.equals(user.getRoleCode())).map(UserMailOrgVo::getId).collect(Collectors.toList());
+                    sendNotifyMap.put(data, alertUser);
+                    data.setReminderstate(MIDDLE);
+                } else {
+                    data.setReminderstate(LOW);
+                }
+
+                saveData.add(data);
+            }
+        });
+        this.updateBatchById(saveData);
+        sendNotify(sendNotifyMap);
+        return R.ok();
+    }
+
+
+    public void sendNotify(Map<AspSpecialEquipmentCertificateDo, List<String>> sendNotifyMap) {
+        sendNotifyMap.forEach((k, v) -> {
+            // 发送消息提醒
+            CXCommonUtils.sendNotify(PERSONNEL_CERTIFICATES_TITLE,
+                    String.format(PERSONNEL_CERTIFICATES_CONTENT, k.getName(), k.getOrgname(), k.getCertificatesort(),
+                            k.getReviewdate()), null, v.stream().distinct().collect(Collectors.toList()),
+                    k.getId(), PERSONNEL_CERTIFICATES, false);
+        });
+    }
+}
+
+
+
+

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

@@ -2,35 +2,62 @@ package com.rongwei.sfcommon.sys.service.impl;
 
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwe.scentity.domian.CheckItemsDo;
 import com.rongwe.scentity.domian.PointCheckDo;
 import com.rongwe.scentity.vo.CheckItemsTypeVo;
+import com.rongwe.scentity.vo.UserMailOrgVo;
+import com.rongwei.rwadmincommon.system.domain.SysDictDo;
+import com.rongwei.rwadmincommon.system.service.impl.SysDictServiceImpl;
+import com.rongwei.rwcommon.base.R;
 import com.rongwei.safecommon.utils.CXCommonUtils;
 import com.rongwei.sfcommon.sys.dao.CheckItemsDao;
+import com.rongwei.sfcommon.sys.dao.SaveCheckCommonDao;
 import com.rongwei.sfcommon.sys.service.CheckItemsService;
 import com.rongwei.sfcommon.sys.service.PointCheckService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.stream.Collectors;
 
-import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.SPECIALEQUIPMENT_CONTENT;
-import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.SPECIALEQUIPMENT_CONTENT_PREFIX;
+import static com.rongwei.safecommon.utils.SaveConstans.*;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.*;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.EQUIPMENT_CHECK_TITLE;
 import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.SPECIALEQUIPMENT_TITLE;
 import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.SPECIALEQUIPMENT;
 
 @Service("checkItemsService")
 public class CheckItemsServiceImpl extends ServiceImpl<CheckItemsDao, CheckItemsDo> implements CheckItemsService {
 
+    /**
+     * 组织机构代码
+     */
+    public static final List<String> ROLE_CODE_LIST = new ArrayList<String>() {{
+        add("code-safe");
+        add("role031");
+    }};
+    /**
+     * 特种设备管理员
+     */
+    public static final String SPECIAL_EQUIPMENT_ADMINISTRATOR = "role031";
     @Autowired
+    @Lazy
     private PointCheckService pointCheckService;
-
     @Autowired
     private CheckItemsDao checkItemsDao;
+    @Autowired
+    private SaveCheckCommonDao saveCheckCommonDao;
+    @Autowired
+    private SysDictServiceImpl sysDictService;
 
     /**
      * 设备列表删除验证是否存在点检记录
@@ -109,7 +136,7 @@ public class CheckItemsServiceImpl extends ServiceImpl<CheckItemsDao, CheckItems
 
                 //发送消息
                 CXCommonUtils.sendNotify(SPECIALEQUIPMENT_TITLE,
-                        SPECIALEQUIPMENT_CONTENT_PREFIX + String.format(SPECIALEQUIPMENT_CONTENT,typeName,checkItemCode,checkItemName,nextCheckDate),
+                        SPECIALEQUIPMENT_CONTENT_PREFIX + String.format(SPECIALEQUIPMENT_CONTENT, typeName, checkItemCode, checkItemName, nextCheckDate),
                         null,
                         equManager.get(item.getTenantid()),
                         item.getId(),
@@ -120,4 +147,64 @@ public class CheckItemsServiceImpl extends ServiceImpl<CheckItemsDao, CheckItems
 
     }
 
+    @Override
+    public R stateUpdateScheduledTasks() {
+        // 获取所有的安全附件
+        List<CheckItemsDo> safeAttachmentsDos = this.list(new LambdaQueryWrapper<CheckItemsDo>().eq(CheckItemsDo::getSource, 1));
+        if (safeAttachmentsDos.isEmpty()) {
+            return R.ok("暂无设备需要检验");
+        }
+        // 对数据按照租户ID 分组
+        Map<String, List<CheckItemsDo>> dataMap = safeAttachmentsDos.stream().collect(Collectors.groupingBy(CheckItemsDo::getTenantid));
+        List<CheckItemsDo> saveData = new ArrayList<>();
+        // 发送消息提醒的参数
+        Map<CheckItemsDo, List<String>> sendNotifyMap = new HashMap<CheckItemsDo, List<String>>();
+        dataMap.forEach((k, v) -> {
+            //获取工厂对应的 安全管理员和特种设备管理员
+            List<UserMailOrgVo> userInfO = saveCheckCommonDao.getUserInfoByTenantIdAndRoleCode(k, ROLE_CODE_LIST);
+            Date manufacturedate;
+            long daysBetween;
+            List<String> alertUser;
+            for (CheckItemsDo data : v) {
+                manufacturedate = data.getNextcheckdate();
+                LocalDate date1 = manufacturedate.toInstant()
+                        .atZone(ZoneId.systemDefault())
+                        .toLocalDate();
+                daysBetween = ChronoUnit.DAYS.between(LocalDate.now(), date1);
+                if (daysBetween <= 30) {
+                    data.setReminderstate(HIGH);
+                    alertUser = userInfO.stream().map(UserMailOrgVo::getId).collect(Collectors.toList());
+                    sendNotifyMap.put(data, alertUser);
+                } else if (daysBetween <= 90) {
+                    alertUser = userInfO.stream().filter(user -> SPECIAL_EQUIPMENT_ADMINISTRATOR.equals(user.getRoleCode())).map(UserMailOrgVo::getId).collect(Collectors.toList());
+                    sendNotifyMap.put(data, alertUser);
+                    data.setReminderstate(MIDDLE);
+                } else {
+                    data.setReminderstate(LOW);
+                }
+
+                saveData.add(data);
+            }
+        });
+        this.updateBatchById(saveData);
+        sendNotify(sendNotifyMap);
+        return R.ok();
+    }
+
+    public void sendNotify(Map<CheckItemsDo, List<String>> sendNotifyMap) {
+        if (sendNotifyMap.isEmpty()) {
+            return;
+        }
+        // 获取数据字典
+        List<SysDictDo> aspCheckItemType = sysDictService.getDictsByType("asp_check_item_type");
+        sendNotifyMap.forEach((k, v) -> {
+            SysDictDo sysDictDo = aspCheckItemType.stream().filter(info -> info.getValue().equals(k.getCheckitemtype())).findFirst().orElse(null);
+
+            // 发送消息提醒
+            CXCommonUtils.sendNotify(EQUIPMENT_CHECK_TITLE,
+                    String.format(EQUIPMENT_CHECK_CONTENT, sysDictDo == null ? "" : sysDictDo.getName(), k.getCheckitemcode(), k.getCheckitemname(),
+                            k.getNextcheckdate()), null, v.stream().distinct().collect(Collectors.toList()),
+                    k.getId(), SPECIALEQUIPMENT, false);
+        });
+    }
 }

+ 19 - 0
cx-safe-check/cx-save-check-common/src/main/resources/mybatis/SaveCheckCommonDao.xml

@@ -98,4 +98,23 @@
             </if>
         </where>
     </select>
+    <select id="getUserInfoByTenantIdAndRoleCode" resultType="com.rongwe.scentity.vo.UserMailOrgVo">
+        select
+        su.ID as id,
+        su.NAME as name,
+        sr.CODE AS roleCode
+        from sys_user su
+        LEFT JOIN sys_user_role sur on sur.USERID = su.ID and sur.DELETED = '0'
+        LEFT JOIN sys_role sr on sur.ROLEID = sr.ID and sr.DELETED = '0'
+        lEFT JOIN sys_user_org suo on suo.USERID = su.ID and suo.DELETED = '0'
+        LEFT JOIN sys_organization so on suo.ORGID=so.ID and so.DELETED='0'
+        <where>
+            su.DELETED='0'
+            AND FIND_IN_SET(#{tenantId},so.FULLPID)
+            AND sr.CODE in
+            <foreach collection="roleCodes" item="code" open="(" close=")" separator=",">
+                #{code}
+            </foreach>
+        </where>
+    </select>
 </mapper>

+ 161 - 0
cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspSafeAttachmentsDo.java

@@ -0,0 +1,161 @@
+package com.rongwe.scentity.domian;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.rongwei.rwcommon.base.BaseDo;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 安全附件
+ *
+ * @TableName asp_safe_attachments
+ */
+@TableName(value = "asp_safe_attachments")
+@Data
+public class AspSafeAttachmentsDo extends BaseDo implements Serializable {
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+    /**
+     * 主键
+     */
+    private String id;
+    /**
+     * 所属租户ID
+     */
+    private String tenantid;
+    /**
+     * 扩展json格式配置
+     */
+    private String roption;
+    /**
+     * 名称
+     */
+    private String name;
+    /**
+     * 型号
+     */
+    private String model;
+    /**
+     * 编号
+     */
+    private String number;
+    /**
+     * 制造厂
+     */
+    private String manufacturer;
+    /**
+     * 出厂日期
+     */
+    private Date manufacturedate;
+    /**
+     * 检测周期
+     */
+    private String detectionperiod;
+    /**
+     * 检测类型
+     */
+    private String detectiontype;
+    /**
+     * 检测单位
+     */
+    private String testingcompany;
+    /**
+     * 检测/更换日期
+     */
+    private Date inspectiondate;
+    /**
+     * 下次检测/更换日期
+     */
+    private Date nextinspectiondate;
+    /**
+     * 等级
+     */
+    private String grade;
+    /**
+     * 证书编号
+     */
+    private String certificatenumber;
+    /**
+     * 责任人
+     */
+    private String responsible;
+    /**
+     * 责任人ID
+     */
+    private String responsibleid;
+    /**
+     * 数量
+     */
+    private String quantity;
+    /**
+     * 防雷类型
+     */
+    private String antilightingtype;
+    /**
+     * 位置编号
+     */
+    private String positionnumber;
+    /**
+     * 使用车间
+     */
+    private String useshop;
+    /**
+     * 使用车间ID
+     */
+    private String useshopid;
+    /**
+     * 使用地点
+     */
+    private String useplace;
+    /**
+     * 安装地点
+     */
+    private String installplace;
+    /**
+     * 最大误差
+     */
+    private String maximumerror;
+    /**
+     * 测量范围
+     */
+    private String measuringrange;
+    /**
+     * 拾包公司名称
+     */
+    private String pickupcompany;
+    /**
+     * 安装部位
+     */
+    private String installsite;
+    /**
+     * 检测气体
+     */
+    private String tracergas;
+    /**
+     * 环境温度
+     */
+    private String ambienttemperature;
+    /**
+     * 工作电压
+     */
+    private String workingvoltage;
+    /**
+     * 附件
+     */
+    private String annex;
+    /**
+     * 提醒状态
+     */
+    private String reminderstate;
+    /**
+     * 主表ID(asp_check_items_area的ID)
+     */
+    private String mainid;
+    /**
+     * 附件类型
+     */
+    private String attachmenttype;
+}

+ 8 - 0
cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspSafetyPerformanceAppraisalDetail.java

@@ -135,6 +135,10 @@ public class AspSafetyPerformanceAppraisalDetail implements Serializable {
      */
     private String lowpressurecheck;
 
+    /**
+     * 危废仓库安全检查
+     */
+    private String hazardouswarehouse;
     /**
      * 安全部日常巡查条数
      */
@@ -245,6 +249,10 @@ public class AspSafetyPerformanceAppraisalDetail implements Serializable {
      */
     private String trainingbycompany;
 
+    /**
+     * 集团公司、公司奖励(50元/加0.5分)
+     */
+    private String companyrewards;
     /**
      * 加分合计
      */

+ 81 - 0
cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspSpecialEquipmentCertificateDo.java

@@ -0,0 +1,81 @@
+package com.rongwe.scentity.domian;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.rongwei.rwcommon.base.BaseDo;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 特种设备作业人员证书表
+ *
+ * @TableName asp_special_equipment_certificate
+ */
+@TableName(value = "asp_special_equipment_certificate")
+@Data
+public class AspSpecialEquipmentCertificateDo extends BaseDo implements Serializable {
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+    /**
+     * 主键ID
+     */
+    private String id;
+    /**
+     *
+     */
+    private String tenantid;
+    /**
+     * 扩展json格式配置
+     */
+    private String roption;
+    /**
+     * 部门ID
+     */
+    private String orgid;
+    /**
+     * 部门名称
+     */
+    private String orgname;
+    /**
+     * 姓名
+     */
+    private String name;
+    /**
+     * 性别
+     */
+    private String sex;
+    /**
+     * 身份证号
+     */
+    private String idcard;
+    /**
+     * 作业种类
+     */
+    private String certificatesort;
+    /**
+     * 档案编号
+     */
+    private String fileno;
+    /**
+     * 证件编号
+     */
+    private String certificateno;
+    /**
+     * 证书类别
+     */
+    private String jobtype;
+    /**
+     * 发证日期
+     */
+    private Date dareofissuance;
+    /**
+     * 复审日期
+     */
+    private Date reviewdate;
+    /**
+     * 预警级别
+     */
+    private String reminderstate;
+}

+ 4 - 1
cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/CheckItemsDo.java

@@ -362,5 +362,8 @@ public class CheckItemsDo extends BaseDo implements Serializable {
 	 * 所属工厂
 	 */
 	private String ownedfactory;
-
+	/**
+	 * 提醒状态
+	 */
+	private String reminderstate;
 }

+ 2 - 0
cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/vo/UserMailOrgVo.java

@@ -14,4 +14,6 @@ public class UserMailOrgVo {
     private String email;
     private String orgId;
     private String name;
+    private String roleCode;
+
 }

+ 34 - 0
cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/AspSafeAttachmentsController.java

@@ -0,0 +1,34 @@
+package com.rongwei.savecheck.controller;
+
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.sfcommon.sys.service.impl.AspSafeAttachmentsServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * AspSafeAttachmentsController class
+ *
+ * @author XH
+ * @date 2024/06/15
+ */
+@RestController
+@RequestMapping("/safe/attachments")
+public class AspSafeAttachmentsController {
+    private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
+
+    @Autowired
+    private AspSafeAttachmentsServiceImpl aspSafeAttachmentsService;
+
+    @Scheduled(cron = "0 0 3 ? * *")
+    @PostMapping("/state")
+    public R stateUpdateScheduledTasks(){
+        log.info("安全附件定时任务,更改安全附件预警级别");
+        return aspSafeAttachmentsService.stateUpdateScheduledTasks();
+    }
+}

+ 12 - 4
cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/AspSafetyProductObjectiveController.java

@@ -6,10 +6,10 @@ import com.rongwei.rwcommon.utils.StringUtils;
 import com.rongwei.sfcommon.sys.service.AspSafetyProductObjectiveService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * 安全生产目标
@@ -40,4 +40,12 @@ public class AspSafetyProductObjectiveController {
         }
     }
 
+    /**
+     * 安全观察指标提醒
+     * @param list 参数:key->id value->userId/安全观察值
+     */
+    @PostMapping("/reportObservationConfig")
+    public void reportObservationConfig(@RequestBody List<String> list){
+        aspSafetyProductObjectiveService.reportObservationConfig(list);
+    }
 }

+ 34 - 0
cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/AspSpecialEquipmentCertificateController.java

@@ -0,0 +1,34 @@
+package com.rongwei.savecheck.controller;
+
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.sfcommon.sys.service.AspSpecialEquipmentCertificateService;
+import com.rongwei.sfcommon.sys.service.impl.AspSafeAttachmentsServiceImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * AspSafeAttachmentsController class
+ *
+ * @author XH
+ * @date 2024/06/15
+ */
+@RestController
+@RequestMapping("/special/equipment")
+public class AspSpecialEquipmentCertificateController {
+    private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
+
+    @Autowired
+    private AspSpecialEquipmentCertificateService aspSpecialEquipmentCertificateService;
+
+    @Scheduled(cron = "0 0 3 ? * *")
+    @PostMapping("/state")
+    public R stateUpdateScheduledTasks(){
+        log.info("特种设备作业人员证书管理,更改预警级别");
+        return aspSpecialEquipmentCertificateService.stateUpdateScheduledTasks();
+    }
+}

+ 8 - 0
cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/CheckItemsController.java

@@ -4,6 +4,7 @@ import com.rongwei.rwcommon.base.R;
 import com.rongwei.sfcommon.sys.service.CheckItemsService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -52,4 +53,11 @@ public class CheckItemsController {
             return R.error(e.getMessage());
         }
     }
+
+    @Scheduled(cron = "0 0 3 ? * *")
+    @PostMapping("/state")
+    public R stateUpdateScheduledTasks(){
+        log.info("安全附件定时任务,更改安全附件预警级别");
+        return checkItemsService.stateUpdateScheduledTasks();
+    }
 }

+ 9 - 5
rw-training/training-common/src/main/java/com/rongwei/trainingcommon/sys/service/impl/ExportQuestionnaireRecordingsServiceImpl.java

@@ -246,12 +246,15 @@ public class ExportQuestionnaireRecordingsServiceImpl implements ExportQuestionn
 
         return String.format(SECOND_SUFFIX, firstList.get(0).getTempName(), firstList.get(0).getQuestionName(),
                 calculatePercentage(firstList.get(0).getPqxy() + firstList.get(0).getBjxy(), firstList.get(0).getTotalCount()),
+
                 secondList.get(0).getTempName(), secondList.get(0).getQuestionName(),
                 calculatePercentage(secondList.get(0).getPqxy() + secondList.get(0).getBjxy(), secondList.get(0).getTotalCount()),
-                secondList.get(2).getTempName(), secondList.get(2).getQuestionName(),
-                calculatePercentage(secondList.get(2).getPqxy() + secondList.get(2).getBjxy(), secondList.get(2).getTotalCount()),
-                secondList.get(3).getTempName(), secondList.get(3).getQuestionName(),
-                calculatePercentage(secondList.get(3).getPqxy() + secondList.get(3).getBjxy(), secondList.get(3).getTotalCount())
+
+                secondList.get(1).getQuestionName(),
+                calculatePercentage(secondList.get(1).getPqxy() + secondList.get(1).getBjxy(), secondList.get(1).getTotalCount()),
+
+                secondList.get(2).getQuestionName(),
+                calculatePercentage(secondList.get(2).getPqxy() + secondList.get(2).getBjxy(), secondList.get(2).getTotalCount())
         );
     }
 
@@ -310,7 +313,8 @@ public class ExportQuestionnaireRecordingsServiceImpl implements ExportQuestionn
         List<QuestionnaireRecordingVo> fourth = values.get(3).stream()
                 .sorted(Comparator.comparingInt((QuestionnaireRecordingVo info) -> info.getPqxy() + info.getBjxy()).reversed())
                 .collect(Collectors.toList());
-        return String.format(String.format(SUMMARY, first.getTempName(), first.getTempName(), first.getQuestionName(), second.get(0).getTempName(),
+        return String.format(String.format(SUMMARY,
+                first.getTempName(), first.getTempName(), first.getQuestionName(), second.get(0).getQuestionName(),
                 second.get(0).getTempName(),second.get(0).getTempName(), second.get(0).getQuestionName(), second.get(1).getQuestionName(), second.get(2).getQuestionName(),
                 third.getTempName(), third.getTempName(), third.getQuestionName(), third.getQuestionName(),
                 fourth.get(0).getTempName(),fourth.get(0).getTempName(), fourth.get(0).getQuestionName(), fourth.get(1).getQuestionName()));