Selaa lähdekoodia

【CHG】修改多选车间查询脚本

ZhaoMn 3 vuotta sitten
vanhempi
commit
b8b8c17e8c

+ 2 - 4
railway-admin/src/main/java/com/railway/web/controller/system/SysProfileController.java

@@ -81,7 +81,7 @@ public class SysProfileController extends BaseController {
   /**
   /**
    * 获取用户所选要查看数据的车间
    * 获取用户所选要查看数据的车间
    */
    */
-  @ApiOperation(value = "获取用户所选要查看数据的车间", response = TableDataInfo.class)
+  @ApiOperation(value = "段领导或中心领导 上次查看检测表所选的车间", response = TableDataInfo.class)
   @GetMapping("/getSelectedDept")
   @GetMapping("/getSelectedDept")
   public AjaxResult getSelectedDept() {
   public AjaxResult getSelectedDept() {
     LoginUser loginUser = getLoginUser();
     LoginUser loginUser = getLoginUser();
@@ -100,15 +100,13 @@ public class SysProfileController extends BaseController {
     }
     }
     AjaxResult ajax = AjaxResult.success();
     AjaxResult ajax = AjaxResult.success();
     ajax.put("selectedDeptId", deptId);
     ajax.put("selectedDeptId", deptId);
-    // 接口兼容
-    ajax.put("selectedDeptIds", deptId);
     return ajax;
     return ajax;
   }
   }
 
 
   /**
   /**
    * 更新用户所选要查看数据的车间
    * 更新用户所选要查看数据的车间
    */
    */
-  @ApiOperation(value = "更新用户所选要查看数据的车间", response = AjaxResult.class)
+  @ApiOperation(value = "更新段领导或中心领导 查看检测表所选的车间", response = AjaxResult.class)
   @Log(title = "用户管理", businessType = BusinessType.UPDATE)
   @Log(title = "用户管理", businessType = BusinessType.UPDATE)
   @PutMapping("/putSelectedDept/{deptId}")
   @PutMapping("/putSelectedDept/{deptId}")
   public AjaxResult putSelectedDept(@PathVariable Long deptId) {
   public AjaxResult putSelectedDept(@PathVariable Long deptId) {

+ 1 - 1
railway-admin/src/main/resources/application-prod.yml

@@ -33,7 +33,7 @@ server:
 # 日志配置
 # 日志配置
 logging:
 logging:
   level:
   level:
-    com.railway: debug
+    com.railway: info
     org.springframework: warn
     org.springframework: warn
 
 
 # Spring配置
 # Spring配置

+ 1 - 1
railway-business/src/main/java/com/railway/business/catenary/domain/BusJcab.java

@@ -46,7 +46,7 @@ public class BusJcab extends BaseEntity {
   @ApiModelProperty(value = "站/区间ID")
   @ApiModelProperty(value = "站/区间ID")
   private Long stationId;
   private Long stationId;
 
 
-  private Long[] stationIds;
+  private List<Long> stationIds;
 
 
   @ApiModelProperty(value = "车间-区间站场关联id")
   @ApiModelProperty(value = "车间-区间站场关联id")
   private Long deptStationId;
   private Long deptStationId;

+ 4 - 0
railway-business/src/main/java/com/railway/business/catenary/service/impl/BusJcabServiceImpl.java

@@ -59,6 +59,10 @@ public abstract class BusJcabServiceImpl {
     if(CollectionUtils.isNotEmpty(jcab.getDeptIds())){
     if(CollectionUtils.isNotEmpty(jcab.getDeptIds())){
       jcab.setDeptId(null);
       jcab.setDeptId(null);
     }
     }
+    // 如果是段领导、中心领导选择了多个车间,就不再使用deptId查询参数
+    if(CollectionUtils.isNotEmpty(jcab.getStationIds())){
+      jcab.setStationId(null);
+    }
     // 设置查询参数
     // 设置查询参数
     if (StringUtils.isNotEmpty(jcab.getOperator()) && StringUtils.isEmpty(jcab.getCheckUser())) {
     if (StringUtils.isNotEmpty(jcab.getOperator()) && StringUtils.isEmpty(jcab.getCheckUser())) {
       jcab.setCheckUser(jcab.getOperator());
       jcab.setCheckUser(jcab.getOperator());

+ 7 - 1
railway-business/src/main/resources/mapper/catenary/BusJcbBlqMapper.xml

@@ -376,10 +376,16 @@
       <if test="deptId!=null and deptId!=''">
       <if test="deptId!=null and deptId!=''">
         and v.dept_id=#{deptId}
         and v.dept_id=#{deptId}
       </if>
       </if>
+      <if test="deptIds!=null and deptIds.size() > 0">
+        and v.dept_id in
+        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+          #{deptId}
+        </foreach>
+      </if>
       <if test="stationId!=null and stationId!=''">
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
         and v.station_id=#{stationId}
       </if>
       </if>
-      <if test="stationIds!=null and stationIds.length > 0">
+      <if test="stationIds!=null and stationIds.size() > 0">
         and v.station_id in
         and v.station_id in
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
           #{stationId}
           #{stationId}

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

@@ -375,10 +375,16 @@
       <if test="deptId!=null and deptId!=''">
       <if test="deptId!=null and deptId!=''">
         and v.dept_id=#{deptId}
         and v.dept_id=#{deptId}
       </if>
       </if>
+      <if test="deptIds!=null and deptIds.size() > 0">
+        and v.dept_id in
+        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+          #{deptId}
+        </foreach>
+      </if>
       <if test="stationId!=null and stationId!=''">
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
         and v.station_id=#{stationId}
       </if>
       </if>
-      <if test="stationIds!=null and stationIds.length > 0">
+      <if test="stationIds!=null and stationIds.size() > 0">
         and v.station_id in
         and v.station_id in
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
           #{stationId}
           #{stationId}

+ 7 - 1
railway-business/src/main/resources/mapper/catenary/BusJcbFdfxjyqMapper.xml

@@ -520,10 +520,16 @@
       <if test="deptId!=null and deptId!=''">
       <if test="deptId!=null and deptId!=''">
         and v.dept_id=#{deptId}
         and v.dept_id=#{deptId}
       </if>
       </if>
+      <if test="deptIds!=null and deptIds.size() > 0">
+        and v.dept_id in
+        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+          #{deptId}
+        </foreach>
+      </if>
       <if test="stationId!=null and stationId!=''">
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
         and v.station_id=#{stationId}
       </if>
       </if>
-      <if test="stationIds!=null and stationIds.length > 0">
+      <if test="stationIds!=null and stationIds.size() > 0">
         and v.station_id in
         and v.station_id in
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
           #{stationId}
           #{stationId}

+ 7 - 1
railway-business/src/main/resources/mapper/catenary/BusJcbGlkgMapper.xml

@@ -716,10 +716,16 @@
       <if test="deptId!=null and deptId!=''">
       <if test="deptId!=null and deptId!=''">
         and v.dept_id=#{deptId}
         and v.dept_id=#{deptId}
       </if>
       </if>
+      <if test="deptIds!=null and deptIds.size() > 0">
+        and v.dept_id in
+        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+          #{deptId}
+        </foreach>
+      </if>
       <if test="stationId!=null and stationId!=''">
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
         and v.station_id=#{stationId}
       </if>
       </if>
-      <if test="stationIds!=null and stationIds.length > 0">
+      <if test="stationIds!=null and stationIds.size() > 0">
         and v.station_id in
         and v.station_id in
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
           #{stationId}
           #{stationId}

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

@@ -500,10 +500,16 @@
       <if test="deptId!=null and deptId!=''">
       <if test="deptId!=null and deptId!=''">
         and v.dept_id=#{deptId}
         and v.dept_id=#{deptId}
       </if>
       </if>
+      <if test="deptIds!=null and deptIds.size() > 0">
+        and v.dept_id in
+        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+          #{deptId}
+        </foreach>
+      </if>
       <if test="stationId!=null and stationId!=''">
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
         and v.station_id=#{stationId}
       </if>
       </if>
-      <if test="stationIds!=null and stationIds.length > 0">
+      <if test="stationIds!=null and stationIds.size() > 0">
         and v.station_id in
         and v.station_id in
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
           #{stationId}
           #{stationId}

+ 7 - 1
railway-business/src/main/resources/mapper/catenary/BusJcbWjcxcMapper.xml

@@ -483,10 +483,16 @@
       <if test="deptId!=null and deptId!=''">
       <if test="deptId!=null and deptId!=''">
         and v.dept_id=#{deptId}
         and v.dept_id=#{deptId}
       </if>
       </if>
+      <if test="deptIds!=null and deptIds.size() > 0">
+        and v.dept_id in
+        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+          #{deptId}
+        </foreach>
+      </if>
       <if test="stationId!=null and stationId!=''">
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
         and v.station_id=#{stationId}
       </if>
       </if>
-      <if test="stationIds!=null and stationIds.length > 0">
+      <if test="stationIds!=null and stationIds.size() > 0">
         and v.station_id in
         and v.station_id in
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
         <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
           #{stationId}
           #{stationId}