Merge branch 'dev-nx' of http://192.168.0.56:3000/bonus/devicesmgt into dev-nx
This commit is contained in:
commit
e4c4a9fd33
|
|
@ -46,6 +46,11 @@ public class LeaseApplyDetails implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@ApiModelProperty(value = "领料出库状态")
|
||||
private String statusName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,6 +202,10 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
int res = 0;
|
||||
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||
res = leaseOutDetailsMapper.updateLeaseApplyDetailsOutNum(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);
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@
|
|||
update_by = #{record.updateBy},
|
||||
</if>
|
||||
update_time = now(),
|
||||
status = '2'
|
||||
status = '1'
|
||||
WHERE
|
||||
parennt_id = #{record.parentId} and type_id = #{record.typeId}
|
||||
</update>
|
||||
|
|
@ -315,6 +315,14 @@
|
|||
WHERE
|
||||
type_id = #{typeId}
|
||||
</update>
|
||||
<update id="updateLeaseApplyDetails">
|
||||
UPDATE
|
||||
lease_apply_details
|
||||
SET
|
||||
status = '2'
|
||||
WHERE
|
||||
parennt_id = #{record.parentId} and type_id = #{record.typeId}
|
||||
</update>
|
||||
|
||||
<insert id="insertAgreementInfo">
|
||||
insert into tm_task_agreement
|
||||
|
|
@ -431,4 +439,15 @@
|
|||
<select id="getmaChineByCt" resultType="java.lang.Integer">
|
||||
select num from ma_type WHERE type_id = #{typeId}
|
||||
</select>
|
||||
<select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
||||
SELECT
|
||||
ifnull( pre_num, 0 ) AS preNum,
|
||||
ifnull( audit_num, 0 ) AS auditNum,
|
||||
ifnull( al_num, 0 ) AS alNum
|
||||
FROM
|
||||
lease_apply_details
|
||||
WHERE
|
||||
parennt_id = #{record.parentId}
|
||||
AND type_id = #{record.typeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -606,9 +606,26 @@
|
|||
|
||||
<select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
||||
SELECT
|
||||
lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,
|
||||
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
|
||||
mt.num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode
|
||||
lad.*,
|
||||
CASE
|
||||
WHEN lad.`status` = 0 THEN
|
||||
'待出库'
|
||||
WHEN lad.`status` = 1 THEN
|
||||
'出库进行中'
|
||||
WHEN lad.`status` = 2 THEN
|
||||
'已出库'
|
||||
END statusName,
|
||||
mt.type_name AS typeModelName,
|
||||
mt1.type_name AS typeName,
|
||||
mt.unit_name AS unitName,
|
||||
mt.manage_type AS manageType,
|
||||
CASE
|
||||
WHEN mt.manage_type = '0' THEN
|
||||
'编号' ELSE '计数'
|
||||
END manageTypeName,
|
||||
mt.num,
|
||||
(lad.pre_num -IF( lad.al_num IS NULL, '0', lad.al_num )) AS outNum,
|
||||
mm.ma_code AS maCode
|
||||
FROM
|
||||
lease_apply_details lad
|
||||
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue