检查问题
This commit is contained in:
parent
5faf388b33
commit
e248e7dcc5
|
|
@ -229,34 +229,45 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
int res = 0;
|
||||
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||
res = leaseOutDetailsMapper.updateLeaseApplyDetailsOutNum(record);
|
||||
log.error("check001");
|
||||
LeaseApplyDetails leaseApplyDetails = leaseOutDetailsMapper.getLeaseApplyDetails(record);
|
||||
log.error("check002");
|
||||
if (leaseApplyDetails.getPreNum().equals(leaseApplyDetails.getAlNum()) || leaseApplyDetails.getAuditNum().equals(leaseApplyDetails.getAlNum())) {
|
||||
leaseOutDetailsMapper.updateLeaseApplyDetails(record);
|
||||
log.error("check003");
|
||||
}
|
||||
if (res > 0) {
|
||||
// 插入领料出库明细表(lease_out_details)
|
||||
res = leaseOutDetailsMapper.insertSelective(record);
|
||||
log.error("check004");
|
||||
if (res > 0) {
|
||||
if (record.getManageType() == 2) {
|
||||
// 成套机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||
log.error("check005");
|
||||
// 成套机具减少 (ma_type 设备规格表)配件的库存数量
|
||||
List<TmTask> typeIds = leaseOutDetailsMapper.getMaTypeDetails(record);
|
||||
log.error("check006");
|
||||
typeIds.removeIf(item -> item == null);
|
||||
for (TmTask typeId : typeIds) {
|
||||
MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId);
|
||||
log.error("check007");
|
||||
machinePart.setPartNum((typeId.getPartNum() * record.getOutNum()));
|
||||
typeId.setNum(machinePart.getNum() - machinePart.getPartNum());
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId);
|
||||
log.error("check008");
|
||||
}
|
||||
} else {
|
||||
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNum(record);
|
||||
log.error("check009");
|
||||
}
|
||||
// 更新 (ma_machine 设备表)的状态
|
||||
leaseOutDetailsMapper.updateMaMachineStatus(record);
|
||||
log.error("check0010");
|
||||
//查询装备是否推送到租赁
|
||||
MaMachine maMachine = maMachineMapper.selectMaMachineByMaId(Long.valueOf(record.getMaId()));
|
||||
log.error("check0011");
|
||||
if (maMachine != null && maMachine.getPushStatus().equals(1)) {
|
||||
//同步租赁商城机具状态
|
||||
try {
|
||||
|
|
@ -273,6 +284,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
throw new RuntimeException("同步租赁商城机具状态失败");
|
||||
}
|
||||
}
|
||||
log.error("check0012");
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
Loading…
Reference in New Issue