fix:取消任务时更新库存
This commit is contained in:
@@ -115,7 +115,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
acsToWmsService.receiveTaskStatusAcs(JSON.toJSONString(finish));
|
||||
break;
|
||||
case "cancel":
|
||||
if (taskObj.getTask_status().equals(StatusEnum.TASK_RUNNING.getCode())){
|
||||
if (taskObj.getTask_status().equals(StatusEnum.TASK_RUNNING.getCode())||taskObj.getTask_status().equals(StatusEnum.TASK_CANNEL.getCode())){
|
||||
JSONArray cancel = new JSONArray();
|
||||
JSONObject res2 = new JSONObject();
|
||||
res2.put("task_id", task_id);
|
||||
@@ -126,7 +126,6 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_CANNEL.getCode()),"task_id = '"+task_id+"'");
|
||||
}
|
||||
|
||||
break;
|
||||
case "delete":
|
||||
SchBaseTask one = getOne(new QueryWrapper<SchBaseTask>().eq("task_id", task_id));
|
||||
|
||||
@@ -883,14 +883,12 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delTask(JSONObject whereJson) {
|
||||
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getById(whereJson.getString("iostorinvdis_id"));
|
||||
|
||||
// 1.删除任务
|
||||
iSchBaseTaskService.update(
|
||||
new UpdateWrapper<SchBaseTask>().lambda()
|
||||
.set(SchBaseTask::getTask_status,TaskStatusEnum.CANCEL.getCode())
|
||||
.eq(SchBaseTask::getTask_id, disDao.getTask_id())
|
||||
);
|
||||
|
||||
// 2.更新分配
|
||||
iostorinvdisCpService.update(
|
||||
new UpdateWrapper<StIvtIostorinvdisCp>().lambda()
|
||||
@@ -902,6 +900,24 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
.eq(StIvtIostorinvdisCp::getStoragevehicle_code, disDao.getStoragevehicle_code())
|
||||
.eq(StIvtIostorinvdisCp::getIostorinv_id, disDao.getIostorinv_id())
|
||||
);
|
||||
// 解锁货位
|
||||
iStIvtStructattrService.update(
|
||||
new StIvtStructattr()
|
||||
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.setInv_code("")
|
||||
.setInv_type("")
|
||||
.setIs_zdepth("")
|
||||
.setInv_id(""),
|
||||
new QueryWrapper<StIvtStructattr>().lambda()
|
||||
.eq(StIvtStructattr::getStruct_id, disDao.getStruct_id())
|
||||
);
|
||||
StIvtIostorinvdtlCp dtlDao = iostorinvdtlCpService.getById(disDao.getIostorinvdtl_id());
|
||||
StIvtIostorinvCp mstDao = this.getById(disDao.getIostorinv_id());
|
||||
JSONObject param = ivtDataParam(disDao, ChangeIvtUtil.SUBWAREHOUSING_QTY, dtlDao.getBase_billdtl_id());
|
||||
param.put("bill_code",mstDao.getBill_code());
|
||||
param.put("inv_id",mstDao.getIostorinv_id());
|
||||
param.put("bill_type_scode",mstDao.getBill_type());
|
||||
iStIvtStructivtCpService.UpdateIvt(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -249,7 +249,7 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
|
||||
if (ObjectUtil.isEmpty(ivtDao)) {
|
||||
// 为空报错
|
||||
throw new BadRequestException("库存不存在,请检查!");
|
||||
// throw new BadRequestException("库存不存在,请检查!");
|
||||
} else {
|
||||
// 判断库存是否异常
|
||||
double change_qty = NumberUtil.sub(ivtDao.getWarehousing_qty(), json.getDoubleValue("change_qty")).doubleValue();
|
||||
|
||||
Reference in New Issue
Block a user