Forráskód Böngészése

地面磁感应器 - 检测表 修改

Eric 4 éve
szülő
commit
06012b6651

+ 17 - 0
railway-admin/src/main/java/com/railway/web/controller/business/baseinfo/BusDmcgyqController.java

@@ -4,6 +4,7 @@ import com.railway.business.baseinfo.domain.BaseDeptStation;
 import com.railway.business.baseinfo.domain.BusDmcgyq;
 import com.railway.business.baseinfo.service.IBaseStationService;
 import com.railway.business.baseinfo.service.IBusDmcgyqService;
+import com.railway.common.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.validation.annotation.Validated;
@@ -73,4 +74,20 @@ public class BusDmcgyqController extends BaseController {
     return getDataTable(list);
   }
 
+  @ApiOperation(value = "支柱号范围-合并")
+  @GetMapping(value = "combinedPillarArea")
+  public AjaxResult combinedPillarArea(BusDmcgyq busDmcgyq) {
+    List<BusDmcgyq> list = busDmcgyqService.getList(busDmcgyq);
+    String combinedPillarArea = "";
+    for(BusDmcgyq data : list) {
+      combinedPillarArea += data.getPillarArea() + ",";
+    }
+    if(StringUtils.isNotBlank(combinedPillarArea)) {
+      combinedPillarArea = combinedPillarArea.substring(0, combinedPillarArea.lastIndexOf(","));
+    }
+    AjaxResult ajax = AjaxResult.success();
+    ajax.put("combinedPillarArea", combinedPillarArea);
+    return ajax;
+  }
+
 }

+ 23 - 10
railway-admin/src/main/java/com/railway/web/controller/business/catenary/BusJcbDmcgyqController.java

@@ -1,12 +1,12 @@
 package com.railway.web.controller.business.catenary;
 
 import com.railway.business.catenary.domain.BusJcbDmcgyq;
+import com.railway.business.catenary.domain.vo.JcebQueryVo;
 import com.railway.business.catenary.service.IBusJcbDmcgyqService;
 import com.railway.common.core.controller.BaseController;
 import com.railway.common.core.domain.AjaxResult;
 import com.railway.common.core.page.TableDataInfo;
 import com.railway.common.utils.StringUtils;
-import com.railway.common.utils.poi.EasyExcelUtil;
 import com.railway.common.utils.poi.WordUtils;
 import com.railway.system.service.ISysFileService;
 import io.swagger.annotations.Api;
@@ -57,8 +57,8 @@ public class BusJcbDmcgyqController extends BaseController {
 
     @ApiOperation(value = "单个")
     @GetMapping(value = "/info")
-    public AjaxResult getInfo(@RequestParam String id) {
-        BusJcbDmcgyq info = busJcbDmcgyqService.getInfo(id);
+    public AjaxResult getInfo(BusJcbDmcgyq busJcbDmcgyq) {
+        BusJcbDmcgyq info = busJcbDmcgyqService.getInfo(busJcbDmcgyq);
         AjaxResult ajax = AjaxResult.success();
         ajax.put("info",info);
         return ajax;
@@ -102,8 +102,9 @@ public class BusJcbDmcgyqController extends BaseController {
     @ApiOperation(value = "导出")
     @GetMapping("/export/{id}")
     public AjaxResult export(@PathVariable(value = "id") String id) {
-
-        BusJcbDmcgyq info = busJcbDmcgyqService.getInfo(id);
+        BusJcbDmcgyq info = new BusJcbDmcgyq();
+        info.setId(Long.parseLong(id));
+        info = busJcbDmcgyqService.getInfo(info);
         WordUtils wordUtil = new WordUtils();
         //填充变量
         Map<String, Object> params = new HashMap<>();
@@ -136,13 +137,25 @@ public class BusJcbDmcgyqController extends BaseController {
 
     @ApiOperation(value = "导出excel")
     @GetMapping(value = "exportExcel")
-    public AjaxResult exportExcel(BusJcbDmcgyq busJcbDmcgyq) {
-        List<BusJcbDmcgyq> list = busJcbDmcgyqService.getList(busJcbDmcgyq);
-        String fileName = "地磁感应器检测记录.xls";
-        String templateFileName = "excel/template/地磁感应器检测记录.xls";
-        String localFilePath = new EasyExcelUtil().writeExcel(fileName, templateFileName, list);
+    public AjaxResult exportExcel(JcebQueryVo query) {
+        String localFilePath = busJcbDmcgyqService.exportExcel(query);
         return sysFileService.uploadFile(localFilePath);
     }
 
+    @ApiOperation(value = "检测表list")
+    @GetMapping(value = "jcebList")
+    public TableDataInfo jcebList(JcebQueryVo query) {
+        startPage();
+        return getDataTable(busJcbDmcgyqService.getJcebList(query));
+    }
+
+    @ApiOperation(value = "检测表单个详情")
+    @GetMapping(value = "/jcebInfo")
+    public AjaxResult getJcebInfo(BusJcbDmcgyq busJcbDmcgyq) {
+        BusJcbDmcgyq info = busJcbDmcgyqService.getJcebInfo(busJcbDmcgyq);
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("info",info);
+        return ajax;
+    }
 
 }

+ 3 - 3
railway-admin/src/main/java/com/railway/web/controller/business/catenary/BusJcebController.java

@@ -116,9 +116,9 @@ public class BusJcebController extends BaseController {
       case Blq:
         list = blqService.getListByType(query);
         break;
-      case Dmcgyq:
-        list = dmcgyqService.getListByType(query);
-        break;
+//      case Dmcgyq:
+//        list = dmcgyqService.getListByType(query);
+//        break;
       case Fdfxjyq:
         list = fdfxjyqService.getListByType(query);
         break;

+ 4 - 2
railway-business/src/main/java/com/railway/business/catenary/domain/BusJcbDmcgyq.java

@@ -91,12 +91,14 @@ public class BusJcbDmcgyq extends BusJcab{
     private Long userId;
 
     // 导出用
-    private String licheng;  // 里程
+    private String czlc;  // 里程
 
-    private String gyqNumber;  // 编号
+    private String gyqNumber;  // 感应器编号
 
     private String ctl; // 磁通量
 
+    private Integer scz; // 实测值
 
+    private String wsjbjsd; // 污损及部件松动
 
 }

+ 6 - 1
railway-business/src/main/java/com/railway/business/catenary/mapper/BusJcbDmcgyqMapper.java

@@ -36,7 +36,12 @@ public interface BusJcbDmcgyqMapper {
     /**
     * 获取单个
     */
-    BusJcbDmcgyq getInfo(@Param("id") String id);
+    BusJcbDmcgyq getInfo(BusJcbDmcgyq busJcbDmcgyq);
+
+    /**
+     * 获取单个-jceb
+     */
+    BusJcbDmcgyq getJcebInfo(BusJcbDmcgyq busJcbDmcgyq);
 
     /**
     * 查询列表

+ 13 - 1
railway-business/src/main/java/com/railway/business/catenary/service/IBusJcbDmcgyqService.java

@@ -31,13 +31,25 @@ public interface IBusJcbDmcgyqService{
     /**
     * 获取单个
     */
-    BusJcbDmcgyq getInfo(String id);
+    BusJcbDmcgyq getInfo(BusJcbDmcgyq busJcbDmcgyq);
+
+    /**
+     * 获取单个-jceb
+     */
+    BusJcbDmcgyq getJcebInfo(BusJcbDmcgyq busJcbDmcgyq);
 
     /**
     * 查询列表
     */
     List<BusJcbDmcgyq> getList(BusJcbDmcgyq busJcbDmcgyq);
 
+    /**
+     * 检测表list
+     * @param query
+     * @return
+     */
+    List<BusJcbDmcgyq> getJcebList(JcebQueryVo query);
+
     /**
      * 获取上次检查记录
      */

+ 129 - 4
railway-business/src/main/java/com/railway/business/catenary/service/impl/BusJcbDmcgyqServiceImpl.java

@@ -1,6 +1,8 @@
 package com.railway.business.catenary.service.impl;
 
 import com.github.pagehelper.Page;
+import com.railway.business.baseinfo.domain.BusDmcgyq;
+import com.railway.business.baseinfo.mapper.BusDmcgyqMapper;
 import com.railway.business.baseinfo.service.IBaseStationService;
 import com.railway.business.catenary.domain.BusJcbDmcgyq;
 import com.railway.business.catenary.domain.vo.JcebCountVo;
@@ -11,9 +13,15 @@ import com.railway.business.catenary.mapper.BusJcbDmcgyqMapper;
 import com.railway.business.catenary.service.IBusJcbDmcgyqService;
 import com.railway.common.utils.SecurityUtils;
 import com.railway.common.utils.StringUtils;
+import com.railway.common.utils.bean.BeanUtils;
 import com.railway.common.utils.poi.EasyExcelUtil;
+
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -27,11 +35,13 @@ import org.springframework.transaction.annotation.Transactional;
 public class BusJcbDmcgyqServiceImpl extends BusJcabServiceImpl implements IBusJcbDmcgyqService {
 
   private final BusJcbDmcgyqMapper busJcbDmcgyqMapper;
+  private final BusDmcgyqMapper busDmcgyqMapper;
 
   public BusJcbDmcgyqServiceImpl(BusJcbDmcgyqMapper busJcbDmcgyqMapper,
-      IBaseStationService stationService) {
+      IBaseStationService stationService, BusDmcgyqMapper busDmcgyqMapper) {
     super(stationService);
     this.busJcbDmcgyqMapper = busJcbDmcgyqMapper;
+    this.busDmcgyqMapper = busDmcgyqMapper;
   }
 
   /**
@@ -74,8 +84,8 @@ public class BusJcbDmcgyqServiceImpl extends BusJcabServiceImpl implements IBusJ
    * 获取单个
    */
   @Override
-  public BusJcbDmcgyq getInfo(String id) {
-    return busJcbDmcgyqMapper.getInfo(id);
+  public BusJcbDmcgyq getInfo(BusJcbDmcgyq busJcbDmcgyq) {
+    return busJcbDmcgyqMapper.getInfo(busJcbDmcgyq);
   }
 
   /**
@@ -138,9 +148,124 @@ public class BusJcbDmcgyqServiceImpl extends BusJcabServiceImpl implements IBusJ
   @Override
   public String exportExcel(JcebQueryVo query) {
     List<BusJcbDmcgyq> list = busJcbDmcgyqMapper.getJcebList(query);
+    List<BusJcbDmcgyq> resultList = new ArrayList<>();
+    list.forEach(
+            x -> {
+              transDataForList(x, resultList);
+            }
+    );
     String fileName = "地磁感应器检测记录.xls";
     String templateFileName = "excel/template/地磁感应器检测记录.xls";
-    return new EasyExcelUtil().writeExcel(fileName, templateFileName, list);
+    return new EasyExcelUtil().writeExcel(fileName, templateFileName, resultList);
+  }
+
+  /**
+   * 检测表list
+   * @param query
+   * @return
+   */
+  public List<BusJcbDmcgyq> getJcebList(JcebQueryVo query) {
+      List<BusJcbDmcgyq> list = busJcbDmcgyqMapper.getJcebList(query);
+      List<BusJcbDmcgyq> resultList = new ArrayList<>();
+      list.forEach(
+              x -> {
+               transDataForList(x, resultList);
+              }
+      );
+      return resultList;
+  }
+
+  /**
+   * 获取单个jceb
+   */
+  @Override
+  public BusJcbDmcgyq getJcebInfo(BusJcbDmcgyq busJcbDmcgyq) {
+    BusJcbDmcgyq result = busJcbDmcgyqMapper.getJcebInfo(busJcbDmcgyq);
+    return transData(result, busJcbDmcgyq.getGyqNumber());
+  }
+
+  private void transDataForList(BusJcbDmcgyq x, List<BusJcbDmcgyq> resultList) {
+      if(StringUtils.YES_VALUE.equals(x.getBspwgAzlg()) &&
+              StringUtils.YES_VALUE.equals(x.getBspwgBsqx()) &&
+              StringUtils.YES_VALUE.equals(x.getDgqwgBmqj()) &&
+              StringUtils.YES_VALUE.equals(x.getDgqwgWzws()) &&
+              StringUtils.YES_VALUE.equals(x.getDgqwgAzlg())) {
+        x.setWsjbjsd("无");
+      } else {
+        x.setWsjbjsd("有");
+      }
+      BusDmcgyq busDmcgyq = busDmcgyqMapper.getInfo(x.getGyqId().toString());
+      BusDmcgyq query = new BusDmcgyq();
+      query.setXingbie(busDmcgyq.getXingbie());
+      query.setFxmc(busDmcgyq.getFxmc());
+      query.setDeptStationId(busDmcgyq.getDeptStationId());
+      List<BusDmcgyq> busDmcgyqList = busDmcgyqMapper.getList(query);
+
+      if(x.getDgqclG1() != null) {
+        BusJcbDmcgyq g1detail = new BusJcbDmcgyq();
+        x.setGyqNumber("G1");
+        x.setScz(x.getDgqclG1());
+        x.setCzlc(getCzlc(busDmcgyqList,"G1"));
+        BeanUtils.copyBeanProp(g1detail, x);
+        resultList.add(g1detail);
+      }
+      if(x.getDgqclG2() != null) {
+        BusJcbDmcgyq g2detail = new BusJcbDmcgyq();
+        x.setGyqNumber("G2");
+        x.setScz(x.getDgqclG2());
+        x.setCzlc(getCzlc(busDmcgyqList,"G2"));
+        BeanUtils.copyBeanProp(g2detail, x);
+        resultList.add(g2detail);
+      }
+      if(x.getDgqclG3() != null) {
+        BusJcbDmcgyq g3detail = new BusJcbDmcgyq();
+        x.setGyqNumber("G3");
+        x.setScz(x.getDgqclG3());
+        x.setCzlc(getCzlc(busDmcgyqList,"G3"));
+        BeanUtils.copyBeanProp(g3detail, x);
+        resultList.add(g3detail);
+      }
+      if(x.getDgqclG4() != null) {
+        BusJcbDmcgyq g4detail = new BusJcbDmcgyq();
+        x.setGyqNumber("G4");
+        x.setScz(x.getDgqclG4());
+        x.setCzlc(getCzlc(busDmcgyqList,"G4"));
+        BeanUtils.copyBeanProp(g4detail, x);
+        resultList.add(g4detail);
+      }
+  }
+
+  private String getCzlc(List<BusDmcgyq> busDmcgyqList, String type) {
+      return busDmcgyqList.stream()
+              .filter(bus -> bus.getSbbh().equals(type))
+              .map(bus -> bus.getCzlc()==null?"":bus.getCzlc().toString())
+              .findFirst().orElse("");
+  }
+
+  private BusJcbDmcgyq transData(BusJcbDmcgyq x, String gyqNumber) {
+    if(StringUtils.YES_VALUE.equals(x.getBspwgAzlg()) &&
+            StringUtils.YES_VALUE.equals(x.getBspwgBsqx()) &&
+            StringUtils.YES_VALUE.equals(x.getDgqwgBmqj()) &&
+            StringUtils.YES_VALUE.equals(x.getDgqwgWzws()) &&
+            StringUtils.YES_VALUE.equals(x.getDgqwgAzlg())) {
+      x.setWsjbjsd("无");
+    } else {
+      x.setWsjbjsd("有");
+    }
+
+    if("G1".equals(gyqNumber)) {
+      x.setScz(x.getDgqclG1());
+    }
+    if("G2".equals(gyqNumber)) {
+      x.setScz(x.getDgqclG2());
+    }
+    if("G3".equals(gyqNumber)) {
+      x.setScz(x.getDgqclG3());
+    }
+    if("G4".equals(gyqNumber)) {
+      x.setScz(x.getDgqclG4());
+    }
+    return x;
   }
 
   /**

BIN
railway-business/src/main/resources/excel/template/地磁感应器检测记录.xls


+ 3 - 0
railway-business/src/main/resources/mapper/baseinfo/BusDmcgyqMapper.xml

@@ -257,6 +257,9 @@
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
       </if>
+      <if test="deptStationId!=null and deptStationId!=''">
+        and t.dept_station_id=#{deptStationId}
+      </if>
       <if test="xingbie!=null and xingbie!=''">
         and t.xingbie=#{xingbie}
       </if>

+ 19 - 1
railway-business/src/main/resources/mapper/catenary/BusJcbDmcgyqMapper.xml

@@ -10,6 +10,7 @@
     <result column="dept_name" property="deptName"/>
     <result column="station_id" property="stationId"/>
     <result column="station_name" property="stationName"/>
+    <result column="line_name" property="lineName"/>
     <result column="dept_station_id" property="deptStationId"/>
     <result column="fenxiang" property="fenxiang"/>
     <result column="xingbie" property="xingbie"/>
@@ -42,6 +43,8 @@
     <result column="update_by" property="updateBy"/>
     <result column="update_time" property="updateTime"/>
     <result column="user_id" property="userId"/>
+    <result column="czlc" property="czlc"/>
+    <result column="ctl" property="ctl"/>
   </resultMap>
 
   <sql id="Base_Column_List">
@@ -51,6 +54,7 @@
     v.dept_name,
     v.station_name as station_name,
     v.station_id,
+    v.line_name,
     t.dept_station_id,
     t.fenxiang,
     t.xingbie,
@@ -331,6 +335,18 @@
 
   </select>
 
+  <select id="getJcebInfo" resultMap="BaseResultMap">
+    SELECT
+    <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text,
+    base.czlc as czlc, '>36' as ctl
+    FROM bus_jcb_dmcgyq t
+    LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
+    LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
+    LEFT JOIN base_dmcgyq base ON t.gyq_id = base.id
+    WHERE t.del_flag='0' and t.id = #{id}
+
+  </select>
+
   <select id="getLastRecord" resultMap="BaseResultMap">
     SELECT
     a.DGQCL_G1, a.DGQCL_G2, a.DGQCL_G3, a.DGQCL_G4
@@ -468,10 +484,12 @@
 
   <select id="getJcebList" resultMap="BaseResultMap">
     SELECT
-    <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
+    <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text,
+    base.czlc as czlc, '>36' as ctl
     FROM bus_jcb_dmcgyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
+    LEFT JOIN base_dmcgyq base ON t.gyq_id = base.id
     <where>
       t.del_flag='0'
       <if test="submitState!=null and submitState!=''">