parent
636cd2ddc2
commit
5faf388b33
|
|
@ -161,20 +161,16 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
public AjaxResult submitOut(LeaseOutDetails record) {
|
public AjaxResult submitOut(LeaseOutDetails record) {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
try {
|
try {
|
||||||
log.error("check001");
|
|
||||||
// 1、判断是否重复提交
|
// 1、判断是否重复提交
|
||||||
res = checkRepeatSubmit(record);
|
res = checkRepeatSubmit(record);
|
||||||
log.error("check002");
|
|
||||||
record.setPreStoreNum(getStorageNum(record));
|
record.setPreStoreNum(getStorageNum(record));
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
if ((record.getManageType() == 1 || record.getManageType() == 2) && record.getInputNum() != null) {
|
if ((record.getManageType() == 1 || record.getManageType() == 2) && record.getInputNum() != null) {
|
||||||
record.setOutNum(record.getInputNum());
|
record.setOutNum(record.getInputNum());
|
||||||
}
|
}
|
||||||
log.error("check003");
|
|
||||||
//2、判断成套机具出库库存是否足够
|
//2、判断成套机具出库库存是否足够
|
||||||
if (record.getManageType() == 2) {
|
if (record.getManageType() == 2) {
|
||||||
res = checkStorageNumCt(record);
|
res = checkStorageNumCt(record);
|
||||||
log.error("check004");
|
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("出库失败,库存不足");
|
throw new RuntimeException("出库失败,库存不足");
|
||||||
}
|
}
|
||||||
|
|
@ -182,30 +178,24 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
res = checkStorageNum(record);
|
res = checkStorageNum(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.error("check005");
|
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
// 3、插入出库记录,修改库存,修改机具状态
|
// 3、插入出库记录,修改库存,修改机具状态
|
||||||
res = insertRecords(record);
|
res = insertRecords(record);
|
||||||
log.error("check006");
|
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("出库失败,更新设备规格库存数量时出错!");
|
throw new RuntimeException("出库失败,更新设备规格库存数量时出错!");
|
||||||
}
|
}
|
||||||
// 4、修改任务状态(tm_task)
|
// 4、修改任务状态(tm_task)
|
||||||
res = updateTaskStatus(record);
|
res = updateTaskStatus(record);
|
||||||
log.error("check007");
|
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("出库失败,修改任务状态失败");
|
throw new RuntimeException("出库失败,修改任务状态失败");
|
||||||
}
|
}
|
||||||
// 5、插入结算记录
|
// 5、插入结算记录
|
||||||
String taskId = leaseOutDetailsMapper.getTaskId(record.getParentId());
|
String taskId = leaseOutDetailsMapper.getTaskId(record.getParentId());
|
||||||
log.error("check008");
|
|
||||||
res = insSltInfo(taskId, record);
|
res = insSltInfo(taskId, record);
|
||||||
log.error("check009");
|
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("出库失败,插入结算记录失败");
|
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||||
}
|
}
|
||||||
record.setPostStoreNum(getStorageNum(record));
|
record.setPostStoreNum(getStorageNum(record));
|
||||||
log.error("check0010");
|
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("领料出库失败,机具库存不足");
|
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue