From 3be3330714a11eecc56a0a3a61a12875355054c2 Mon Sep 17 00:00:00 2001 From: csyue <1203338439@qq.com> Date: Tue, 4 Jun 2024 13:04:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=81=E5=A4=8F=E8=AF=95=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/app/domain/LeaseApplyDetails.java | 5 ++ .../app/mapper/LeaseOutDetailsMapper.java | 4 ++ .../impl/LeaseOutDetailsServiceImpl.java | 50 ++++++++++--------- .../mapper/app/LeaseOutDetailsMapper.xml | 21 +++++++- .../resources/mapper/app/TmTaskMapper.xml | 27 ++++++++-- 5 files changed, 78 insertions(+), 29 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/LeaseApplyDetails.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/LeaseApplyDetails.java index abd73b1d..6cc26f3d 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/LeaseApplyDetails.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/LeaseApplyDetails.java @@ -46,6 +46,11 @@ public class LeaseApplyDetails implements Serializable { */ @ApiModelProperty(value = "类型名称") private String typeName; + /** + * 类型名称 + */ + @ApiModelProperty(value = "领料出库状态") + private String statusName; /** * 规格型号 diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseOutDetailsMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseOutDetailsMapper.java index 6dceec1d..a509fdaa 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseOutDetailsMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseOutDetailsMapper.java @@ -103,4 +103,8 @@ public interface LeaseOutDetailsMapper { int getmaChineByCt(LeaseOutDetails record); void updateMaTypeNum(LeaseApplyDetails leaseApplyDetails); + + LeaseApplyDetails getLeaseApplyDetails(@Param("record") LeaseOutDetails record); + + int updateLeaseApplyDetails(@Param("record") LeaseOutDetails record); } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java index 9ee94be6..950db6b3 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java @@ -202,30 +202,34 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService { int res = 0; // 首先更新领料任务详情表的领料数及状态(lease_apply_details) res = leaseOutDetailsMapper.updateLeaseApplyDetailsOutNum(record); - if (res > 0) { - // 插入领料出库明细表(lease_out_details) - res = leaseOutDetailsMapper.insertSelective(record); - if (res > 0) { - if (record.getManageType() == 2) { - // 成套机具减少 (ma_type 设备规格表)的库存数量 - res = leaseOutDetailsMapper.updateMaTypeStockNum(record); - // 成套机具减少 (ma_type 设备规格表)配件的库存数量 - List typeIds = leaseOutDetailsMapper.getMaTypeDetails(record); - typeIds.removeIf(item -> item == null); - for (TmTask typeId : typeIds) { - MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId); - machinePart.setPartNum((typeId.getPartNum() * record.getOutNum())); - typeId.setNum(machinePart.getNum() - machinePart.getPartNum()); - res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId); - } - } else { - // 普通机具减少 (ma_type 设备规格表)的库存数量 - res = leaseOutDetailsMapper.updateMaTypeStockNum(record); - } - // 更新 (ma_machine 设备表)的状态 - leaseOutDetailsMapper.updateMaMachineStatus(record); - } + LeaseApplyDetails leaseApplyDetails = leaseOutDetailsMapper.getLeaseApplyDetails(record); + if (leaseApplyDetails.getPreNum().equals(leaseApplyDetails.getAlNum()) || leaseApplyDetails.getAuditNum().equals(leaseApplyDetails.getAlNum())){ + leaseOutDetailsMapper.updateLeaseApplyDetails(record); } + if (res > 0) { + // 插入领料出库明细表(lease_out_details) + res = leaseOutDetailsMapper.insertSelective(record); + if (res > 0) { + if (record.getManageType() == 2) { + // 成套机具减少 (ma_type 设备规格表)的库存数量 + res = leaseOutDetailsMapper.updateMaTypeStockNum(record); + // 成套机具减少 (ma_type 设备规格表)配件的库存数量 + List typeIds = leaseOutDetailsMapper.getMaTypeDetails(record); + typeIds.removeIf(item -> item == null); + for (TmTask typeId : typeIds) { + MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId); + machinePart.setPartNum((typeId.getPartNum() * record.getOutNum())); + typeId.setNum(machinePart.getNum() - machinePart.getPartNum()); + res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId); + } + } else { + // 普通机具减少 (ma_type 设备规格表)的库存数量 + res = leaseOutDetailsMapper.updateMaTypeStockNum(record); + } + // 更新 (ma_machine 设备表)的状态 + leaseOutDetailsMapper.updateMaMachineStatus(record); + } + } return res; } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml index fd1ad9dd..ad3a9044 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml @@ -186,7 +186,7 @@ update_by = #{record.updateBy}, update_time = now(), - status = '2' + status = '1' WHERE parennt_id = #{record.parentId} and type_id = #{record.typeId} @@ -315,6 +315,14 @@ WHERE type_id = #{typeId} + + UPDATE + lease_apply_details + SET + status = '2' + WHERE + parennt_id = #{record.parentId} and type_id = #{record.typeId} + insert into tm_task_agreement @@ -431,4 +439,15 @@ + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml index af5e2891..e74bf1f4 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml @@ -606,16 +606,33 @@ From d02a1558524997671dd7c2e6dd5250beeab9fba1 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 4 Jun 2024 14:05:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A7=A3=E5=AF=86=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/system/user/index.vue | 59 +------------------------ 1 file changed, 2 insertions(+), 57 deletions(-) diff --git a/sgzb-ui/src/views/system/user/index.vue b/sgzb-ui/src/views/system/user/index.vue index 3d3cb587..0d92c0e9 100644 --- a/sgzb-ui/src/views/system/user/index.vue +++ b/sgzb-ui/src/views/system/user/index.vue @@ -551,6 +551,7 @@ import { getToken } from '@/utils/auth' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' import { validPassword } from '@/utils/validate' +import { decrypt } from '@/utils/jsencrypt.js' export default { name: 'User', @@ -714,14 +715,7 @@ export default { this.getList() this.getDeptTree() this.getConfigKey('sys.user.initPassword').then((response) => { - this.decryptData(response.msg, this.secretKey) - .then((data) => { - console.log('🚀 ~ this.getConfigKey ~ data:', data) - this.initPassword = data - }) - .catch((error) => { - console.log('🚀 ~ this.getConfigKey ~ error:', error) - }) + this.initPassword = decrypt(response.msg) }) }, methods: { @@ -962,55 +956,6 @@ export default { submitFileForm() { this.$refs.upload.submit() }, - // 加密 - async encryptData(data, keyStr) { - const keyUint8 = new TextEncoder().encode(keyStr) - const key = await crypto.subtle.importKey( - 'raw', - keyUint8, - { name: 'AES-CBC', length: 256 }, - false, - ['encrypt'], - ) - - const iv = crypto.getRandomValues(new Uint8Array(16)) - const cipherTextBuffer = await crypto.subtle.encrypt( - { name: 'AES-CBC', iv }, - key, - new TextEncoder().encode(data), - ) - - const combined = new Uint8Array( - iv.length + cipherTextBuffer.byteLength, - ) - combined.set(iv, 0) - combined.set(new Uint8Array(cipherTextBuffer), iv.length) - - return btoa(String.fromCharCode.apply(null, combined)) - }, - // 解密 - async decryptData(encryptedData, keyStr) { - const keyUint8 = new TextEncoder().encode(keyStr) - const encryptedBytes = Uint8Array.from(atob(encryptedData), (c) => - c.charCodeAt(0), - ) - - const key = await crypto.subtle.importKey( - 'raw', - keyUint8, - { name: 'AES-CBC', length: 256 }, // 假设后端使用了CBC模式,需要调整为实际使用的模式 - false, - ['decrypt'], - ) - - const decryptedData = await crypto.subtle.decrypt( - { name: 'AES-CBC', iv: new Uint8Array(16) }, // 实际使用时需要正确的IV,这里仅为示例 - key, - encryptedBytes, - ) - - return new TextDecoder().decode(decryptedData) - }, }, } From a8fc887cd11194cae9051e764422881490d87177 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 4 Jun 2024 14:18:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=A2=86=E6=96=99=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85-=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/claimAndRefund/receive/receiveExamine.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-ui/src/views/claimAndRefund/receive/receiveExamine.vue b/sgzb-ui/src/views/claimAndRefund/receive/receiveExamine.vue index c9b000c8..a6a5e1b2 100644 --- a/sgzb-ui/src/views/claimAndRefund/receive/receiveExamine.vue +++ b/sgzb-ui/src/views/claimAndRefund/receive/receiveExamine.vue @@ -596,7 +596,7 @@ export default { this.queryParams.leaseApplyDetails.forEach((v) => { this.$set(v, 'applyFor', this.queryParams.applyFor) this.$set(v, 'updateTimes', this.queryParams.updateTimes) - this.$set(v, 'taskName', this.queryParams.taskName) + this.$set(v, 'taskName', v.statusName) this.$set(v, 'createTime', this.queryParams.createTimes) this.$set(v, 'updateTime', this.queryParams.updateTimes) })