Commit 5c7c8f712c0741ed1bf14ecdbfd622bf950983d3

Authored by 肖超群
1 parent 3ca1a780

增加错误日志

huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoCheckoutTask.java
... ... @@ -73,6 +73,7 @@ public class AutoCheckoutTask implements Job {
73 73 }
74 74 }
75 75 taskHeaderService.createCheckOutTask(container.getCode(), toPort, warehouseCode);
  76 + log.info(String.format(" AutoCheckoutTask 执行任务! 容器编码:" + container.getCode()));
76 77 }
77 78 }
78 79 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoCreateAgvTask.java
... ... @@ -58,6 +58,7 @@ public class AutoCreateAgvTask implements Job {
58 58 agvTask.setToPort(toPortCode);
59 59 agvTask.setPriority(10);
60 60 Result result = agvTaskService.addAgvTask(agvTask, warehouseCode);
  61 + log.info(String.format("AutoCreateAgvTask 生成AGV任务执行:" + result.getMessage()));
61 62 if (result.isSuccess()) {
62 63 int taskHeaderId = taskHeader.getId();
63 64 taskHeader = new TaskHeader();
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoCreateWaveConfigTask.java
1 1 package org.jeecg.modules.wms.monitor.job;
2 2  
3   -import com.alibaba.fastjson.JSON;
4   -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5   -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
6   -import com.baomidou.mybatisplus.core.toolkit.Wrappers;
7   -import lombok.extern.slf4j.Slf4j;
  3 +import java.util.List;
  4 +
  5 +import javax.annotation.Resource;
  6 +
  7 +import org.jeecg.common.util.DateUtils;
8 8 import org.jeecg.modules.wms.config.waveConfig.entity.WaveConfig;
9 9 import org.jeecg.modules.wms.config.waveConfig.entity.WaveConfigDetail;
10 10 import org.jeecg.modules.wms.config.waveConfig.service.IWaveConfigDetailService;
11 11 import org.jeecg.modules.wms.config.waveConfig.service.IWaveConfigService;
12 12 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
13   -import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
14 13 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService;
15 14 import org.jeecg.utils.constant.QuantityConstant;
16 15 import org.quartz.*;
17 16  
18   -import javax.annotation.Resource;
19   -import java.util.List;
  17 +import com.alibaba.fastjson.JSON;
  18 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  19 +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
  20 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  21 +
  22 +import lombok.extern.slf4j.Slf4j;
20 23  
21 24 @Slf4j
22 25 @PersistJobDataAfterExecution
... ... @@ -34,6 +37,7 @@ public class AutoCreateWaveConfigTask implements Job {
34 37  
35 38 @Override
36 39 public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
  40 + log.info(String.format(" AutoCreateWaveConfigTask 执行任务! 时间:" + DateUtils.getTimestamp()));
37 41 LambdaQueryWrapper<WaveConfig> waveConfigLambdaQueryWrapper = Wrappers.lambdaQuery();
38 42 waveConfigLambdaQueryWrapper.eq(WaveConfig::getIsEnable, QuantityConstant.WAVE_Config_START);
39 43 List<WaveConfig> waveConfigList = waveConfigService.list(waveConfigLambdaQueryWrapper);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoSendAgvTask.java
... ... @@ -40,7 +40,7 @@ public class AutoSendAgvTask implements Job {
40 40 try {
41 41 agvTaskService.sendAgvTaskToAcs(agvTask.getId());
42 42 } catch (Exception e) {
43   - log.error("下发AGV任务执行异常,agvTask:{}", JSON.toJSONString(agvTask), e);
  43 + log.error("AutoSendAgvTask 下发AGV任务执行异常,agvTask:{}", JSON.toJSONString(agvTask), e);
44 44 }
45 45 }
46 46 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoSendWcsTask.java
... ... @@ -44,7 +44,7 @@ public class AutoSendWcsTask implements Job {
44 44  
45 45 @Override
46 46 public void execute(JobExecutionContext context) throws JobExecutionException {
47   - log.info(String.format(" WcsTask 执行任务! 时间:" + DateUtils.getTimestamp()));
  47 + log.info(String.format(" AutoSendWcsTask 执行任务! 时间:" + DateUtils.getTimestamp()));
48 48 LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
49 49 taskHeaderLambdaQueryWrapper.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_BUILD).eq(TaskHeader::getAgvTaskId, 0)
50 50 .ge(TaskHeader::getCreateTime, DateUtil.offsetDay(new Date(), -180)).orderByAsc(TaskHeader::getCreateTime);
... ... @@ -61,6 +61,7 @@ public class AutoSendWcsTask implements Job {
61 61 ? QuantityConstant.DEFAULT_ZONE_CODE : containerZoneCodeMap.get(taskHeader.getContainerCode())));
62 62 // 循环 groupedTaskHeaders 中的每个键值对
63 63 groupeTaskHeaders.forEach((zoneCode, taskHeaders) -> {
  64 + log.info(String.format("AutoSendWcsTask 下发任务执行" + taskHeaders));
64 65 huahengMultiHandlerService.sendTaskToWcs(taskHeaders, taskHeaders.get(0).getWarehouseCode(), zoneCode);
65 66 });
66 67 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/BackUpDataTask.java
... ... @@ -54,7 +54,9 @@ public class BackUpDataTask implements Job {
54 54 Thread.sleep(1000);
55 55 }
56 56 } catch (Exception e) {
  57 + log.info(String.format(" BackUpDataTask 任务执行异常 " + e));
57 58 e.printStackTrace();
58 59 }
  60 + log.info(String.format(" BackUpDataTask 完成任务! 时间:" + DateUtils.getTimestamp()));
59 61 }
60 62 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/ErpTask.java
... ... @@ -4,6 +4,7 @@ import java.util.List;
4 4  
5 5 import javax.annotation.Resource;
6 6  
  7 +import org.jeecg.common.util.DateUtils;
7 8 import org.jeecg.modules.wms.api.erp.service.IErpService;
8 9 import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
9 10 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
... ... @@ -44,6 +45,7 @@ public class ErpTask implements Job {
44 45 LambdaQueryWrapper<ReceiptHeader> receiptHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
45 46 receiptHeaderLambdaQueryWrapper.eq(ReceiptHeader::getLastStatus, QuantityConstant.RECEIPT_HEADER_COMPLETED).isNotNull(ReceiptHeader::getReferCode);
46 47 List<ReceiptHeader> receiptHeaderList = receiptHeaderService.list(receiptHeaderLambdaQueryWrapper);
  48 + log.info(String.format(" ErpTask 执行任务! receiptHeaderList :" + receiptHeaderList + "时间" + DateUtils.getTimestamp()));
47 49 for (ReceiptHeader receiptHeader : receiptHeaderList) {
48 50 try {
49 51 huahengMultiHandlerService.backReceipt(receiptHeader);
... ... @@ -54,6 +56,7 @@ public class ErpTask implements Job {
54 56 LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
55 57 shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getLastStatus, QuantityConstant.SHIPMENT_HEADER_COMPLETED).isNotNull(ShipmentHeader::getReferCode);
56 58 List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(shipmentHeaderLambdaQueryWrapper);
  59 + log.info(String.format(" ErpTask 执行任务! shipmentHeaderList :" + shipmentHeaderList + "时间" + DateUtils.getTimestamp()));
57 60 for (ShipmentHeader shipmentHeader : shipmentHeaderList) {
58 61 try {
59 62 huahengMultiHandlerService.backShipment(shipmentHeader);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/ErpTryTask.java
... ... @@ -4,6 +4,7 @@ import java.util.List;
4 4  
5 5 import javax.annotation.Resource;
6 6  
  7 +import org.jeecg.common.util.DateUtils;
7 8 import org.jeecg.modules.wms.api.erp.service.IErpService;
8 9 import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
9 10 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
... ... @@ -42,6 +43,7 @@ public class ErpTryTask implements Job {
42 43 LambdaQueryWrapper<ReceiptHeader> receiptHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
43 44 receiptHeaderLambdaQueryWrapper.eq(ReceiptHeader::getLastStatus, QuantityConstant.RECEIPT_HEADER_RETURN_ERROR).isNotNull(ReceiptHeader::getReferCode);
44 45 List<ReceiptHeader> receiptHeaderList = receiptHeaderService.list(receiptHeaderLambdaQueryWrapper);
  46 + log.info(String.format(" ErpTryTask 执行任务! receiptHeaderList :" + receiptHeaderList + "时间" + DateUtils.getTimestamp()));
45 47 for (ReceiptHeader receiptHeader : receiptHeaderList) {
46 48 try {
47 49 huahengMultiHandlerService.backReceipt(receiptHeader);
... ... @@ -52,6 +54,7 @@ public class ErpTryTask implements Job {
52 54 LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
53 55 shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getLastStatus, QuantityConstant.SHIPMENT_HEADER_RETURN_ERROR).isNotNull(ShipmentHeader::getReferCode);
54 56 List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(shipmentHeaderLambdaQueryWrapper);
  57 + log.info(String.format(" ErpTryTask 执行任务! shipmentHeaderList :" + shipmentHeaderList + "时间" + DateUtils.getTimestamp()));
55 58 for (ShipmentHeader shipmentHeader : shipmentHeaderList) {
56 59 try {
57 60 huahengMultiHandlerService.backShipment(shipmentHeader);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/InventoryAgeAlarmTask.java
1 1 package org.jeecg.modules.wms.monitor.job;
2 2  
3   -import cn.hutool.core.date.DateUtil;
4   -import cn.hutool.core.text.StrSpliter;
5   -import cn.hutool.core.util.StrUtil;
6   -import lombok.extern.slf4j.Slf4j;
  3 +import java.util.Date;
  4 +import java.util.List;
  5 +import java.util.stream.Collectors;
  6 +
  7 +import javax.annotation.Resource;
  8 +
7 9 import org.apache.ibatis.session.SqlSession;
8 10 import org.jeecg.common.util.DateUtils;
9 11 import org.jeecg.modules.message.websocket.WebSocket;
... ... @@ -16,14 +18,14 @@ import org.jeecg.modules.wms.inventory.inventoryAge.service.impl.InventoryAgeAla
16 18 import org.quartz.*;
17 19 import org.springframework.util.CollectionUtils;
18 20  
19   -import javax.annotation.Resource;
20   -import java.util.Date;
21   -import java.util.List;
22   -import java.util.stream.Collectors;
  21 +import cn.hutool.core.date.DateUtil;
  22 +import cn.hutool.core.text.StrSpliter;
  23 +import cn.hutool.core.util.StrUtil;
  24 +import lombok.extern.slf4j.Slf4j;
23 25  
24 26 /**
25 27 * 库龄预警通知
26   - * @author 游杰
  28 + * @author 周锋
27 29 */
28 30  
29 31 @Slf4j
... ... @@ -77,7 +79,7 @@ public class InventoryAgeAlarmTask implements Job {
77 79 }
78 80 sysAnnouncementService.quickAnnouncementToUser(userList, "库龄预警", msg, DateUtil.offsetDay(new Date(), 1), "H");
79 81 } catch (Exception e) {
80   - log.error("获取预警通知用户出错", e);
  82 + log.error("InventoryAgeAlarmTask 获取预警通知用户出错", e);
81 83 }
82 84 }
83 85 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/InventoryLevelAlarmTask.java
1 1 package org.jeecg.modules.wms.monitor.job;
2 2  
3   -import cn.hutool.core.date.DateUtil;
4   -import cn.hutool.core.text.StrSpliter;
5   -import cn.hutool.core.util.StrUtil;
6   -import lombok.extern.slf4j.Slf4j;
  3 +import java.util.Date;
  4 +import java.util.List;
  5 +import java.util.stream.Collectors;
  6 +
  7 +import javax.annotation.Resource;
  8 +
7 9 import org.apache.ibatis.session.SqlSession;
8 10 import org.jeecg.common.util.DateUtils;
9 11 import org.jeecg.modules.message.websocket.WebSocket;
... ... @@ -16,14 +18,14 @@ import org.jeecg.modules.wms.inventory.inventoryLevel.service.impl.InventoryLeve
16 18 import org.quartz.*;
17 19 import org.springframework.util.CollectionUtils;
18 20  
19   -import javax.annotation.Resource;
20   -import java.util.Date;
21   -import java.util.List;
22   -import java.util.stream.Collectors;
  21 +import cn.hutool.core.date.DateUtil;
  22 +import cn.hutool.core.text.StrSpliter;
  23 +import cn.hutool.core.util.StrUtil;
  24 +import lombok.extern.slf4j.Slf4j;
23 25  
24 26 /**
25 27 * 水位预警通知
26   - * @author 游杰
  28 + * @author 周锋
27 29 */
28 30  
29 31 @Slf4j
... ... @@ -56,7 +58,7 @@ public class InventoryLevelAlarmTask implements Job {
56 58  
57 59 @Override
58 60 public void execute(JobExecutionContext context) throws JobExecutionException {
59   - log.info(StrUtil.format("定时任务 MaterialLevelAlarmTask 参数:{},执行时间:{}", this.parameter, DateUtils.getTimestamp()));
  61 + log.info(StrUtil.format("定时任务 InventoryLevelAlarmTask 参数:{},执行时间:{}", this.parameter, DateUtils.getTimestamp()));
60 62  
61 63 List<InventoryLevelAlarm> alarmList = inventoryLevelAlarmService.getLevelAlarm(null);
62 64 if (CollectionUtils.isEmpty(alarmList)) {
... ... @@ -77,7 +79,7 @@ public class InventoryLevelAlarmTask implements Job {
77 79 }
78 80 sysAnnouncementService.quickAnnouncementToUser(userList, "库存水位预警", msg, DateUtil.offsetDay(new Date(), 1), "H");
79 81 } catch (Exception e) {
80   - log.error("获取预警通知用户出错", e);
  82 + log.error("InventoryLevelAlarmTask 获取预警通知用户出错", e);
81 83 }
82 84 }
83 85 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/MesTask.java
1 1 package org.jeecg.modules.wms.monitor.job;
2 2  
3   -import java.util.HashMap;
4 3 import java.util.List;
5   -import java.util.Map;
6 4  
7 5 import javax.annotation.Resource;
8 6  
9   -import org.apache.commons.collections.MapUtils;
  7 +import org.jeecg.common.util.DateUtils;
10 8 import org.jeecg.modules.wms.api.mes.servuce.IMesService;
11 9 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
12 10 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
13 11 import org.jeecg.utils.constant.QuantityConstant;
14   -import org.quartz.DisallowConcurrentExecution;
15   -import org.quartz.Job;
16   -import org.quartz.JobExecutionContext;
17   -import org.quartz.JobExecutionException;
18   -import org.quartz.PersistJobDataAfterExecution;
  12 +import org.quartz.*;
19 13  
20 14 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
21 15 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
... ... @@ -48,6 +42,7 @@ public class MesTask implements Job {
48 42 .in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_WHOLERECEIPT, QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT)
49 43 .le(TaskHeader::getBackMesTimes, QuantityConstant.MAX_MES_TRY_TIMES);
50 44 List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper);
  45 + log.info(String.format(" MesTask 执行入库回传! taskHeaderList :" + taskHeaderList + "时间" + DateUtils.getTimestamp()));
51 46 for (TaskHeader taskHeader : taskHeaderList) {
52 47 try {
53 48 taskHeaderService.addMesTryTimes(taskHeader);
... ... @@ -62,6 +57,7 @@ public class MesTask implements Job {
62 57 .in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_WHOLESHIPMENT, QuantityConstant.TASK_TYPE_SORTINGSHIPMENT)
63 58 .le(TaskHeader::getBackMesTimes, QuantityConstant.MAX_MES_TRY_TIMES);
64 59 taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper);
  60 + log.info(String.format(" MesTask 执行出库回传! taskHeaderList :" + taskHeaderList + "时间" + DateUtils.getTimestamp()));
65 61 for (TaskHeader taskHeader : taskHeaderList) {
66 62 try {
67 63 taskHeaderService.addMesTryTimes(taskHeader);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/MesTryTask.java
1 1 package org.jeecg.modules.wms.monitor.job;
2 2  
3   -import java.util.HashMap;
4 3 import java.util.List;
5   -import java.util.Map;
6 4  
7 5 import javax.annotation.Resource;
8 6  
9   -import org.apache.commons.collections.MapUtils;
  7 +import org.jeecg.common.util.DateUtils;
10 8 import org.jeecg.modules.wms.api.mes.servuce.IMesService;
11 9 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
12 10 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
13 11 import org.jeecg.utils.constant.QuantityConstant;
14   -import org.quartz.DisallowConcurrentExecution;
15   -import org.quartz.Job;
16   -import org.quartz.JobExecutionContext;
17   -import org.quartz.JobExecutionException;
18   -import org.quartz.PersistJobDataAfterExecution;
  12 +import org.quartz.*;
19 13  
20 14 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
21 15 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
... ... @@ -48,6 +42,7 @@ public class MesTryTask implements Job {
48 42 .in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_WHOLERECEIPT, QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT)
49 43 .gt(TaskHeader::getBackMesTimes, QuantityConstant.MAX_MES_TRY_TIMES);
50 44 List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper);
  45 + log.info(String.format(" MesTryTask 执行入库回传! taskHeaderList :" + taskHeaderList + "时间" + DateUtils.getTimestamp()));
51 46 for (TaskHeader taskHeader : taskHeaderList) {
52 47 try {
53 48 taskHeaderService.addMesTryTimes(taskHeader);
... ... @@ -62,6 +57,7 @@ public class MesTryTask implements Job {
62 57 .in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_WHOLESHIPMENT, QuantityConstant.TASK_TYPE_SORTINGSHIPMENT)
63 58 .gt(TaskHeader::getBackMesTimes, QuantityConstant.MAX_MES_TRY_TIMES);
64 59 taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper);
  60 + log.info(String.format(" MesTryTask 执行出库回传! taskHeaderList :" + taskHeaderList + "时间" + DateUtils.getTimestamp()));
65 61 for (TaskHeader taskHeader : taskHeaderList) {
66 62 try {
67 63 taskHeaderService.addMesTryTimes(taskHeader);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/SelfCheck.java
... ... @@ -53,7 +53,7 @@ public class SelfCheck implements Job {
53 53  
54 54 @Override
55 55 public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
56   - log.info(String.format("开始进行自检,时间:" + DateUtils.getTimestamp()));
  56 + log.info(String.format("SelfCheck 开始进行自检,时间:" + DateUtils.getTimestamp()));
57 57 Timestamp timestamp = DateUtils.getTimestamp();
58 58 List<Container> containerList = new ArrayList<>();
59 59 List<String> container = new ArrayList<>();
... ... @@ -372,7 +372,7 @@ public class SelfCheck implements Job {
372 372 }
373 373 }
374 374 Timestamp timestamp1 = DateUtils.getTimestamp();
375   - log.info(String.format("自检完成,开始时间:" + timestamp));
376   - log.info(String.format("自检完成,结束时间:" + timestamp1));
  375 + log.info(String.format("SelfCheck 自检完成,开始时间:" + timestamp));
  376 + log.info(String.format("SelfCheck 自检完成,结束时间:" + timestamp1));
377 377 }
378 378 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... ... @@ -257,20 +257,18 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
257 257 @Transactional(rollbackFor = Exception.class)
258 258 public Result autoCombination(String shipmentCode, boolean advice, String warehouseCode) {
259 259 log.info("开始自动配盘,单号" + shipmentCode);
260   - LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
261   - shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getWarehouseCode, warehouseCode).eq(ShipmentHeader::getCode, shipmentCode);
262   - ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(shipmentHeaderLambdaQueryWrapper);
  260 + ShipmentHeader shipmentHeader = shipmentHeaderService.getShipmentHeaderByCode(shipmentCode, warehouseCode);
263 261 if (shipmentHeader == null) {
264   - throw new JeecgBootException("系统没有此单据");
  262 + return Result.error("自动配盘, 系统没有此单据" + shipmentCode);
265 263 }
266 264 if (shipmentHeader.getLastStatus() >= QuantityConstant.SHIPMENT_HEADER_COMPLETED) {
267   - return Result.OK("出库单已经作业完毕");
  265 + return Result.OK("自动配盘,出库单已经作业完毕");
268 266 }
269 267 LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
270 268 shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode, shipmentCode).eq(ShipmentDetail::getWarehouseCode, warehouseCode);
271 269 List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(shipmentDetailLambdaQueryWrapper);
272 270 if (shipmentDetailList.isEmpty()) {
273   - return Result.error("出库单没有明细", null);
  271 + return Result.error("自动配盘, 出库单没有明细", null);
274 272 }
275 273 boolean over = true;
276 274 for (ShipmentDetail shipmentDetail : shipmentDetailList) {
... ... @@ -317,7 +315,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
317 315 BigDecimal shipmentQty = shipmentDetail.getQty().subtract(shipmentDetail.getTaskQty());
318 316 // 判断是否还有需要出库的物料,如果没有就跳过该物料
319 317 if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) {
320   - return Result.OK("出库数量必须大于0");
  318 + return Result.OK("自动配盘时, 出库数量必须大于0");
321 319 }
322 320 if (shipQty != null) {
323 321 shipmentQty = shipQty;
... ... @@ -353,7 +351,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
353 351 }
354 352 inventoryList.removeAll(removeInventoryList);
355 353 if (inventoryList.size() < 1) {
356   - return Result.error(shipmentDetail.getMaterialName() + "没有符合出库条件的库存");
  354 + return Result.error("自动配盘时," + shipmentDetail.getMaterialName() + "没有符合出库条件的库存");
357 355 }
358 356  
359 357 for (InventoryDetail inventoryDetail : inventoryList) {
... ... @@ -400,7 +398,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
400 398 BigDecimal shipmentQty = combinationModel.getShipQty();
401 399 ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail();
402 400 InventoryDetail inventoryDetail = combinationModel.getInventoryDetail();
403   - log.info("开始出库配盘" + shipmentDetail);
  401 + log.info("开始出库配盘" + shipmentDetail + "库存详情" + inventoryDetail);
404 402 if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) {
405 403 return Result.error("配盘时,出库数量必须大于0");
406 404 }
... ... @@ -415,10 +413,10 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
415 413 int shipmentZoneRule = Integer.parseInt(value);
416 414 if (shipmentZoneRule == QuantityConstant.SHIPMENT_BY_ZONE) {
417 415 if (StringUtils.isEmpty(inventoryDetail.getZoneCode())) {
418   - return Result.error("配盘时,库存没有库区");
  416 + return Result.error("配盘时,库存没有库区" + inventoryDetail);
419 417 }
420 418 if (!inventoryDetail.getZoneCode().equals(shipmentDetail.getZoneCode())) {
421   - return Result.error("配盘时,库存和库区不匹配");
  419 + return Result.error("配盘时,库存和库区不匹配" + inventoryDetail + shipmentDetail);
422 420 }
423 421 }
424 422 }
... ... @@ -426,7 +424,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
426 424 String containerCode = inventoryDetail.getContainerCode();
427 425 String warehouseCode = inventoryDetail.getWarehouseCode();
428 426 if (!warehouseCode.equals(shipmentDetail.getWarehouseCode())) {
429   - return Result.error("配盘时,库存仓库编码和出库单仓库编码不一致");
  427 + return Result.error("配盘时,库存仓库编码和出库单仓库编码不一致" + shipmentDetail);
430 428 }
431 429 boolean success = receiptContainerHeaderService.havaUnCompleteCombineByContainerCode(containerCode, warehouseCode);
432 430 if (success) {
... ... @@ -448,7 +446,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
448 446 // 如果不是呼叫料盒,那么要判断容器状态
449 447 if (callBox == QuantityConstant.NOT_CALL_BOX) {
450 448 if (container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
451   - return Result.error("配盘时, 容器已经锁定,不能再配盘");
  449 + return Result.error("配盘时, 容器已经锁定,不能再配盘" + container);
452 450 }
453 451 }
454 452 ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode);
... ... @@ -460,56 +458,56 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
460 458 // 可出数量
461 459 BigDecimal shipmentDetailAvailableQty = shipmentDetailQty.subtract(shipmentDetailTaskQty);
462 460 if (shipmentDetailAvailableQty.compareTo(shipmentQty) < 0) {
463   - return Result.error("配盘时, 录入数量超出出库单明细待出数量");
  461 + return Result.error("配盘时, 录入数量超出出库单明细待出数量" + shipmentDetail + "录入数量" + shipmentQty + "出库单明细待出数量" + shipmentDetailAvailableQty);
464 462 }
465 463 BigDecimal inventoryDetailQty = inventoryDetail.getQty();
466 464 BigDecimal inventoryDetailTaskQty = inventoryDetail.getTaskQty();
467 465 BigDecimal inventoryDetailAvailableQty = inventoryDetailQty.subtract(inventoryDetailTaskQty);
468 466 if (inventoryDetailAvailableQty.compareTo(shipmentQty) < 0) {
469   - return Result.error("配盘时, 录入数量超出库存详情待出数量");
  467 + return Result.error("配盘时, 录入数量超出库存详情待出数量" + inventoryDetail + "录入数量" + shipmentQty + "库存详情待出数量" + inventoryDetailAvailableQty);
470 468 }
471 469 if (!shipmentDetail.getMaterialCode().equals(inventoryDetail.getMaterialCode())) {
472   - return Result.error("配盘时, 配盘物料不一致");
  470 + return Result.error("配盘时, 配盘物料不一致" + shipmentDetail + inventoryDetail);
473 471 }
474 472 inventoryDetailTaskQty = inventoryDetailTaskQty.add(shipmentQty);
475 473 if (inventoryDetailTaskQty.compareTo(BigDecimal.ZERO) <= 0) {
476   - return Result.error("配盘时, 库存详情的任务数量必须大于0");
  474 + return Result.error("配盘时, 库存详情的任务数量必须大于0," + "库存详情任务数量" + inventoryDetailTaskQty);
477 475 }
478 476 if (inventoryDetailTaskQty.compareTo(inventoryDetailQty) > 0) {
479   - return Result.error("配盘时, 库存详情的任务数量不能超过库存数量");
  477 + return Result.error("配盘时, 库存详情的任务数量不能超过库存详情数量," + "库存详情任务数量" + inventoryDetailTaskQty + "库存详情数量" + inventoryDetailQty);
480 478 }
481 479 inventoryDetail.setTaskQty(inventoryDetailTaskQty);
482 480 success = inventoryDetailService.updateTaskQtyById(inventoryDetailTaskQty, inventoryDetail.getId());
483 481 if (!success) {
484   - throw new JeecgBootException("配盘时, 更新库存详情失败");
  482 + throw new JeecgBootException("配盘时, 更新库存详情失败" + inventoryDetail.getId());
485 483 }
486 484 shipmentDetailTaskQty = shipmentDetailTaskQty.add(shipmentQty);
487 485 if (shipmentDetailTaskQty.compareTo(BigDecimal.ZERO) <= 0) {
488   - return Result.error("配盘时, 出库详情的任务数量必须大于0");
  486 + return Result.error("配盘时, 出库详情的任务数量必须大于0," + "出库详情任务数量" + shipmentDetailTaskQty);
489 487 }
490 488 if (shipmentDetailTaskQty.compareTo(shipmentDetailQty) > 0) {
491   - return Result.error("配盘时, 出库详情的任务数量不能超过单据数量");
  489 + return Result.error("配盘时, 出库详情的任务数量不能超过出库详情数量," + "出库详情任务数量" + shipmentDetailTaskQty + "出库详情数量" + shipmentDetailQty);
492 490 }
493 491 shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK);
494 492 shipmentDetail.setTaskQty(shipmentDetailTaskQty);
495 493 success = shipmentDetailService.updateTaskQtyAndStatusById(shipmentDetailTaskQty, QuantityConstant.SHIPMENT_HEADER_GROUPDISK, shipmentDetail.getId());
496 494 if (!success) {
497   - throw new JeecgBootException("配盘时, 更新出库详情失败");
  495 + throw new JeecgBootException("配盘时, 更新出库详情失败" + shipmentDetail.getId());
498 496 }
499 497 ShipmentContainerHeader shipmentContainerHeader = shipmentCombinationService.addShipmentContainerHeader(inventoryDetail, shipmentDetail);
500 498 if (shipmentContainerHeader == null) {
501   - throw new JeecgBootException("配盘时, 新增出库组盘头失败");
  499 + throw new JeecgBootException("配盘时, 新增出库配盘头失败" + inventoryDetail + shipmentDetail);
502 500 }
503 501 ShipmentContainerDetail shipmentContainerDetail = shipmentCombinationService.addShipmentContainerDetail(shipmentContainerHeader, combinationModel);
504 502 if (shipmentContainerDetail == null) {
505   - throw new JeecgBootException("配盘时, 新增出库组盘详情失败");
  503 + throw new JeecgBootException("配盘时, 新增出库组盘详情失败" + combinationModel);
506 504 }
507 505 success = shipmentHeaderService.updateShipmentHeaderStatus(shipmentDetail.getShipmentId());
508 506 if (!success) {
509   - throw new JeecgBootException("配盘时, 更新出库单失败");
  507 + throw new JeecgBootException("配盘时, 更新出库单失败" + shipmentDetail);
510 508 }
511 509 LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentContainerDetail)));
512   - log.info("完成出库配盘" + shipmentDetail);
  510 + log.info("完成出库配盘" + shipmentDetail + "库存详情" + inventoryDetail);
513 511 return Result.ok("配盘成功");
514 512 }
515 513  
... ... @@ -520,7 +518,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
520 518 BigDecimal shipmentQty = combinationModel.getShipQty();
521 519 ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail();
522 520 InventoryDetail inventoryDetail = combinationModel.getInventoryDetail();
523   - log.info("开始出库配盘" + shipmentDetail);
  521 + log.info("开始出库配盘" + shipmentDetail + "库存详情" + inventoryDetail);
524 522 if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) {
525 523 return Result.error("配盘时,出库数量必须大于0");
526 524 }
... ... @@ -535,10 +533,10 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
535 533 int shipmentZoneRule = Integer.parseInt(value);
536 534 if (shipmentZoneRule == QuantityConstant.SHIPMENT_BY_ZONE) {
537 535 if (StringUtils.isEmpty(inventoryDetail.getZoneCode())) {
538   - return Result.error("配盘时,库存没有库区");
  536 + return Result.error("配盘时,库存没有库区" + inventoryDetail);
539 537 }
540 538 if (!inventoryDetail.getZoneCode().equals(shipmentDetail.getZoneCode())) {
541   - return Result.error("配盘时,库存和库区不匹配");
  539 + return Result.error("配盘时,库存和库区不匹配" + inventoryDetail + shipmentDetail);
542 540 }
543 541 }
544 542 }
... ... @@ -546,7 +544,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
546 544 String containerCode = inventoryDetail.getContainerCode();
547 545 String warehouseCode = inventoryDetail.getWarehouseCode();
548 546 if (!warehouseCode.equals(shipmentDetail.getWarehouseCode())) {
549   - return Result.error("配盘时,库存仓库编码和出库单仓库编码不一致");
  547 + return Result.error("配盘时,库存仓库编码和出库单仓库编码不一致" + shipmentDetail);
550 548 }
551 549 boolean success = receiptContainerHeaderService.havaUnCompleteCombineByContainerCode(containerCode, warehouseCode);
552 550 if (success) {
... ... @@ -580,56 +578,56 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
580 578 // 可出数量
581 579 BigDecimal shipmentDetailAvailableQty = shipmentDetailQty.subtract(shipmentDetailTaskQty);
582 580 if (shipmentDetailAvailableQty.compareTo(shipmentQty) < 0) {
583   - return Result.error("配盘时, 录入数量超出出库单明细待出数量");
  581 + return Result.error("配盘时, 录入数量超出出库单明细待出数量" + shipmentDetail + "录入数量" + shipmentQty + "出库单明细待出数量" + shipmentDetailAvailableQty);
584 582 }
585 583 BigDecimal inventoryDetailQty = inventoryDetail.getQty();
586 584 BigDecimal inventoryDetailTaskQty = inventoryDetail.getTaskQty();
587 585 BigDecimal inventoryDetailAvailableQty = inventoryDetailQty.subtract(inventoryDetailTaskQty);
588 586 if (inventoryDetailAvailableQty.compareTo(shipmentQty) < 0) {
589   - return Result.error("配盘时, 录入数量超出库存详情待出数量");
  587 + return Result.error("配盘时, 录入数量超出库存详情待出数量" + inventoryDetail + "录入数量" + shipmentQty + "库存详情待出数量" + inventoryDetailAvailableQty);
590 588 }
591 589 if (!shipmentDetail.getMaterialCode().equals(inventoryDetail.getMaterialCode())) {
592   - return Result.error("配盘时, 配盘物料不一致");
  590 + return Result.error("配盘时, 配盘物料不一致" + shipmentDetail + inventoryDetail);
593 591 }
594 592 inventoryDetailTaskQty = inventoryDetailTaskQty.add(shipmentQty);
595 593 if (inventoryDetailTaskQty.compareTo(BigDecimal.ZERO) <= 0) {
596   - return Result.error("配盘时, 库存详情的任务数量必须大于0");
  594 + return Result.error("配盘时, 库存详情的任务数量必须大于0," + "库存详情任务数量" + inventoryDetailTaskQty);
597 595 }
598 596 if (inventoryDetailTaskQty.compareTo(inventoryDetailQty) > 0) {
599   - return Result.error("配盘时, 库存详情的任务数量不能超过库存数量");
  597 + return Result.error("配盘时, 库存详情的任务数量不能超过库存详情数量," + "库存详情任务数量" + inventoryDetailTaskQty + "库存详情数量" + inventoryDetailQty);
600 598 }
601 599 inventoryDetail.setTaskQty(inventoryDetailTaskQty);
602 600 success = inventoryDetailService.updateTaskQtyById(inventoryDetailTaskQty, inventoryDetail.getId());
603 601 if (!success) {
604   - throw new JeecgBootException("配盘时, 更新库存详情失败");
  602 + throw new JeecgBootException("配盘时, 更新库存详情失败" + inventoryDetail.getId());
605 603 }
606 604 shipmentDetailTaskQty = shipmentDetailTaskQty.add(shipmentQty);
607 605 if (shipmentDetailTaskQty.compareTo(BigDecimal.ZERO) <= 0) {
608   - return Result.error("配盘时, 出库详情的任务数量必须大于0");
  606 + return Result.error("配盘时, 出库详情的任务数量必须大于0," + "出库详情任务数量" + shipmentDetailTaskQty);
609 607 }
610 608 if (shipmentDetailTaskQty.compareTo(shipmentDetailQty) > 0) {
611   - return Result.error("配盘时, 出库详情的任务数量不能超过单据数量");
  609 + return Result.error("配盘时, 出库详情的任务数量不能超过出库详情数量," + "出库详情任务数量" + shipmentDetailTaskQty + "出库详情数量" + shipmentDetailQty);
612 610 }
613 611 shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK);
614 612 shipmentDetail.setTaskQty(shipmentDetailTaskQty);
615 613 success = shipmentDetailService.updateTaskQtyAndStatusById(shipmentDetailTaskQty, QuantityConstant.SHIPMENT_HEADER_GROUPDISK, shipmentDetail.getId());
616 614 if (!success) {
617   - throw new JeecgBootException("配盘时, 更新出库详情失败");
  615 + throw new JeecgBootException("配盘时, 更新出库详情失败" + shipmentDetail.getId());
618 616 }
619 617 ShipmentContainerHeader shipmentContainerHeader = shipmentCombinationService.addShipmentContainerHeader(inventoryDetail, shipmentDetail);
620 618 if (shipmentContainerHeader == null) {
621   - throw new JeecgBootException("配盘时, 新增出库组盘头失败");
  619 + throw new JeecgBootException("配盘时, 新增出库配盘头失败" + inventoryDetail + shipmentDetail);
622 620 }
623 621 ShipmentContainerAdvice shipmentContainerAdvice = shipmentCombinationService.addShipmentContainerAdvice(shipmentContainerHeader, combinationModel);
624 622 if (shipmentContainerAdvice == null) {
625   - throw new JeecgBootException("配盘时, 新增出库组盘详情失败");
  623 + throw new JeecgBootException("配盘时, 新增出库组盘详情失败" + combinationModel);
626 624 }
627 625 success = shipmentHeaderService.updateShipmentHeaderStatus(shipmentDetail.getShipmentId());
628 626 if (!success) {
629   - throw new JeecgBootException("配盘时, 更新出库单失败");
  627 + throw new JeecgBootException("配盘时, 更新出库单失败" + shipmentDetail);
630 628 }
631 629 LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentContainerAdvice)));
632   - log.info("完成出库配盘" + shipmentDetail);
  630 + log.info("完成出库配盘" + shipmentDetail + "库存详情" + inventoryDetail);
633 631 return Result.ok("配盘成功");
634 632 }
635 633  
... ...