15143018065 1 tydzień temu
rodzic
commit
b68c14e369

+ 8 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/WlfwJkyjController.java

@@ -2,6 +2,8 @@ package com.ruoyi.system.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.WlfwYjbw;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -25,7 +27,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 
 /**
  * 为老服务监控硬件信息Controller
- * 
+ *
  * @author sun
  * @date 2023-07-24
  */
@@ -48,6 +50,11 @@ public class WlfwJkyjController extends BaseController
         return getDataTable(list);
     }
 
+    @GetMapping("/commonList")
+    public List<WlfwJkyj> commonList(WlfwJkyj wlfwJkyj) {
+        return wlfwJkyjService.selectWlfwJkyjList(wlfwJkyj);
+    }
+
     /**
      * 导出为老服务监控硬件信息列表
      */

+ 5 - 5
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/WlfwJkyjListController.java

@@ -25,7 +25,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 
 /**
  * 为老服务监控硬件列表Controller
- * 
+ *
  * @author sun
  * @date 2024-09-09
  */
@@ -87,7 +87,7 @@ public class WlfwJkyjListController extends BaseController
      */
     @RequiresPermissions("system:jkyjList:edit")
     @Log(title = "为老服务监控硬件列表", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @PostMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody WlfwJkyjList wlfwJkyjList)
     {
         return toAjax(wlfwJkyjListService.updateWlfwJkyjList(wlfwJkyjList));
@@ -98,9 +98,9 @@ public class WlfwJkyjListController extends BaseController
      */
     @RequiresPermissions("system:jkyjList:remove")
     @Log(title = "为老服务监控硬件列表", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids)
+	@PostMapping("/remove")
+    public AjaxResult remove(@RequestBody WlfwJkyjList wlfwJkyjList)
     {
-        return toAjax(wlfwJkyjListService.deleteWlfwJkyjListByIds(ids));
+        return toAjax(wlfwJkyjListService.deleteWlfwJkyjListByIds(wlfwJkyjList.getId()));
     }
 }

+ 6 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/WlfwYjbwController.java

@@ -83,6 +83,12 @@ public class WlfwYjbwController extends BaseController
         return toAjax(wlfwYjbwService.insertWlfwYjbw(wlfwYjbw),wlfwYjbw.getId());
     }
 
+    @PostMapping("/handle")
+    public AjaxResult handle(@RequestBody WlfwYjbw wlfwYjbw)
+    {
+        return toAjax(wlfwYjbwService.handle(wlfwYjbw),wlfwYjbw.getId());
+    }
+
     /**
      * 修改为老服务监控硬件报文信息
      */

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/WlfwJkyjList.java

@@ -146,4 +146,6 @@ public class WlfwJkyjList
     @NumberV(message = "{设备状态 0}")
     private String status;
 
+    @TableField(exist = false)
+    private String lrXm;
 }

+ 10 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/WlfwYjbw.java

@@ -1,6 +1,7 @@
 package com.ruoyi.system.domain;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.ruoyi.common.core.annotation.Excel;
@@ -77,8 +78,6 @@ public class WlfwYjbw extends BaseEntity
     /** 接报数据 */
     @Excel(name = "接报数据")
     @ApiModelProperty(value = "接报数据")
-    @Size(max = -1, message = "{接报数据}")
-
     private String jbsj;
 
     /** 触发结果 */
@@ -114,4 +113,13 @@ public class WlfwYjbw extends BaseEntity
 
     private String createAreaCode;
 
+    private String iscl;
+
+    private String cljg;
+
+    @TableField(exist = false)
+    private String lrXm;
+
+    @TableField(exist = false)
+    private String[] ids;
 }

+ 4 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/WlfwJgMapper.java

@@ -1,15 +1,18 @@
 package com.ruoyi.system.mapper;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ruoyi.system.domain.WlfwJg;
 import com.ruoyi.common.datascope.utils.BaseMapperPlus;
 
 /**
  * 为老服务机构信息Mapper接口
- * 
+ *
  * @author sun
  * @date 2023-07-24
  */
 public interface WlfwJgMapper extends BaseMapperPlus<WlfwJg> {
 
+    public Map<String, String> getYljgJcxx(String id);
 }

+ 8 - 8
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IWlfwJkyjListService.java

@@ -5,15 +5,15 @@ import com.ruoyi.system.domain.WlfwJkyjList;
 
 /**
  * 为老服务监控硬件列表Service接口
- * 
+ *
  * @author sun
  * @date 2024-09-09
  */
-public interface IWlfwJkyjListService 
+public interface IWlfwJkyjListService
 {
     /**
      * 查询为老服务监控硬件列表
-     * 
+     *
      * @param id 为老服务监控硬件列表主键
      * @return 为老服务监控硬件列表
      */
@@ -21,7 +21,7 @@ public interface IWlfwJkyjListService
 
     /**
      * 查询为老服务监控硬件列表列表
-     * 
+     *
      * @param wlfwJkyjList 为老服务监控硬件列表
      * @return 为老服务监控硬件列表集合
      */
@@ -29,7 +29,7 @@ public interface IWlfwJkyjListService
 
     /**
      * 新增为老服务监控硬件列表
-     * 
+     *
      * @param wlfwJkyjList 为老服务监控硬件列表
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface IWlfwJkyjListService
 
     /**
      * 修改为老服务监控硬件列表
-     * 
+     *
      * @param wlfwJkyjList 为老服务监控硬件列表
      * @return 结果
      */
@@ -45,10 +45,10 @@ public interface IWlfwJkyjListService
 
     /**
      * 批量删除为老服务监控硬件列表
-     * 
+     *
      * @param ids 需要删除的为老服务监控硬件列表主键集合
      * @return 结果
      */
-    public int deleteWlfwJkyjListByIds(String[] ids);
+    public int deleteWlfwJkyjListByIds(String ids);
 
 }

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IWlfwYjbwService.java

@@ -41,6 +41,8 @@ public interface IWlfwYjbwService
      */
     public int insertWlfwYjbw(WlfwYjbw wlfwYjbw);
 
+    public int handle(WlfwYjbw wlfwYjbw);
+
     /**
      * 修改为老服务监控硬件报文信息
      *

+ 47 - 11
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WlfwJkyjListServiceImpl.java

@@ -1,9 +1,18 @@
 package com.ruoyi.system.service.impl;
 
 import java.util.List;
+
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.security.utils.SysDeptJlUtils;
+import com.ruoyi.system.mapper.SysDeptJlMapper;
+import com.ruoyi.system.mapper.WlfwJgMapper;
+import com.ruoyi.system.mapper.WlfwJkyjMapper;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import java.util.Arrays;
+import java.util.Map;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.system.mapper.WlfwJkyjListMapper;
 import com.ruoyi.system.domain.WlfwJkyjList;
@@ -11,43 +20,70 @@ import com.ruoyi.system.service.IWlfwJkyjListService;
 
 /**
  * 为老服务监控硬件列表Service业务层处理
- * 
+ *
  * @author sun
  * @date 2024-09-09
  */
 @Service
-public class WlfwJkyjListServiceImpl implements IWlfwJkyjListService 
+public class WlfwJkyjListServiceImpl implements IWlfwJkyjListService
 {
     @Autowired
     private WlfwJkyjListMapper wlfwJkyjListMapper;
 
+    @Autowired
+    private WlfwJgMapper wlfwJgMapper;
+
+    @Autowired
+    private WlfwJkyjMapper wlfwJkyjMapper;
+
     /**
      * 查询为老服务监控硬件列表
-     * 
+     *
      * @param id 为老服务监控硬件列表主键
      * @return 为老服务监控硬件列表
      */
     @Override
     public WlfwJkyjList selectWlfwJkyjListById(String id)
     {
-        return wlfwJkyjListMapper.selectById(id);
+        WlfwJkyjList res = wlfwJkyjListMapper.selectById(id);
+        if (ObjectUtils.isNotEmpty(res)) {
+            if (StringUtils.isNotEmpty(res.getLrid())) {
+                Map<String, String> lr = wlfwJkyjMapper.selectLrById(res.getLrid());
+                if (ObjectUtils.isNotEmpty(lr) && lr.containsKey("xm")) {
+                    res.setLrXm(lr.get("xm"));
+                }
+            }
+        }
+        return res;
     }
 
     /**
      * 查询为老服务监控硬件列表列表
-     * 
+     *
      * @param wlfwJkyjList 为老服务监控硬件列表
      * @return 为老服务监控硬件列表
      */
     @Override
     public List<WlfwJkyjList> selectWlfwJkyjListList(WlfwJkyjList wlfwJkyjList)
     {
-        return wlfwJkyjListMapper.selectList(new LambdaQueryWrapper<>(wlfwJkyjList));
+        List<WlfwJkyjList> res = wlfwJkyjListMapper.selectList(new LambdaQueryWrapper<>(wlfwJkyjList));
+        res.forEach(r -> {
+            if (StringUtils.isNotEmpty(r.getJgid())) {
+                Map<String, String> jgxx = wlfwJgMapper.getYljgJcxx(r.getJgid());
+                if (ObjectUtils.isNotEmpty(jgxx) && jgxx.containsKey("jgmc")) {
+                    r.setJgid(jgxx.get("jgmc"));
+                }
+            }
+            if (StringUtils.isNotEmpty(r.getSsqh())) {
+                r.setSsqh(SysDeptJlUtils.getDeptCache(r.getSsqh()));
+            }
+        });
+        return res;
     }
 
     /**
      * 新增为老服务监控硬件列表
-     * 
+     *
      * @param wlfwJkyjList 为老服务监控硬件列表
      * @return 结果
      */
@@ -59,7 +95,7 @@ public class WlfwJkyjListServiceImpl implements IWlfwJkyjListService
 
     /**
      * 修改为老服务监控硬件列表
-     * 
+     *
      * @param wlfwJkyjList 为老服务监控硬件列表
      * @return 结果
      */
@@ -71,14 +107,14 @@ public class WlfwJkyjListServiceImpl implements IWlfwJkyjListService
 
     /**
      * 批量删除为老服务监控硬件列表
-     * 
+     *
      * @param ids 需要删除的为老服务监控硬件列表主键
      * @return 结果
      */
     @Override
-    public int deleteWlfwJkyjListByIds(String[] ids)
+    public int deleteWlfwJkyjListByIds(String ids)
     {
-        return wlfwJkyjListMapper.deleteBatchIds(Arrays.asList(ids));
+        return wlfwJkyjListMapper.deleteById(ids);
     }
 
 }

+ 45 - 3
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WlfwYjbwServiceImpl.java

@@ -1,18 +1,27 @@
 package com.ruoyi.system.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.ruoyi.common.core.exception.ServiceException;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.system.api.enums.SysUserTypeStatus;
+import com.ruoyi.system.api.enums.WhetherStatus;
 import com.ruoyi.system.domain.WlfwYjbw;
+import com.ruoyi.system.mapper.WlfwJkyjMapper;
 import com.ruoyi.system.mapper.WlfwYjbwMapper;
 import com.ruoyi.system.service.IWlfwYjbwService;
 import com.ruoyi.system.utils.SubCodeUtil;
+import io.seata.common.util.CollectionUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * 为老服务监控硬件报文信息Service业务层处理
@@ -26,6 +35,9 @@ public class WlfwYjbwServiceImpl implements IWlfwYjbwService
     @Autowired
     private WlfwYjbwMapper wlfwYjbwMapper;
 
+    @Autowired
+    private WlfwJkyjMapper wlfwJkyjMapper;
+
     /**
      * 查询为老服务监控硬件报文信息
      *
@@ -35,7 +47,14 @@ public class WlfwYjbwServiceImpl implements IWlfwYjbwService
     @Override
     public WlfwYjbw selectWlfwYjbwById(String id)
     {
-        return wlfwYjbwMapper.selectById(id);
+        WlfwYjbw res = wlfwYjbwMapper.selectById(id);
+        if (ObjectUtils.isNotEmpty(res)) {
+            Map<String, String> lr = wlfwJkyjMapper.selectLrById(res.getLrId());
+            if (ObjectUtils.isNotEmpty(lr) && lr.containsKey("xm")) {
+                res.setLrXm(lr.get("xm"));
+            }
+        }
+        return res;
     }
 
     /**
@@ -47,10 +66,19 @@ public class WlfwYjbwServiceImpl implements IWlfwYjbwService
     @Override
     public List<WlfwYjbw> selectWlfwYjbwList(WlfwYjbw wlfwYjbw)
     {
-        if (com.ruoyi.common.core.utils.StringUtils.equals(SecurityUtils.getLoginUser().getSysUser().getUserType(), SysUserTypeStatus.YLFWS.getCode())) {
+        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
             wlfwYjbw.setJgId(SecurityUtils.getWlfwsId());
         }
-        return wlfwYjbwMapper.selectList(new LambdaQueryWrapper<>(wlfwYjbw));
+        List<WlfwYjbw> res = wlfwYjbwMapper.selectList(new LambdaQueryWrapper<>(wlfwYjbw).orderByDesc(WlfwYjbw::getSbsj));
+        res.forEach(r -> {
+            if (StringUtils.isNotEmpty(r.getLrId())) {
+                Map<String, String> lr = wlfwJkyjMapper.selectLrById(r.getLrId());
+                if (ObjectUtils.isNotEmpty(lr) && lr.containsKey("xm")) {
+                    r.setLrXm(lr.get("xm"));
+                }
+            }
+        });
+        return res;
     }
 
 
@@ -82,6 +110,20 @@ public class WlfwYjbwServiceImpl implements IWlfwYjbwService
         return wlfwYjbwMapper.insert(wlfwYjbw);
     }
 
+    @Override
+    public int handle(WlfwYjbw wlfwYjbw) {
+        if (CollectionUtils.isEmpty(wlfwYjbw.getIds())) {
+            throw new ServiceException("处理报文主键不能为空");
+        }
+        if (StringUtils.isEmpty(wlfwYjbw.getCljg())) {
+            throw new ServiceException("处理结果不能为空");
+        }
+        List<String> idList = Stream.of(wlfwYjbw.getIds()).collect(Collectors.toList());
+        LambdaUpdateWrapper<WlfwYjbw> luw = new LambdaUpdateWrapper<WlfwYjbw>().in(WlfwYjbw::getId, idList)
+                .set(WlfwYjbw::getCljg, wlfwYjbw.getCljg()).set(WlfwYjbw::getIscl, WhetherStatus.YES.getCode());
+        return wlfwYjbwMapper.update(null, luw);
+    }
+
     /**
      * 修改为老服务监控硬件报文信息
      *

+ 3 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/WlfwJgMapper.xml

@@ -43,4 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="state"    column="state"    />
     </resultMap>
 
+    <select id="getYljgJcxx" parameterType="String" resultType="java.util.HashMap">
+        select * from yljg_jcxx where id = #{id}
+    </select>
 </mapper>

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/WlfwYjbwMapper.xml

@@ -14,6 +14,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="sbsj"    column="sbsj"    />
         <result property="jbsj"    column="jbsj"    />
         <result property="cfjg"    column="cfjg"    />
+        <result property="iscl"    column="iscl"    />
+        <result property="cljg"    column="cljg"    />
         <result property="status"    column="status"    />
         <result property="createTimeStr"    column="create_time_str"    />
         <result property="createUserId"    column="create_user_id"    />

+ 6 - 5
ruoyi-ui/src/api/system/jkyjList.js

@@ -29,16 +29,17 @@ export function addJkyjList(data) {
 // 修改为老服务监控硬件列表
 export function updateJkyjList(data) {
   return request({
-    url: '/system/jkyjList',
-    method: 'put',
+    url: '/system/jkyjList/edit',
+    method: 'post',
     data: data
   })
 }
 
 // 删除为老服务监控硬件列表
-export function delJkyjList(id) {
+export function delJkyjList(data) {
   return request({
-    url: '/system/jkyjList/' + id,
-    method: 'delete'
+    url: '/system/jkyjList/remove',
+    method: 'post',
+    data: data
   })
 }

+ 9 - 0
ruoyi-ui/src/api/system/yjbw.js

@@ -42,3 +42,12 @@ export function delYjbw(id) {
     method: 'delete'
   })
 }
+
+// 处理为老服务监控硬件报文信息
+export function handleYjbw(data) {
+  return request({
+    url: '/system/yjbw/handle',
+    method: 'post',
+    data: data
+  })
+}

+ 31 - 0
ruoyi-ui/src/api/tool/sm4.js

@@ -670,3 +670,34 @@ export function decryptRowData_ECB(rowdata, fields, hides) {
   }
   return rowdata
 }
+
+export function decryptDataDef_ECB(rowdata, fields, hides) {
+  if (rowdata) {
+    var s4 = new SM4Util();
+    s4.secretKey = getsm4Keydef();
+    for (let j = 0; j < fields.length; j++) {
+      if (rowdata[fields[j]] != null) {
+        let zfc = s4.decryptData_ECB(rowdata[fields[j]]);
+        zfc instanceof Array ? rowdata[fields[j]] = maskArr(zfc, hides[j]) : rowdata[fields[j]] = mask(zfc, hides[j])
+      }
+    }
+  }
+  return rowdata
+}
+
+export function decryptRowDataDef_ECB(rowdata, fields, hides) {
+  if (rowdata && rowdata.length > 0) {
+    var s4 = new SM4Util();
+    s4.secretKey = getsm4Keydef();
+    for (let i = 0; i < rowdata.length; i++) {
+      for (let j = 0; j < fields.length; j++) {
+        if (rowdata[i][fields[j]] != null) {
+          let srcs = rowdata[i][fields[j]]
+          let zfc = s4.decryptData_ECB(srcs);
+          rowdata[i][fields[j]] = mask(zfc, hides[j]);
+        }
+      }
+    }
+  }
+  return rowdata
+}

+ 90 - 126
ruoyi-ui/src/views/system/jkyjList/index.vue

@@ -1,26 +1,10 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="机构主键标识" prop="jgid">
+      <el-form-item label="隶属机构" prop="jgid">
         <el-input
           v-model="queryParams.jgid"
-          placeholder="请输入机构主键标识"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="老人主键标识" prop="lrid">
-        <el-input
-          v-model="queryParams.lrid"
-          placeholder="请输入老人主键标识"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="设备主键标识" prop="sbid">
-        <el-input
-          v-model="queryParams.sbid"
-          placeholder="请输入设备主键标识"
+          placeholder="请输入隶属机构"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -76,12 +60,12 @@
         />
       </el-form-item>
       <el-form-item label="接入时间" prop="jrsj">
-          <el-date-picker clearable
-            v-model="queryParams.jrsj"
-            type="datetime"
-            value-format="yyyyMMddHHmmss"
-            placeholder="请选择接入时间">
-          </el-date-picker>
+        <el-date-picker clearable
+                        v-model="queryParams.jrsj"
+                        type="datetime"
+                        value-format="yyyyMMddHHmmss"
+                        placeholder="请选择接入时间">
+        </el-date-picker>
       </el-form-item>
       <el-form-item label="安装方式" prop="azfs">
         <el-input
@@ -91,22 +75,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="数据上报频次" prop="sbpc">
-        <el-input
-          v-model="queryParams.sbpc"
-          placeholder="请输入数据上报频次"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="最近数据上报时间" prop="zjsbsj">
-          <el-date-picker clearable
-            v-model="queryParams.zjsbsj"
-            type="datetime"
-            value-format="yyyyMMddHHmmss"
-            placeholder="请选择最近数据上报时间">
-          </el-date-picker>
-      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -122,7 +90,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['system:jkyjList:add']"
-        >新增</el-button>
+        >新增
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -132,45 +101,37 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['system:jkyjList:export']"
-        >导出</el-button>
+        >导出
+        </el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="jkyjListList" >
+    <el-table v-loading="loading" :data="jkyjListList">
       <el-table-column label="序号" align="center">
         <template slot-scope="scope">
-          {{(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1}}
+          {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
         </template>
       </el-table-column>
-      <el-table-column label="所属区划" align="center" prop="ssqh" />
-      <el-table-column label="机构主键标识" align="center" prop="jgid" />
-      <el-table-column label="老人主键标识" align="center" prop="lrid" />
-      <el-table-column label="设备主键标识" align="center" prop="sbid" />
-      <el-table-column label="设备编号" align="center" prop="sbbh" />
+      <el-table-column label="所属区划" align="center" prop="ssqh"/>
+      <el-table-column label="隶属机构" align="center" prop="jgid"/>
+      <!--      <el-table-column label="归属老人姓名" align="center" prop="lrid"/>-->
+      <el-table-column label="设备编号" align="center" prop="sbbh"/>
       <el-table-column label="设备类别" align="center" prop="sblb">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.WL003" :value="scope.row.sblb"/>
         </template>
       </el-table-column>
-      <el-table-column label="设备名称" align="center" prop="sbmc" />
-      <el-table-column label="生产厂家" align="center" prop="sccj" />
-      <el-table-column label="品牌型号" align="center" prop="ppxh" />
-      <el-table-column label="接入方式" align="center" prop="jrfs" />
+      <el-table-column label="设备名称" align="center" prop="sbmc"/>
+      <el-table-column label="生产厂家" align="center" prop="sccj"/>
+      <el-table-column label="品牌型号" align="center" prop="ppxh"/>
+      <el-table-column label="接入方式" align="center" prop="jrfs"/>
       <el-table-column label="接入时间" align="center" prop="jrsj" width="180">
         <template slot-scope="scope">
-            <span>{{ special(scope.row.jrsj,'time') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="安装方式" align="center" prop="azfs" />
-      <el-table-column label="安装描述" align="center" prop="azms" />
-      <el-table-column label="数据上报频次" align="center" prop="sbpc" />
-      <el-table-column label="最近数据上报时间" align="center" prop="zjsbsj" width="180">
-        <template slot-scope="scope">
-            <span>{{ special(scope.row.zjsbsj,'time') }}</span>
+          <span>{{ special(scope.row.jrsj, 'time') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="最近接报数据" align="center" prop="zjsb" />
+      <el-table-column label="安装方式" align="center" prop="azfs"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
         <template slot-scope="scope">
           <el-button
@@ -179,14 +140,16 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:jkyjList:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row,scope.$index)"
             v-hasPermi="['system:jkyjList:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -204,75 +167,75 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
 
         <el-form-item label="所属区划" prop="ssqh">
-          <el-input v-model="form.ssqh" type="textarea" maxlength="255" show-word-limit placeholder="请输入所属区划" />
+          <el-input v-model="form.ssqh" type="textarea" maxlength="255" show-word-limit placeholder="请输入所属区划"/>
         </el-form-item>
 
-        <el-form-item label="老人主键标识" prop="lrid">
-          <el-input v-model="form.lrid" placeholder="请输入老人主键标识" />
+        <el-form-item label="归属老人" prop="lrXm">
+          <el-input :disabled="true" v-model="form.lrXm" placeholder="请输入归属老人"/>
         </el-form-item>
 
-        <el-form-item label="设备主键标识" prop="sbid">
-          <el-input v-model="form.sbid" placeholder="请输入设备主键标识" />
-        </el-form-item>
+        <!--        <el-form-item label="设备主键标识" prop="sbid">-->
+        <!--          <el-input v-model="form.sbid" placeholder="请输入设备主键标识" />-->
+        <!--        </el-form-item>-->
 
         <el-form-item label="设备编号" prop="sbbh">
-          <el-input v-model="form.sbbh" placeholder="请输入设备编号" />
+          <el-input v-model="form.sbbh" placeholder="请输入设备编号"/>
         </el-form-item>
 
         <el-form-item label="设备类别" prop="sblb">
-          <el-select v-model="form.sblb" placeholder="请选择设备类别">
+          <el-select v-model="form.sblb" placeholder="请选择设备类别" style="width: 380px">
             <el-option
               v-for="dict in dict.type.WL003"
               :key="dict.value"
               :label="dict.label"
-:value="dict.value"
+              :value="dict.value"
             ></el-option>
           </el-select>
         </el-form-item>
 
         <el-form-item label="设备名称" prop="sbmc">
-          <el-input v-model="form.sbmc" placeholder="请输入设备名称" />
+          <el-input v-model="form.sbmc" placeholder="请输入设备名称"/>
         </el-form-item>
 
         <el-form-item label="生产厂家" prop="sccj">
-          <el-input v-model="form.sccj" placeholder="请输入生产厂家" />
+          <el-input v-model="form.sccj" placeholder="请输入生产厂家"/>
         </el-form-item>
 
         <el-form-item label="品牌型号" prop="ppxh">
-          <el-input v-model="form.ppxh" placeholder="请输入品牌型号" />
+          <el-input v-model="form.ppxh" placeholder="请输入品牌型号"/>
         </el-form-item>
 
         <el-form-item label="接入方式" prop="jrfs">
-          <el-input v-model="form.jrfs" placeholder="请输入接入方式" />
+          <el-input v-model="form.jrfs" placeholder="请输入接入方式"/>
         </el-form-item>
 
         <el-form-item label="接入时间" prop="jrsj">
           <el-date-picker clearable
-            v-model="form.jrsj"
-            type="datetime"
-            value-format="yyyyMMddHHmmss"
-            placeholder="请选择接入时间">
+                          v-model="form.jrsj"
+                          type="datetime"
+                          value-format="yyyyMMddHHmmss"
+                          placeholder="请选择接入时间" style="width: 380px">
           </el-date-picker>
         </el-form-item>
 
         <el-form-item label="安装方式" prop="azfs">
-          <el-input v-model="form.azfs" placeholder="请输入安装方式" />
+          <el-input v-model="form.azfs" placeholder="请输入安装方式"/>
         </el-form-item>
 
         <el-form-item label="安装描述" prop="azms">
-          <el-input v-model="form.azms" type="textarea" maxlength="400" show-word-limit placeholder="请输入安装描述" />
+          <el-input v-model="form.azms" type="textarea" maxlength="400" show-word-limit placeholder="请输入安装描述"/>
         </el-form-item>
 
         <el-form-item label="数据上报频次" prop="sbpc">
-          <el-input v-model="form.sbpc" placeholder="请输入数据上报频次" />
+          <el-input v-model="form.sbpc" placeholder="请输入数据上报频次"/>
         </el-form-item>
 
         <el-form-item label="最近数据上报时间" prop="zjsbsj">
           <el-date-picker clearable
-            v-model="form.zjsbsj"
-            type="datetime"
-            value-format="yyyyMMddHHmmss"
-            placeholder="请选择最近数据上报时间">
+                          v-model="form.zjsbsj"
+                          type="datetime"
+                          value-format="yyyyMMddHHmmss"
+                          placeholder="请选择最近数据上报时间" style="width: 380px">
           </el-date-picker>
         </el-form-item>
 
@@ -286,10 +249,10 @@
 </template>
 
 <script>
-  import {addJkyjList, delJkyjList, getJkyjList, listJkyjList, updateJkyjList} from "@/api/system/jkyjList";
-  import {chineseOne, idCard, Regular} from '@/utils/regular'
+import {addJkyjList, delJkyjList, getJkyjList, listJkyjList, updateJkyjList} from "@/api/system/jkyjList";
+import {chineseOne, idCard, Regular} from '@/utils/regular'
 
-  export default {
+export default {
   name: "JkyjList",
   dicts: ['WL003'],
   data() {
@@ -323,29 +286,29 @@
       // 表单校验
       rules: {
         sbbh: [
-          { required: true, message: "设备编号不能为空", trigger: "blur" },
-          { max: 32, message: '设备编号不能超过32个字符', trigger: 'blur'},
+          {required: true, message: "设备编号不能为空", trigger: "blur"},
+          {max: 32, message: '设备编号不能超过32个字符', trigger: 'blur'},
         ],
         sbmc: [
-          { max: 72, message: '设备名称不能超过72个字符', trigger: 'blur'},
+          {max: 72, message: '设备名称不能超过72个字符', trigger: 'blur'},
         ],
         sccj: [
-          { max: 72, message: '生产厂家不能超过72个字符', trigger: 'blur'},
+          {max: 72, message: '生产厂家不能超过72个字符', trigger: 'blur'},
         ],
         ppxh: [
-          { max: 32, message: '品牌型号不能超过32个字符', trigger: 'blur'},
+          {max: 32, message: '品牌型号不能超过32个字符', trigger: 'blur'},
         ],
         jrfs: [
-          { max: 2, message: '接入方式不能超过2个字符', trigger: 'blur'},
+          {max: 2, message: '接入方式不能超过2个字符', trigger: 'blur'},
         ],
         azfs: [
-          { max: 2, message: '安装方式不能超过2个字符', trigger: 'blur'},
+          {max: 2, message: '安装方式不能超过2个字符', trigger: 'blur'},
         ],
         sbpc: [
-          { max: 12, message: '数据上报频次不能超过12个字符', trigger: 'blur'},
+          {max: 12, message: '数据上报频次不能超过12个字符', trigger: 'blur'},
         ],
         status: [
-          { required: true, message: "设备状态 0不能为空", trigger: "blur" },
+          {required: true, message: "设备状态 0不能为空", trigger: "blur"},
         ]
       }
     };
@@ -370,7 +333,7 @@
     },
     // 表单重置
     reset() {
-      this.submitFormLoading =false;
+      this.submitFormLoading = false;
       this.form = {
         id: null,
         ssqh: null,
@@ -386,6 +349,7 @@
         azfs: null,
         azms: null,
         sbpc: null,
+        lrXm: null,
         zjsbsj: null,
         zjsb: null,
         status: 0
@@ -405,14 +369,14 @@
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
       this.open = true;
-      this.title = "添加为老服务监控硬件列表";
+      this.title = "监控硬件";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -421,10 +385,10 @@
       getJkyjList(id).then(response => {
         this.form = response.data;
         /****** sks 需要改动的地方 start ******/
-        this.copyForm=this.deepCopy(response.data)
+        this.copyForm = this.deepCopy(response.data)
         /****** sks 需要改动的地方 end ******/
         this.open = true;
-        this.title = "修改为老服务监控硬件列表";
+        this.title = "监控硬件";
       });
     },
     /** 提交按钮 */
@@ -434,15 +398,15 @@
           this.submitFormLoading = true;
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
-            let formData=this.comparisonObject(this.form,this.copyForm);
-            if(formData) {
-              updateJkyjList({...formData,id:this.form.id}).then(response => {
+            let formData = this.comparisonObject(this.form, this.copyForm);
+            if (formData) {
+              updateJkyjList({...formData, id: this.form.id}).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
-                this.jkyjListList=this.dataReplacement(this.jkyjListList,this.form.id,formData);
+                this.jkyjListList = this.dataReplacement(this.jkyjListList, this.form.id, formData);
                 // this.getList();
-              }).finally(()=>this.submitFormLoading =false);
-            }else{
+              }).finally(() => this.submitFormLoading = false);
+            } else {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.submitFormLoading = false;
@@ -454,37 +418,37 @@
               this.open = false;
               // this.getList();
               /****** sks 需要改动的地方 start ******/
-              if (this.queryParams.pageSize===this.jkyjListList.length)
-              {
+              if (this.queryParams.pageSize === this.jkyjListList.length) {
                 this.jkyjListList.pop();
               }
-              this.jkyjListList.unshift({...this.form,id:response.data});
+              this.jkyjListList.unshift({...this.form, id: response.data});
               this.total++;
               /****** sks 需要改动的地方 end ******/
-            }).finally(()=>this.submitFormLoading =false);
+            }).finally(() => this.submitFormLoading = false);
           }
         }
       });
     },
     /** 删除按钮操作 */
-    handleDelete(row,index) {
-      const ids = row.id || this.ids;
-      const xh = (this.queryParams.pageNum-1)*this.queryParams.pageSize + index + 1;
-      this.$modal.confirm('确认删除' + this.changeDelData(row,'id','ID值',xh) + '的记录?').then(function() {
-        return delJkyjList(ids);
+    handleDelete(row, index) {
+      const ids = row.id;
+      const xh = (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
+      this.$modal.confirm('确认删除' + this.changeDelData(row, 'id', 'ID值', xh) + '的记录?').then(function () {
+        const param = {id: ids};
+        return delJkyjList(param);
       }).then(() => {
         // this.getList();
         /****** sks 需要改动的地方 ind参数需要传进来 start ******/
-        this.jkyjListList.splice(index,1);
-        if(this.jkyjListList.length===0)
-        {
+        this.jkyjListList.splice(index, 1);
+        if (this.jkyjListList.length === 0) {
           this.getList();
-        }else {
+        } else {
           this.total--;
         }
         this.$modal.msgSuccess("删除成功");
         /****** sks 需要改动的地方 end ******/
-      }).catch(() => {});
+      }).catch(() => {
+      });
     },
     /** 导出按钮操作 */
     handleExport() {

+ 204 - 131
ruoyi-ui/src/views/system/yjbw/index.vue

@@ -4,13 +4,26 @@
       <el-form-item label="报文类型" prop="bwlx">
         <el-select v-model="queryParams.bwlx" placeholder="请选择报文类型" clearable>
           <el-option
-            v-for="dict in dict.type.sys_user_sex"
+            v-for="dict in dict.type.WL004"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="是否处理" prop="iscl">
+        <el-select v-model="queryParams.iscl" @change="getList" placeholder="请选择是否处理" clearable>
+          <el-option
+            v-for="dict in dict.type.CZ035"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="选择客户" prop="lrId">
+        <BizDict :value="queryParams.lrId" :parmar="parmarKh" @changeData="changeDataKh" :para1="paramJg"></BizDict>
+      </el-form-item>
       <el-form-item label="设备编号" prop="sbbh">
         <el-input
           v-model="queryParams.sbbh"
@@ -26,76 +39,98 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="primary"-->
+      <!--          plain-->
+      <!--          icon="el-icon-plus"-->
+      <!--          size="mini"-->
+      <!--          @click="handleAdd"-->
+      <!--          v-hasPermi="['system:yjbw:add']"-->
+      <!--        >新增-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="warning"-->
+      <!--          plain-->
+      <!--          icon="el-icon-download"-->
+      <!--          size="mini"-->
+      <!--          @click="handleExport"-->
+      <!--          v-hasPermi="['system:yjbw:export']"-->
+      <!--        >导出-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="primary"
           plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['system:yjbw:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
+          icon="el-icon-edit"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['system:yjbw:export']"
-        >导出</el-button>
+          @click="handleUpdateRows"
+          v-hasPermi="['system:yjbw:edit']"
+        >批量处理
+        </el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="yjbwList" >
+    <el-table ref="table" v-loading="loading" :data="yjbwList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="序号" align="center">
         <template slot-scope="scope">
-          {{(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1}}
+          {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
         </template>
       </el-table-column>
       <el-table-column label="报文类型" align="center" prop="bwlx">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.bwlx"/>
+          <dict-tag :options="dict.type.WL004" :value="scope.row.bwlx"/>
         </template>
       </el-table-column>
-      <el-table-column label="设备编号" align="center" prop="sbbh" />
-      <el-table-column label="数据上报时间" align="center" prop="sbsj" width="180">
+      <el-table-column label="设备编号" align="center" prop="sbbh"/>
+      <el-table-column label="归属客户" align="center" prop="lrXm"/>
+      <el-table-column label="接收时间" align="center" prop="sbsj" width="180">
         <template slot-scope="scope">
-            <span>{{ special(scope.row.sbsj,'time') }}</span>
+          <span>{{ special(scope.row.sbsj, 'time') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="触发结果" align="center" prop="cfjg">
+      <el-table-column label="触发原因" align="center" prop="cfjg"/>
+      <el-table-column label="是否处理" align="center" prop="iscl">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.cfjg"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="机构老人区分" align="center" prop="status">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.status"/>
+          <dict-tag :options="dict.type.CZ035" :value="scope.row.iscl"/>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
         <template slot-scope="scope">
           <el-button
+            v-if="scope.row.iscl === '0'"
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:yjbw:edit']"
-          >修改</el-button>
+          >处理
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleView(scope.row)"
+            v-hasPermi="['system:yjbw:edit']"
+          >详情
+          </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row,scope.$index)"
             v-hasPermi="['system:yjbw:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -104,75 +139,69 @@
       @pagination="getList"
     />
 
-    <!-- 添加或修改为老服务监控硬件报文信息对话框 -->
-    <el-dialog v-dialog-drag :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-
-        <el-form-item label="报文类型" prop="bwlx">
-          <el-select v-model="form.bwlx" placeholder="请选择报文类型">
-            <el-option
-              v-for="dict in dict.type.sys_user_sex"
-              :key="dict.value"
-              :label="dict.label"
-:value="dict.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-
-        <el-form-item label="设备编号" prop="sbbh">
-          <el-input v-model="form.sbbh" placeholder="请输入设备编号" />
-        </el-form-item>
-
-        <el-form-item label="数据上报时间" prop="sbsj">
-          <el-date-picker clearable
-            v-model="form.sbsj"
-            type="datetime"
-            value-format="yyyyMMddHHmmss"
-            placeholder="请选择数据上报时间">
-          </el-date-picker>
-        </el-form-item>
-
-        <el-form-item label="接报数据" prop="jbsj">
-          <el-input v-model="form.jbsj" type="textarea" maxlength="-1" show-word-limit placeholder="请输入接报数据" />
-        </el-form-item>
-
-        <el-form-item label="触发结果" prop="cfjg">
-          <el-select v-model="form.cfjg" placeholder="请选择触发结果">
-            <el-option
-              v-for="dict in dict.type.sys_user_sex"
-              :key="dict.value"
-              :label="dict.label"
-:value="dict.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
+    <!-- 详情页 -->
+    <el-dialog v-dialog-drag :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-scrollbar wrapClass="scroll-height">
+        <h3>智能硬件报文信息</h3>
+        <table>
+          <tr>
+            <td>报文类型</td>
+            <td>{{ translateDict('WL004', form.bwlx) }}</td>
+            <td>设备编号</td>
+            <td>{{ form.sbbh }}</td>
+          </tr>
+          <tr>
+            <td>归属老人</td>
+            <td>{{ form.lrXm }}</td>
+            <td>接收时间</td>
+            <td>{{ special(form.sbsj, 'time') }}</td>
+          </tr>
+          <tr>
+            <td>触发原因</td>
+            <td>{{ form.cfjg }}</td>
+            <td>处理结果</td>
+            <td>{{ form.cljg }}</td>
+          </tr>
+          <tr>
+            <td>报文信息</td>
+            <td colspan="3">{{ form.jbsj }}</td>
+          </tr>
+        </table>
+      </el-scrollbar>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="cancel">确 定</el-button>
+      </div>
+    </el-dialog>
 
-        <el-form-item label="机构老人区分" prop="status">
-          <el-select v-model="form.status" placeholder="请选择机构老人区分">
-            <el-option
-              v-for="dict in dict.type.sys_user_sex"
-              :key="dict.value"
-              :label="dict.label"
-:value="dict.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-      </el-form>
+    <!-- 处理页 -->
+    <el-dialog v-dialog-drag title="录入处理结果" :visible.sync="openHandle" width="800px" append-to-body>
+      <el-scrollbar wrapClass="scroll-height">
+        <h3>处理结果</h3>
+        <el-form ref="handleForm" :model="handleForm" :rules="rules" label-width="150px">
+          <el-form-item label="处理结果" prop="cljg">
+            <el-input v-model="handleForm.cljg" type="textarea" maxlength="200" show-word-limit placeholder="请输入处理结果"/>
+          </el-form-item>
+        </el-form>
+      </el-scrollbar>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" :loading="submitFormLoading">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
+        <el-button type="primary" @click="handleYjbw">确 定</el-button>
       </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-  import {addYjbw, delYjbw, getYjbw, listYjbw, updateYjbw} from "@/api/system/yjbw";
-  import {chineseOne, idCard, Regular} from '@/utils/regular'
+import {addYjbw, handleYjbw, delYjbw, getYjbw, listYjbw, updateYjbw} from "@/api/system/yjbw";
+import {chineseOne, idCard, Regular} from '@/utils/regular'
+import {decryptDataDef_ECB, decryptRowDataDef_ECB} from '@/api/tool/sm4';
+import {mapState} from "vuex";
 
-  export default {
+export default {
   name: "Yjbw",
-  dicts: ['sys_user_sex'],
+  dicts: ['WL004', 'CZ035'],
+  computed: {
+    ...mapState(['user'])
+  },
   data() {
     return {
       // 遮罩层
@@ -190,39 +219,46 @@
       total: 0,
       // 为老服务监控硬件报文信息表格数据
       yjbwList: [],
+      parmarKh: {
+        dictType: 'kh'
+      },
       // 弹出层标题
       title: "",
       // 是否显示弹出层
       open: false,
+      openHandle: false,
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        iscl: '0',
+        bwlx: null,
+        sbbh: null,
+        lrId: null,
       },
+      paramJg: '',
       // 表单参数
       form: {},
+      handleForm: {
+        cljg: null,
+      },
       // 表单校验
       rules: {
         bwlx: [
-          { required: true, message: "报文类型不能为空", trigger: "change" },
+          {required: true, message: "报文类型不能为空", trigger: "change"},
         ],
         sbbh: [
-          { required: true, message: "设备编号不能为空", trigger: "blur" },
-          { max: 32, message: '设备编号不能超过32个字符', trigger: 'blur'},
-        ],
-        createBmjsc: [
-          { max: 60, message: '部门检索串不能超过60个字符', trigger: 'blur'},
+          {required: true, message: "设备编号不能为空", trigger: "blur"},
+          {max: 32, message: '设备编号不能超过32个字符', trigger: 'blur'},
         ],
-        createQhjsc: [
-          { max: 80, message: '区划检索串不能超过80个字符', trigger: 'blur'},
-        ],
-        createAreaCode: [
-          { max: 12, message: '创建人行政区划编码不能超过12个字符', trigger: 'blur'},
+        cljg: [
+          {required: true, message: '处理结果不能为空', trigger: 'blur'},
         ],
       }
     };
   },
   created() {
+    this.paramJg = this.user.userData.jgId;
     this.getList();
   },
   methods: {
@@ -230,7 +266,7 @@
     getList() {
       this.loading = true;
       listYjbw(this.queryParams).then(response => {
-        this.yjbwList = response.rows;
+        this.yjbwList = decryptRowDataDef_ECB(response.rows, ['lrXm'], [1]);
         this.total = response.total;
         this.loading = false;
       });
@@ -240,9 +276,19 @@
       this.open = false;
       this.reset();
     },
+    // 客户
+    changeDataKh(id, data) {
+      if (data) {
+        this.queryParams.lrId = data.bm;
+        this.getList();
+      } else {
+        this.queryParams.lrId = null;
+        this.getList();
+      }
+    },
     // 表单重置
     reset() {
-      this.submitFormLoading =false;
+      this.submitFormLoading = false;
       this.form = {
         id: null,
         lrId: null,
@@ -267,32 +313,54 @@
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.lrId = null;
       this.resetForm("queryForm");
       this.handleQuery();
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
       this.open = true;
-      this.title = "添加为老服务监控硬件报文信息";
+      this.title = "智能硬件报文信息";
     },
-    /** 修改按钮操作 */
+    /** 处理按钮操作 */
     handleUpdate(row) {
+      this.handleForm.cljg = null;
+      this.ids = [];
+      this.$refs["table"].clearSelection();
+      this.ids.push(row.id);
+      this.openHandle = true;
+    },
+    /** 批量处理按钮操作 */
+    handleUpdateRows() {
+      this.handleForm.cljg = null;
+      this.openHandle = true;
+    },
+    /** 修改按钮操作 */
+    handleYjbw() {
+      this.$refs["handleForm"].validate(valid => {
+        if (valid) {
+          handleYjbw({...this.handleForm, ids: this.ids}).then(response => {
+            this.$modal.msgSuccess("处理成功");
+            this.openHandle = false;
+            this.getList();
+          });
+        }
+      });
+    },
+    handleView(row) {
       this.reset();
-      const id = row.id || this.ids
+      const id = row.id;
       getYjbw(id).then(response => {
-        this.form = response.data;
-        /****** sks 需要改动的地方 start ******/
-        this.copyForm=this.deepCopy(response.data)
-        /****** sks 需要改动的地方 end ******/
+        this.form = decryptDataDef_ECB(response.data, ['lrXm'], [1]);
         this.open = true;
-        this.title = "修改为老服务监控硬件报文信息";
+        this.title = "智能硬件报文信息";
       });
     },
     /** 提交按钮 */
@@ -302,15 +370,15 @@
           this.submitFormLoading = true;
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
-            let formData=this.comparisonObject(this.form,this.copyForm);
-            if(formData) {
-              updateYjbw({...formData,id:this.form.id}).then(response => {
+            let formData = this.comparisonObject(this.form, this.copyForm);
+            if (formData) {
+              updateYjbw({...formData, id: this.form.id}).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
-                this.yjbwList=this.dataReplacement(this.yjbwList,this.form.id,formData);
+                this.yjbwList = this.dataReplacement(this.yjbwList, this.form.id, formData);
                 // this.getList();
-              }).finally(()=>this.submitFormLoading =false);
-            }else{
+              }).finally(() => this.submitFormLoading = false);
+            } else {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.submitFormLoading = false;
@@ -322,44 +390,49 @@
               this.open = false;
               // this.getList();
               /****** sks 需要改动的地方 start ******/
-              if (this.queryParams.pageSize===this.yjbwList.length)
-              {
+              if (this.queryParams.pageSize === this.yjbwList.length) {
                 this.yjbwList.pop();
               }
-              this.yjbwList.unshift({...this.form,id:response.data});
+              this.yjbwList.unshift({...this.form, id: response.data});
               this.total++;
               /****** sks 需要改动的地方 end ******/
-            }).finally(()=>this.submitFormLoading =false);
+            }).finally(() => this.submitFormLoading = false);
           }
         }
       });
     },
     /** 删除按钮操作 */
-    handleDelete(row,index) {
+    handleDelete(row, index) {
       const ids = row.id || this.ids;
-      const xh = (this.queryParams.pageNum-1)*this.queryParams.pageSize + index + 1;
-      this.$modal.confirm('确认删除' + this.changeDelData(row,'id','ID值',xh) + '的记录?').then(function() {
+      const xh = (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
+      this.$modal.confirm('确认删除' + this.changeDelData(row, 'id', 'ID值', xh) + '的记录?').then(function () {
         return delYjbw(ids);
       }).then(() => {
         // this.getList();
         /****** sks 需要改动的地方 ind参数需要传进来 start ******/
-        this.yjbwList.splice(index,1);
-        if(this.yjbwList.length===0)
-        {
+        this.yjbwList.splice(index, 1);
+        if (this.yjbwList.length === 0) {
           this.getList();
-        }else {
+        } else {
           this.total--;
         }
         this.$modal.msgSuccess("删除成功");
         /****** sks 需要改动的地方 end ******/
-      }).catch(() => {});
+      }).catch(() => {
+      });
     },
     /** 导出按钮操作 */
     handleExport() {
       this.download('system/yjbw/export', {
         ...this.queryParams
       }, `yjbw_${new Date().getTime()}.xlsx`)
-    }
+    },
+    translateDict(type, value) {
+      return this.selectDictLabel(this.dict.type[type], value)
+    },
   }
 };
 </script>
+<style rel="stylesheet/scss" lang="scss" scoped>
+@import '@/assets/styles/common/common.scss';
+</style>