hfxc226 2 lat temu
rodzic
commit
0c5de3a413

+ 21 - 23
platform-dao/src/main/java/com/platform/dao/util/CustomExcelImportUtil.java

@@ -887,33 +887,31 @@ public class CustomExcelImportUtil {
                 record.setTypeName(row.getCell(7).getStringCellValue().trim());
                 record.setUseType(getUseType(row.getCell(8).getStringCellValue().trim()));
                 record.setZz(getCellValue(row.getCell(9)));
-                record.setCph(getCellValue(row.getCell(10)));
+                record.setPositionName(getCellValue(row.getCell(10)));
                 record.setZzh(getCellValue(row.getCell(11)));
                 record.setProducerId(row.getCell(12).getStringCellValue().trim());
                 record.setSaveUserName(row.getCell(13).getStringCellValue().trim());
-                record.setRepairUserName(row.getCell(14).getStringCellValue().trim());
-                record.setRepairUserNameSecond(row.getCell(15).getStringCellValue().trim());
-                if (StringUtils.isBlank(getCellValue(row.getCell(16)))) {
+                if (StringUtils.isBlank(getCellValue(row.getCell(14)))) {
                     record.setBuyDate(DateUtils.strToLocalDate("2014-01-01", DateUtils.PATTERN_YMD));
                 } else {
-                    record.setBuyDate(DateUtils.strToLocalDate((getCellValue(row.getCell(16)).substring(0, 4) + "-01-01"), DateUtils.PATTERN_YMD));
+                    record.setBuyDate(DateUtils.strToLocalDate((getCellValue(row.getCell(14)).substring(0, 4) + "-01-01"), DateUtils.PATTERN_YMD));
                 }
-                if (StringUtils.isBlank(getCellValue(row.getCell(17)))) {
+                if (StringUtils.isBlank(getCellValue(row.getCell(15)))) {
                     record.setStartDate(DateUtils.strToLocalDate("2019-01-01", DateUtils.PATTERN_YMD));
                 } else {
-                    if (getCellValue(row.getCell(17)).contains(".")) {
-                        if (getCellValue(row.getCell(17)).contains("E7")) {
-                            record.setStartDate(DateUtils.strToLocalDate(getCellValue(row.getCell(17)).replace(".", "").replace("E7", ""), DateUtils.PATTERNYMD));
-                        } else if (getCellValue(row.getCell(17)).endsWith(".0")) {
-                            record.setStartDate(DateUtils.strToLocalDate(ExcelDoubleToDate(getCellValue(row.getCell(17))), DateUtils.PATTERN_YMD));
+                    if (getCellValue(row.getCell(15)).contains(".")) {
+                        if (getCellValue(row.getCell(15)).contains("E7")) {
+                            record.setStartDate(DateUtils.strToLocalDate(getCellValue(row.getCell(15)).replace(".", "").replace("E7", ""), DateUtils.PATTERNYMD));
+                        } else if (getCellValue(row.getCell(15)).endsWith(".0")) {
+                            record.setStartDate(DateUtils.strToLocalDate(ExcelDoubleToDate(getCellValue(row.getCell(15))), DateUtils.PATTERN_YMD));
                         } else {
-                            record.setStartDate(DateUtils.strToLocalDate(getCellValue(row.getCell(17)), DateUtils.PATTERN_YMD_DOT));
+                            record.setStartDate(DateUtils.strToLocalDate(getCellValue(row.getCell(15)), DateUtils.PATTERN_YMD_DOT));
                         }
-                    } else if (getCellValue(row.getCell(17)).contains("-")) {
-                        record.setStartDate(DateUtils.strToLocalDate(getCellValue(row.getCell(17)), DateUtils.PATTERN_YMD));
+                    } else if (getCellValue(row.getCell(15)).contains("-")) {
+                        record.setStartDate(DateUtils.strToLocalDate(getCellValue(row.getCell(15)), DateUtils.PATTERN_YMD));
                     } else {
-                        if(getCellValue(row.getCell(17)).contains("/")){
-                            String[] strList = getCellValue(row.getCell(17)).split("/");
+                        if(getCellValue(row.getCell(15)).contains("/")){
+                            String[] strList = getCellValue(row.getCell(15)).split("/");
                             if(strList.length == 3){
                                 if(strList[1].length() == 1){
                                     strList[1] = "0" + strList[1];
@@ -925,18 +923,18 @@ public class CustomExcelImportUtil {
                             String newDate = strList[0] + "-" + strList[1] + "-" + strList[2];
                             record.setStartDate(DateUtils.strToLocalDate(newDate, DateUtils.PATTERN_YMD));
                         }else{
-                            record.setStartDate(DateUtils.strToLocalDate(getCellValue(row.getCell(17)), DateUtils.PATTERNYMD));
+                            record.setStartDate(DateUtils.strToLocalDate(getCellValue(row.getCell(15)), DateUtils.PATTERNYMD));
                         }
                     }
                 }
-                record.setStatus(getSbInfoStatus(row.getCell(18).getStringCellValue()));
-                record.setRemark(row.getCell(19).getStringCellValue().trim());
+                record.setStatus(getSbInfoStatus(row.getCell(16).getStringCellValue()));
+                record.setRemark(row.getCell(17).getStringCellValue().trim());
                 System.out.println("row.getPhysicalNumberOfCells(): " + row.getPhysicalNumberOfCells());
                 // 主子设备和是否大屏显示
-                if(row.getPhysicalNumberOfCells()>20){
-                    record.setIsChild(getChild(row.getCell(20).getStringCellValue().trim()));
-                    record.setIsShow(getShow(row.getCell(21).getStringCellValue().trim()));
-                    record.setPositionId(row.getCell(22).getStringCellValue().trim());
+                if(row.getPhysicalNumberOfCells()>18){
+                    record.setIsChild(getChild(row.getCell(18).getStringCellValue().trim()));
+                    record.setIsShow(getShow(row.getCell(19).getStringCellValue().trim()));
+                    //record.setParentNo(row.getCell(20).getStringCellValue().trim());
                 }else{// 默认值
                     record.setIsChild(SbInfoChildEnum.IS_NORMAL.getValue());
                     record.setIsShow(SbInfoShowEnum.NOT_SHOW.getValue());

+ 114 - 113
platform-dao/src/main/java/com/platform/dao/vo/export/sb/ExportSbInfoStopDetailVO.java

@@ -3,6 +3,7 @@ package com.platform.dao.vo.export.sb;
 import com.platform.office.annotation.Excel;
 import lombok.Data;
 import lombok.experimental.Accessors;
+
 import java.io.Serializable;
 import java.time.LocalDateTime;
 import java.time.LocalDate;
@@ -18,117 +19,117 @@ import java.time.LocalDate;
 public class ExportSbInfoStopDetailVO implements Serializable {
 
     /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "1")
-      private String id;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "2")
-      private String no;
-    
-    /**
-   * 设备Id
-   */
-          @Excel(name = "设备Id", orderNum = "3")
-      private String sbId;
-      /**
-       * 设备Id -名称
-       */
-      @Excel(name = "设备Id", orderNum = "3")
-      private String sbInfoName;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "4")
-      private Integer repairId;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "5")
-      private String userId;
-    
-    /**
-   * 类型
-   */
-          @Excel(name = "类型", orderNum = "6")
-      private Integer type;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "7")
-      private LocalDate applyDate;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "8")
-      private LocalDate startDate;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "9")
-      private LocalDate stopDate;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "10")
-      private String content;
-    
-    /**
-   * 状态
-   */
-          @Excel(name = "状态", orderNum = "11")
-      private Integer status;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "12")
-      private String remark;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "13")
-      private LocalDateTime createdTime;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "14")
-      private LocalDateTime updateTime;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "15")
-      private String createdUserId;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "16")
-      private String createdUserName;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "17")
-      private String updateUserId;
-    
-    /**
-   * $column.comments
-   */
-          @Excel(name = "$column.comments", orderNum = "18")
-      private String updateUserName;
-    
-  
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "1")
+    private String id;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "2")
+    private String no;
+
+    /**
+     * 设备Id
+     */
+    @Excel(name = "设备Id", orderNum = "3")
+    private String sbId;
+    /**
+     * 设备Id -名称
+     */
+    @Excel(name = "设备Id", orderNum = "3")
+    private String sbInfoName;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "4")
+    private Integer repairId;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "5")
+    private String userId;
+
+    /**
+     * 类型
+     */
+    @Excel(name = "类型", orderNum = "6")
+    private Integer type;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "7")
+    private LocalDate applyDate;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "8")
+    private LocalDate startDate;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "9")
+    private LocalDate stopDate;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "10")
+    private String content;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态", orderNum = "11")
+    private Integer status;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "12")
+    private String remark;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "13")
+    private LocalDateTime createdTime;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "14")
+    private LocalDateTime updateTime;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "15")
+    private String createdUserId;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "16")
+    private String createdUserName;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "17")
+    private String updateUserId;
+
+    /**
+     * $column.comments
+     */
+    @Excel(name = "$column.comments", orderNum = "18")
+    private String updateUserName;
+
+
 }

+ 6 - 11
platform-dao/src/main/java/com/platform/dao/vo/export/sb/ExportSbInfoVO.java

@@ -48,7 +48,7 @@ public class ExportSbInfoVO implements Serializable {
     /**
      * 设备等级
      */
-    @Excel(name = "设备等级(1:A级,2:B级,3:C级)", orderNum = "6", dicCode="SBINFO_LEVEL")
+    @Excel(name = "设备等级", orderNum = "6", dicCode="SBINFO_LEVEL")
     private Integer level;
     /**
      * 设备原值
@@ -74,7 +74,7 @@ public class ExportSbInfoVO implements Serializable {
      * 设备位置
      */
     @Excel(name = "设备位置", orderNum = "11")
-    private String cph;
+    private String positionName;
     /**
      * 使用位置
      */
@@ -88,7 +88,7 @@ public class ExportSbInfoVO implements Serializable {
     /**
      * 使用施工组名称
      */
-    @Excel(name = "使用机台/使用人", orderNum = "14")
+    @Excel(name = "使用人", orderNum = "14")
     private String saveUserName;
     /**
      * 购置日期
@@ -103,7 +103,7 @@ public class ExportSbInfoVO implements Serializable {
     /**
      * 状态
      */
-    @Excel(name = "状态(1在库,2使用中,4已报废,7停用中,11丢失)", orderNum = "17", dicCode="SB_INFO_STATUS")
+    @Excel(name = "状态", orderNum = "17", dicCode="SB_INFO_STATUS")
     private Integer status;
     /**
      * 备注
@@ -113,17 +113,12 @@ public class ExportSbInfoVO implements Serializable {
     /**
      * 是否子设备
      */
-    @Excel(name = "是否子设备(0否,1是子设备)", orderNum = "19", dicCode="SB_IS_CHILD")
+    @Excel(name = "是否子设备", orderNum = "19", dicCode="SB_IS_CHILD")
     private Integer isChild;
-    /**
-     * 是否子设备
-     */
-    @Excel(name = "父设备编号", orderNum = "20")
-    private String parentId;
     /**
      * 财务编码/固定资产编号
      */
-    @Excel(name = "财务编码", orderNum = "21")
+    @Excel(name = "财务编码", orderNum = "20")
     private String financingNo;
 
 }

+ 10 - 1
platform-dao/src/main/java/com/platform/dao/vo/sb/SbInfoVO.java

@@ -154,12 +154,17 @@ public class SbInfoVO extends BaseVO implements Serializable {
      */
     @Transient
     private String parentSbName;
+    /**
+     * 上层设备编号:唯一的
+     */
+    @Transient
+    private String parentSbNo;
     /**
      * 计量单位
      */
     private String unit;
     /**
-     * 所属车间
+     * 所属车间:设备位置
      */
     private String positionId;
     /**
@@ -358,6 +363,10 @@ public class SbInfoVO extends BaseVO implements Serializable {
      * 上层类型名称
      */
     private String parentName;
+    /**
+     * 上层类型名称
+     */
+    private String parentNo;
     /**
      * 来源设备名称
      */

+ 0 - 1
platform-rest/src/main/java/com/platform/rest/controller/sb/SbInfoController.java

@@ -361,7 +361,6 @@ public class SbInfoController {
     @PreAuthorize("@pms.hasPermission('sb-infos-export')")
     public void export(HttpServletResponse response, SbInfoDTO sbInfoDTO) {
         List<SbInfoVO> list = sbInfoService.selectExportVOList(sbInfoDTO);
-
         ExcelUtil.exportResponseDict(response, ExportSbInfoVO.class, BeanConverterUtil.copyListProperties(list, ExportSbInfoVO.class), "设备基础信息");
     }
 

+ 13 - 26
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -1737,32 +1737,6 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
                     if (!findSaveUser) {
                         throw new BusinessException("找不到使用人员,请先添加, 名称" + item.getSaveUser());
                     }
-                    if (StringUtils.isNotBlank(item.getRepairUserName())) {
-                        boolean findRepairUser = false;
-                        for (SysUser user : users) {
-                            if (user.getRealName().equals(item.getRepairUserName())) {
-                                item.setRepairUser(user.getUserId());
-                                findRepairUser = true;
-                                break;
-                            }
-                        }
-                        if (!findRepairUser) {
-                            throw new BusinessException("找不到维修人员,请先添加, 名称" + item.getRepairUser());
-                        }
-                    }
-                    if (StringUtils.isNotBlank(item.getRepairUserNameSecond())) {
-                        boolean findRepairUser = false;
-                        for (SysUser user : users) {
-                            if (user.getRealName().equals(item.getRepairUserNameSecond())) {
-                                item.setRepairUserSecond(user.getUserId());
-                                findRepairUser = true;
-                                break;
-                            }
-                        }
-                        if (!findRepairUser) {
-                            throw new BusinessException("找不到第二维修人员,请先添加, 名称" + item.getRepairUser());
-                        }
-                    }
 
                     List<SbType> typeList = sbTypeMapper.selectAll();
                     boolean find = false;
@@ -1777,6 +1751,19 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
                         throw new BusinessException("找不到设备类型,请先添加:" + item.getTypeName());
                     }
 
+                    List<SbPosition> positionList = sbPositionMapper.selectAll();
+                    boolean findPosition = false;
+                    for (SbPosition position : positionList) {
+                        if (position.getName().equals(item.getPositionName())) {
+                            item.setPositionId(position.getId());
+                            findPosition = true;
+                            break;
+                        }
+                    }
+                    if (!findPosition) {
+                        throw new BusinessException("找不到设备位置,请先添加,位置名称是:" + item.getPositionName());
+                    }
+
                     boolean findProdcuer = false;
                     for (FirmProducer producer : producerList) {
                         if (producer.getName().equals(item.getProducerId())) {