Browse Source

用友接口

hfxc226 2 years ago
parent
commit
11a62504b2
18 changed files with 288 additions and 272 deletions
  1. 1 1
      platform-dao/src/main/java/com/platform/dao/dto/remote/RemoteDegreeDTO.java
  2. 1 1
      platform-dao/src/main/java/com/platform/dao/dto/remote/RemoteDegreeLogDTO.java
  3. 1 1
      platform-dao/src/main/java/com/platform/dao/dto/remote/RemoteMeasureDTO.java
  4. 1 1
      platform-dao/src/main/java/com/platform/dao/entity/remote/RemoteDegree.java
  5. 1 1
      platform-dao/src/main/java/com/platform/dao/entity/remote/RemoteDegreeLog.java
  6. 1 1
      platform-dao/src/main/java/com/platform/dao/entity/remote/RemoteMeasure.java
  7. 8 35
      platform-dao/src/main/java/com/platform/dao/util/CustomExcelImportUtil.java
  8. 1 1
      platform-dao/src/main/java/com/platform/dao/vo/export/remote/ExportRemoteDegreeLogVO.java
  9. 1 1
      platform-dao/src/main/java/com/platform/dao/vo/export/remote/ExportRemoteDegreeVO.java
  10. 1 1
      platform-dao/src/main/java/com/platform/dao/vo/export/remote/ExportRemoteMeasureVO.java
  11. 29 29
      platform-dao/src/main/java/com/platform/dao/vo/query/remote/RemoteDegreeLogVO.java
  12. 1 1
      platform-dao/src/main/java/com/platform/dao/vo/query/remote/RemoteDegreeVO.java
  13. 1 1
      platform-dao/src/main/java/com/platform/dao/vo/query/remote/RemoteMeasureVO.java
  14. 68 65
      platform-dao/src/main/resources/mapper/remote/RemoteDegreeLogMapper.xml
  15. 72 65
      platform-dao/src/main/resources/mapper/remote/RemoteDegreeMapper.xml
  16. 72 65
      platform-dao/src/main/resources/mapper/remote/RemoteMeasureMapper.xml
  17. 14 1
      platform-service/src/main/java/com/platform/service/remote/impl/RemoteDegreeServiceImpl.java
  18. 14 1
      platform-service/src/main/java/com/platform/service/remote/impl/RemoteMeasureServiceImpl.java

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/dto/remote/RemoteDegreeDTO.java

@@ -47,7 +47,7 @@ public class RemoteDegreeDTO extends BaseDTO implements Serializable {
     /**
      * 描述
      */
-    private String desc;
+    private String description;
     /**
      * 实时数值
      */

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/dto/remote/RemoteDegreeLogDTO.java

@@ -46,7 +46,7 @@ public class RemoteDegreeLogDTO extends BaseDTO implements Serializable {
           /**
      * 描述
      */
-          private String desc;
+          private String description;
           /**
      * 实时数值
      */

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/dto/remote/RemoteMeasureDTO.java

@@ -46,7 +46,7 @@ public class RemoteMeasureDTO extends BaseDTO implements Serializable {
           /**
      * 描述
      */
-          private String desc;
+          private String description;
           /**
      * 实时数值
      */

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/entity/remote/RemoteDegree.java

@@ -47,7 +47,7 @@ public class RemoteDegree implements Serializable{
     /**
      * 描述
      */
-    private String desc;
+    private String description;
     /**
      * 实时数值
      */

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/entity/remote/RemoteDegreeLog.java

@@ -47,7 +47,7 @@ public class RemoteDegreeLog implements Serializable{
     /**
      * 描述
      */
-    private String desc;
+    private String description;
     /**
      * 实时数值
      */

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/entity/remote/RemoteMeasure.java

@@ -47,7 +47,7 @@ public class RemoteMeasure implements Serializable{
     /**
      * 描述
      */
-    private String desc;
+    private String description;
     /**
      * 实时数值
      */

+ 8 - 35
platform-dao/src/main/java/com/platform/dao/util/CustomExcelImportUtil.java

@@ -466,14 +466,14 @@ public class CustomExcelImportUtil {
     }
 
     public static void main(String[] args) throws IOException, InvalidFormatException {
-        String[] files = {"E:\\项目\\龙岩思康\\设备管理\\信息表-时代思康电量数据上送项目-电度.xlsx"};
+        String[] files = {"E:\\项目\\龙岩思康\\设备管理\\信息表-时代思康电量数据上送项目-遥测.xlsx"};
         DateUtils.strToLocalDate("2022-09-23", DateUtils.PATTERN_YMD);
         for(String fileStr:files){
             System.out.println(fileStr);
             InputStream inputstream = new FileInputStream(fileStr);
             LocalDateTime now = LocalDateTime.now();
             //List<SbInfoVO> list = importSbInfoList(inputstream);
-            List<RemoteDegree> list = importRemoteDegreeList(inputstream, null);
+            List<RemoteMeasure> list = importRemoteMeasureList(inputstream);
             list.forEach(item -> {
                 System.out.println(item.toString());
             });
@@ -961,12 +961,11 @@ public class CustomExcelImportUtil {
     /**
      * 导入电度对应表
      * @param inputstream
-     * @param sysDictList
      * @return
      * @throws IOException
      * @throws InvalidFormatException
      */
-    public static List<RemoteDegree> importRemoteDegreeList(InputStream inputstream, List<SysDict> sysDictList) throws IOException, InvalidFormatException {
+    public static List<RemoteDegree> importRemoteDegreeList(InputStream inputstream) throws IOException, InvalidFormatException {
         if (inputstream == null) {
             return Collections.emptyList();
         }
@@ -999,20 +998,7 @@ public class CustomExcelImportUtil {
                 record.setPositionNum(Integer.valueOf(getCellValue(row.getCell(0))));
                 record.setSbName(getCellValue(row.getCell(1)));
                 String desc = getCellValue(row.getCell(2)).trim();
-                record.setDesc(desc);
-                if(StringUtils.isNotEmpty(desc)){
-                    boolean find = false;
-                    for(SysDict sysDict: sysDictList){
-                        if(sysDict.getLabel().equals(desc)){
-                            record.setType(Integer.valueOf(sysDict.getValue()));
-                            find = true;
-                            break;
-                        }
-                    }
-                    if(!find){
-                        throw new BusinessException("点位类型未配置,请配置电度数据字典:" + desc );
-                    }
-                }
+                record.setDescription(desc);
                 record.setUnit(getCellValue(row.getCell(3)).trim());
             } catch (Exception e) {
                 e.printStackTrace();
@@ -1031,12 +1017,11 @@ public class CustomExcelImportUtil {
     /**
      * 导入遥测对应表-新增
      * @param inputstream
-     * @param sysDictList
      * @return
      * @throws IOException
      * @throws InvalidFormatException
      */
-    public static List<RemoteMeasure> importRemoteMeasureList(InputStream inputstream, List<SysDict> sysDictList) throws IOException, InvalidFormatException {
+    public static List<RemoteMeasure> importRemoteMeasureList(InputStream inputstream) throws IOException, InvalidFormatException {
         if (inputstream == null) {
             return Collections.emptyList();
         }
@@ -1062,27 +1047,15 @@ public class CustomExcelImportUtil {
                 continue;
             }
 
-            String index = row.getCell(0).getStringCellValue() + "";
+            String index = getCellValue(row.getCell(0)) + "";
             try {
                 //i,j i:行 j:列
                 record.setId(IdGeneratorUtils.getObjectId());
                 record.setPositionNum(Integer.valueOf(getCellValue(row.getCell(0))));
                 record.setSbName(getCellValue(row.getCell(1)));
-                record.setDesc(StringUtils.getExcelString(row.getCell(2)));
+                record.setDescription(StringUtils.getExcelString(row.getCell(2)));
                 String type = getCellValue(row.getCell(3)).trim();
-                if(StringUtils.isNotEmpty(type)){
-                    boolean find = false;
-                    for(SysDict sysDict: sysDictList){
-                        if(sysDict.getLabel().equals(type)){
-                            record.setType(Integer.valueOf(sysDict.getValue()));
-                            find = true;
-                            break;
-                        }
-                    }
-                    if(!find){
-                        throw new BusinessException("点位类型未配置,请配置数据字典:" + type );
-                    }
-                }
+                record.setRemark(type);
                 record.setUnit(getCellValue(row.getCell(4)).trim());
             } catch (Exception e) {
                 e.printStackTrace();

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/vo/export/remote/ExportRemoteDegreeLogVO.java

@@ -52,7 +52,7 @@ public class ExportRemoteDegreeLogVO implements Serializable {
    * 描述
    */
           @Excel(name = "描述", orderNum = "6")
-      private String desc;
+      private String description;
     
     /**
    * 实时数值

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/vo/export/remote/ExportRemoteDegreeVO.java

@@ -52,7 +52,7 @@ public class ExportRemoteDegreeVO implements Serializable {
    * 描述
    */
           @Excel(name = "描述", orderNum = "6")
-      private String desc;
+      private String description;
     
     /**
    * 实时数值

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/vo/export/remote/ExportRemoteMeasureVO.java

@@ -52,7 +52,7 @@ public class ExportRemoteMeasureVO implements Serializable {
    * 描述
    */
           @Excel(name = "描述", orderNum = "6")
-      private String desc;
+      private String description;
     
     /**
    * 实时数值

+ 29 - 29
platform-dao/src/main/java/com/platform/dao/vo/query/remote/RemoteDegreeLogVO.java

@@ -6,6 +6,7 @@ import com.platform.common.bean.BaseDTO;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+
 import javax.validation.constraints.*;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -21,65 +22,64 @@ import java.math.BigDecimal;
 @Data
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
-public class RemoteDegreeLogVO extends BaseVO implements Serializable{
+public class RemoteDegreeLogVO extends BaseVO implements Serializable {
 
     /**
      * id
      */
-        private String id;
-        /**
+    private String id;
+    /**
      * 设备id
      */
-        private String sbId;
-        /**
+    private String sbId;
+    /**
      * 设备名称
      */
-        private String sbName;
-        /**
+    private String sbName;
+    /**
      * 点位
      */
-        private Integer positionNum;
-        /**
+    private Integer positionNum;
+    /**
      * 类型
      */
-        private Integer type;
-        /**
+    private Integer type;
+    /**
      * 描述
      */
-        private String desc;
-        /**
+    private String description;
+    /**
      * 实时数值
      */
-        private String result;
-        /**
+    private String result;
+    /**
      * 系数
      */
-        private BigDecimal ratio;
-        /**
+    private BigDecimal ratio;
+    /**
      * 单位
      */
-        private String unit;
-        /**
+    private String unit;
+    /**
      * 备注
      */
-        private String remark;
-        /**
+    private String remark;
+    /**
      * 创建人
      */
-        private String createdUserId;
-        /**
+    private String createdUserId;
+    /**
      * 更新人
      */
-        private String updateUserId;
-        /**
+    private String updateUserId;
+    /**
      * 创建日期
      */
-        private LocalDateTime createdTime;
-        /**
+    private LocalDateTime createdTime;
+    /**
      * 更新日期
      */
-        private LocalDateTime updateTime;
-    
+    private LocalDateTime updateTime;
 
 
 }

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/vo/query/remote/RemoteDegreeVO.java

@@ -46,7 +46,7 @@ public class RemoteDegreeVO extends BaseVO implements Serializable{
         /**
      * 描述
      */
-        private String desc;
+        private String description;
         /**
      * 实时数值
      */

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/vo/query/remote/RemoteMeasureVO.java

@@ -46,7 +46,7 @@ public class RemoteMeasureVO extends BaseVO implements Serializable{
         /**
      * 描述
      */
-        private String desc;
+        private String description;
         /**
      * 实时数值
      */

+ 68 - 65
platform-dao/src/main/resources/mapper/remote/RemoteDegreeLogMapper.xml

@@ -2,12 +2,13 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.platform.dao.mapper.remote.RemoteDegreeLogMapper">
     <sql id="Base_Column_List">
-                             degree-log.id,
+        degree
+        -log.id,
                                      degree-log.sb_id,
                                      degree-log.sb_name,
                                      degree-log.position_num,
                                      degree-log.type,
-                                     degree-log.desc,
+                                     degree-log.description,
                                      degree-log.result,
                                      degree-log.ratio,
                                      degree-log.unit,
@@ -16,82 +17,84 @@
                                      degree-log.update_user_id,
                                      degree-log.created_time,
                                      degree-log.update_time
-                        </sql>
+    </sql>
     <sql id="Ref_Column_List">
-                                                                         degree-log.sb_id,
+        degree
+        -log.sb_id,
                                      degree-log.sb_name,
                                      degree-log.position_num,
                                      degree-log.type,
-                                     degree-log.desc,
+                                     degree-log.description,
                                      degree-log.result,
                                      degree-log.ratio,
                                      degree-log.unit,
                                      degree-log.remark,
-                                                                                                                                                                                                        </sql>
+    </sql>
     <sql id="List_Condition">
-                                    <if test="id != null and id != ''">
-                    and degree-log.id = #{id}
-                </if>
-                                                <if test="sbId != null and sbId != ''">
-                    and degree-log.sb_id = #{sbId}
-                </if>
-                                                <if test="sbName != null and sbName != ''">
-                    and degree-log.sb_name = #{sbName}
-                </if>
-                                                <if test="positionNum != null">
-                    and degree-log.position_num = #{positionNum}
-                </if>
-                                                <if test="type != null">
-                    and degree-log.type = #{type}
-                </if>
-                                                <if test="desc != null and desc != ''">
-                    and degree-log.desc = #{desc}
-                </if>
-                                                <if test="result != null and result != ''">
-                    and degree-log.result = #{result}
-                </if>
-                                                <if test="ratio != null">
-                    and degree-log.ratio = #{ratio}
-                </if>
-                                                <if test="unit != null and unit != ''">
-                    and degree-log.unit = #{unit}
-                </if>
-                                                <if test="remark != null and remark != ''">
-                    and degree-log.remark = #{remark}
-                </if>
-                                                <if test="createdUserId != null and createdUserId != ''">
-                    and degree-log.created_user_id = #{createdUserId}
-                </if>
-                                                <if test="updateUserId != null and updateUserId != ''">
-                    and degree-log.update_user_id = #{updateUserId}
-                </if>
-                                                <if test="createdTimeStart != null">
-                    and degree-log.created_time <![CDATA[>=]]>; #{createdTimeStart}
-                </if>
-                <if test="createdTimeEnd != null">
-                    and degree-log.created_time <![CDATA[<=]]> #{createdTimeEnd}
-                </if>
-                <if test="createdTime != null">
-                    and degree-log.created_time = #{createdTime}
-                </if>
-                                                <if test="updateTimeStart != null">
-                    and degree-log.update_time <![CDATA[>=]]>; #{updateTimeStart}
-                </if>
-                <if test="updateTimeEnd != null">
-                    and degree-log.update_time <![CDATA[<=]]> #{updateTimeEnd}
-                </if>
-                <if test="updateTime != null">
-                    and degree-log.update_time = #{updateTime}
-                </if>
-                            <if test="keyword != null and keyword != ''">
+        <if test="id != null and id != ''">
+            and degree-log.id = #{id}
+        </if>
+        <if test="sbId != null and sbId != ''">
+            and degree-log.sb_id = #{sbId}
+        </if>
+        <if test="sbName != null and sbName != ''">
+            and degree-log.sb_name = #{sbName}
+        </if>
+        <if test="positionNum != null">
+            and degree-log.position_num = #{positionNum}
+        </if>
+        <if test="type != null">
+            and degree-log.type = #{type}
+        </if>
+        <if test="description != null and description != ''">
+            and degree-log.description = #{description}
+        </if>
+        <if test="result != null and result != ''">
+            and degree-log.result = #{result}
+        </if>
+        <if test="ratio != null">
+            and degree-log.ratio = #{ratio}
+        </if>
+        <if test="unit != null and unit != ''">
+            and degree-log.unit = #{unit}
+        </if>
+        <if test="remark != null and remark != ''">
+            and degree-log.remark = #{remark}
+        </if>
+        <if test="createdUserId != null and createdUserId != ''">
+            and degree-log.created_user_id = #{createdUserId}
+        </if>
+        <if test="updateUserId != null and updateUserId != ''">
+            and degree-log.update_user_id = #{updateUserId}
+        </if>
+        <if test="createdTimeStart != null">
+            and degree-log.created_time <![CDATA[>=]]>; #{createdTimeStart}
+        </if>
+        <if test="createdTimeEnd != null">
+            and degree-log.created_time <![CDATA[<=]]> #{createdTimeEnd}
+        </if>
+        <if test="createdTime != null">
+            and degree-log.created_time = #{createdTime}
+        </if>
+        <if test="updateTimeStart != null">
+            and degree-log.update_time <![CDATA[>=]]>; #{updateTimeStart}
+        </if>
+        <if test="updateTimeEnd != null">
+            and degree-log.update_time <![CDATA[<=]]> #{updateTimeEnd}
+        </if>
+        <if test="updateTime != null">
+            and degree-log.update_time = #{updateTime}
+        </if>
+        <if test="keyword != null and keyword != ''">
             and degree-log.id like concat(concat('%',#{keyword}),'%')
         </if>
     </sql>
-    <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteDegreeLogDTO" resultType="com.platform.dao.vo.query.remote.RemoteDegreeLogVO">
+    <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteDegreeLogDTO"
+            resultType="com.platform.dao.vo.query.remote.RemoteDegreeLogVO">
         select degree-log.*
-                                                                                                                                                                                                                                                                                                        from t_remote_degree_log as degree-log
-                                                                                                                                                                                                                                                                                                        <where>
-            <include refid="List_Condition" />
+        from t_remote_degree_log as degree-log
+        <where>
+            <include refid="List_Condition"/>
         </where>
     </select>
 </mapper>

+ 72 - 65
platform-dao/src/main/resources/mapper/remote/RemoteDegreeMapper.xml

@@ -2,12 +2,15 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.platform.dao.mapper.remote.RemoteDegreeMapper">
     <sql id="Base_Column_List">
-                             degree.id,
+        degree
+        .
+        id
+        ,
                                      degree.sb_id,
                                      degree.sb_name,
                                      degree.position_num,
                                      degree.type,
-                                     degree.desc,
+                                     degree.description,
                                      degree.result,
                                      degree.ratio,
                                      degree.unit,
@@ -16,82 +19,86 @@
                                      degree.update_user_id,
                                      degree.created_time,
                                      degree.update_time
-                        </sql>
+    </sql>
     <sql id="Ref_Column_List">
-                                                                         degree.sb_id,
+        degree
+        .
+        sb_id
+        ,
                                      degree.sb_name,
                                      degree.position_num,
                                      degree.type,
-                                     degree.desc,
+                                     degree.description,
                                      degree.result,
                                      degree.ratio,
                                      degree.unit,
                                      degree.remark,
-                                                                                                                                                                                                        </sql>
+    </sql>
     <sql id="List_Condition">
-                                    <if test="id != null and id != ''">
-                    and degree.id = #{id}
-                </if>
-                                                <if test="sbId != null and sbId != ''">
-                    and degree.sb_id = #{sbId}
-                </if>
-                                                <if test="sbName != null and sbName != ''">
-                    and degree.sb_name = #{sbName}
-                </if>
-                                                <if test="positionNum != null">
-                    and degree.position_num = #{positionNum}
-                </if>
-                                                <if test="type != null">
-                    and degree.type = #{type}
-                </if>
-                                                <if test="desc != null and desc != ''">
-                    and degree.desc = #{desc}
-                </if>
-                                                <if test="result != null and result != ''">
-                    and degree.result = #{result}
-                </if>
-                                                <if test="ratio != null">
-                    and degree.ratio = #{ratio}
-                </if>
-                                                <if test="unit != null and unit != ''">
-                    and degree.unit = #{unit}
-                </if>
-                                                <if test="remark != null and remark != ''">
-                    and degree.remark = #{remark}
-                </if>
-                                                <if test="createdUserId != null and createdUserId != ''">
-                    and degree.created_user_id = #{createdUserId}
-                </if>
-                                                <if test="updateUserId != null and updateUserId != ''">
-                    and degree.update_user_id = #{updateUserId}
-                </if>
-                                                <if test="createdTimeStart != null">
-                    and degree.created_time <![CDATA[>=]]>; #{createdTimeStart}
-                </if>
-                <if test="createdTimeEnd != null">
-                    and degree.created_time <![CDATA[<=]]> #{createdTimeEnd}
-                </if>
-                <if test="createdTime != null">
-                    and degree.created_time = #{createdTime}
-                </if>
-                                                <if test="updateTimeStart != null">
-                    and degree.update_time <![CDATA[>=]]>; #{updateTimeStart}
-                </if>
-                <if test="updateTimeEnd != null">
-                    and degree.update_time <![CDATA[<=]]> #{updateTimeEnd}
-                </if>
-                <if test="updateTime != null">
-                    and degree.update_time = #{updateTime}
-                </if>
-                            <if test="keyword != null and keyword != ''">
+        <if test="id != null and id != ''">
+            and degree.id = #{id}
+        </if>
+        <if test="sbId != null and sbId != ''">
+            and degree.sb_id = #{sbId}
+        </if>
+        <if test="sbName != null and sbName != ''">
+            and degree.sb_name = #{sbName}
+        </if>
+        <if test="positionNum != null">
+            and degree.position_num = #{positionNum}
+        </if>
+        <if test="type != null">
+            and degree.type = #{type}
+        </if>
+        <if test="description != null and description != ''">
+            and degree.description = #{description}
+        </if>
+        <if test="result != null and result != ''">
+            and degree.result = #{result}
+        </if>
+        <if test="ratio != null">
+            and degree.ratio = #{ratio}
+        </if>
+        <if test="unit != null and unit != ''">
+            and degree.unit = #{unit}
+        </if>
+        <if test="remark != null and remark != ''">
+            and degree.remark = #{remark}
+        </if>
+        <if test="createdUserId != null and createdUserId != ''">
+            and degree.created_user_id = #{createdUserId}
+        </if>
+        <if test="updateUserId != null and updateUserId != ''">
+            and degree.update_user_id = #{updateUserId}
+        </if>
+        <if test="createdTimeStart != null">
+            and degree.created_time <![CDATA[>=]]>; #{createdTimeStart}
+        </if>
+        <if test="createdTimeEnd != null">
+            and degree.created_time <![CDATA[<=]]> #{createdTimeEnd}
+        </if>
+        <if test="createdTime != null">
+            and degree.created_time = #{createdTime}
+        </if>
+        <if test="updateTimeStart != null">
+            and degree.update_time <![CDATA[>=]]>; #{updateTimeStart}
+        </if>
+        <if test="updateTimeEnd != null">
+            and degree.update_time <![CDATA[<=]]> #{updateTimeEnd}
+        </if>
+        <if test="updateTime != null">
+            and degree.update_time = #{updateTime}
+        </if>
+        <if test="keyword != null and keyword != ''">
             and degree.id like concat(concat('%',#{keyword}),'%')
         </if>
     </sql>
-    <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteDegreeDTO" resultType="com.platform.dao.vo.query.remote.RemoteDegreeVO">
+    <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteDegreeDTO"
+            resultType="com.platform.dao.vo.query.remote.RemoteDegreeVO">
         select degree.*
-                                                                                                                                                                                                                                                                                                        from t_remote_degree as degree
-                                                                                                                                                                                                                                                                                                        <where>
-            <include refid="List_Condition" />
+        from t_remote_degree as degree
+        <where>
+            <include refid="List_Condition"/>
         </where>
     </select>
 </mapper>

+ 72 - 65
platform-dao/src/main/resources/mapper/remote/RemoteMeasureMapper.xml

@@ -2,12 +2,15 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.platform.dao.mapper.remote.RemoteMeasureMapper">
     <sql id="Base_Column_List">
-                             measure.id,
+        measure
+        .
+        id
+        ,
                                      measure.sb_id,
                                      measure.sb_name,
                                      measure.position_num,
                                      measure.type,
-                                     measure.desc,
+                                     measure.description,
                                      measure.result,
                                      measure.ratio,
                                      measure.unit,
@@ -16,82 +19,86 @@
                                      measure.update_user_id,
                                      measure.created_time,
                                      measure.update_time
-                        </sql>
+    </sql>
     <sql id="Ref_Column_List">
-                                                                         measure.sb_id,
+        measure
+        .
+        sb_id
+        ,
                                      measure.sb_name,
                                      measure.position_num,
                                      measure.type,
-                                     measure.desc,
+                                     measure.description,
                                      measure.result,
                                      measure.ratio,
                                      measure.unit,
                                      measure.remark,
-                                                                                                                                                                                                        </sql>
+    </sql>
     <sql id="List_Condition">
-                                    <if test="id != null and id != ''">
-                    and measure.id = #{id}
-                </if>
-                                                <if test="sbId != null and sbId != ''">
-                    and measure.sb_id = #{sbId}
-                </if>
-                                                <if test="sbName != null and sbName != ''">
-                    and measure.sb_name = #{sbName}
-                </if>
-                                                <if test="positionNum != null">
-                    and measure.position_num = #{positionNum}
-                </if>
-                                                <if test="type != null">
-                    and measure.type = #{type}
-                </if>
-                                                <if test="desc != null and desc != ''">
-                    and measure.desc = #{desc}
-                </if>
-                                                <if test="result != null and result != ''">
-                    and measure.result = #{result}
-                </if>
-                                                <if test="ratio != null">
-                    and measure.ratio = #{ratio}
-                </if>
-                                                <if test="unit != null and unit != ''">
-                    and measure.unit = #{unit}
-                </if>
-                                                <if test="remark != null and remark != ''">
-                    and measure.remark = #{remark}
-                </if>
-                                                <if test="createdUserId != null and createdUserId != ''">
-                    and measure.created_user_id = #{createdUserId}
-                </if>
-                                                <if test="updateUserId != null and updateUserId != ''">
-                    and measure.update_user_id = #{updateUserId}
-                </if>
-                                                <if test="createdTimeStart != null">
-                    and measure.created_time <![CDATA[>=]]>; #{createdTimeStart}
-                </if>
-                <if test="createdTimeEnd != null">
-                    and measure.created_time <![CDATA[<=]]> #{createdTimeEnd}
-                </if>
-                <if test="createdTime != null">
-                    and measure.created_time = #{createdTime}
-                </if>
-                                                <if test="updateTimeStart != null">
-                    and measure.update_time <![CDATA[>=]]>; #{updateTimeStart}
-                </if>
-                <if test="updateTimeEnd != null">
-                    and measure.update_time <![CDATA[<=]]> #{updateTimeEnd}
-                </if>
-                <if test="updateTime != null">
-                    and measure.update_time = #{updateTime}
-                </if>
-                            <if test="keyword != null and keyword != ''">
+        <if test="id != null and id != ''">
+            and measure.id = #{id}
+        </if>
+        <if test="sbId != null and sbId != ''">
+            and measure.sb_id = #{sbId}
+        </if>
+        <if test="sbName != null and sbName != ''">
+            and measure.sb_name = #{sbName}
+        </if>
+        <if test="positionNum != null">
+            and measure.position_num = #{positionNum}
+        </if>
+        <if test="type != null">
+            and measure.type = #{type}
+        </if>
+        <if test="description != null and description != ''">
+            and measure.description = #{description}
+        </if>
+        <if test="result != null and result != ''">
+            and measure.result = #{result}
+        </if>
+        <if test="ratio != null">
+            and measure.ratio = #{ratio}
+        </if>
+        <if test="unit != null and unit != ''">
+            and measure.unit = #{unit}
+        </if>
+        <if test="remark != null and remark != ''">
+            and measure.remark = #{remark}
+        </if>
+        <if test="createdUserId != null and createdUserId != ''">
+            and measure.created_user_id = #{createdUserId}
+        </if>
+        <if test="updateUserId != null and updateUserId != ''">
+            and measure.update_user_id = #{updateUserId}
+        </if>
+        <if test="createdTimeStart != null">
+            and measure.created_time <![CDATA[>=]]>; #{createdTimeStart}
+        </if>
+        <if test="createdTimeEnd != null">
+            and measure.created_time <![CDATA[<=]]> #{createdTimeEnd}
+        </if>
+        <if test="createdTime != null">
+            and measure.created_time = #{createdTime}
+        </if>
+        <if test="updateTimeStart != null">
+            and measure.update_time <![CDATA[>=]]>; #{updateTimeStart}
+        </if>
+        <if test="updateTimeEnd != null">
+            and measure.update_time <![CDATA[<=]]> #{updateTimeEnd}
+        </if>
+        <if test="updateTime != null">
+            and measure.update_time = #{updateTime}
+        </if>
+        <if test="keyword != null and keyword != ''">
             and measure.id like concat(concat('%',#{keyword}),'%')
         </if>
     </sql>
-    <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteMeasureDTO" resultType="com.platform.dao.vo.query.remote.RemoteMeasureVO">
+    <select id="selectList" parameterType="com.platform.dao.dto.remote.RemoteMeasureDTO"
+            resultType="com.platform.dao.vo.query.remote.RemoteMeasureVO">
         select measure.*
-                                                                                                                                                                                                                                                                                                        from t_remote_measure as measure
-                                                                                                                                                                                                                                                                                                        <where>
-            <include refid="List_Condition" />
+        from t_remote_measure as measure
+        <where>
+            <include refid="List_Condition"/>
         </where>
     </select>
 </mapper>

+ 14 - 1
platform-service/src/main/java/com/platform/service/remote/impl/RemoteDegreeServiceImpl.java

@@ -76,8 +76,21 @@ public class RemoteDegreeServiceImpl extends BaseServiceImpl<RemoteDegreeMapper,
         weekendCriteria.andEqualTo(SysDict::getType, DictTypeEnum.REMOTE_DEGREE);
         List<SysDict> sysDictList = sysDictMapper.selectByExample(weekend);
         try {
-            List<RemoteDegree> items = CustomExcelImportUtil.importRemoteDegreeList(file.getInputStream(),sysDictList);
+            List<RemoteDegree> items = CustomExcelImportUtil.importRemoteDegreeList(file.getInputStream());
             if (!CollectionUtils.isEmpty(items)) {
+                for(RemoteDegree remoteDegree:items){
+                    boolean find = false;
+                    for(SysDict sysDict: sysDictList){
+                        if(sysDict.getLabel().equals(remoteDegree.getDescription())){
+                            remoteDegree.setType(Integer.valueOf(sysDict.getValue()));
+                            find = true;
+                            break;
+                        }
+                    }
+                    if(!find){
+                        throw new BusinessException("点位类型未配置,请配置电度数据字典:" + remoteDegree.getDescription() );
+                    }
+                }
                 mapper.insertListforComplex(items);
             }
             return "总计新增导入:" + (items.size());

+ 14 - 1
platform-service/src/main/java/com/platform/service/remote/impl/RemoteMeasureServiceImpl.java

@@ -68,8 +68,21 @@ public class RemoteMeasureServiceImpl extends BaseServiceImpl<RemoteMeasureMappe
         weekendCriteria.andEqualTo(SysDict::getType, DictTypeEnum.REMOTE_MEASURE);
         List<SysDict> sysDictList = sysDictMapper.selectByExample(weekend);
         try {
-            List<RemoteMeasure> items = CustomExcelImportUtil.importRemoteMeasureList(file.getInputStream(),sysDictList);
+            List<RemoteMeasure> items = CustomExcelImportUtil.importRemoteMeasureList(file.getInputStream());
             if (!CollectionUtils.isEmpty(items)) {
+                for(RemoteMeasure remoteMeasure:items){
+                    boolean find = false;
+                    for(SysDict sysDict: sysDictList){
+                        if(sysDict.getLabel().equals(remoteMeasure.getRemark())){
+                            remoteMeasure.setType(Integer.valueOf(sysDict.getValue()));
+                            find = true;
+                            break;
+                        }
+                    }
+                    if(!find){
+                        throw new BusinessException("点位类型未配置,请配置电度数据字典:" + remoteMeasure.getRemark() );
+                    }
+                }
                 mapper.insertListforComplex(items);
             }
             return "总计新增导入:" + (items.size());