Переглянути джерело

Merge remote-tracking branch 'origin/master'

xiahan 1 рік тому
батько
коміт
650d119577
42 змінених файлів з 1181 додано та 65 видалено
  1. 15 0
      bs-common/src/main/java/com/rongwei/safecommon/utils/SaveConstans.java
  2. 13 0
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/AspCheckItemsAreaDao.java
  3. 2 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/EquLubricationPlanDetailMapperDao.java
  4. 2 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/EquLubricationTaskDetailMapperDao.java
  5. 8 0
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/EquOverhaulInventoryMapperDao.java
  6. 14 0
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/AspCheckItemsAreaService.java
  7. 6 3
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/AspCheckItemsService.java
  8. 3 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquFrockListService.java
  9. 1 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquLubricationPlanDetailService.java
  10. 1 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquLubricationTaskDetailService.java
  11. 8 0
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquOverhaulInventoryService.java
  12. 12 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquipmentSendNotifyService.java
  13. 30 0
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/AspCheckItemsAreaServiceImpl.java
  14. 20 12
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/AspCheckItemsServiceImpl.java
  15. 12 2
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquFrockListServiceImpl.java
  16. 2 2
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquLubricationPlanDetailServiceImpl.java
  17. 9 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquLubricationPlanServiceImpl.java
  18. 2 2
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquLubricationTaskDetailServiceImpl.java
  19. 9 1
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquLubricationTaskManagementServiceImpl.java
  20. 26 3
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquOverhaulInventoryServiceImpl.java
  21. 31 21
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquOverhaulPlanningTasksServiceImpl.java
  22. 13 3
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquipmentArchivesServiceImpl.java
  23. 55 0
      cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquipmentSendNotifyServiceImpl.java
  24. 2 0
      cx-equipment/cx-equipment-common/src/main/resources/mybatis/business/EquLubricationPlanDetailDao.xml
  25. 2 0
      cx-equipment/cx-equipment-common/src/main/resources/mybatis/business/EquLubricationTaskDetailDao.xml
  26. 6 0
      cx-equipment/cx-equipment-common/src/main/resources/mybatis/business/EquOverhaulInventoryDao.xml
  27. 7 1
      cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/AspCheckItems.java
  28. 185 0
      cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/AspCheckItemsAreaDo.java
  29. 135 0
      cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquInformationDo.java
  30. 24 0
      cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquLubricationPlanDetailDo.java
  31. 18 0
      cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquLubricationTaskManagementDo.java
  32. 70 0
      cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquMaintenanceTaskDo.java
  33. 233 0
      cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquTechnicalReformDo.java
  34. 4 4
      cx-equipment/cx-equipment-server/src/main/java/com/rongwei/bsserver/sys/controller/EquOverhaulPlanningTasksController.java
  35. 24 1
      cx-equipment/cx-equipment-server/src/main/java/com/rongwei/bsserver/sys/controller/EquipmentSendNotifyController.java
  36. 12 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/AspSafetyDrillProgrammeDao.java
  37. 7 0
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/AspSafetyDrillProgrammeService.java
  38. 110 3
      cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafetyDrillProgrammeServiceImpl.java
  39. 15 0
      cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/vo/AspSafetyTeamMemberVo.java
  40. 22 0
      cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/vo/AspSafetyTeamVo.java
  41. 11 0
      cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/AspSafetyDrillProgrammeController.java
  42. BIN
      cx-safe-check/cx-save-check-server/src/main/resources/template/ExercisePlan.docx

+ 15 - 0
bs-common/src/main/java/com/rongwei/safecommon/utils/SaveConstans.java

@@ -129,6 +129,10 @@ public class SaveConstans {
          * 保养检修
          */
         public static final String MAINTAIN = "maintain";
+        /**
+         * 保养检修
+         */
+        public static final String ACCEPTMAINTAINTASK = "acceptmaintaintask";
     }
 
     public static class NotifyTitle {
@@ -189,6 +193,11 @@ public class SaveConstans {
          */
         public static final String MAINTAIN_SYSTEM_TITLE = "保养任务";
 
+        /**
+         * 保养检修工单提醒标题
+         */
+        public static final String ACCEPTANCE_SYSTEM_TITLE = "待验收保养任务";
+
 
     }
 
@@ -247,5 +256,11 @@ public class SaveConstans {
          * 保养检修工单提醒内容
          */
         public static final String MAINTAIN_SYSTEM_CONTENT = "请及时执行%s的%s的%s( %s )-%s的保养任务并登记保养结果,负责人:%s,其他保养工程师:%s";
+
+        /**
+         * 保养检修工单提醒内容
+         */
+        public static final String ACCEPTANCE_SYSTEM_CONTENT = "请及时对已完成保养登记的%s-%s的%s(%s )%s的保养任务进行验收确认,(完成日期:%s,保养负责人:%s,其他保养工程师:%s";
+
     }
 }

+ 13 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/AspCheckItemsAreaDao.java

@@ -0,0 +1,13 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.AspCheckItemsAreaDo;
+
+/**
+ * @author shangmi
+ * @title AspCheckItemsAreaDao
+ * @date 2024/1/22 14:19
+ * @description 查询对象所属区域表
+ */
+public interface AspCheckItemsAreaDao extends BaseMapper<AspCheckItemsAreaDo> {
+}

+ 2 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/EquLubricationPlanDetailMapperDao.java

@@ -18,7 +18,8 @@ public interface EquLubricationPlanDetailMapperDao extends BaseMapper<EquLubrica
 
     /**
      * 查询所有润滑明细
+     * @param tenantId
      * @return
      */
-    List<EquLubricationPlanDetailVo> queryAllDetailList();
+    List<EquLubricationPlanDetailVo> queryAllDetailList(String tenantId);
 }

+ 2 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/EquLubricationTaskDetailMapperDao.java

@@ -18,7 +18,8 @@ public interface EquLubricationTaskDetailMapperDao extends BaseMapper<EquLubrica
 
     /**
      * 查询所有任务明细数据
+     * @param tenantId
      * @return
      */
-    List<EquLubricationTaskDetailVo> queryAllTaskDetailList();
+    List<EquLubricationTaskDetailVo> queryAllTaskDetailList(String tenantId);
 }

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

@@ -3,6 +3,8 @@ package com.rongwei.bscommon.sys.dao;
 import com.rongwei.bsentity.domain.EquOverhaulInventoryDo;
 import com.rongwei.rwcommon.base.BaseDao;
 
+import java.util.List;
+
 /**
  * <p>
  * 设备子系统——备品备件库存 Mapper 接口
@@ -17,4 +19,10 @@ public interface EquOverhaulInventoryMapperDao extends BaseDao<EquOverhaulInvent
      * 系统自动根据安全库存信息、过期信息自动更新提醒状态
      */
     void updateInventoryReminderStatus();
+
+    /**
+     * 查询所有库存数据
+     * @return
+     */
+    List<EquOverhaulInventoryDo> selectAllInventory();
 }

+ 14 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/AspCheckItemsAreaService.java

@@ -0,0 +1,14 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.AspCheckItemsAreaDo;
+
+/**
+ * @author shangmi
+ * @title AspCheckItemsAreaService
+ * @date 2024/1/22 14:51
+ * @description 查询对象所属区域表
+ */
+public interface AspCheckItemsAreaService extends IService<AspCheckItemsAreaDo> {
+    AspCheckItemsAreaDo getByDeptName(String plantId,String rollInDept);
+}

+ 6 - 3
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/AspCheckItemsService.java

@@ -3,8 +3,11 @@ package com.rongwei.bscommon.sys.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwei.bsentity.domain.AspCheckItems;
+import com.rongwei.bsentity.domain.AspCheckItemsAreaDo;
 import com.rongwei.bsentity.dto.EquipmentDisposeDTO;
 
+import java.util.Date;
+
 /**
  * <p>
  * 设备子系统——设备 服务类
@@ -19,12 +22,12 @@ public interface AspCheckItemsService extends IService<AspCheckItems> {
      * 根据ID修改地址信息
      *
      * @param equipmentDisposeDTO
+     * @param checkItemsArea
      * @return
      * @date 2024/1/16 16:28
      * @author shangmi
-     *
      */
-    void updateSiteById(EquipmentDisposeDTO equipmentDisposeDTO);
+    void updateSiteById(EquipmentDisposeDTO equipmentDisposeDTO, AspCheckItemsAreaDo checkItemsArea);
 
-    void updateStateById(String equipmentId);
+    void updateStateById(String equipmentId, Date newDate);
 }

+ 3 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquFrockListService.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwei.bsentity.domain.EquFrockListDo;
 import com.rongwei.bsentity.dto.EquipmentDisposeDTO;
 
+import java.util.Date;
+
 /**
  * @author shangmi
  * @title EquFrockListService
@@ -13,5 +15,5 @@ import com.rongwei.bsentity.dto.EquipmentDisposeDTO;
 public interface EquFrockListService extends IService<EquFrockListDo> {
     void updateSiteById(EquipmentDisposeDTO equipmentDisposeDTO);
 
-    void updateStateById(String equipmentId);
+    void updateStateById(String equipmentId, Date newDate);
 }

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

@@ -21,5 +21,5 @@ public interface EquLubricationPlanDetailService extends IService<EquLubrication
      * 查询所有润滑计划标准明细
      * @return
      */
-    List<EquLubricationPlanDetailVo> queryAllDetailList();
+    List<EquLubricationPlanDetailVo> queryAllDetailList(String tenantId);
 }

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

@@ -20,5 +20,5 @@ public interface EquLubricationTaskDetailService extends IService<EquLubrication
      * 查询所有任务明细数据
      * @return
      */
-    List<EquLubricationTaskDetailVo> queryAllTaskDetailList();
+    List<EquLubricationTaskDetailVo> queryAllTaskDetailList(String tenantId);
 }

+ 8 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquOverhaulInventoryService.java

@@ -4,6 +4,8 @@ package com.rongwei.bscommon.sys.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwei.bsentity.domain.EquOverhaulInventoryDo;
 
+import java.util.List;
+
 /**
  * <p>
  * 设备子系统——备品备件库存 服务类
@@ -23,4 +25,10 @@ public interface EquOverhaulInventoryService extends IService<EquOverhaulInvento
      * 系统每个小时更新一次库存数据
      */
     void initializeInventory();
+
+    /**
+     * 查询所有库存数据
+     * @return
+     */
+    List<EquOverhaulInventoryDo> selectAllInventory();
 }

+ 12 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquipmentSendNotifyService.java

@@ -10,7 +10,7 @@ import com.rongwei.rwcommon.base.R;
  */
 public interface EquipmentSendNotifyService {
     /**
-     * 根据任务ID发送 提醒
+     * 根据任务ID发送维修 提醒
      *
      * @param id 保养任务ID
      * @return {@link R}
@@ -19,4 +19,15 @@ public interface EquipmentSendNotifyService {
      *
      */
     R maintainCreateTaskNotify(String id);
+
+    /**
+     * 根据任务ID发送验收 提醒
+     *
+     * @param id 保养任务ID
+     * @return {@link R}
+     * @date 2024/1/18 17:16
+     * @author shangmi
+     *
+     */
+    R maintainVerifyTaskNotify(String id);
 }

+ 30 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/AspCheckItemsAreaServiceImpl.java

@@ -0,0 +1,30 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.sys.dao.AspCheckItemsAreaDao;
+import com.rongwei.bscommon.sys.service.AspCheckItemsAreaService;
+import com.rongwei.bsentity.domain.AspCheckItemsAreaDo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author shangmi
+ * @title AspCheckItemsAreaServiceImpl
+ * @date 2024/1/22 15:00
+ * @description 查询对象所属区域表
+ */
+@Service
+public class AspCheckItemsAreaServiceImpl extends ServiceImpl<AspCheckItemsAreaDao, AspCheckItemsAreaDo> implements AspCheckItemsAreaService {
+    @Autowired
+    private AspCheckItemsAreaDao checkItemsAreaDao;
+
+    @Override
+    public AspCheckItemsAreaDo getByDeptName(String plantId,String rollInDept) {
+        LambdaQueryWrapper<AspCheckItemsAreaDo> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.like(AspCheckItemsAreaDo::getFullpid,plantId)
+                .eq(AspCheckItemsAreaDo::getAreaname,rollInDept)
+                .last("limit 1");
+        return checkItemsAreaDao.selectOne(queryWrapper);
+    }
+}

+ 20 - 12
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/AspCheckItemsServiceImpl.java

@@ -1,10 +1,12 @@
 package com.rongwei.bscommon.sys.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwei.bscommon.sys.dao.AspCheckItemsDao;
 import com.rongwei.bscommon.sys.service.AspCheckItemsService;
 import com.rongwei.bsentity.domain.AspCheckItems;
+import com.rongwei.bsentity.domain.AspCheckItemsAreaDo;
 import com.rongwei.bsentity.dto.EquipmentDisposeDTO;
 import com.rongwei.bsentity.enums.PlantEnum;
 import org.slf4j.Logger;
@@ -12,6 +14,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+
 /**
  * <p>
  * 设备子系统——设备 服务实现类
@@ -32,28 +36,32 @@ public class AspCheckItemsServiceImpl extends ServiceImpl<AspCheckItemsDao, AspC
      * 根据ID修改地址信息
      *
      * @param equipmentDisposeDTO
+     * @param checkItemsArea
      * @return
      * @date 2024/1/16 16:28
      * @author shangmi
-     *
      */
     @Override
-    public void updateSiteById(EquipmentDisposeDTO equipmentDisposeDTO) {
+    public void updateSiteById(EquipmentDisposeDTO equipmentDisposeDTO, AspCheckItemsAreaDo checkItemsArea) {
         LambdaUpdateWrapper<AspCheckItems> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.eq(AspCheckItems::getId,equipmentDisposeDTO.getEquipmentId())
-                .set(AspCheckItems::getTenantid,equipmentDisposeDTO.getRollInPlantId())
-                .set(AspCheckItems::getUsedeptid,equipmentDisposeDTO.getRollInDeptId())
-                .set(AspCheckItems::getUsedeptname,equipmentDisposeDTO.getRollInDept())
+        boolean empty = ObjectUtil.isEmpty(checkItemsArea);
+        updateWrapper.eq(AspCheckItems::getId, equipmentDisposeDTO.getEquipmentId())
+                .set(AspCheckItems::getTenantid, equipmentDisposeDTO.getRollInPlantId())
+                .set(AspCheckItems::getUsedeptid, equipmentDisposeDTO.getRollInDeptId())
+                .set(AspCheckItems::getUsedeptname, equipmentDisposeDTO.getRollInDept())
                 .set(AspCheckItems::getOwnedfactory, PlantEnum.nameOf(equipmentDisposeDTO.getRollInPlantId()))
-                .set(AspCheckItems::getDeviceaddress,equipmentDisposeDTO.getRollInLocation());
-        aspCheckItemsDao.update(null,updateWrapper);
+                .set(AspCheckItems::getDeviceaddress, equipmentDisposeDTO.getRollInLocation())
+                .set(empty, AspCheckItems::getCheckitemareaid, checkItemsArea.getId())
+                .set(empty, AspCheckItems::getChargeorgid, checkItemsArea.getAreachargerorgid());
+        aspCheckItemsDao.update(null, updateWrapper);
     }
 
     @Override
-    public void updateStateById(String equipmentId) {
+    public void updateStateById(String equipmentId, Date newDate) {
         LambdaUpdateWrapper<AspCheckItems> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.eq(AspCheckItems::getId,equipmentId)
-                .set(AspCheckItems::getEnabled,"报废");
-        aspCheckItemsDao.update(null,updateWrapper);
+        updateWrapper.eq(AspCheckItems::getId, equipmentId)
+                .set(AspCheckItems::getDevicestatus, "报废")
+                .set(AspCheckItems::getFactobsoledate, newDate);
+        aspCheckItemsDao.update(null, updateWrapper);
     }
 }

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

@@ -10,6 +10,8 @@ import com.rongwei.bsentity.enums.PlantEnum;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+
 /**
  * @author shangmi
  * @title EquFrockListServiceImpl
@@ -44,11 +46,19 @@ public class EquFrockListServiceImpl extends ServiceImpl<EquFrockListDao,EquFroc
 
     }
 
+    /**
+     * 更新报废状态
+     *
+     * @param equipmentId id
+     * @param newDate
+     */
     @Override
-    public void updateStateById(String equipmentId) {
+    public void updateStateById(String equipmentId, Date newDate) {
+
         LambdaUpdateWrapper<EquFrockListDo> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.eq(EquFrockListDo::getId,equipmentId)
-                .set(EquFrockListDo::getUsestate,"报废");
+                .set(EquFrockListDo::getUsestate,"报废")
+                .set(EquFrockListDo::getFactobsoledate,newDate);
         equFrockListDao.update(null,updateWrapper);
     }
 }

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

@@ -25,7 +25,7 @@ public class EquLubricationPlanDetailServiceImpl extends ServiceImpl<EquLubricat
     private EquLubricationPlanDetailMapperDao equLubricationPlanDetailMapperDao;
 
     @Override
-    public List<EquLubricationPlanDetailVo> queryAllDetailList() {
-        return equLubricationPlanDetailMapperDao.queryAllDetailList();
+    public List<EquLubricationPlanDetailVo> queryAllDetailList(String tenantId) {
+        return equLubricationPlanDetailMapperDao.queryAllDetailList(tenantId);
     }
 }

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

@@ -9,10 +9,12 @@ import com.rongwei.bscommon.sys.dao.CommonDao;
 import com.rongwei.bscommon.sys.dao.EquLubricationPlanMapperDao;
 import com.rongwei.bscommon.sys.service.EquLubricationPlanDetailService;
 import com.rongwei.bscommon.sys.service.EquLubricationPlanService;
+import com.rongwei.bscommon.sys.utils.CommonUtils;
 import com.rongwei.bscommon.sys.utils.ExceptionUtils;
 import com.rongwei.bsentity.domain.EquLubricationPlanDetailVo;
 import com.rongwei.bsentity.domain.EquLubricationPlanDo;
 import com.rongwei.rwadmincommon.system.domain.SysDictDo;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,7 +55,13 @@ public class EquLubricationPlanServiceImpl extends ServiceImpl<EquLubricationPla
     @Override
     public void wordExportLubrication(Map<String, Object> parameter, HttpServletResponse response) {
         log.info("开始导出润滑明细");
-        List<EquLubricationPlanDetailVo> planDetailList = equLubricationPlanDetailService.queryAllDetailList();
+        SysUserVo currentUser = CommonUtils.getCurrentUser();
+        String tenantId = "";
+        //判断当前是否存在集团领导角色
+        if (currentUser.getSysuserroleids().contains("d7797802376e42b2af37781f258b99fb")){
+            tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        }
+        List<EquLubricationPlanDetailVo> planDetailList = equLubricationPlanDetailService.queryAllDetailList(tenantId);
         try {
             response.setContentType("application/octet-stream");
             // 读取模板文件

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

@@ -25,7 +25,7 @@ public class EquLubricationTaskDetailServiceImpl extends ServiceImpl<EquLubricat
     private EquLubricationTaskDetailMapperDao equLubricationTaskDetailMapperDao;
 
     @Override
-    public List<EquLubricationTaskDetailVo> queryAllTaskDetailList() {
-        return equLubricationTaskDetailMapperDao.queryAllTaskDetailList();
+    public List<EquLubricationTaskDetailVo> queryAllTaskDetailList(String tenantId) {
+        return equLubricationTaskDetailMapperDao.queryAllTaskDetailList(tenantId);
     }
 }

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

@@ -8,11 +8,13 @@ import com.rongwei.bscommon.sys.dao.CommonDao;
 import com.rongwei.bscommon.sys.dao.EquLubricationTaskManagementMapperDao;
 import com.rongwei.bscommon.sys.service.EquLubricationTaskDetailService;
 import com.rongwei.bscommon.sys.service.EquLubricationTaskManagementService;
+import com.rongwei.bscommon.sys.utils.CommonUtils;
 import com.rongwei.bscommon.sys.utils.ExceptionUtils;
 import com.rongwei.bscommon.sys.utils.TimeUtils;
 import com.rongwei.bsentity.domain.EquLubricationTaskDetailVo;
 import com.rongwei.bsentity.domain.EquLubricationTaskManagementDo;
 import com.rongwei.rwadmincommon.system.domain.SysDictDo;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,7 +48,13 @@ public class EquLubricationTaskManagementServiceImpl extends ServiceImpl<EquLubr
     @Override
     public void wordExportLubricationTask(Map<String, Object> parameter, HttpServletResponse response) {
         log.info("开始导出润滑任务明细");
-        List<EquLubricationTaskDetailVo> taskDetailVoList = equLubricationTaskDetailService.queryAllTaskDetailList();
+        SysUserVo currentUser = CommonUtils.getCurrentUser();
+        String tenantId = "";
+        //判断当前是否存在集团领导角色
+        if (currentUser.getSysuserroleids().contains("d7797802376e42b2af37781f258b99fb")){
+            tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+        }
+        List<EquLubricationTaskDetailVo> taskDetailVoList = equLubricationTaskDetailService.queryAllTaskDetailList(tenantId);
         try {
             response.setContentType("application/octet-stream");
             // 读取模板文件

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

@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -64,10 +65,11 @@ public class EquOverhaulInventoryServiceImpl extends ServiceImpl<EquOverhaulInve
         // 查询所有工厂数据
         List<SysOrganizationVo> factoryList = commonDao.getAllFactoryNameAndId();
         // 查询库存表已有数据列表
-        List<EquOverhaulInventoryDo> queryInventoryDos = equOverhaulInventoryService.list(new LambdaQueryWrapper<EquOverhaulInventoryDo>().eq(EquOverhaulInventoryDo::getDeleted, 0));
+        List<EquOverhaulInventoryDo> queryInventoryDos = equOverhaulInventoryService.selectAllInventory();
         for (VInventoryVo inventoryVo : allOracleInventory) {
             EquOverhaulInventoryDo equOverhaulInventoryDo = new EquOverhaulInventoryDo();
-            if (queryInventoryDos.stream().noneMatch(a->a.getAccessorycode().equals(inventoryVo.getItem_num()))){
+            List<EquOverhaulInventoryDo> resultInventoryList = queryInventoryDos.stream().filter(p -> p.getAccessorycode().equals(inventoryVo.getItem_num())).collect(Collectors.toList());
+            if (resultInventoryList.size()==0){
                 String uuid = SecurityUtil.getUUID();
                 equOverhaulInventoryDo.setId(uuid);
                 equOverhaulInventoryDo.setAccessory(inventoryVo.getProduct_name());
@@ -83,9 +85,30 @@ public class EquOverhaulInventoryServiceImpl extends ServiceImpl<EquOverhaulInve
                     equOverhaulInventoryDo.setInventorynumber(BigDecimal.valueOf(inventoryVo.getQuantity()));
                 }
                 equOverhaulInventoryDos.add(equOverhaulInventoryDo);
+            }else {
+                equOverhaulInventoryDo.setModifydate(new Date());
+                equOverhaulInventoryDo.setId(resultInventoryList.get(0).getId());
+                equOverhaulInventoryDo.setAccessory(inventoryVo.getProduct_name());
+                equOverhaulInventoryDo.setBelongfactory(inventoryVo.getOrg_name());
+                equOverhaulInventoryDo.setAccessorycode(inventoryVo.getItem_num());
+                equOverhaulInventoryDo.setSpecifications(inventoryVo.getSpec());
+                equOverhaulInventoryDo.setUnit(inventoryVo.getUnit());
+                equOverhaulInventoryDo.setSource(inventoryVo.getCangku());
+                equOverhaulInventoryDo.setBatch(inventoryVo.getBatch_num());
+                List<SysOrganizationVo> resultList = factoryList.stream().filter(p -> p.getFullname().equals(inventoryVo.getOrg_name())).collect(Collectors.toList());
+                equOverhaulInventoryDo.setTenantid(resultList.get(0).getId());
+                if (inventoryVo.getQuantity()!= null){
+                    equOverhaulInventoryDo.setInventorynumber(BigDecimal.valueOf(inventoryVo.getQuantity()));
+                }
+                equOverhaulInventoryDos.add(equOverhaulInventoryDo);
             }
         }
         // 数据保存到库存表中
-        equOverhaulInventoryService.saveBatch(equOverhaulInventoryDos);
+        equOverhaulInventoryService.saveOrUpdateBatch(equOverhaulInventoryDos);
+    }
+
+    @Override
+    public List<EquOverhaulInventoryDo> selectAllInventory() {
+        return equOverhaulInventoryMapperDao.selectAllInventory();
     }
 }

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

@@ -2,15 +2,15 @@ package com.rongwei.bscommon.sys.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.sys.dao.CommonDao;
 import com.rongwei.bscommon.sys.dao.EquOverhaulPlanningTasksMapperDao;
 import com.rongwei.bscommon.sys.service.EquOverhaulPlanningTasksService;
-import com.rongwei.bscommon.sys.utils.DateUtils;
-import com.rongwei.bscommon.sys.utils.ExcelUtils;
-import com.rongwei.bscommon.sys.utils.ExceptionUtils;
-import com.rongwei.bscommon.sys.utils.StringUtil;
+import com.rongwei.bscommon.sys.utils.*;
 import com.rongwei.bsentity.domain.EquOverhaulPlanningTasksDo;
 import com.rongwei.bsentity.domain.EquWarrantyProviderDo;
 import com.rongwei.rwadmincommon.system.domain.SysDictDo;
+import com.rongwei.rwadmincommon.system.vo.SysOrganizationVo;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.rwcommon.utils.StringUtils;
@@ -27,6 +27,7 @@ import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -42,42 +43,48 @@ public class EquOverhaulPlanningTasksServiceImpl extends ServiceImpl<EquOverhaul
     @Autowired
     private EquOverhaulPlanningTasksService equOverhaulPlanningTasksService;
 
+    @Autowired
+    private CommonDao commonDao;
+
     @Override
     public R importEquOverhaulPlanningTasks(MultipartFile file) {
         try {
+            // 查询所有工厂数据
+            List<SysOrganizationVo> factoryList = commonDao.getAllFactoryNameAndId();
+            SysUserVo currentUser = CommonUtils.getCurrentUser();
             StringBuilder allStrBuilder = new StringBuilder();
             Sheet sheet = new XSSFWorkbook(file.getInputStream()).getSheetAt(0);
             int lastRowNum = sheet.getLastRowNum();
             List<EquOverhaulPlanningTasksDo> equOverhaulPlanningTasksDos = new ArrayList<>();
             for (int i = 1; i <= lastRowNum; i++) {
                 StringBuilder stringBuilder = new StringBuilder();
+                String taskNumber = "";
+                String factoryId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
+                List<SysOrganizationVo> resultList = factoryList.stream().filter(p -> p.getId().equals(factoryId)).collect(Collectors.toList());
+                String factory = resultList.get(0).getFullname();
                 EquOverhaulPlanningTasksDo equOverhaulPlanningTasksDo = new EquOverhaulPlanningTasksDo();
                 Row row = sheet.getRow(i);
                 if (ExcelUtils.isRowEmpty(row)){
                     continue;
                 }
                 String year = row.getCell(0) == null ? "" : row.getCell(0).toString().trim();
-                String taskNumber = row.getCell(1) == null ? "" : row.getCell(1).toString().trim();
-                String factory = row.getCell(2) == null ? "" : row.getCell(2).toString().trim();
-                String dept = row.getCell(3) == null ? "" : row.getCell(3).toString().trim();
-                String equName = row.getCell(4) == null ? "" : row.getCell(4).toString().trim();
-                String equNumber = row.getCell(5) == null ? "" : row.getCell(5).toString().trim();
-                String repairReason = row.getCell(6) == null ? "" : row.getCell(6).toString().trim();
-                Date planStartDate = row.getCell(7) == null ? null : DateUtils.importExcelFormatExcel((XSSFCell) row.getCell(7));
-                Date planEndDate = row.getCell(8) == null ? null : DateUtils.importExcelFormatExcel((XSSFCell) row.getCell(8));
-                String repairProgramme = row.getCell(9) == null ? "" : row.getCell(9).toString().trim();
-                String isDangerous = row.getCell(10) == null ? "" : row.getCell(10).toString().trim();
-                String isOutsourcing = row.getCell(11) == null ? "" : row.getCell(11).toString().trim();
-                String header = row.getCell(12) == null ? "" : row.getCell(12).toString().trim();
-                String others = row.getCell(13) == null ? "" : row.getCell(13).toString().trim();
+                String dept = row.getCell(1) == null ? "" : row.getCell(1).toString().trim();
+                String equName = row.getCell(2) == null ? "" : row.getCell(2).toString().trim();
+                String equNumber = row.getCell(3) == null ? "" : row.getCell(3).toString().trim();
+                String repairReason = row.getCell(4) == null ? "" : row.getCell(4).toString().trim();
+                Date planStartDate = row.getCell(5) == null ? null : DateUtils.importExcelFormatExcel((XSSFCell) row.getCell(5));
+                Date planEndDate = row.getCell(6) == null ? null : DateUtils.importExcelFormatExcel((XSSFCell) row.getCell(6));
+                String repairProgramme = row.getCell(7) == null ? "" : row.getCell(7).toString().trim();
+                String isDangerous = row.getCell(8) == null ? "" : row.getCell(8).toString().trim();
+                String isOutsourcing = row.getCell(9) == null ? "" : row.getCell(9).toString().trim();
+                String header = row.getCell(10) == null ? "" : row.getCell(10).toString().trim();
+                String others = row.getCell(11) == null ? "" : row.getCell(11).toString().trim();
+                String taskStatus = row.getCell(12) == null ? "" : row.getCell(12).toString().trim();
                 if (StringUtils.isBlank(year)){
                     stringBuilder.append("年度必填");
                 }else {
                     year = StringUtil.formatDecimal(year);
                 }
-                if (StringUtils.isBlank(taskNumber)){
-                    stringBuilder.append("任务号必填");
-                }
                 if (StringUtils.isBlank(equName)){
                     stringBuilder.append("设备名称必填");
                 }
@@ -100,7 +107,10 @@ public class EquOverhaulPlanningTasksServiceImpl extends ServiceImpl<EquOverhaul
                             .setIsdangerousoperations(isDangerous)
                             .setIsoutsourcing(isOutsourcing)
                             .setRepairhead(header)
-                            .setOtherrepairengineer(others);
+                            .setOtherrepairengineer(others)
+                            .setTenantid(factoryId)
+                            .setRepairillustrate(repairProgramme)
+                            .setTaskstatus(taskStatus);
                     equOverhaulPlanningTasksDos.add(equOverhaulPlanningTasksDo);
                 }
             }

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

@@ -1,11 +1,14 @@
 package com.rongwei.bscommon.sys.service.impl;
 
 import com.rongwei.bscommon.sys.service.*;
+import com.rongwei.bsentity.domain.AspCheckItemsAreaDo;
 import com.rongwei.bsentity.dto.EquipmentDisposeDTO;
 import com.rongwei.rwcommon.base.R;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+
 /**
  * @author shangmi
  * @title EquipmentArchivesServiceImpl
@@ -31,6 +34,9 @@ public class EquipmentArchivesServiceImpl implements EquipmentArchivesService {
     @Autowired
     private EquLubricationPlanService lubricationPlanService;
 
+    @Autowired
+    private AspCheckItemsAreaService checkItemsAreaService;
+
     /**
      * 更新设备库
      *
@@ -43,23 +49,27 @@ public class EquipmentArchivesServiceImpl implements EquipmentArchivesService {
 
     @Override
     public R updateEquipmentData(EquipmentDisposeDTO equipmentDisposeDTO) {
+        Date newDate = new Date();
+        //处置状态  报废/移交
         boolean isState = HANDLING_TYPE[0].equals(equipmentDisposeDTO.getState());
+        //对象类型  设备/工装
         boolean isObject = OBJECT_TYPE[0].equals(equipmentDisposeDTO.getObjectType());
         if (isState){
             //更新停用状态
             String equipmentId = equipmentDisposeDTO.getEquipmentId();
             if (isObject) {
-                aspCheckItemsService.updateStateById(equipmentId);
+                aspCheckItemsService.updateStateById(equipmentId,newDate);
                 lubricationPlanService.updateStateByEquId(equipmentId);
             } else {
-                equFrockListService.updateStateById(equipmentId);
+                equFrockListService.updateStateById(equipmentId,newDate);
             }
             maintenanceScheduleService.updateStateByEquId(equipmentId);
 
         }else {
             //修改组织结构
             if (isObject) {
-                aspCheckItemsService.updateSiteById(equipmentDisposeDTO);
+                AspCheckItemsAreaDo checkItemsArea = checkItemsAreaService.getByDeptName(equipmentDisposeDTO.getRollInPlantId(), equipmentDisposeDTO.getRollInDept());
+                aspCheckItemsService.updateSiteById(equipmentDisposeDTO,checkItemsArea);
             } else {
                 equFrockListService.updateSiteById(equipmentDisposeDTO);
             }

+ 55 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquipmentSendNotifyServiceImpl.java

@@ -19,8 +19,11 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
 
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.ACCEPTANCE_SYSTEM_CONTENT;
 import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.MAINTAIN_SYSTEM_CONTENT;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.ACCEPTANCE_SYSTEM_TITLE;
 import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.MAINTAIN_SYSTEM_TITLE;
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.ACCEPTMAINTAINTASK;
 import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.MAINTAIN;
 
 /**
@@ -101,5 +104,57 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
                 context,null,userId.stream().distinct().collect(Collectors.toList()),maintenanceTaskDo.getId(),MAINTAIN);
         return R.ok();
     }
+
+    @Override
+    public R maintainVerifyTaskNotify(String id) {
+        if (StringUtils.isBlank(id)) {
+            log.info("任务ID为空");
+            return R.ok();
+        }
+        EquMaintenanceTaskDo maintenanceTaskDo = maintenanceTaskService.getById(id);
+
+        if (null == maintenanceTaskDo) {
+            log.info("无法通过id:{}获取到任务列表", id);
+            return R.ok();
+        }
+
+        // 发送人
+        List<String> userId = new ArrayList<>();
+        // 发送内容
+        String context = null;
+        // 发送标题
+        String title = null;
+        if (maintenanceTaskDo.getAcceptorid() != null){
+            userId.addAll(Arrays.asList(maintenanceTaskDo.getAcceptorid().split(",")));
+        }
+        if (userId.isEmpty()){
+            log.info("id为{}的任务无提醒人",id);
+            return R.ok();
+        }
+        title = ACCEPTANCE_SYSTEM_TITLE;
+        context = String.format(ACCEPTANCE_SYSTEM_CONTENT,
+                maintenanceTaskDo.getPlanyear()+"-"+maintenanceTaskDo.getMonth(),
+                maintenanceTaskDo.getWorkshop(),
+                maintenanceTaskDo.getEquipmentname(),
+                maintenanceTaskDo.getEquipmentnumber(),
+                maintenanceTaskDo.getMaintenancesite(),
+                maintenanceTaskDo.getTaskendtime(),
+                maintenanceTaskDo.getPrincipal(),
+                maintenanceTaskDo.getOtherengineers()
+        );
+
+        JSONArray data = JSONUtil.parseArray( commonFeginClient.list(new HashMap<String, Object>() {{
+            this.put("NOTIFYTYPE", "acceptmaintaintask");
+            this.put("ROPTION", id);
+        }}).getData());
+        if (!data.isEmpty()){
+            List<String> ids = data.stream().map(info -> JSONUtil.parseObj(info).get("id").toString()).collect(Collectors.toList());
+            commonFeginClient.delete(ids);
+        }
+
+        CXCommonUtils.sendNotify(title,
+                context,null,userId.stream().distinct().collect(Collectors.toList()),maintenanceTaskDo.getId(),ACCEPTMAINTAINTASK);
+        return R.ok();
+    }
 }
 

+ 2 - 0
cx-equipment/cx-equipment-common/src/main/resources/mybatis/business/EquLubricationPlanDetailDao.xml

@@ -11,6 +11,8 @@
         FROM equ_lubrication_plan_detail a
         LEFT JOIN equ_lubrication_plan b ON a.MASTERID = b.id and b.DELETED = 0
         where a.DELETED = 0
+        <if test="tenantId != null and tenantId != ''"> and b.TENANTID = #{tenantId}</if>
+        ORDER BY b.MODIFYDATE DESC,a.MODIFYDATE DESC
     </select>
 
 </mapper>

+ 2 - 0
cx-equipment/cx-equipment-common/src/main/resources/mybatis/business/EquLubricationTaskDetailDao.xml

@@ -13,6 +13,8 @@
         FROM equ_lubrication_task_detail a
         LEFT JOIN equ_lubrication_task_management b ON a.MASTERID = b.id and b.DELETED = 0
         where a.DELETED = 0
+        <if test="tenantId != null and tenantId != ''"> and b.TENANTID = #{tenantId}</if>
+        ORDER BY b.MODIFYDATE DESC,a.MODIFYDATE DESC
     </select>
 
 </mapper>

+ 6 - 0
cx-equipment/cx-equipment-common/src/main/resources/mybatis/business/EquOverhaulInventoryDao.xml

@@ -19,4 +19,10 @@
         END;
     </update>
 
+    <select id="selectAllInventory" resultType="com.rongwei.bsentity.domain.EquOverhaulInventoryDo">
+        SELECT *
+        FROM equ_overhaul_inventory
+        where DELETED = 0
+    </select>
+
 </mapper>

+ 7 - 1
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/AspCheckItems.java

@@ -1,9 +1,10 @@
 package com.rongwei.bsentity.domain;
 
+import lombok.Data;
+
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
-import lombok.Data;
 
 /**
  * asp_check_items
@@ -351,5 +352,10 @@ public class AspCheckItems implements Serializable {
      */
     private String ownedfactory;
 
+    /**
+     * 报废时间
+     */
+    private Date factobsoledate;
+
     private static final long serialVersionUID = 1L;
 }

+ 185 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/AspCheckItemsAreaDo.java

@@ -0,0 +1,185 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author  cyn 
+ * @create 2024-01-22 14:01 
+ */
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("asp_check_items_area")
+public class AspCheckItemsAreaDo implements Serializable {
+
+	private static long serialVersionUID = 1L;
+
+	/**
+	 * table name:ID
+	 * table type:varchar(32)
+	 * table comment:主键
+	 */
+	private String id;
+
+	/**
+	 * table name:PID
+	 * table type:varchar(36)
+	 * table comment:父ID
+	 */
+	private String pid;
+
+	/**
+	 * table name:FULLPID
+	 * table type:varchar(500)
+	 * table comment:父级全路径
+	 */
+	private String fullpid;
+
+	/**
+	 * table name:TREECODE
+	 * table type:varchar(100)
+	 * table comment:树表结构编号
+	 */
+	private String treecode;
+
+	/**
+	 * table name:LEVEL
+	 * table type:int
+	 * table comment:等级
+	 */
+	private Integer level;
+
+	/**
+	 * table name:ISLEAF
+	 * table type:char(1)
+	 * table comment:是否叶子节点
+	 */
+	private String isleaf;
+
+	/**
+	 * table name:AREANAME
+	 * table type:varchar(100)
+	 * table comment:区域名称
+	 */
+	private String areaname;
+
+	/**
+	 * table name:AREATYPE
+	 * table type:varchar(50)
+	 * table comment:区域类型
+	 */
+	private String areatype;
+
+	/**
+	 * table name:AREACHARGER
+	 * table type:varchar(500)
+	 * table comment:区域负责人
+	 */
+	private String areacharger;
+
+	/**
+	 * table name:AREACHARGERNAME
+	 * table type:varchar(300)
+	 * table comment:区域负责人名称
+	 */
+	private String areachargername;
+
+	/**
+	 * table name:AREACHARGERORGID
+	 * table type:varchar(100)
+	 * table comment:区域负责机构
+	 */
+	private String areachargerorgid;
+
+	/**
+	 * table name:AREACHARGERORGNAME
+	 * table type:varchar(255)
+	 * table comment:区域负责机构名称
+	 */
+	private String areachargerorgname;
+
+	/**
+	 * table name:TENANTID
+	 * table type:text
+	 * table comment:null
+	 */
+	private String tenantid;
+
+	/**
+	 * table name:ROPTION
+	 * table type:mediumtext
+	 * table comment:扩展json格式配置
+	 */
+	private String roption;
+
+	/**
+	 * table name:DELETED
+	 * table type:char(1)
+	 * table comment:是否删除Y/N
+	 */
+	private String deleted;
+
+	/**
+	 * table name:REMARK
+	 * table type:varchar(500)
+	 * table comment:备注
+	 */
+	private String remark;
+
+	/**
+	 * table name:CREATEDATE
+	 * table type:datetime
+	 * table comment:创建时间
+	 */
+	private Date createdate;
+
+	/**
+	 * table name:CREATEUSERID
+	 * table type:varchar(36)
+	 * table comment:创建用户ID
+	 */
+	private String createuserid;
+
+	/**
+	 * table name:MODIFYDATE
+	 * table type:datetime
+	 * table comment:修改日期
+	 */
+	private Date modifydate;
+
+	/**
+	 * table name:MODIFYUSERID
+	 * table type:varchar(36)
+	 * table comment:修改用户ID
+	 */
+	private String modifyuserid;
+
+	/**
+	 * table name:CREATEUSERNAME
+	 * table type:varchar(50)
+	 * table comment:创建人名称
+	 */
+	private String createusername;
+
+	/**
+	 * table name:MODIFYUSERNAME
+	 * table type:varchar(50)
+	 * table comment:修改人名称
+	 */
+	private String modifyusername;
+
+	/**
+	 * table name:ADDFROM
+	 * table type:varchar(255)
+	 * table comment:操作来源(普通设备新增/特种设备新增)
+	 */
+	private String addfrom;
+
+}

+ 135 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquInformationDo.java

@@ -0,0 +1,135 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author  cyn 
+ * @create 2024-01-22 14:03 
+ */
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("equ_information")
+public class EquInformationDo implements Serializable {
+
+	private static long serialVersionUID = 1L;
+	/**
+	 * table name:ID
+	 * table type:varchar(36)
+	 * table comment:主键ID
+	 */
+	private String id;
+
+	/**
+	 * table name:TENANTID
+	 * table type:text
+	 * table comment:null
+	 */
+	private String tenantid;
+
+	/**
+	 * table name:ROPTION
+	 * table type:text
+	 * table comment:扩展json格式配置
+	 */
+	private String roption;
+
+	/**
+	 * table name:DELETED
+	 * table type:varchar(1)
+	 * table comment:是否删除Y/N
+	 */
+	private String deleted;
+
+	/**
+	 * table name:REMARK
+	 * table type:varchar(2000)
+	 * table comment:备注
+	 */
+	private String remark;
+
+	/**
+	 * table name:CREATEDATE
+	 * table type:datetime
+	 * table comment:创建时间
+	 */
+	private Date createdate;
+
+	/**
+	 * table name:CREATEUSERID
+	 * table type:varchar(36)
+	 * table comment:创建用户ID
+	 */
+	private String createuserid;
+
+	/**
+	 * table name:MODIFYDATE
+	 * table type:datetime
+	 * table comment:修改日期
+	 */
+	private Date modifydate;
+
+	/**
+	 * table name:MODIFYUSERID
+	 * table type:varchar(36)
+	 * table comment:修改用户ID
+	 */
+	private String modifyuserid;
+
+	/**
+	 * table name:CREATEUSERNAME
+	 * table type:varchar(20)
+	 * table comment:创建人
+	 */
+	private String createusername;
+
+	/**
+	 * table name:MODIFYUSERNAME
+	 * table type:varchar(20)
+	 * table comment:修改人
+	 */
+	private String modifyusername;
+
+	/**
+	 * table name:MAINID
+	 * table type:varchar(36)
+	 * table comment:主表ID
+	 */
+	private String mainid;
+
+	/**
+	 * table name:INFORMATIONNAME
+	 * table type:varchar(255)
+	 * table comment:资料名称
+	 */
+	private String informationname;
+
+	/**
+	 * table name:UNIT
+	 * table type:varchar(50)
+	 * table comment:单位
+	 */
+	private String unit;
+
+	/**
+	 * table name:NUMBER
+	 * table type:decimal(18,2)
+	 * table comment:数量
+	 */
+	private Double number;
+
+	/**
+	 * table name:FILES
+	 * table type:text
+	 * table comment:附件
+	 */
+	private String files;
+
+}

+ 24 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquLubricationPlanDetailDo.java

@@ -110,5 +110,29 @@ public class EquLubricationPlanDetailDo extends BaseDo implements Serializable {
     @TableField("LUBRICATIONPOSITION")
     private String lubricationposition;
 
+    /**
+     * 频次IDS
+     */
+    @TableField("FREQUENCYIDS")
+    private String frequencyids;
+
+    /**
+     * 频次一级
+     */
+    @TableField("FREQUENCYONE")
+    private String frequencyone;
+
+    /**
+     * 频次二级
+     */
+    @TableField("FREQUENCYTWO")
+    private String frequencytwo;
+
+    /**
+     * 频次三级
+     */
+    @TableField("FREQUENCYTHREE")
+    private String frequencythree;
+
 
 }

+ 18 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquLubricationTaskManagementDo.java

@@ -104,5 +104,23 @@ public class EquLubricationTaskManagementDo extends BaseDo implements Serializab
     @TableField("LUBRICATORID")
     private String lubricatorid;
 
+    /**
+     * 设备id
+     */
+    @TableField("EQUIPMENTID")
+    private String equipmentid;
+
+    /**
+     * 设备使用车间ID
+     */
+    @TableField("EQUIPMENTWORKSHOPID")
+    private String equipmentworkshopid;
+
+    /**
+     * 设备使用车间名称
+     */
+    @TableField("EQUIPMENTWORKSHOP")
+    private String equipmentworkshop;
+
 
 }

+ 70 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquMaintenanceTaskDo.java

@@ -345,4 +345,74 @@ public class EquMaintenanceTaskDo implements Serializable {
 	 */
 	private String otherengineersid;
 
+	/**
+	 * table name:TASKSTARTTIME
+	 * table type:datetime
+	 * table comment:保养开始时间
+	 */
+	private Date taskstarttime;
+
+	/**
+	 * table name:TASKENDTIME
+	 * table type:datetime
+	 * table comment:保养完成时间
+	 */
+	private Date taskendtime;
+
+	/**
+	 * table name:PREVIOUSSITUATION
+	 * table type:text
+	 * table comment:保养前情况
+	 */
+	private String previoussituation;
+
+	/**
+	 * table name:ACCEPTOR
+	 * table type:varchar(50)
+	 * table comment:验收人
+	 */
+	private String acceptor;
+
+	/**
+	 * table name:ACCEPTORID
+	 * table type:varchar(36)
+	 * table comment:验收人ID
+	 */
+	private String acceptorid;
+
+	/**
+	 * table name:RESULTCHART
+	 * table type:text
+	 * table comment:保养结果图
+	 */
+	private String resultchart;
+
+	/**
+	 * table name:CONFIRMRESULT
+	 * table type:varchar(20)
+	 * table comment:确认结果
+	 */
+	private String confirmresult;
+
+	/**
+	 * table name:AFFIRMSTATE
+	 * table type:text
+	 * table comment:确认说明
+	 */
+	private String affirmstate;
+
+	/**
+	 * table name:ACCEPTANCETIME
+	 * table type:datetime
+	 * table comment:确认验收时间
+	 */
+	private Date acceptancetime;
+
+	/**
+	 * table name:RETURNMARK
+	 * table type:varchar(255)
+	 * table comment:返工标记
+	 */
+	private String returnmark;
+
 }

+ 233 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquTechnicalReformDo.java

@@ -0,0 +1,233 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author  cyn 
+ * @create 2024-01-22 14:03 
+ */
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("equ_technical_reform")
+public class EquTechnicalReformDo implements Serializable {
+
+	private static long serialVersionUID = 1L;
+	/**
+	 * table name:ID
+	 * table type:varchar(36)
+	 * table comment:主键ID
+	 */
+	private String id;
+
+	/**
+	 * table name:TENANTID
+	 * table type:text
+	 * table comment:null
+	 */
+	private String tenantid;
+
+	/**
+	 * table name:ROPTION
+	 * table type:text
+	 * table comment:扩展json格式配置
+	 */
+	private String roption;
+
+	/**
+	 * table name:DELETED
+	 * table type:varchar(1)
+	 * table comment:是否删除Y/N
+	 */
+	private String deleted;
+
+	/**
+	 * table name:REMARK
+	 * table type:varchar(2000)
+	 * table comment:备注
+	 */
+	private String remark;
+
+	/**
+	 * table name:CREATEDATE
+	 * table type:datetime
+	 * table comment:创建时间
+	 */
+	private Date createdate;
+
+	/**
+	 * table name:CREATEUSERID
+	 * table type:varchar(36)
+	 * table comment:创建用户ID
+	 */
+	private String createuserid;
+
+	/**
+	 * table name:MODIFYDATE
+	 * table type:datetime
+	 * table comment:修改日期
+	 */
+	private Date modifydate;
+
+	/**
+	 * table name:MODIFYUSERID
+	 * table type:varchar(36)
+	 * table comment:修改用户ID
+	 */
+	private String modifyuserid;
+
+	/**
+	 * table name:CREATEUSERNAME
+	 * table type:varchar(20)
+	 * table comment:创建人
+	 */
+	private String createusername;
+
+	/**
+	 * table name:MODIFYUSERNAME
+	 * table type:varchar(20)
+	 * table comment:修改人
+	 */
+	private String modifyusername;
+
+	/**
+	 * table name:OWNEDFACTORY
+	 * table type:varchar(255)
+	 * table comment:所属工厂
+	 */
+	private String ownedfactory;
+
+	/**
+	 * table name:TECHNICIMPNO
+	 * table type:varchar(255)
+	 * table comment:技改编号
+	 */
+	private String technicimpno;
+
+	/**
+	 * table name:EQUID
+	 * table type:varchar(36)
+	 * table comment:设备ID
+	 */
+	private String equid;
+
+	/**
+	 * table name:EQUNUM
+	 * table type:varchar(255)
+	 * table comment:设备编号
+	 */
+	private String equnum;
+
+	/**
+	 * table name:EQUNAME
+	 * table type:varchar(255)
+	 * table comment:设备名称
+	 */
+	private String equname;
+
+	/**
+	 * table name:MANEGEDEPTID
+	 * table type:varchar(36)
+	 * table comment:管理部门ID
+	 */
+	private String manegedeptid;
+
+	/**
+	 * table name:MANEGEDEPTNAME
+	 * table type:varchar(255)
+	 * table comment:管理部门
+	 */
+	private String manegedeptname;
+
+	/**
+	 * table name:TECHNICIMPPROJECT
+	 * table type:varchar(500)
+	 * table comment:技改项目
+	 */
+	private String technicimpproject;
+
+	/**
+	 * table name:PLANSTARTTIME
+	 * table type:datetime
+	 * table comment:计划技改开始时间
+	 */
+	private Date planstarttime;
+
+	/**
+	 * table name:PLANENDTIME
+	 * table type:datetime
+	 * table comment:计划技改结束时间
+	 */
+	private Date planendtime;
+
+	/**
+	 * table name:DUTYUSERID
+	 * table type:text
+	 * table comment:技改责任人ID
+	 */
+	private String dutyuserid;
+
+	/**
+	 * table name:DUTYUSER
+	 * table type:text
+	 * table comment:技改责任人
+	 */
+	private String dutyuser;
+
+	/**
+	 * table name:ACTSTARTTIME
+	 * table type:datetime
+	 * table comment:实际技改开始时间
+	 */
+	private Date actstarttime;
+
+	/**
+	 * table name:ACTENDTIME
+	 * table type:datetime
+	 * table comment:实际技改结束时间
+	 */
+	private Date actendtime;
+
+	/**
+	 * table name:TECHNICIMPREASON
+	 * table type:text
+	 * table comment:技改原因
+	 */
+	private String technicimpreason;
+
+	/**
+	 * table name:IMPLEMENTRES
+	 * table type:text
+	 * table comment:实施后效果
+	 */
+	private String implementres;
+
+	/**
+	 * table name:TECHNICIMPSCHEME
+	 * table type:text
+	 * table comment:技改方案
+	 */
+	private String technicimpscheme;
+
+	/**
+	 * table name:TECHNICIMPFILES
+	 * table type:text
+	 * table comment:技改相关资料
+	 */
+	private String technicimpfiles;
+
+	/**
+	 * table name:TECHNICIMPSTATE
+	 * table type:varchar(50)
+	 * table comment:技改状态
+	 */
+	private String technicimpstate;
+
+}

+ 4 - 4
cx-equipment/cx-equipment-server/src/main/java/com/rongwei/bsserver/sys/controller/EquOverhaulPlanningTasksController.java

@@ -44,10 +44,10 @@ public class EquOverhaulPlanningTasksController {
         if (file == null){
             return R.error("文件解析失败");
         }
-//        String errorMsg = checkUtil.fileCheckDetail(file,"a02f48e0c8024df1980ee5661c72be10");
-//        if (StringUtils.isNotBlank(errorMsg)){
-//            return R.error(errorMsg);
-//        }
+        String errorMsg = checkUtil.fileCheckDetail(file,"a02f48e0c8024df1980ee5661c72be10");
+        if (StringUtils.isNotBlank(errorMsg)){
+            return R.error(errorMsg);
+        }
         return equOverhaulPlanningTasksService.importEquOverhaulPlanningTasks(file);
     }
 }

+ 24 - 1
cx-equipment/cx-equipment-server/src/main/java/com/rongwei/bsserver/sys/controller/EquipmentSendNotifyController.java

@@ -27,7 +27,7 @@ public class EquipmentSendNotifyController {
 
 
     /**
-     * 根据任务ID发送 提醒
+     * 根据任务ID发送维修 提醒
      *
      * @param idGeneralDTO 保养任务ID
      * @return {@link R}
@@ -46,7 +46,30 @@ public class EquipmentSendNotifyController {
             log.info(e.getMessage());
             return R.error(e.getMessage());
         }
+    };
+
+
+
+    /**
+     * 根据任务ID发送验收 提醒
+     *
+     * @param idGeneralDTO 保养任务ID
+     * @return {@link R}
+     * @date 2024/1/18 17:16
+     * @author shangmi
+     *
+     */
 
+    @PostMapping("/maintainVerifyTaskNotify")
+    public R maintainVerifyTaskNotify(@RequestBody IdGeneralDTO idGeneralDTO){
+        try {
+            log.info("进入接口:/send-notify/maintainVerifyTaskNotify;入参为:{}",idGeneralDTO);
+            return sendNotifyService.maintainVerifyTaskNotify(idGeneralDTO.getId());
+        }catch (Exception e){
+            ExceptionUtils.printExceptionDetail(e,"发送消息提醒失败,异常为:");
+            log.info(e.getMessage());
+            return R.error(e.getMessage());
+        }
     };
 
 }

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

@@ -3,9 +3,12 @@ package com.rongwei.sfcommon.sys.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.rongwe.scentity.domian.*;
 import com.rongwe.scentity.vo.AspSafetyEmergencyDrillPlanVo;
+import com.rongwe.scentity.vo.AspSafetyTeamMemberVo;
+import com.rongwe.scentity.vo.AspSafetyTeamVo;
 import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -28,4 +31,13 @@ public interface AspSafetyDrillProgrammeDao extends BaseMapper<AspSafetyDrillPro
 
     @Select("select * from asp_safety_annual_drill_plan_month where DELETED = 0 AND ANNUALDRILLPLANID = #{id}")
     List<AspSafetyAnnualDrillPlanMonth> selectAnnualDrillPlanMonthById(String id);
+
+    @Select("select ID,TEAMNAME AS 'teamName',ORGPOSITION AS 'content' from asp_safety_team where DELETED = 0")
+    List<AspSafetyTeamVo> selectTeam();
+
+    @Select("select TEAMPOSITION AS 'roleName',GROUP_CONCAT(TEAMMEMBERNAME) AS 'name' from asp_safety_team_member where DELETED = 0 AND TEAMID=#{id} GROUP BY TEAMPOSITION")
+    List<AspSafetyTeamMemberVo> selectTeamMemberByTeamId(String id);
+
+    @Select("select GROUP_CONCAT(a.`name`) from (SELECT CONCAT(ITEMNAME,ITEMQTY) as 'name' FROM asp_safety_drill_programme_item where DELETED = 0 AND PROGRAMMEID = #{mainId}) a")
+    String selectEquimentByMainId(String mainId);
 }

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

@@ -5,6 +5,10 @@ import com.rongwe.scentity.domian.AspSafetyDrillProgrammeDo;
 import com.rongwei.rwcommon.base.R;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -42,4 +46,7 @@ public interface AspSafetyDrillProgrammeService extends IService<AspSafetyDrillP
     void exportEmergencyDrillPlanWord(String startDate, String endDate, HttpServletResponse response) throws Exception;
 
     void exportAnnualDrillPlanWord(String id, HttpServletResponse response) throws Exception;
+
+    void exportDrillProgramme(String id, HttpServletResponse response) throws Exception;
+
 }

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

@@ -10,9 +10,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwe.scentity.domian.*;
 import com.rongwe.scentity.vo.AspSafetyEmergencyDrillPlanVo;
+import com.rongwe.scentity.vo.AspSafetyTeamMemberVo;
+import com.rongwe.scentity.vo.AspSafetyTeamVo;
 import com.rongwei.rwadmincommon.system.domain.SysDictDo;
 import com.rongwei.rwadmincommon.system.service.SysDictService;
 import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.rwcommon.utils.StringUtils;
 import com.rongwei.safecommon.utils.CXCommonUtils;
@@ -21,15 +24,14 @@ import com.rongwei.sfcommon.sys.service.AspSafetyDrillProgrammeMsgNotifyRecordSe
 import com.rongwei.sfcommon.sys.service.AspSafetyDrillProgrammeService;
 import com.rongwei.sfcommon.sys.service.AspSafetyEmergencyPlanService;
 import com.rongwei.sfcommon.utils.AsposeWordsUtils;
-import com.rongwei.sfcommon.utils.CommonUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletResponse;
 import java.awt.*;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.IOException;
 import java.net.URLEncoder;
 import java.util.*;
 import java.util.List;
@@ -529,6 +531,111 @@ public class AspSafetyDrillProgrammeServiceImpl extends ServiceImpl<AspSafetyDri
 
     }
 
+    @Override
+    public void exportDrillProgramme(String mainId, HttpServletResponse response) throws Exception {
+        boolean wordLicense = AsposeWordsUtils.getWordLicense();
+
+        Map<String,Object> map = new HashMap<>();
+        //查询小组表信息
+        List<AspSafetyTeamVo> list = this.baseMapper.selectTeam();
+        //查询小组对应成员信息
+        for (AspSafetyTeamVo item : list) {
+            String id = item.getID();
+            String teamName = item.getTeamName();
+            String content = item.getContent();
+            List<AspSafetyTeamMemberVo> memberList = this.baseMapper.selectTeamMemberByTeamId(id);
+            item.setMemberList(memberList);
+            if(teamName.equals("演练指挥小组")){
+                for (AspSafetyTeamMemberVo vo : memberList) {
+                    String roleName = vo.getRoleName();
+                    String name = vo.getName();
+                    if(roleName.equals("总指挥")){
+                        map.put("item1",name);
+                    }
+                    if(roleName.equals("副总指挥")){
+                        map.put("item2",name);
+                    }
+                    if(roleName.equals("成员")){
+                        map.put("item3",name);
+                    }
+                }
+            }
+            if(teamName.equals("指挥领导小组")){
+                map.put("item4",content);
+            }
+            if(teamName.equals("总指挥")){
+                map.put("item5",content);
+            }
+            if(teamName.equals("副总指挥")){
+                map.put("item6",content);
+            }
+            List<String> teamNameList = new LinkedList<>();
+            teamNameList.add("抢险技术组");
+            teamNameList.add("抢险抢修组");
+            teamNameList.add("医疗救护组");
+            teamNameList.add("监测洗消组");
+            teamNameList.add("消防救援组");
+            teamNameList.add("后勤物资保障组");
+            teamNameList.add("警戒疏散联络组");
+            teamNameList.add("财力保障组");
+            int index = 7;
+            if(teamNameList.contains(teamName)){
+                int i = teamNameList.indexOf(teamName);
+                int startIndex = index + i*4;
+                for (AspSafetyTeamMemberVo vo : memberList) {
+                    String roleName = vo.getRoleName();
+                    String name = vo.getName();
+                    if(roleName.equals("组长")){
+                        map.put("item"+startIndex,name);
+                    }
+                    if(roleName.equals("副组长")){
+                        map.put("item"+(startIndex+1),name);
+                    }
+                    if(roleName.equals("成员")){
+                        map.put("item"+(startIndex+2),name);
+                    }
+                }
+                map.put("item"+(startIndex+3),content);
+            }
+
+        }
+        //主表数据
+        AspSafetyDrillProgrammeDo aspSafetyDrillProgrammeDo = this.baseMapper.selectById(mainId);
+        map.put("PLANNAME",aspSafetyDrillProgrammeDo.getPlanname());
+        map.put("DRILLTIME",DateUtil.format(aspSafetyDrillProgrammeDo.getDrilltime(), "yyyy年MM月dd日 HH时mm分"));
+        map.put("DRILLLOCATION",aspSafetyDrillProgrammeDo.getDrilllocation());
+        map.put("PARTICIPANTNAME",aspSafetyDrillProgrammeDo.getParticipantname());
+        map.put("OBSERVERNAMES",aspSafetyDrillProgrammeDo.getObservernames());
+        map.put("CAMERACREWNAME",aspSafetyDrillProgrammeDo.getCameracrewname());
+
+        map.put("PREPARATION",aspSafetyDrillProgrammeDo.getPreparation());
+        map.put("MOBILIZATIONTRAINING",aspSafetyDrillProgrammeDo.getMobilizationtraining());
+        map.put("DRILLPROCESS",aspSafetyDrillProgrammeDo.getDrillprocess());
+        map.put("EVALUATIONSUMMARY",aspSafetyDrillProgrammeDo.getEvaluationsummary());
+
+        //增加所需器材组装字段(equipments)
+        String equipments = this.baseMapper.selectEquimentByMainId(mainId);
+        map.put("equipments", equipments);
+
+        ClassPathResource classPathResource = new ClassPathResource("template/ExercisePlan.docx");
+
+
+        Document doc = new Document(classPathResource.getInputStream());
+        doc.getMailMerge().setCleanupOptions(MailMergeCleanupOptions.REMOVE_UNUSED_FIELDS);
+        try {
+            doc.getMailMerge().execute(map.keySet().toArray(new String[0]),map.values().toArray());
+            doc.getMailMerge().setCleanupOptions(MailMergeCleanupOptions.REMOVE_EMPTY_TABLE_ROWS);
+            doc.getMailMerge().deleteFields();
+            response.setContentType("application/octet-stream;charset=ISO8859-1");
+            response.setHeader("Content-Disposition", "attachment;filename="+URLEncoder.encode(aspSafetyDrillProgrammeDo.getPlanname()+"演练方案.docx", "UTF-8"));
+            doc.save(response.getOutputStream(), com.aspose.words.SaveFormat.DOCX);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new CustomException("演练方案导出异常");
+        }
+
+    }
+
     /**
      * 消息提醒
      *

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

@@ -0,0 +1,15 @@
+package com.rongwe.scentity.vo;
+
+import lombok.Data;
+
+/**
+ * @author :sc
+ * @since :2024/1/20
+ */
+@Data
+public class AspSafetyTeamMemberVo {
+    //小组职务
+    private String roleName;
+    //姓名
+    private String name;
+}

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

@@ -0,0 +1,22 @@
+package com.rongwe.scentity.vo;
+
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author :sc
+ * @since :2024/1/20
+ */
+@Data
+public class AspSafetyTeamVo {
+    //小组主键
+    private String ID;
+    //小组名称
+    private String teamName;
+    //小组职责
+    private String content;
+    //小组成员
+    private List<AspSafetyTeamMemberVo> memberList;
+}

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

@@ -1,11 +1,14 @@
 package com.rongwei.savecheck.controller;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.sfcommon.sys.service.AspSafetyDrillProgrammeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -85,5 +88,13 @@ public class AspSafetyDrillProgrammeController {
                                           HttpServletResponse response) throws Exception {
         aspSafetyDrillProgrammeService.exportAnnualDrillPlanWord(id, response);
     }
+
+    /**
+     * 导出演练方案
+     */
+    @PostMapping("/exportDrillProgramme")
+    public void exportDrillProgramme(@RequestParam String id, HttpServletResponse response) throws Exception {
+        aspSafetyDrillProgrammeService.exportDrillProgramme(id, response);
+    }
 }
 

BIN
cx-safe-check/cx-save-check-server/src/main/resources/template/ExercisePlan.docx