xiongchao 3 жил өмнө
parent
commit
14d2329e2c

+ 6 - 6
platform-dao/src/main/java/com/platform/dao/enums/CheckPlanUserTypeEnum.java

@@ -14,17 +14,17 @@ import lombok.Getter;
 public enum CheckPlanUserTypeEnum {
 public enum CheckPlanUserTypeEnum {
 
 
     /**
     /**
-     *指定
+     *使用人
      */
      */
-    ZHIDING(1),
+    USE_USER(1),
     /**
     /**
-     * 设备管理员
+     * 维修人
      */
      */
-    MANAGER(2),
+    REPAIR_USER(2),
     /**
     /**
-     * 部门对应的维修员
+     * 指定
      */
      */
-    WEIXIU(3);
+    ZHIDING(3);
 
 
     private final Integer value;
     private final Integer value;
 
 

+ 17 - 11
platform-dao/src/main/java/com/platform/dao/util/CustomExcelImportUtil.java

@@ -457,13 +457,13 @@ public class CustomExcelImportUtil {
     public static void main(String[] args) throws IOException, InvalidFormatException {
     public static void main(String[] args) throws IOException, InvalidFormatException {
         //String path = "C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson";
         //String path = "C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson";
         //File dirFile = new File("C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson");
         //File dirFile = new File("C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson");
-        String[] files = {"C:\\Users\\cyz\\\\Downloads\\保养标准20210812160348862.xls"};
+        String[] files = {"C:\\Users\\cyz\\\\Downloads\\2021.8.27 保养初始时间导入 desma.xls"};
         for(String fileStr:files){
         for(String fileStr:files){
             System.out.println(fileStr);
             System.out.println(fileStr);
             InputStream inputstream = new FileInputStream(fileStr);
             InputStream inputstream = new FileInputStream(fileStr);
             LocalDateTime now = LocalDateTime.now();
             LocalDateTime now = LocalDateTime.now();
             //List<SbInfoVO> list = importSbInfoList(inputstream);
             //List<SbInfoVO> list = importSbInfoList(inputstream);
-            List<SbInfoVO> list = importListByUpdateALl(inputstream);
+            List<CheckStandard> list = importCheckStandardListByUpdate(inputstream);
            list.forEach(item -> {
            list.forEach(item -> {
                 System.out.println(item.toString());
                 System.out.println(item.toString());
             });
             });
@@ -1028,13 +1028,13 @@ public class CustomExcelImportUtil {
             }
             }
             try {
             try {
                 record.setId(row.getCell(0).getStringCellValue().trim());
                 record.setId(row.getCell(0).getStringCellValue().trim());
-                record.setName(row.getCell(3).getStringCellValue().trim());
-                record.setNo(row.getCell(4).getStringCellValue().trim());
-                record.setRequirement(row.getCell(5).getStringCellValue().trim());
-                record.setRemark(row.getCell(6).getStringCellValue().trim());
-                String period = row.getCell(7).getStringCellValue();
+                record.setName(row.getCell(5).getStringCellValue().trim());
+                record.setNo(row.getCell(6).getStringCellValue().trim());
+                record.setRequirement(row.getCell(7).getStringCellValue().trim());
+                record.setRemark(row.getCell(8).getStringCellValue().trim());
+                String period = row.getCell(9).getStringCellValue();
                 record.setPeriod(Double.valueOf(period).intValue());
                 record.setPeriod(Double.valueOf(period).intValue());
-                String periodType = row.getCell(8).getStringCellValue();
+                String periodType = row.getCell(10).getStringCellValue();
                 if(periodType.equals("天")){
                 if(periodType.equals("天")){
                     record.setPeriodType(CheckPlanPeriodTypeEnum.DAY.getValue());
                     record.setPeriodType(CheckPlanPeriodTypeEnum.DAY.getValue());
                 }else  if(periodType.equals("周")){
                 }else  if(periodType.equals("周")){
@@ -1050,8 +1050,8 @@ public class CustomExcelImportUtil {
                 }else  if(periodType.equals("台时")){
                 }else  if(periodType.equals("台时")){
                     record.setPeriodType(CheckPlanPeriodTypeEnum.TAISHI.getValue());
                     record.setPeriodType(CheckPlanPeriodTypeEnum.TAISHI.getValue());
                 }
                 }
-                String lastDate = row.getCell(9).getStringCellValue().trim();
-                String nextDate = row.getCell(10).getStringCellValue().trim();
+                String lastDate = row.getCell(11).getStringCellValue().trim();
+                String nextDate = row.getCell(12).getStringCellValue().trim();
                 if(StringUtils.isNotBlank(lastDate)){
                 if(StringUtils.isNotBlank(lastDate)){
                     record.setLastDate(DateUtils.strToLocalDate(lastDate, DateUtils.PATTERN_YMD));
                     record.setLastDate(DateUtils.strToLocalDate(lastDate, DateUtils.PATTERN_YMD));
                 }
                 }
@@ -1066,7 +1066,13 @@ public class CustomExcelImportUtil {
                         record.setCheckUserType(CheckUserTypeEnum.USE_USER.getValue());
                         record.setCheckUserType(CheckUserTypeEnum.USE_USER.getValue());
                     }
                     }
                 }else{
                 }else{
-                    record.setCheckUserType(Integer.valueOf(checkUserType));
+                    if(checkUserType.equals("使用人")){
+                        record.setCheckUserType(CheckPlanUserTypeEnum.USE_USER.getValue());
+                    }else if(checkUserType.equals("维修人")){
+                        record.setCheckUserType(CheckUserTypeEnum.REPAIR_USER.getValue());
+                    }else{
+                     record.setCheckUserType(CheckUserTypeEnum.ZHIDING.getValue());
+                    }
                 }
                 }
             } catch (Exception e) {
             } catch (Exception e) {
                 throw new BusinessException("导入异常,行号:"+ i + ", 错误信息" + e.getMessage() +  ", 错误原因" + e.getCause());
                 throw new BusinessException("导入异常,行号:"+ i + ", 错误信息" + e.getMessage() +  ", 错误原因" + e.getCause());

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/vo/export/check/ExportCheckStandardVO.java

@@ -87,7 +87,7 @@ public class ExportCheckStandardVO implements Serializable {
     /**
     /**
      * 执行人方式(1使用人、2维修人、3指定人)
      * 执行人方式(1使用人、2维修人、3指定人)
      */
      */
-    @Excel(name = "执行人方式", orderNum = "14")
+    @Excel(name = "执行人方式", orderNum = "14", dicCode="CHECK_USER_TYPE")
     private Integer checkUserType;
     private Integer checkUserType;
 
 
 }
 }

+ 3 - 3
platform-dao/src/main/resources/mapper/check/CheckStandardMapper.xml

@@ -169,13 +169,13 @@ checkstandard.last_date,
                      remark = #{item.remark},
                      remark = #{item.remark},
                 </if>
                 </if>
                 <if test="item.no != null and item.no != ''">
                 <if test="item.no != null and item.no != ''">
-                    remark = #{item.no},
+                    no = #{item.no},
                 </if>
                 </if>
                 <if test="item.name != null and item.name != ''">
                 <if test="item.name != null and item.name != ''">
-                    remark = #{item.name},
+                    name = #{item.name},
                 </if>
                 </if>
                 <if test="item.period != null">
                 <if test="item.period != null">
-                     period = #{item.period},
+                    period = #{item.period},
                 </if>
                 </if>
                 <if test="item.periodType != null">
                 <if test="item.periodType != null">
                      period_type = #{item.periodType},
                      period_type = #{item.periodType},

+ 2 - 2
platform-service/src/main/java/com/platform/service/check/impl/CheckJobServiceImpl.java

@@ -271,13 +271,13 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
                     if (item.getCheckUserType().intValue() == CheckPlanUserTypeEnum.ZHIDING.getValue()) {
                     if (item.getCheckUserType().intValue() == CheckPlanUserTypeEnum.ZHIDING.getValue()) {
                         checkJob.setCheckUserId(item.getCheckUserId());
                         checkJob.setCheckUserId(item.getCheckUserId());
                         checkJob.setCheckUserName(item.getCheckUserName());
                         checkJob.setCheckUserName(item.getCheckUserName());
-                    } else if (item.getCheckUserType().intValue() == CheckPlanUserTypeEnum.MANAGER.getValue()) {
+                    } else if (item.getCheckUserType().intValue() == CheckPlanUserTypeEnum.USE_USER.getValue()) {
                         // 查找设备的使用人员
                         // 查找设备的使用人员
                         if (sbInfo.getSaveUser() == null) {
                         if (sbInfo.getSaveUser() == null) {
                             throw new BusinessException("设备SaveUser为空,计划无法启动,请联系管理员或者更换计划执行人方式,设备id, 班组id: " + sbInfo.getId() + ", " + sbInfo.getUseGroup());
                             throw new BusinessException("设备SaveUser为空,计划无法启动,请联系管理员或者更换计划执行人方式,设备id, 班组id: " + sbInfo.getId() + ", " + sbInfo.getUseGroup());
                         }
                         }
                         checkJob.setCheckUserId(sbInfo.getSaveUser());
                         checkJob.setCheckUserId(sbInfo.getSaveUser());
-                    } else if (item.getCheckUserType().intValue() == CheckPlanUserTypeEnum.WEIXIU.getValue()) {
+                    } else if (item.getCheckUserType().intValue() == CheckPlanUserTypeEnum.REPAIR_USER.getValue()) {
                         // 查找设备所属班组对应的维修人员
                         // 查找设备所属班组对应的维修人员
                         List<SysUserVO> sysUser = sysUserDeptService.selectByIdentityTypeDept(sbInfo.getUseGroup(), SysDeptManagerType.REPAIR.getValue());
                         List<SysUserVO> sysUser = sysUserDeptService.selectByIdentityTypeDept(sbInfo.getUseGroup(), SysDeptManagerType.REPAIR.getValue());
                         if (!CollectionUtils.isEmpty(sysUser)) {
                         if (!CollectionUtils.isEmpty(sysUser)) {