ソースを参照

【CHG】修改安全工具业务

ZhaoMn 3 年 前
コミット
c7842cbf9a

+ 3 - 0
railway-business/src/main/java/com/railway/business/catenary/domain/BusJcbJcxc.java

@@ -22,6 +22,9 @@ public class BusJcbJcxc extends BusJcab{
     @Length(min = 1, max = 50, message = "【支柱号】长度必须介于 {min} 和 {max} 之间")
     private String pillarCode;
 
+    @ApiModelProperty(value = "支柱号范围")
+    private String pillarArea;
+
     @ApiModelProperty(value = "线岔号")
     private String xch;
 

+ 8 - 0
railway-business/src/main/java/com/railway/business/catenary/service/impl/BusJcbJcxcServiceImpl.java

@@ -46,6 +46,10 @@ public class BusJcbJcxcServiceImpl extends BusJcabServiceImpl implements IBusJcb
   public int create(BusJcbJcxc busJcbJcxc) {
     setCreate(busJcbJcxc);
     busJcbJcxc.setUserId(SecurityUtils.getUserId());
+    if(StringUtils.isEmpty(busJcbJcxc.getPillarCode())
+        && StringUtils.isNotEmpty(busJcbJcxc.getPillarArea())){
+      busJcbJcxc.setPillarCode(busJcbJcxc.getPillarArea());
+    }
     return busJcbJcxcMapper.insert(busJcbJcxc);
   }
 
@@ -79,6 +83,10 @@ public class BusJcbJcxcServiceImpl extends BusJcabServiceImpl implements IBusJcb
   @Transactional(rollbackFor = Exception.class)
   public int update(BusJcbJcxc busJcbJcxc) {
     setUpdate(busJcbJcxc);
+    if(StringUtils.isEmpty(busJcbJcxc.getPillarCode())
+        && StringUtils.isNotEmpty(busJcbJcxc.getPillarArea())){
+      busJcbJcxc.setPillarCode(busJcbJcxc.getPillarArea());
+    }
     return busJcbJcxcMapper.update(busJcbJcxc);
   }
 

+ 1 - 1
railway-business/src/main/java/com/railway/business/safetool/domain/BaseSafetyTool.java

@@ -56,7 +56,7 @@ public class BaseSafetyTool extends BaseEntity {
   private String toolCode;
 
   @ApiModelProperty(value = "二维码编码")
-  @Length(min = 1, max = 64, message = "【二维码编码】长度必须介于 {min} 和 {max} 之间")
+  @Length(max = 64, message = "【二维码编码】长度必须介于 {min} 和 {max} 之间")
   private String toolQcode;
 
   @ApiModelProperty(value = "二维码URL")

+ 5 - 0
railway-business/src/main/java/com/railway/business/safetool/mapper/SecScheduledMapper.java

@@ -41,6 +41,11 @@ public interface SecScheduledMapper {
      */
     SecScheduled getInfo(@Param("id") Long id);
 
+    /**
+     * 获取单个
+     */
+    SecScheduled getInfoByExpId(@Param("expId") Long expId);
+
     /**
      * 获取单个
      */

+ 2 - 2
railway-business/src/main/java/com/railway/business/safetool/service/impl/SecExperimentServiceImpl.java

@@ -3,6 +3,7 @@ package com.railway.business.safetool.service.impl;
 import com.railway.business.safetool.domain.BaseSafetyTool;
 import com.railway.business.safetool.domain.SecExperiment;
 import com.railway.business.safetool.domain.SecExperimentTool;
+import com.railway.business.safetool.domain.SecScheduled;
 import com.railway.business.safetool.domain.vo.SecExpAddParmVo;
 import com.railway.business.safetool.domain.vo.SecExpEndParmVo;
 import com.railway.business.safetool.domain.vo.SecExpInfoVo;
@@ -98,13 +99,12 @@ public class SecExperimentServiceImpl implements ISecExperimentService {
     int ret = update(secExperiment);
     if (ret > 0) {
       //设置待送检状态
+      SecScheduled scheduled = scheduledMapper.getInfoByExpId(secExperiment.getId());
       ret = secExperimentMapper.updateScheduled(secExperiment.getId(), TestStateEnum.WAITING.getCode());
       // 更新工具最后实验时间
       List<BaseSafetyTool> toolList =  toolMapper.listByExperimentId(secExperiment.getId());
       for(BaseSafetyTool tool : toolList){
-        tool.setExperimentId(secExperiment.getId());
         tool.setLastTestDate(secExperiment.getExpDate());
-        //TODO 设置工具计划ID
         toolMapper.update(tool);
         SecScheduledToolVo scheduledToolVo = new SecScheduledToolVo();
         scheduledToolVo.setScheduledId(secExperiment.getId());

+ 1 - 0
railway-business/src/main/resources/mapper/catenary/BusJcbJcxcMapper.xml

@@ -12,6 +12,7 @@
     <result column="station_name" property="stationName"/>
     <result column="dept_station_id" property="deptStationId"/>
     <result column="pillar_code" property="pillarCode"/>
+    <result column="pillar_code" property="pillarArea"/>
     <result column="xch" property="xch"/>
     <result column="temperature" property="temperature"/>
     <result column="check_date" property="checkDate"/>

+ 10 - 1
railway-business/src/main/resources/mapper/safetool/SecScheduledMapper.xml

@@ -117,10 +117,19 @@
   <select id="getInfo" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>
-    FROM sec_experiment
+    FROM sec_scheduled
     WHERE del_flag='0' and id = #{id}
   </select>
 
+  <select id="getInfoByExpId" resultMap="BaseResultMap">
+    SELECT
+    <include refid="Base_Column_List"/>
+    FROM sec_scheduled
+    where id = (
+      select scheduled_id from sec_experiment where id = #{expId}
+    )
+  </select>
+
   <resultMap id="BaseResultMap2" type="com.railway.business.safetool.domain.vo.SecScheduledCountVo">
     <result column="id" property="id"/>
     <result column="dept_id" property="deptId"/>