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 = "类型名称")
|
@ApiModelProperty(value = "类型名称")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
/**
|
||||||
|
* 类型名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "领料出库状态")
|
||||||
|
private String statusName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格型号
|
* 规格型号
|
||||||
|
|
|
||||||
|
|
@ -103,4 +103,8 @@ public interface LeaseOutDetailsMapper {
|
||||||
int getmaChineByCt(LeaseOutDetails record);
|
int getmaChineByCt(LeaseOutDetails record);
|
||||||
|
|
||||||
void updateMaTypeNum(LeaseApplyDetails leaseApplyDetails);
|
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;
|
int res = 0;
|
||||||
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||||
res = leaseOutDetailsMapper.updateLeaseApplyDetailsOutNum(record);
|
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) {
|
if (res > 0) {
|
||||||
// 插入领料出库明细表(lease_out_details)
|
// 插入领料出库明细表(lease_out_details)
|
||||||
res = leaseOutDetailsMapper.insertSelective(record);
|
res = leaseOutDetailsMapper.insertSelective(record);
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@
|
||||||
update_by = #{record.updateBy},
|
update_by = #{record.updateBy},
|
||||||
</if>
|
</if>
|
||||||
update_time = now(),
|
update_time = now(),
|
||||||
status = '2'
|
status = '1'
|
||||||
WHERE
|
WHERE
|
||||||
parennt_id = #{record.parentId} and type_id = #{record.typeId}
|
parennt_id = #{record.parentId} and type_id = #{record.typeId}
|
||||||
</update>
|
</update>
|
||||||
|
|
@ -315,6 +315,14 @@
|
||||||
WHERE
|
WHERE
|
||||||
type_id = #{typeId}
|
type_id = #{typeId}
|
||||||
</update>
|
</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 id="insertAgreementInfo">
|
||||||
insert into tm_task_agreement
|
insert into tm_task_agreement
|
||||||
|
|
@ -431,4 +439,15 @@
|
||||||
<select id="getmaChineByCt" resultType="java.lang.Integer">
|
<select id="getmaChineByCt" resultType="java.lang.Integer">
|
||||||
select num from ma_type WHERE type_id = #{typeId}
|
select num from ma_type WHERE type_id = #{typeId}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
@ -606,9 +606,26 @@
|
||||||
|
|
||||||
<select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
<select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
|
||||||
SELECT
|
SELECT
|
||||||
lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,
|
lad.*,
|
||||||
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
|
CASE
|
||||||
mt.num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode
|
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
|
FROM
|
||||||
lease_apply_details lad
|
lease_apply_details lad
|
||||||
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
||||||
|
|
|
||||||
|
|
@ -596,7 +596,7 @@ export default {
|
||||||
this.queryParams.leaseApplyDetails.forEach((v) => {
|
this.queryParams.leaseApplyDetails.forEach((v) => {
|
||||||
this.$set(v, 'applyFor', this.queryParams.applyFor)
|
this.$set(v, 'applyFor', this.queryParams.applyFor)
|
||||||
this.$set(v, 'updateTimes', this.queryParams.updateTimes)
|
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, 'createTime', this.queryParams.createTimes)
|
||||||
this.$set(v, 'updateTime', this.queryParams.updateTimes)
|
this.$set(v, 'updateTime', this.queryParams.updateTimes)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -551,6 +551,7 @@ import { getToken } from '@/utils/auth'
|
||||||
import Treeselect from '@riophae/vue-treeselect'
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
import { validPassword } from '@/utils/validate'
|
import { validPassword } from '@/utils/validate'
|
||||||
|
import { decrypt } from '@/utils/jsencrypt.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'User',
|
name: 'User',
|
||||||
|
|
@ -714,14 +715,7 @@ export default {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getDeptTree()
|
this.getDeptTree()
|
||||||
this.getConfigKey('sys.user.initPassword').then((response) => {
|
this.getConfigKey('sys.user.initPassword').then((response) => {
|
||||||
this.decryptData(response.msg, this.secretKey)
|
this.initPassword = decrypt(response.msg)
|
||||||
.then((data) => {
|
|
||||||
console.log('🚀 ~ this.getConfigKey ~ data:', data)
|
|
||||||
this.initPassword = data
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.log('🚀 ~ this.getConfigKey ~ error:', error)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -962,55 +956,6 @@ export default {
|
||||||
submitFileForm() {
|
submitFileForm() {
|
||||||
this.$refs.upload.submit()
|
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>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue