diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 7d6c622..2f89597 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -254,6 +254,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService } return R.ok(idParam.getId().toString()); }else { + currTaskDetServiceBiz.remove(new QueryWrapper().eq(CurrTaskDet.CURR_TASK_ID,currTask.getId())); currTaskServiceBiz.removeById(idParam); return R.ok(idParam.getId().toString()); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java index df3086f..f1f6820 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java @@ -121,11 +121,13 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic { R info = getTaskInfoByIdenCardNum(e.getIdenCardNum()); e.setFinishWeight(info.getData().getFinishWeight()); - e.setFinishQuantity(info.getData().getQuantity()); + e.setFinishQuantity(info.getData().getFinishQuantity()); e.setWaitWeight(info.getData().getWaitWeight()); e.setWaitQuantity(info.getData().getWaitQuantity()); e.setReProcessQuantity(info.getData().getReProcessQuantity()); e.setReProcessWeight(info.getData().getReProcessWeight()); + e.setSurplusQuantity(e.getQuantity()-e.getFinishQuantity()-e.getWaitQuantity()); + e.setSurplusWeight(e.getWeight()-e.getFinishWeight()-e.getWaitWeight()); //当完成数量等于总数量且完成重量等于总重量时订单状态置为2 if (e.getQuantity().equals(e.getFinishQuantity())&&e.getWeight().equals(e.getFinishWeight())){ OrderInfo orderInfo = orderInfoService.getById(e.getId()); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java index 13d9c8c..dfab2e9 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java @@ -159,6 +159,9 @@ public class AsynRunTaskService extends BaseService { runTask.setStatus(3); runTask.setUpdateTime(LocalDateTime.now()); runTaskServiceBiz.updateById(runTask); + currTask.setStatus(0); + currTaskServiceBiz.updateById(currTask); + logger.info("===执行任务:" + currTaskId + " ,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行失败==="); logger.info("任务 " + currTask.getTaskCode() + " 车辆从起点"+startPoint+"台到加工炉过程中失败。"); webSocketServer.sendtoAll("任务 " + currTask.getTaskCode() + " 车辆从起点"+startPoint+"台到加工炉过程中失败。"); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java index 258971c..a802400 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java @@ -195,10 +195,14 @@ public class RunTaskUtils { */ public R runTaskForOutKiln(Long kilnId) throws IOException { //查询正在该工业炉加工的currTask - CurrTask currTask = currTaskServiceBiz.getOne(new QueryWrapper() + List currTaskList = currTaskServiceBiz.list(new QueryWrapper() .eq("is_in", 1) .eq("status", 1) - .eq("kiln_id", kilnId)); + .eq("kiln_id", kilnId).orderByAsc(CurrTask.BEGIN_TIME)); + if (currTaskList.size()==0){ + return R.failed(); + } + CurrTask currTask = currTaskList.get(0); //查询是否为自动任务 if (currTask.getIsAuto() == 1) { logger.info(currTask.getId() + "为自动任务"); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java index 2814021..6597bce 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java @@ -156,4 +156,17 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty(value = "返工数量") private Float reProcessQuantity; + /** + * 剩余重量 + */ + @ApiModelProperty(value = "返工重量") + private Float surplusWeight; + + /** + * 剩余数量 + */ + @ApiModelProperty(value = "返工数量") + private Float surplusQuantity; + + }