hfxc226 3 years ago
parent
commit
6842ddd0bc

+ 69 - 49
platform-dao/src/main/java/com/platform/dao/util/CustomExcelImportUtil.java

@@ -461,13 +461,13 @@ public class CustomExcelImportUtil {
     public static void main(String[] args) throws IOException, InvalidFormatException {
         //String path = "C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson";
         //File dirFile = new File("C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson");
-        String[] files = {"C:\\Users\\LTKJ\\Downloads\\计量设备基础信息20211128205448123.xls"};
+        String[] files = {"C:\\Users\\LTKJ\\Downloads\\设备台账 (1).xlsx"};
         for(String fileStr:files){
             System.out.println(fileStr);
             InputStream inputstream = new FileInputStream(fileStr);
             LocalDateTime now = LocalDateTime.now();
             //List<SbInfoVO> list = importSbInfoList(inputstream);
-            List<SbInfoMeasureVO> list = importListByUpdateALlMeasure(inputstream);
+            List<SbInfoMeasureVO> list = importSbInfoMeasureList(inputstream);
             list.forEach(item -> {
                 System.out.println(item.toString());
             });
@@ -623,7 +623,7 @@ public class CustomExcelImportUtil {
         } else if ("已校准".equals(stringCellValue)) {
             return 3;
         } else{
-            throw new BusinessException("检定结论未配置,请配置:" + stringCellValue);
+            return 1;
         }
     }
 
@@ -640,6 +640,8 @@ public class CustomExcelImportUtil {
             return 5;
         } else if ("丢失".equals(stringCellValue)){
             return 6;
+        }else if ("转出".equals(stringCellValue)){
+            return 7;
         }else{
             throw new BusinessException("管理状态未配置,请配置:" + stringCellValue);
         }
@@ -972,36 +974,46 @@ public class CustomExcelImportUtil {
         StringBuffer error = new StringBuffer();
         for (int i = 2; i <= rowCounts; i++) {
             record = new SbInfoMeasureVO();
+            record.setId(IdGeneratorUtils.getObjectId());
             Row row = sheet.getRow(i);
             if(isRowEmpty(row)){
                 continue;
             }
-            String index = row.getCell(0).getStringCellValue() + "";
+            String index = row.getCell(1).getStringCellValue() + "";
             try {
                 //i,j i:行 j:列
                 record.setCardNo(row.getCell(1).getStringCellValue().trim());
-                record.setNo(row.getCell(2).getStringCellValue().trim());
-                record.setName(row.getCell(3).getStringCellValue().trim().replace("'", ""));
-                record.setZz(getCellValue(row.getCell(4)));
-                record.setModel(getCellValue(row.getCell(5)).trim());
-                record.setFdjxh(row.getCell(6).getStringCellValue().trim());
-                record.setUseDept(row.getCell(7).getStringCellValue().trim());
-                record.setCph(row.getCell(8).getStringCellValue().trim());
-                record.setCheckDate(DateUtils.strToLocalDate(row.getCell(9).getStringCellValue().trim(), DateUtils.PATTERN_YMD));
-                record.setCheckPeriod(Double.valueOf(row.getCell(10).getNumericCellValue()).intValue());
-                record.setNextCheckDate(DateUtils.strToLocalDate(row.getCell(11).getStringCellValue().trim(), DateUtils.PATTERN_YMD));
-                record.setProducerId(row.getCell(12).getStringCellValue().trim());
-                record.setDph(row.getCell(13).getStringCellValue().trim());
-                record.setZaiz(row.getCell(14).getStringCellValue().trim());
-                record.setRlType(getRlType(row.getCell(15).getStringCellValue()));
-                record.setColor(row.getCell(16).getStringCellValue().trim().equals("是")?1:0);
-                record.setSbdh(row.getCell(17).getStringCellValue().trim());
-                record.setRemark(row.getCell(18).getStringCellValue().trim());
-                record.setSeatNumber(Double.valueOf(row.getCell(19).getNumericCellValue()).intValue());
-                record.setIsFinancing(row.getCell(20).getStringCellValue().trim().equals("是")?1:0);
-                record.setFinancingNo(row.getCell(21).getStringCellValue().trim());
-                record.setStatus(getSbMeasureInfoStatus(row.getCell(22).getStringCellValue()));
-
+                record.setName(row.getCell(2).getStringCellValue().trim().replace("'", ""));
+                record.setZzh(row.getCell(3).getStringCellValue().trim().replace("'", ""));
+                record.setModel(getCellValue(row.getCell(4)).trim());
+                record.setZz(getCellValue(row.getCell(5)));
+                record.setUseDept(row.getCell(6).getStringCellValue().trim());
+                record.setCph(row.getCell(7).getStringCellValue().trim());
+                record.setFdjxh(row.getCell(8).getStringCellValue().trim());
+                record.setStatus(getSbMeasureInfoStatus(row.getCell(9).getStringCellValue()));
+                if(StringUtils.isBlank(row.getCell(10).getStringCellValue())){
+                    record.setCheckDate(null);
+                }else{
+                    record.setCheckDate(DateUtils.strToLocalDate(row.getCell(10).getStringCellValue().trim(), DateUtils.PATTERN_YMD));
+                }
+                record.setCheckPeriod(Double.valueOf(row.getCell(11).getStringCellValue()).intValue());
+                if(StringUtils.isBlank(row.getCell(12).getStringCellValue())){
+                    record.setCheckDate(null);
+                }else{
+                    record.setNextCheckDate(DateUtils.strToLocalDate(row.getCell(12).getStringCellValue().trim(), DateUtils.PATTERN_YMD));
+                }
+                record.setProducerId(row.getCell(13).getStringCellValue().trim());
+                record.setDph(row.getCell(14).getStringCellValue().trim());
+                record.setZaiz(row.getCell(15).getStringCellValue().trim());
+                record.setRlType(getRlType(row.getCell(16).getStringCellValue()));
+                record.setColor(row.getCell(17).getStringCellValue().trim().equals("是")?1:0);
+                record.setSbdh(row.getCell(18).getStringCellValue().trim());
+                record.setZbh(row.getCell(19).getStringCellValue().trim());
+                record.setRemark(row.getCell(20).getStringCellValue().trim());
+                record.setSeatNumber(Double.valueOf(row.getCell(21).getStringCellValue()).intValue());
+                record.setIsFinancing(row.getCell(22).getStringCellValue().trim().equals("是")?1:0);
+                record.setFinancingNo(row.getCell(23).getStringCellValue().trim());
+                record.setNo(row.getCell(24).getStringCellValue().trim());
             } catch (Exception e) {
                 error.append(index).append(",");
             }
@@ -1043,30 +1055,38 @@ public class CustomExcelImportUtil {
             String index = row.getCell(0).getStringCellValue() + "";
             try {
                 //i,j i:行 j:列
-                record.setId(row.getCell(0).getStringCellValue().trim());
                 record.setCardNo(row.getCell(1).getStringCellValue().trim());
-                record.setNo(row.getCell(2).getStringCellValue().trim());
-                record.setName(row.getCell(3).getStringCellValue().trim().replace("'", ""));
-                record.setZz(getCellValue(row.getCell(4)));
-                record.setModel(getCellValue(row.getCell(5)).trim());
-                record.setFdjxh(row.getCell(6).getStringCellValue().trim());
-                record.setUseDept(row.getCell(7).getStringCellValue().trim());
-                record.setCph(row.getCell(8).getStringCellValue().trim());
-                record.setCheckDate(DateUtils.strToLocalDate(row.getCell(9).getStringCellValue().trim(), DateUtils.PATTERN_YMD));
-                record.setCheckPeriod(Double.valueOf(row.getCell(10).getStringCellValue()).intValue());
-                record.setNextCheckDate(DateUtils.strToLocalDate(row.getCell(11).getStringCellValue().trim(), DateUtils.PATTERN_YMD));
-                record.setProducerId(row.getCell(12).getStringCellValue().trim());
-                record.setDph(row.getCell(13).getStringCellValue().trim());
-                record.setZaiz(row.getCell(14).getStringCellValue().trim());
-                record.setRlType(getRlType(row.getCell(15).getStringCellValue()));
-                record.setColor(row.getCell(16).getStringCellValue().trim().equals("是")?1:0);
-                record.setSbdh(row.getCell(17).getStringCellValue().trim());
-                record.setRemark(row.getCell(18).getStringCellValue().trim());
-                record.setSeatNumber(Double.valueOf(row.getCell(19).getStringCellValue()).intValue());
-                record.setIsFinancing(row.getCell(20).getStringCellValue().trim().equals("是")?1:0);
-                record.setFinancingNo(row.getCell(21).getStringCellValue().trim());
-                record.setStatus(getSbMeasureInfoStatus(row.getCell(22).getStringCellValue()));
-
+                record.setName(row.getCell(2).getStringCellValue().trim().replace("'", ""));
+                record.setZzh(row.getCell(3).getStringCellValue().trim().replace("'", ""));
+                record.setModel(getCellValue(row.getCell(4)).trim());
+                record.setZz(getCellValue(row.getCell(5)));
+                record.setUseDept(row.getCell(6).getStringCellValue().trim());
+                record.setCph(row.getCell(7).getStringCellValue().trim());
+                record.setFdjxh(row.getCell(8).getStringCellValue().trim());
+                record.setStatus(getSbMeasureInfoStatus(row.getCell(9).getStringCellValue()));
+                if(StringUtils.isBlank(row.getCell(10).getStringCellValue())){
+                    record.setCheckDate(null);
+                }else{
+                    record.setCheckDate(DateUtils.strToLocalDate(row.getCell(10).getStringCellValue().trim(), DateUtils.PATTERN_YMD));
+                }
+                record.setCheckPeriod(Double.valueOf(row.getCell(11).getStringCellValue()).intValue());
+                if(StringUtils.isBlank(row.getCell(12).getStringCellValue())){
+                    record.setCheckDate(null);
+                }else{
+                    record.setNextCheckDate(DateUtils.strToLocalDate(row.getCell(12).getStringCellValue().trim(), DateUtils.PATTERN_YMD));
+                }
+                record.setProducerId(row.getCell(13).getStringCellValue().trim());
+                record.setDph(row.getCell(14).getStringCellValue().trim());
+                record.setZaiz(row.getCell(15).getStringCellValue().trim());
+                record.setRlType(getRlType(row.getCell(16).getStringCellValue()));
+                record.setColor(row.getCell(17).getStringCellValue().trim().equals("是")?1:0);
+                record.setSbdh(row.getCell(18).getStringCellValue().trim());
+                record.setZbh(row.getCell(19).getStringCellValue().trim());
+                record.setRemark(row.getCell(20).getStringCellValue().trim());
+                record.setSeatNumber(Double.valueOf(row.getCell(21).getStringCellValue()).intValue());
+                record.setIsFinancing(row.getCell(22).getStringCellValue().trim().equals("是")?1:0);
+                record.setFinancingNo(row.getCell(23).getStringCellValue().trim());
+                record.setNo(row.getCell(24).getStringCellValue().trim());
             } catch (Exception e) {
                 error.append(index).append(",");
             }

+ 39 - 29
platform-dao/src/main/java/com/platform/dao/vo/export/sb/ExportSbInfoMeasureVO.java

@@ -27,110 +27,120 @@ public class ExportSbInfoMeasureVO implements Serializable {
      */
     @Excel(name = "测量设备编号", orderNum = "2")
     private String cardNo;
-    /**
-     * 设备新号设备新号
-     */
-    @Excel(name = "设备新号", orderNum = "3")
-    private String no;
     /**
      * 测量设备名称
      */
-    @Excel(name = "测量设备名称", orderNum = "4")
+    @Excel(name = "测量设备名称", orderNum = "3")
     private String name;
     /**
      * 出厂编号
      */
-    @Excel(name = "出厂编号", orderNum = "5")
+    @Excel(name = "出厂编号", orderNum = "4")
     private String zzh;
     /**
      * 规格型号
      */
-    @Excel(name = "规格型号", orderNum = "6")
+    @Excel(name = "规格型号", orderNum = "5")
     private String model;
     /**
      * 准确度等级
      */
-    @Excel(name = "准确度等级", orderNum = "7")
-    private String fdjxh;
+    @Excel(name = "要求准确度等级", orderNum = "6")
+    private String zz;
     /**
      * 使用部门
      */
-    @Excel(name = "使用部门", orderNum = "8")
+    @Excel(name = "使用部门", orderNum = "7")
     private String useDept;
     /**
      * 使用地点
      */
-    @Excel(name = "使用地点", orderNum = "9")
+    @Excel(name = "使用地点", orderNum = "8")
     private String cph;
+    /**
+     * 准确度等级
+     */
+    @Excel(name = "准确度等级", orderNum = "9")
+    private String fdjxh;
+    /**
+     * 管理状态
+     */
+    @Excel(name = "管理状态", orderNum = "10", dicCode="SB_MEASURE_STATUS")
+    private String status;
     /**
      * 检定日期
      */
-    @Excel(name = "检定日期", orderNum = "10")
+    @Excel(name = "检定日期", orderNum = "11")
     private LocalDate checkDate;
     /**
      * 检定周期
      */
-    @Excel(name = "检定周期", orderNum = "11")
+    @Excel(name = "检定周期", orderNum = "12")
     private Integer checkPeriod;
     /**
      * 有效日期
      */
-    @Excel(name = "有效日期", orderNum = "12")
+    @Excel(name = "有效日期", orderNum = "13")
     private LocalDate nextCheckDate;
     /**
      * 生产商
      */
-    @Excel(name = "生产商", orderNum = "13")
+    @Excel(name = "生产厂商", orderNum = "14")
     private String producerId;
     /**
      * 检定单位
      */
-    @Excel(name = "检定单位", orderNum = "14")
+    @Excel(name = "检定单位", orderNum = "15")
     private String dph;
     /**
      * 检定人
      */
-    @Excel(name = "检定人", orderNum = "15")
+    @Excel(name = "检定人", orderNum = "16")
     private String zaiz;
     /**
      * 检定结论
      */
-    @Excel(name = "检定结论", orderNum = "16", dicCode="SB_MEASURE_RESULT")
+    @Excel(name = "检定结论", orderNum = "17", dicCode="SB_MEASURE_RESULT")
     private String rlType;
     /**
      * 是否周检
      */
-    @Excel(name = "是否周检", orderNum = "17")
+    @Excel(name = "是否周检", orderNum = "18")
     private String color;
     /**
      * 检定证书编号
      */
-    @Excel(name = "检定证书编号", orderNum = "18")
+    @Excel(name = "检定证书编号", orderNum = "19")
     private String sbdh;
     /**
      * 备注
      */
-    @Excel(name = "备注", orderNum = "19")
+    @Excel(name = "检定校准记录", orderNum = "20")
+    private String zbh;
+    /**
+     * 备注
+     */
+    @Excel(name = "备注", orderNum = "21")
     private String remark;
     /**
      * 预警天数
      */
-    @Excel(name = "预警天数", orderNum = "20")
+    @Excel(name = "预警天数", orderNum = "22")
     private String seatNumber;
     /**
      * 是否固定资产
      */
-    @Excel(name = "是否固定资产", orderNum = "21")
+    @Excel(name = "是否固定资产", orderNum = "23")
     private String isFinancing;
     /**
      * 固定资产编号
      */
-    @Excel(name = "固定资产编号", orderNum = "22")
+    @Excel(name = "固定资产编号", orderNum = "24")
     private String financingNo;
+
     /**
-     * 管理状态
+     * 设备新号设备新号
      */
-    @Excel(name = "管理状态", orderNum = "23", dicCode="SB_MEASURE_STATUS")
-    private String status;
-
+    @Excel(name = "设备新号", orderNum = "25")
+    private String no;
 }

+ 18 - 313
platform-dao/src/main/resources/mapper/sb/SbInfoMeasureMapper.xml

@@ -151,8 +151,6 @@ sb.param_list,
         sb.level,
         sb.unit,
         sb.use_type as useType,
-        sbType.name as typeName,producer.name as producerName,
-        position.name as positionName,
         sb.check_date,
         sb.check_period,
         sb.register_no,
@@ -172,8 +170,7 @@ sb.apply_time,
                                      sb.remark,
                                      sb.apply_comment,
 sb.scrap_user_id,
-sb.scrap_user_name,
-user.real_name as saveUserName
+sb.scrap_user_name
     </sql>
 
     <sql id="deptSql">
@@ -187,18 +184,19 @@ user.real_name as saveUserName
         select
         <include refid="Left_Column"/>
         from t_sb_info_measure sb
-        left join t_sb_type sbType on sb.type_id = sbType.id
-        left join t_firm_producer producer on sb.producer_id = producer.id
-        left join t_sb_position position on sb.position_id = position.id
-        left join t_sys_user user on sb.save_user = user.user_id
-        left join t_sys_dept sdDept on sb.save_dept = sdDept.dept_id
         where
         1 = 1
         <if test="keyword != null and keyword != ''">
-            and sb.name like concat('%',#{keyword},'%')
+            and (
+            sb.name like concat('%',#{keyword},'%')
+            or
+            sb.no like concat('%',#{keyword},'%')
+            or
+            sb.card_no like concat('%',#{keyword},'%')
+            )
         </if>
         <if test="cardNo != null and cardNo!=''">
-            and sb.cardNo like concat('%',#{cardNo},'%')
+            and sb.card_no like concat('%',#{cardNo},'%')
         </if>
         <if test="no != null and no!=''">
             and sb.no like concat('%',#{no},'%')
@@ -206,29 +204,11 @@ user.real_name as saveUserName
         <if test="zbh != null and zbh!=''">
             and sb.zbh like concat('%',#{zbh},'%')
         </if>
-        <if test="likeDeptCode != null and likeDeptCode!=''">
-            and sdDept.dept_code like concat(#{likeDeptCode},'%')
-        </if>
         <if test="financingNo != null and financingNo!=''">
             and sb.financing_no like concat(#{financingNo},'%')
         </if>
-        <if test="positionIds != null">
-            AND sb.position_id in
-            <foreach item="item" index="index" collection="positionIds" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="useType != null">
-            and sb.use_type = #{useType}
-        </if>
-        <if test="id != null">
-            and sb.id = #{id}
-        </if>
-        <if test="checkId != null">
-            and sb.check_id = #{checkId}
-        </if>
-        <if test="isChild != null">
-            and sb.is_child = #{isChild}
+        <if test="zzh != null">
+            and sb.zzh = #{zzh}
         </if>
         <if test="isShow != null">
             and sb.is_show = #{isShow}
@@ -236,36 +216,13 @@ user.real_name as saveUserName
         <if test="isFinancing != null">
             and sb.is_financing = #{isFinancing}
         </if>
-        <if test="useArea != null">
-            and sb.use_area = #{useArea}
-        </if>
-        <if test="useCompany != null">
-            and sb.use_company = #{useCompany}
-        </if>
-        <if test="useProject != null">
-            and sb.use_project = #{useProject}
-        </if>
-        <if test="typeId != null">
-            and sb.type_id = #{typeId}
-        </if>
-        <if test="parentId != null">
-            and sb.parent_id = #{parentId}
-        </if>
+
         <if test="model != null">
             and sb.model like concat('%',#{model},'%')
         </if>
         <if test="useDept != null">
             and sb.use_dept = #{useDept}
         </if>
-        <if test="useGroup != null">
-            and sb.use_group = #{useGroup}
-        </if>
-        <if test="saveDept != null">
-            and sb.save_dept = #{saveDept}
-        </if>
-        <if test="saveUser != null">
-            and sb.save_user = #{saveUser}
-        </if>
         <if test="nextCheckDateStart != null">
             and sb.next_check_date <![CDATA[ >= ]]> #{nextCheckDateStart}
         </if>
@@ -314,120 +271,11 @@ user.real_name as saveUserName
         </if>
     </select>
 
-    <select id="selectVOListStandard" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
-            resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
-        SELECT
-        sb.id,
-        sb.no,
-        sbType.name as typeName,
-        sb.NAME,
-        sb.zbh,
-        sb.status,
-        sb.use_type,
-        sb.type_id,
-        count( standard.id ) as standardNum
-        FROM
-        t_sb_info_measure sb
-        LEFT JOIN t_check_standard standard ON sb.id = standard.sb_id
-        left join t_sb_type sbType on sb.type_id = sbType.id
-        where
-        1 = 1
-        <if test="keyword != null and keyword != ''">
-            and (
-            sb.name like concat('%',#{keyword},'%')
-            or
-            sb.no like concat('%',#{keyword},'%')
-            )
-        </if>
-        <if test="zbh != null and zbh!=''">
-            and sb.zbh like concat('%',#{zbh},'%')
-        </if>
-        <if test="useType != null">
-            and sb.use_type = #{useType}
-        </if>
-        <if test="id != null">
-            and sb.id = #{id}
-        </if>
-        <if test="checkId != null">
-            and sb.check_id = #{checkId}
-        </if>
-        <if test="isChild != null">
-            and sb.is_child = #{isChild}
-        </if>
-        <if test="isFinancing != null">
-            and sb.is_financing = #{isFinancing}
-        </if>
-        <if test="isShow != null">
-            and sb.is_show = #{isShow}
-        </if>
-        <if test="useArea != null">
-            and sb.use_area = #{useArea}
-        </if>
-        <if test="useCompany != null">
-            and sb.use_company = #{useCompany}
-        </if>
-        <if test="useProject != null">
-            and sb.use_project = #{useProject}
-        </if>
-        <if test="typeId != null">
-            and sb.type_id = #{typeId}
-        </if>
-        <if test="parentId != null">
-            and sb.parent_id = #{parentId}
-        </if>
-        <if test="model != null">
-            and sb.model like concat('%',#{model},'%')
-        </if>
-        <if test="useDept != null">
-            and sb.use_dept = #{useDept}
-        </if>
-        <if test="useGroup != null">
-            and sb.use_group = #{useGroup}
-        </if>
-        <if test="saveDept != null">
-            and sb.save_dept = #{saveDept}
-        </if>
-        <if test="saveUser != null">
-            and sb.save_user = #{saveUser}
-        </if>
-        <if test="nextCheckDateStart != null">
-            and sb.next_check_date <![CDATA[ >= ]]> #{nextCheckDateStart}
-        </if>
-        <if test="nextCheckDateEnd != null">
-            and sb.next_check_date <![CDATA[ <= ]]> #{nextCheckDateEnd}
-        </if>
-        <if test="status != null">
-            and sb.status = #{status}
-        </if>
-        <if test="modelId != null">
-            and sb.model_id = #{modelId}
-        </if>
-        group by sb.id
-    </select>
-
-    <select id="selectScreenDetailVOList"
-            parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
-            resultType="com.platform.dao.vo.sb.SbInfoScreenDetailVO">
-        select
-        sb.id, sb.no, sb.zjm, sb.jbdh, sb.level
-        from t_sb_info_measure sb
-        <where>
-            sb.zjm is not null
-            and sb.jbdh is not null
-            and is_show = true
-        </where>
-    </select>
-
     <select id="selectPageInfoForWarn" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
             resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
         select
         <include refid="Left_Column"/>
         from t_sb_info_measure sb
-        left join t_sb_type sbType on sb.type_id = sbType.id
-        left join t_firm_producer producer on sb.producer_id = producer.id
-        left join t_sb_position position on sb.position_id = position.id
-        left join t_sys_user user on sb.save_user = user.user_id
-        left join t_sys_dept sdDept on sb.save_dept = sdDept.dept_id
         where
         TIMESTAMPDIFF( DAY, CURDATE( ), sb.next_check_date ) <![CDATA[ <= ]]> sb.seat_number
         <if test="keyword != null and keyword != ''">
@@ -435,49 +283,21 @@ user.real_name as saveUserName
             sb.name like concat('%',#{keyword},'%')
             or
             sb.no like concat('%',#{keyword},'%')
+            or
+            sb.card_no like concat('%',#{keyword},'%')
             )
         </if>
-        <if test="likeDeptCode != null and likeDeptCode!=''">
-            and sdDept.dept_code like concat(#{likeDeptCode},'%')
-        </if>
-        <if test="financingNo != null and financingNo!=''">
-            and sb.financing_no like concat(#{financingNo},'%')
-        </if>
-        <if test="positionIds != null">
-            AND sb.position_id in
-            <foreach item="item" index="index" collection="positionIds" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="useType != null">
-            and sb.use_type = #{useType}
-        </if>
-        <if test="id != null">
-            and sb.id = #{id}
-        </if>
-        <if test="checkId != null">
-            and sb.check_id = #{checkId}
-        </if>
-        <if test="isChild != null">
-            and sb.is_child = #{isChild}
+        <if test="zzh != null">
+            and sb.zzh = #{zzh}
         </if>
         <if test="isFinancing != null">
             and sb.is_financing = #{isFinancing}
         </if>
-        <if test="isShow != null">
-            and sb.is_show = #{isShow}
-        </if>
-        <if test="useArea != null">
-            and sb.use_area = #{useArea}
-        </if>
-        <if test="useCompany != null">
-            and sb.use_company = #{useCompany}
-        </if>
         <if test="useProject != null">
             and sb.use_project = #{useProject}
         </if>
-        <if test="typeId != null">
-            and sb.type_id = #{typeId}
+        <if test="zzh != null">
+            and sb.zzh = #{zzh}
         </if>
         <if test="model != null">
             and sb.model like concat('%',#{model},'%')
@@ -485,21 +305,12 @@ user.real_name as saveUserName
         <if test="useDept != null">
             and sb.use_dept = #{useDept}
         </if>
-        <if test="useGroup != null">
-            and sb.use_group = #{useGroup}
-        </if>
         <if test="nextCheckDateStart != null">
             and sb.next_check_date <![CDATA[ >= ]]> #{nextCheckDateStart}
         </if>
         <if test="nextCheckDateEnd != null">
             and sb.next_check_date <![CDATA[ <= ]]> #{nextCheckDateEnd}
         </if>
-        <if test="saveDept != null">
-            and sb.save_dept = #{saveDept}
-        </if>
-        <if test="saveUser != null">
-            and sb.save_user = #{saveUser}
-        </if>
         <if test="status != null">
             and sb.status = #{status}
         </if>
@@ -518,35 +329,18 @@ user.real_name as saveUserName
                 #{item}
             </foreach>
         </if>
-        <if test="sbIds != null and sbIds.size > 0">
-            AND sb.id in
-            <foreach item="item" index="index" collection="sbIds" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="ascriptionDept != null and ascriptionDept">
-            <include refid="deptSql"/>
-        </if>
     </select>
 
     <select id="getById" parameterType="java.lang.Object" resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
         select
         <include refid="Left_Column"/>
         from t_sb_info_measure sb
-        left join t_sb_type sbType on sb.type_id = sbType.id
-        left join t_firm_producer producer on sb.producer_id = producer.id
-        left join t_sb_position position on sb.position_id = position.id
-        left join t_sys_user user on sb.save_user = user.user_id
         where sb.id = #{value}
     </select>
     <select id="getByNo" parameterType="java.lang.Object" resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
         select
         <include refid="Left_Column"/>
         from t_sb_info_measure sb
-        left join t_sb_type sbType on sb.type_id = sbType.id
-        left join t_firm_producer producer on sb.producer_id = producer.id
-        left join t_sb_position position on sb.position_id = position.id
-        left join t_sys_user user on sb.save_user = user.user_id
         where sb.no = #{value}
     </select>
 
@@ -618,93 +412,4 @@ user.real_name as saveUserName
             where id = #{item.id}
         </foreach>
     </update>
-
-    <update id="updateStatusByIds" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO">
-        update t_sb_info_measure
-        <set>
-            status=${status}, update_time=#{updateTime,jdbcType=TIMESTAMP}
-        </set>
-        where
-        id in
-        <foreach item="item" index="index" collection="sbIds" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </update>
-
-    <update id="updateTotalById" parameterType="java.util.List">
-        <foreach collection="sbInfos" item="item" index="index" open="" close="" separator=";">
-            update t_sb_info_measure
-            <set>
-                <if test="item.totalHours != null">
-                    total_hours= total_hours+#{item.totalHours},
-                </if>
-                <if test="item.totalMiles != null">
-                    total_miles=total_miles+#{item.totalMiles},
-                </if>
-            </set>
-            where id = #{item.id}
-        </foreach>
-    </update>
-
-    <update id="updateBySbIds" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO">
-        update t_sb_info_measure
-        <set>
-            <if test="useArea != null">
-                use_area = #{useArea},
-            </if>
-            <if test="useCompany != null">
-                use_company = #{useCompany},
-            </if>
-            <if test="useCompanyName != null">
-                use_company_name = #{useCompanyName},
-            </if>
-            <if test="useProject != null">
-                use_project = #{useProject},
-            </if>
-            <if test="useProjectName != null">
-                use_project_name = #{useProjectName},
-            </if>
-            <if test="useDept != null">
-                use_dept = #{useDept},
-            </if>
-            <if test="useDeptName != null">
-                use_dept_name = #{useDeptName},
-            </if>
-            <if test="useGroup != null">
-                use_group = #{useGroup},
-            </if>
-            <if test="useGroupName != null">
-                use_group_name = #{useGroupName},
-            </if>
-            <if test="saveDept != null">
-                save_dept = #{saveDept},
-            </if>
-            <if test="saveDeptName != null">
-                save_dept_name = #{saveDeptName},
-            </if>
-            <if test="saveUser != null">
-                save_user = #{saveUser},
-            </if>
-            <if test="status != null">
-                status = #{status},
-            </if>
-            <if test="updateTime != null">
-                update_time=#{updateTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="updateUserId != null">
-                update_user_id = #{updateUserId},
-            </if>
-            <if test="updateUserName != null">
-                update_user_name = #{updateUserName},
-            </if>
-            <if test="saveUserNull != null and saveUserNull">
-                save_user = null,
-            </if>
-        </set>
-        where
-        id in
-        <foreach item="item" index="index" collection="sbIds" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </update>
 </mapper>

+ 21 - 32
platform-rest/src/main/java/com/platform/rest/controller/sb/SbInfoMeasureController.java

@@ -32,7 +32,7 @@ import java.util.Arrays;
 import java.util.List;
 
 /**
- * @Description 设备基础信息 控制器
+ * @Description 计量设备基础信息 控制器
  * @Author liuyu
  * @Date 2020-04-21 21:05:46
  * @Version Copyright (c) 2019,北京乾元坤和科技有限公司 All rights reserved.
@@ -69,10 +69,10 @@ public class SbInfoMeasureController {
     /**
      * 新增记录
      *
-     * @param sbInfoDTO 设备基础信息DTO
+     * @param sbInfoDTO 计量设备基础信息DTO
      * @return R
      */
-    @SysLog("新增设备基础信息")
+    @SysLog("新增计量设备基础信息")
     @PostMapping
     @PreAuthorize("@pms.hasPermission('sb-infos-add')")
     public R save(@Validated({AddGroup.class}) @RequestBody SbInfoMeasureDTO sbInfoDTO) {
@@ -82,10 +82,10 @@ public class SbInfoMeasureController {
     /**
      * 新增记录
      *
-     * @param sbInfoDTO 设备基础信息DTO
+     * @param sbInfoDTO 计量设备基础信息DTO
      * @return R
      */
-    @SysLog("复制设备基础信息")
+    @SysLog("复制计量设备基础信息")
     @PostMapping("/copy")
     @PreAuthorize("@pms.hasPermission('sb-infos-add')")
     public R copy(@Validated({AddGroup.class}) @RequestBody SbInfoMeasureDTO sbInfoDTO) {
@@ -95,10 +95,10 @@ public class SbInfoMeasureController {
     /**
      * 修改记录
      *
-     * @param sbInfoDTO 设备基础信息DTO
+     * @param sbInfoDTO 计量设备基础信息DTO
      * @return R
      */
-    @SysLog("修改设备基础信息")
+    @SysLog("修改计量设备基础信息")
     @PutMapping("/{id}")
     @PreAuthorize("@pms.hasPermission('sb-infos-edit')")
     public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody SbInfoMeasureDTO sbInfoDTO) {
@@ -107,12 +107,12 @@ public class SbInfoMeasureController {
     }
 
     /**
-     * 更新设备状态:位置等其他信息
+     * 更新计量设备状态:位置等其他信息
      *
-     * @param sbInfoDTO 设备基础信息DTO
+     * @param sbInfoDTO 计量设备基础信息DTO
      * @return R
      */
-    @SysLog("修改设备状态基础信息")
+    @SysLog("修改计量设备状态基础信息")
     @PutMapping("/status/{id}")
     @PreAuthorize("@pms.hasPermission('sb-infos-edit')")
     public R updateStatus(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody SbInfoMeasureDTO sbInfoDTO) {
@@ -126,7 +126,7 @@ public class SbInfoMeasureController {
      * @param id 主键
      * @return R
      */
-    @SysLog("删除设备基础信息")
+    @SysLog("删除计量设备基础信息")
     @DeleteMapping("/{id}")
     @PreAuthorize("@pms.hasPermission('sb-infos-del')")
     public R removeById(@PathVariable String id) {
@@ -140,7 +140,7 @@ public class SbInfoMeasureController {
      * @param ids 主键
      * @return R
      */
-    @SysLog("批量删除设备基础信息")
+    @SysLog("批量删除计量设备基础信息")
     @DeleteMapping("")
     @PreAuthorize("@pms.hasPermission('sb-infos-del')")
     public R removeIds(@RequestBody List<String> ids) {
@@ -153,7 +153,7 @@ public class SbInfoMeasureController {
      *
      * @param pageNum   当前页码
      * @param pageSize  每页条数
-     * @param sbInfoDTO 设备基础信息DTO
+     * @param sbInfoDTO 计量设备基础信息DTO
      * @return R
      */
     @GetMapping("/page")
@@ -166,7 +166,7 @@ public class SbInfoMeasureController {
      *
      * @param pageNum   当前页码
      * @param pageSize  每页条数
-     * @param sbInfoDTO 设备基础信息DTO
+     * @param sbInfoDTO 计量设备基础信息DTO
      * @return R
      */
     @GetMapping("warn/page")
@@ -177,7 +177,7 @@ public class SbInfoMeasureController {
     /**
      * 获取列表
      *
-     * @param sbInfoDTO 设备基础信息DTO
+     * @param sbInfoDTO 计量设备基础信息DTO
      * @return R
      */
     @GetMapping("")
@@ -186,13 +186,13 @@ public class SbInfoMeasureController {
     }
 
     /**
-     * 设备基础信息导出
+     * 计量设备基础信息导出
      *
-     * @param sbInfoDTO 设备基础信息DTO
+     * @param sbInfoDTO 计量设备基础信息DTO
      * @return R
      */
     @GetMapping("/export")
-    @SysLog("设备基础信息导出")
+    @SysLog("计量设备基础信息导出")
     @PreAuthorize("@pms.hasPermission('sb-infos-export')")
     public void export(HttpServletResponse response, SbInfoMeasureDTO sbInfoDTO) {
         List<SbInfoMeasureVO> list = sbInfoService.selectExportVOList(sbInfoDTO);
@@ -213,11 +213,11 @@ public class SbInfoMeasureController {
                 }
             }
         }
-        ExcelUtil.exportResponseDict(response, ExportSbInfoMeasureVO.class, sbInfoMeasureVOS, "计量设备基础信息");
+        ExcelUtil.exportResponseDict(response, ExportSbInfoMeasureVO.class, sbInfoMeasureVOS, "计量计量设备基础信息");
     }
 
     /**
-     * 导入设备:
+     * 导入计量设备:
      * 新增导入,且对应的供应商、类型、等级等都已经在数据库添加好了
      * 主要用途:初始化导入的时候数据比较多,需要用户批量导入
      *
@@ -225,7 +225,7 @@ public class SbInfoMeasureController {
      *
      * @return R
      */
-    @SysLog("新增导入设备")
+    @SysLog("新增导入计量设备")
     @PostMapping("/import")
     public R importExcel(@RequestParam("type") Integer type, @RequestParam("file") MultipartFile file) throws Exception {
         String result = "";
@@ -237,15 +237,4 @@ public class SbInfoMeasureController {
         return new R<>(result);
     }
 
-    /**
-     * 子设备数量
-     *
-     * @param sbInfoDTO
-     * @return R
-     */
-    @GetMapping("/child/num")
-    public R getNum(SbInfoMeasureDTO sbInfoDTO) {
-        return new R<>(sbInfoService.getCountByDTO(sbInfoDTO));
-    }
-
 }

+ 0 - 1
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoMeasureServiceImpl.java

@@ -469,7 +469,6 @@ public class SbInfoMeasureServiceImpl extends BaseServiceImpl<SbInfoMeasureMappe
     @Override
     public AbstractPageResultBean<SbInfoMeasureVO> selectPageInfoForWarn(SbInfoMeasureDTO record, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
-        record.setUseType(SbUseType.BGCL.getValue());
         AbstractPageResultBean<SbInfoMeasureVO> pageInfo = new MyPage(mapper.selectPageInfoForWarn(record));
         return pageInfo;
     }