安全漏洞升级,推送逻辑优化
This commit is contained in:
parent
56e9c40f59
commit
30b81bf3dc
|
|
@ -159,7 +159,6 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AjaxResult submitOut(LeaseOutDetails record) {
|
public AjaxResult submitOut(LeaseOutDetails record) {
|
||||||
log.error("check0001");
|
|
||||||
int res = 0;
|
int res = 0;
|
||||||
try {
|
try {
|
||||||
// 1、判断是否重复提交
|
// 1、判断是否重复提交
|
||||||
|
|
@ -178,7 +177,6 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
} else {
|
} else {
|
||||||
res = checkStorageNum(record);
|
res = checkStorageNum(record);
|
||||||
}
|
}
|
||||||
log.error("check0002");
|
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
// 3、插入出库记录,修改库存,修改机具状态
|
// 3、插入出库记录,修改库存,修改机具状态
|
||||||
res = insertRecords(record);
|
res = insertRecords(record);
|
||||||
|
|
@ -230,45 +228,41 @@ 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);
|
||||||
log.error("check001");
|
|
||||||
LeaseApplyDetails leaseApplyDetails = leaseOutDetailsMapper.getLeaseApplyDetails(record);
|
LeaseApplyDetails leaseApplyDetails = leaseOutDetailsMapper.getLeaseApplyDetails(record);
|
||||||
log.error("check002");
|
|
||||||
if (leaseApplyDetails.getPreNum().equals(leaseApplyDetails.getAlNum()) || leaseApplyDetails.getAuditNum().equals(leaseApplyDetails.getAlNum())) {
|
if (leaseApplyDetails.getPreNum().equals(leaseApplyDetails.getAlNum()) || leaseApplyDetails.getAuditNum().equals(leaseApplyDetails.getAlNum())) {
|
||||||
leaseOutDetailsMapper.updateLeaseApplyDetails(record);
|
leaseOutDetailsMapper.updateLeaseApplyDetails(record);
|
||||||
log.error("check003");
|
|
||||||
}
|
}
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
// 插入领料出库明细表(lease_out_details)
|
// 插入领料出库明细表(lease_out_details)
|
||||||
res = leaseOutDetailsMapper.insertSelective(record);
|
res = leaseOutDetailsMapper.insertSelective(record);
|
||||||
log.error("check004");
|
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
if (record.getManageType() == 2) {
|
if (record.getManageType() == 2) {
|
||||||
// 成套机具减少 (ma_type 设备规格表)的库存数量
|
// 成套机具减少 (ma_type 设备规格表)的库存数量
|
||||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||||
log.error("check005");
|
|
||||||
// 成套机具减少 (ma_type 设备规格表)配件的库存数量
|
// 成套机具减少 (ma_type 设备规格表)配件的库存数量
|
||||||
List<TmTask> typeIds = leaseOutDetailsMapper.getMaTypeDetails(record);
|
List<TmTask> typeIds = leaseOutDetailsMapper.getMaTypeDetails(record);
|
||||||
log.error("check006");
|
|
||||||
typeIds.removeIf(item -> item == null);
|
typeIds.removeIf(item -> item == null);
|
||||||
for (TmTask typeId : typeIds) {
|
for (TmTask typeId : typeIds) {
|
||||||
MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId);
|
MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId);
|
||||||
log.error("check007");
|
|
||||||
machinePart.setPartNum((typeId.getPartNum() * record.getOutNum()));
|
machinePart.setPartNum((typeId.getPartNum() * record.getOutNum()));
|
||||||
typeId.setNum(machinePart.getNum() - machinePart.getPartNum());
|
typeId.setNum(machinePart.getNum() - machinePart.getPartNum());
|
||||||
res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId);
|
res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId);
|
||||||
log.error("check008");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||||
log.error("check009");
|
|
||||||
}
|
}
|
||||||
// 更新 (ma_machine 设备表)的状态
|
// 更新 (ma_machine 设备表)的状态
|
||||||
leaseOutDetailsMapper.updateMaMachineStatus(record);
|
leaseOutDetailsMapper.updateMaMachineStatus(record);
|
||||||
log.error("check0010{}",record);
|
//判断是数量设备还是编码设备
|
||||||
|
if (record.getMaId()!=null){
|
||||||
//查询装备是否推送到租赁
|
//查询装备是否推送到租赁
|
||||||
MaMachine maMachine = maMachineMapper.selectMaMachineByMaId(Long.valueOf(record.getMaId()));
|
MaMachine maMachine = maMachineMapper.selectMaMachineByMaId(Long.valueOf(record.getMaId()));
|
||||||
log.error("check0011");
|
|
||||||
if (maMachine != null && maMachine.getPushStatus().equals(1)) {
|
if (maMachine != null && maMachine.getPushStatus().equals(1)) {
|
||||||
//同步租赁商城机具状态
|
//同步租赁商城机具状态
|
||||||
try {
|
try {
|
||||||
|
|
@ -285,7 +279,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
throw new RuntimeException("同步租赁商城机具状态失败");
|
throw new RuntimeException("同步租赁商城机具状态失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.error("check0012");
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue