Browse Source

服务机构管理-加密处理-前后端提交

953954216 2 years ago
parent
commit
6701558acb

+ 3 - 2
ruoyi-modules/mz-business/src/main/java/com/ruoyi/business/service/impl/YljgXfaqzcxxServiceImpl.java

@@ -12,6 +12,7 @@ import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.security.utils.EncryptionUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.organization.domain.YljgJcxx;
 import com.ruoyi.organization.mapper.YljgJcxxMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -44,14 +45,14 @@ public class YljgXfaqzcxxServiceImpl implements IYljgXfaqzcxxService
     @Override
     public Map<String,Object> selectYlJgMsg(String id){
         Map<String,Object> res = yljgJcxxMapper.selectYlJgMsgBuss(id);
-        EncryptionUtils.encryptionMap(res, new YljgXfaqzcxx());
+        EncryptionUtils.encryptionMap(res, new YljgJcxx());
         return res;
     }
 
     @Override
     public Map<String,Object> selectYlJgMsgTT(){
         Map<String, Object> res = yljgJcxxMapper.selectYlJgMsgBuss(SecurityUtils.getJgId());
-        EncryptionUtils.encryptionMap(res, new YljgXfaqzcxx());
+        EncryptionUtils.encryptionMap(res, new YljgJcxx());
         return res;
     }
 

+ 3 - 3
ruoyi-modules/mz-organization-jg/src/main/resources/mapper/organization/YljgJcxxMapper.xml

@@ -798,9 +798,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectYlJgMsgBuss" resultType="java.util.Map">
         select
-        CONCAT(getxzqhmcbycode(szxzqh),txdz) as txdz,
-        getxzqhmcbycode(szxzqh) as szxzqh,
-        getxzqhmcbycode(ssxzqh) as ssxzqh,
+        a.szxzqh, a.ssxzqh, a.txdz,
+        getxzqhmcbycode(a.szxzqh) as szxzqhName,
+        getxzqhmcbycode(a.ssxzqh) as ssxzqhName,
         a.tyshxydm, a.jgmc, b.dict_label as xbzt,
         a.frxm, a.frlxfs, a.frzjlx, a.frzjhm
         from yljg_jcxx a

+ 9 - 7
ruoyi-ui/src/views/business/fwjggl/ajgsx/xfaqjcxx/index.vue

@@ -663,7 +663,7 @@ import {
   updateXfaqzcxxCx
 } from '@/api/search/xxcx/fwjg/zhjg'
 import { Constant } from '@/utils/constant'
-import { chineseOne, idCard, Regular } from '@/utils/regular'
+import { chineseOne, idCard, Mobile } from '@/utils/regular'
 import TreeNodeDialog from '../../../../tool/build/TreeNodeDialog'
 import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
 
@@ -755,7 +755,7 @@ export default {
         ],
         xfaqfzrdh: [
           { required: true, message: '消防安全负责人手机号码不能为空', trigger: 'blur' },
-          { pattern: Regular.Mobile, message: '消防安全负责人手机号码格式不对', trigger: 'blur' }
+          { validator: Mobile, trigger: 'blur' }
         ],
         xfaqglr: [
           { required: true, message: '消防安全管理人姓名不能为空', trigger: 'blur' },
@@ -771,7 +771,7 @@ export default {
         ],
         xfaqglrdh: [
           { required: true, message: '消防安全管理人手机号码不能为空', trigger: 'blur' },
-          { pattern: Regular.Mobile, message: '消防安全管理人手机号码格式不对', trigger: 'blur' }
+          { validator: Mobile, trigger: 'blur' }
         ],
         mhhjyssya: [
           { required: true, message: '灭火和应急疏散预案不能为空', trigger: 'blur' }
@@ -1125,7 +1125,7 @@ export default {
       }
       // listXfaqzcxx(this.queryParams).then(response => {
       this.request.groupListXfaqzcxx(this.queryParams).then(response => {
-        this.xfaqzcxxList = response.rows
+        this.xfaqzcxxList = decryptRowData_ECB(response.rows, ["zcfzer"], [1]);
         this.total = response.total
         this.loading = false
       })
@@ -1269,8 +1269,10 @@ export default {
       this.reset()
       const id = row.id || this.ids
       this.request.getXfaqzcxx(id).then(response => {
-        this.form = response.data
-        this.fixation = response.data
+        this.form = decryptData_ECB(response.data, ["xfaqfzr", "xfaqfzrdh", "xfaqfzrzjhm", "xfaqglr", "xfaqglrdh", "xfaqglrzjhm", "zcfzer","txdz"], [1, 3, 2, 1, 3, 2, 1,4]);
+        this.fixation = decryptData_ECB(response.data, ["xfaqfzr", "xfaqfzrdh", "xfaqfzrzjhm", "xfaqglr", "xfaqglrdh", "xfaqglrzjhm", "zcfzer","txdz"], [1, 3, 2, 1, 3, 2, 1,4]);
+        // this.form = response.data
+        // this.fixation = response.data
         this.changeXfaqglrzjlx(this.form.xfaqglrzjlx)
         this.changeXfaqfzrzjlx(this.form.xfaqfzrzjlx)
         if (this.form.xfsyhbaqk == '1') {
@@ -1325,7 +1327,7 @@ export default {
         // this.selectYlJgMsg(response.data.jgId)
         this.fixation = response.data
         this.openXQ = true
-        this.form = response.data
+        this.form = decryptData_ECB(response.data, ["xfaqfzr", "xfaqfzrdh", "xfaqfzrzjhm", "xfaqglr", "xfaqglrdh", "xfaqglrzjhm", "zcfzer","txdz"], [1, 3, 2, 1, 3, 2, 1,4]);
         this.form.pbqk = this.form.pbqk ? this.form.pbqk.split(',') : []
         this.form.yljgJcxmxxList = this.form.yljgJcxmxxList.map((item, index) => {
           let rules = {}

+ 27 - 9
ruoyi-ui/src/views/business/fwjggl/bn/index.vue

@@ -661,9 +661,9 @@
 
 <script>
 import { addBn, delBn, getBn, getChangeBn, listBn,listBnGroup, updateBn } from '@/api/business/fwjggl/bn'
-import { chineseOne, idCard, Regular } from '@/utils/regular'
+import { chineseOne, idCard, Mobile } from '@/utils/regular'
 import { Constant } from '@/utils/constant'
-import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
+import { decryptData_ECB, decryptRowData_ECB, decrypt_ECB } from "@/api/tool/sm4";
 
 export default {
   name: 'Bn',
@@ -752,8 +752,7 @@ export default {
         ],
         frlxfs: [
           { required: true, message: '法定代表人或负责人联系方式不能为空', trigger: 'blur' },
-          { pattern: Regular.Mobile, message: '号码格式:131xxxxxxxx或010-88xxxxx', trigger: 'blur' }
-          // { max: 32, message: '法定代表人或负责人联系方式不能超过32个字符', trigger: 'blur' }
+          { validator: Mobile, trigger: 'blur'}
         ],
         frdjjg: [
           { required: true, message: '法人登记机关不能为空', trigger: 'blur' },
@@ -815,8 +814,7 @@ export default {
         ],
         barLxfs: [
           { required: true, message: '备案人联系方式不能为空', trigger: 'blur' },
-          // { max: 11, message: '备案人联系方式不能超过11个字符', trigger: 'blur' },
-          { pattern: Regular.Mobile, message: '号码格式:131xxxxxxxx或010-88xxxxx', trigger: 'blur' }
+          { validator: Mobile, trigger: 'blur'}
         ],
 
         babgXm: [
@@ -833,8 +831,7 @@ export default {
         ],
         babgLxfs: [
           { required: true, message: '备案人联系方式不能为空', trigger: 'blur' },
-          // { max: 11, message: '备案人联系方式不能超过11个字符', trigger: 'blur' },
-          { pattern: Regular.Mobile, message: '号码格式:131xxxxxxxx或010-88xxxxx', trigger: 'blur' }
+          { validator: Mobile, trigger: 'blur'}
         ],
         babgMs: [
           { required: true, message: '变更原因描述不能为空', trigger: 'blur' }
@@ -891,6 +888,7 @@ export default {
           { required: true, message: '落款名称不能为空', trigger: 'blur' }
         ]
       },
+      decodeStr: {},
       qtDispaly: true,
       xzqh: null,
       isBg: true,
@@ -1275,6 +1273,14 @@ export default {
       this.resetBl()
       getChangeBn(row.id).then(response => {
         this.form.id = row.id
+        this.decodeStr.txdz = decrypt_ECB(response.data.txdz)
+        this.decodeStr.frxm = decrypt_ECB(response.data.frxm)
+        this.decodeStr.frzjhm = decrypt_ECB(response.data.frzjhm)
+        this.decodeStr.frlxfs = decrypt_ECB(response.data.frlxfs)
+        console.log('txdz11111  ', this.decodeStr.txdz);
+
+        this.form = decryptData_ECB(response.data, ["txdz", "frxm", "frlxfs", "frzjhm", "barXm", "barZjhm", "barLxfs", "babgXm", "babgSfzhm", "babgLxfs"], [4, 1, 3, 2, 1, 2, 3, 1, 2, 3]);
+
         if (row.bnCjzt == '1') {
           this.title = '养老机构备案详情'
           this.xqList = [...this.jcList, this.jgList]
@@ -1558,6 +1564,7 @@ export default {
       this.reset()
       const id = row.id || this.ids
       getBn(id).then(response => {
+        this.form = decryptData_ECB(response.data, ["txdz", "frxm", "frzjhm", "frlxfs", "barXm", "barZjhm", "barLxfs","babgXm","babgSfzhm","babgLxfs"], [4, 1, 2, 3, 1, 2, 3, 1, 2, 3]);
         this.form = { barXm: '', barZjlx: '', barZjhm: '', babgXm: '', barLxfs: '', babgZjlx: '', babgSfzhm: '', babgMs: '', babgLxfs: '', ...response.data }
         if (this.form.szxzqhIds) {
           // this.form.szxzqh = JSON.stringify(this.form.szxzqhName.split(','))
@@ -1646,8 +1653,19 @@ export default {
         /****** sks 需要改动的地方 start ******/
         // let formData=this.comparisonObject(this.form,this.copyForm);
         let formData = this.comparisonObject({ ...this.form, ...pamar }, this.copyForm)
+        console.log('formData  ', formData);
+
         if (formData) {
-          updateBn({ ...formData, id: this.form.id }).then(response => {
+          let copyform = {
+            ...formData,
+            txdz: this.decodeStr.frdjjg,
+            frxm: this.decodeStr.frxm,
+            frzjhm: this.decodeStr.frzjhm,
+            frlxfs: this.decodeStr.frlxfs
+          }
+          console.log('txdz2222  ', this.copyform.txdz);
+          updateBn(copyform).then(response => {
+          // updateBn({ ...formData, id: this.form.id }).then(response => {
             this.$modal.msgSuccess('修改成功')
             this.open = false
             this.bnList = this.dataReplacement(this.bnList, this.form.id, formData)

+ 1 - 1
ruoyi-ui/src/views/business/fwjggl/jgxxgl/index.vue

@@ -459,7 +459,7 @@ export default {
       this.reset();
       const id = row.id || this.ids
       getJcxx(id).then(response => {
-        this.form = response.data;
+        this.form = decryptData_ECB(response.data, ["frxm", "frzjhm", "frlxfs", "txdz"], [1, 2, 3, 4]);
         Object.keys(this.form).forEach(key => {
           this.form[key] === null ? this.form[key] = '' : false
         })

+ 4 - 3
ruoyi-ui/src/views/business/fwjggl/sqjgxxgl/index.vue

@@ -366,7 +366,8 @@ export default {
       this.loading = true;
       this.queryParams.params = {};
       listSqJcxx(this.queryParams).then(response => {
-        this.jcxxList = response.rows;
+        this.jcxxList = decryptRowData_ECB(response.rows, ["txdz", "frxm", "frlxfs", "frzjhm"], [4, 1, 3, 2]);
+        // this.jcxxList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
@@ -407,7 +408,7 @@ export default {
       this.reset();
       const id = row.id || this.ids
       businessGetSqJcxx(id).then(response => {
-        this.form = response.data;
+        this.form = decryptData_ECB(response.data, ["txdz", "frxm", "frlxfs", "frzjhm"], [4, 1, 3, 2]);
         this.open = true;
         this.title = '社区养老服务机构和设施详细信息'
       })
@@ -417,7 +418,7 @@ export default {
       this.reset();
       this.jgId = row.id;
       this.openXG = true;
-      this.title = '社区养老服务机构和设施'
+      this.title = '社区养老服务机构和设施FFFFFFFFFFF'
     },
     /** 提交按钮 */
     submitFormAndStart() {

+ 2 - 1
ruoyi-ui/src/views/organization/jggl/bn/index.vue

@@ -744,7 +744,8 @@ export default {
       const id = row.id || this.ids
       // getBn(id).then(response => {
       getJcxx(id).then(response => {
-        this.form = response.data;
+        this.form = decryptData_ECB(response.data, ["txdz", "frxm", "frzjhm", "frlxfs", "barXm", "barZjhm", "barLxfs","babgXm","babgSfzhm","babgLxfs"], [4, 1, 2, 3, 1, 2, 3, 1, 2, 3]);
+
         if (this.form.szxzqhName) {
           // this.form.szxzqh = JSON.stringify(this.form.szxzqhName.split(','))
           this.form.szxzqh = JSON.stringify(this.form.szxzqh.split(','))