Prechádzať zdrojové kódy

104协议遥测接口

hfxc226 2 rokov pred
rodič
commit
c0de0b60cc

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/entity/sb/SbInfo.java

@@ -381,7 +381,7 @@ public class SbInfo implements Serializable {
     private LocalDate lastBaoyangTime;//最近保养时间
     private double lastBaoyangMiles;//最近保养里程
     private double lastBaoyangHours;//最近保养台时
-    private Integer baoyangTimes;//保养次数
+    private Integer baoyangTimes;//保养次数/时代思康:所属线路
 
 
     private LocalDate spDate;//上牌日期

+ 9 - 0
platform-dao/src/main/resources/mapper/sb/SbInfoMapper.xml

@@ -202,6 +202,9 @@ user.real_name as saveUserName,sb.repair_dept_id
             sb.no like concat('%',#{keyword},'%')
             )
         </if>
+        <if test="name != null and name!=''">
+            and sb.name like concat('%',#{name},'%')
+        </if>
         <if test="zbh != null and zbh!=''">
             and sb.zbh like concat('%',#{zbh},'%')
         </if>
@@ -386,6 +389,9 @@ user.real_name as saveUserName,sb.repair_dept_id
             sb.no like concat('%',#{keyword},'%')
             )
         </if>
+        <if test="name != null and name!=''">
+            and sb.name like concat('%',#{name},'%')
+        </if>
         <if test="zbh != null and zbh!=''">
             and sb.zbh like concat('%',#{zbh},'%')
         </if>
@@ -496,6 +502,9 @@ user.real_name as saveUserName,sb.repair_dept_id
             sb.no like concat('%',#{keyword},'%')
             )
         </if>
+        <if test="name != null and name!=''">
+            and sb.name like concat('%',#{name},'%')
+        </if>
         <if test="financingNo != null and financingNo!=''">
             and sb.financing_no like concat(#{financingNo},'%')
         </if>

+ 25 - 11
platform-service/src/main/java/com/platform/service/remote/impl/RemoteMeasureServiceImpl.java

@@ -66,7 +66,7 @@ public class RemoteMeasureServiceImpl extends BaseServiceImpl<RemoteMeasureMappe
 
         RemoteMeasure remoteMeasure = new RemoteMeasure();
         remoteMeasure.setResult(result);
-        mapper.updateByExampleSelective(remoteMeasure,weekend);
+        mapper.updateByExampleSelective(remoteMeasure, weekend);
     }
 
     @Override
@@ -90,29 +90,37 @@ public class RemoteMeasureServiceImpl extends BaseServiceImpl<RemoteMeasureMappe
                 // 电度的导入不处理,因为遥测导入已经添加了设备,电度导入需要查询设备id,根据设备名字查询
                 List<String> sbNames = items.stream().distinct().map(RemoteMeasure::getSbName).distinct().collect(Collectors.toList());
                 // 设置设备新增
-                int i =1 ;
-                for(String name:sbNames){
+                int i = 1;
+                for (String name : sbNames) {
                     SbInfo sbInfo = new SbInfo();
                     sbInfo.setId(i++ + "");
                     sbInfo.setName(name);
+                    sbInfo.setNo(sbInfo.getId());
+                    sbInfo.setUseType(3);
+                    sbInfo.setIsMeasure(0);
+                    sbInfo.setIsSelf(0);
+                    sbInfo.setIsChild(0);
+                    sbInfo.setIsShow(0);
+                    sbInfo.setIsFinancing(0);
+                    sbInfo.setBaoyangTimes((int) ((Math.random() * 6) + 1));
                     addSbInfoList.add(sbInfo);
                 }
-                for(RemoteMeasure remoteMeasure:items){
-                    for(SbInfo sbInfo:addSbInfoList){
-                        if(remoteMeasure.getSbName().equals(sbInfo.getName())){
+                for (RemoteMeasure remoteMeasure : items) {
+                    for (SbInfo sbInfo : addSbInfoList) {
+                        if (remoteMeasure.getSbName().equals(sbInfo.getName())) {
                             remoteMeasure.setSbId(sbInfo.getId());
                         }
                     }
                     boolean find = false;
-                    for(SysDict sysDict: sysDictList){
-                        if(sysDict.getLabel().equals(remoteMeasure.getRemark())){
+                    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() );
+                    if (!find) {
+                        throw new BusinessException("点位类型未配置,请配置遥测数据字典:" + remoteMeasure.getRemark());
                     }
                 }
                 sbInfoMapper.insertListforComplex(addSbInfoList);
@@ -124,4 +132,10 @@ public class RemoteMeasureServiceImpl extends BaseServiceImpl<RemoteMeasureMappe
             throw new BusinessException(e.getMessage());
         }
     }
-                                                                                                                                                                            }
+
+    public static void main(String[] args) {
+        for(int i=0;i<100;i++){
+            System.out.println((int)((Math.random()*6)+1));
+        }
+    }
+}

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

@@ -1,5 +1,6 @@
 package com.platform.service.sb;
 
+import com.alibaba.fastjson.JSONObject;
 import com.platform.dao.bean.MyVOPage;
 import com.platform.dao.dto.sb.SbInfoDTO;
 import com.platform.dao.entity.sb.SbInfo;

+ 11 - 5
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -2,6 +2,7 @@ package com.platform.service.sb.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
@@ -10,6 +11,7 @@ import com.platform.activiti.enums.ActApplyEnum;
 import com.platform.common.cache.ConfigCache;
 import com.platform.common.constant.CommonConstants;
 import com.platform.common.enums.DataFilterTypeEnum;
+import com.platform.common.enums.DictTypeEnum;
 import com.platform.common.enums.ResultCode;
 import com.platform.common.exception.BusinessException;
 import com.platform.common.exception.DeniedException;
@@ -29,20 +31,22 @@ import com.platform.dao.entity.check.CheckStandard;
 import com.platform.dao.entity.firm.FirmProducer;
 import com.platform.dao.entity.part.PartInfo;
 import com.platform.dao.entity.part.PartType;
+import com.platform.dao.entity.remote.RemoteDegree;
+import com.platform.dao.entity.remote.RemoteMeasure;
 import com.platform.dao.entity.repair.RepairApplicationForm;
 import com.platform.dao.entity.sb.*;
-import com.platform.dao.entity.upms.SysDept;
-import com.platform.dao.entity.upms.SysFile;
-import com.platform.dao.entity.upms.SysUser;
-import com.platform.dao.entity.upms.SysUserDept;
+import com.platform.dao.entity.upms.*;
 import com.platform.dao.enums.*;
 import com.platform.dao.mapper.check.CheckStandardMapper;
 import com.platform.dao.mapper.firm.FirmProducerMapper;
 import com.platform.dao.mapper.part.PartInfoMapper;
 import com.platform.dao.mapper.part.PartTypeMapper;
+import com.platform.dao.mapper.remote.RemoteDegreeMapper;
+import com.platform.dao.mapper.remote.RemoteMeasureMapper;
 import com.platform.dao.mapper.repair.RepairApplicationFormMapper;
 import com.platform.dao.mapper.sb.*;
 import com.platform.dao.mapper.upms.SysDeptMapper;
+import com.platform.dao.mapper.upms.SysDictMapper;
 import com.platform.dao.mapper.upms.SysUserMapper;
 import com.platform.dao.mapper.workplace.WorkplaceBacklogUserMapper;
 import com.platform.dao.util.CustomExcelImportUtil;
@@ -99,7 +103,9 @@ import java.util.stream.Collectors;
 @Service("sbInfoService")
 @Slf4j
 public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbInfoDTO> implements SbInfoService {
-
+    private final RemoteMeasureMapper remoteMeasureMapper;
+    private final RemoteDegreeMapper remoteDegreeMapper;
+    private final SysDictMapper sysDictMapper;
     private final Environment environment;
 
     private final SysDeptMapper deptMapper;