diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index b27079da..6187fd57 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -537,8 +537,8 @@ public class IoOrderController extends BaseController { IoOrderPdaResponse orderPdaResponse = new IoOrderPdaResponse(); orderPdaResponse.setOrderResponse(list.get(0)); orderPdaResponse.setOrderDetailBizResponses(orderDetailBizResponses); - PageInfo pageInfo = new PageInfo<>(list); - return ResultVOUtils.page(pageInfo); +// PageInfo pageInfo = new PageInfo<>(list); + return ResultVOUtils.success(orderPdaResponse); } diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java index 79128e31..69278047 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java @@ -2,6 +2,7 @@ package com.glxp.api.entity.inout; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; +import org.apache.poi.ss.formula.functions.Count; import java.math.BigDecimal; @@ -198,6 +199,12 @@ public class IoOrderDetailBizEntity { @TableField(exist = false) private boolean checkSuccess; + + @TableField(exist = false) + private int codeCount; + /** + * 扫码实际数量 + */ @TableField(exist = false) private int scanCount; diff --git a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java index 3d068c96..7f89cdb0 100644 --- a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java @@ -420,18 +420,23 @@ public class IoAddInoutService { if (tempEntity != null) { return ResultVOUtils.error(500, "单据已存在,请勿重复提交"); } - tempEntity = orderService.findByCorpOrderId(orderEntity.getBillNo()); + tempEntity = orderService.findByCorpOrderId(orderEntity.getCorpOrderId()); if (tempEntity != null) { return ResultVOUtils.error(500, "单据已存在,请勿重复提交"); } - if (CollUtil.isNotEmpty(pdaPostOrderRequest.getCodeTempEntities())) { - codeTempService.insertBatch(pdaPostOrderRequest.getCodeTempEntities()); - } + BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); orderEntity.setBillNo(orderNo); orderService.insertOrder(orderEntity); + if (CollUtil.isNotEmpty(pdaPostOrderRequest.getCodeTempEntities())) { + for (IoCodeTempEntity codeTempEntity : pdaPostOrderRequest.getCodeTempEntities()) { + codeTempEntity.setOrderId(orderNo); + } + codeTempService.insertBatch(pdaPostOrderRequest.getCodeTempEntities()); + } + dealProcess(orderEntity); if (!ioCheckInoutService.checkManual(orderEntity.getBillNo())) { ioCheckInoutService.check(orderEntity.getBillNo()); @@ -447,12 +452,12 @@ public class IoAddInoutService { */ @Transactional(rollbackFor = Exception.class) public BaseResponse waitOrderByPda(PdaPostOrderRequest pdaPostOrderRequest) { - if (CollUtil.isEmpty(pdaPostOrderRequest.getOrderDetailCodeEntities())) { - return ResultVOUtils.error(500, "提交失败,单据还未扫码或和扫码校验存在异常!"); - } +// if (CollUtil.isEmpty(pdaPostOrderRequest.getOrderDetailCodeEntities())) { +// return ResultVOUtils.error(500, "提交失败,单据还未扫码或和扫码校验存在异常!"); +// } IoOrderEntity orderEntity = pdaPostOrderRequest.getOrderEntity(); List orderDetailBizEntities = pdaPostOrderRequest.getOrderDetailBizEntities(); - List orderDetailCodeEntities = pdaPostOrderRequest.getOrderDetailCodeEntities(); + List codeTempEntities = pdaPostOrderRequest.getCodeTempEntities(); orderDetailBizService.deleteByOrderId(orderEntity.getBillNo()); @@ -461,10 +466,10 @@ public class IoAddInoutService { if (CollUtil.isNotEmpty(orderDetailBizEntities)) { orderDetailBizEntities.forEach(orderDetailBizEntity -> { orderDetailBizService.insert(orderDetailBizEntity); - }); - } - if (CollUtil.isNotEmpty(orderDetailCodeEntities)) { - orderDetailCodeEntities.forEach(orderDetailCodeEntity -> { + IoOrderDetailCodeEntity orderDetailCodeEntity = new IoOrderDetailCodeEntity(); + BeanUtil.copyProperties(orderDetailBizEntity, orderDetailCodeEntity); + orderDetailCodeEntity.setReCount(orderDetailBizEntity.getScanCount()); + orderDetailCodeEntity.setCount(orderDetailBizEntity.getCodeCount()); orderDetailCodeService.insert(orderDetailCodeEntity); }); } @@ -473,9 +478,9 @@ public class IoAddInoutService { codeTempService.insert(codeTempEntity); }); } - BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); if (ioCheckInoutService.checkManual(orderEntity.getBillNo())) { + List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderEntity.getBillNo()); if (CollUtil.isNotEmpty(orderDetailBizEntities)) { if (bussinessTypeEntity.getCheckWebNew() == 1) { String errMsg = ioCheckInoutService.bizOrderCheck(orderDetailBizEntities, orderDetailCodeEntities); diff --git a/src/main/java/com/glxp/api/task/SyncHeartTask.java b/src/main/java/com/glxp/api/task/SyncHeartTask.java index 78cb299d..a6e2762a 100644 --- a/src/main/java/com/glxp/api/task/SyncHeartTask.java +++ b/src/main/java/com/glxp/api/task/SyncHeartTask.java @@ -20,8 +20,8 @@ import javax.annotation.Resource; import java.util.Arrays; @Slf4j -@Component -@EnableScheduling +//@Component +//@EnableScheduling public class SyncHeartTask implements SchedulingConfigurer { @Resource