From 292462151f642921af7678a22dd8fe566f4d2af1 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 25 Apr 2023 13:36:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=89=E6=9C=9F=E6=8B=A3?= =?UTF-8?q?=E8=B4=A7=EF=BC=8C=E6=97=A0=E4=B8=89=E6=9C=9F=E6=8B=A3=E8=B4=A7?= =?UTF-8?q?=EF=BC=8C=E4=B8=BA=E9=85=8D=E8=B4=A7=E7=AD=89=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/api/constant/Constant.java | 6 + .../com/glxp/api/constant/ConstantStatus.java | 11 ++ .../inout/IoCodeTempController.java | 23 ++- .../controller/inout/IoOrderController.java | 53 ++++++- .../inout/IoOrderDetailResultController.java | 8 + .../api/dao/inout/IoOrderDetailCodeDao.java | 3 + .../basic/BasicBussinessTypeEntity.java | 18 +-- .../req/basic/BussinessTypeSaveRequest.java | 18 +-- .../glxp/api/req/inout/AddOrderRequest.java | 2 + .../res/basic/BasicBussinessTypeResponse.java | 18 +-- .../api/service/auth/InvBusUserService.java | 6 +- .../auth/impl/InvBusUserServiceImpl.java | 8 +- .../api/service/inout/IoAddInoutService.java | 8 +- .../service/inout/IoCheckInoutService.java | 92 ++++++++--- .../inout/IoOrderDetailBizService.java | 2 + .../inout/IoOrderDetailCodeService.java | 2 + .../impl/IoOrderDetailBizServiceImpl.java | 28 +++- .../impl/IoOrderDetailCodeServiceImpl.java | 5 + .../inout/impl/IoOrderServiceImpl.java | 7 + .../mybatis/mapper/auth/SysMenuDao.xml | 143 +++++++++++------- .../mapper/inout/IoOrderDetailCodeDao.xml | 20 ++- 21 files changed, 361 insertions(+), 120 deletions(-) diff --git a/src/main/java/com/glxp/api/constant/Constant.java b/src/main/java/com/glxp/api/constant/Constant.java index 2d683c52..349e2309 100644 --- a/src/main/java/com/glxp/api/constant/Constant.java +++ b/src/main/java/com/glxp/api/constant/Constant.java @@ -197,6 +197,12 @@ public class Constant { */ public static final String ORDER_STATUS_UN_CHECK = "unCheck"; + /** + * 单据-未校验/待校验标识 + */ + public static final String ORDER_STATUS_UN_ALLOCATE = "unAllocate"; + + /** * 单据-校验异常标识 */ diff --git a/src/main/java/com/glxp/api/constant/ConstantStatus.java b/src/main/java/com/glxp/api/constant/ConstantStatus.java index 46be5f28..59d3db1e 100644 --- a/src/main/java/com/glxp/api/constant/ConstantStatus.java +++ b/src/main/java/com/glxp/api/constant/ConstantStatus.java @@ -59,6 +59,11 @@ public class ConstantStatus { */ public static final Integer ORDER_STATUS_PROCESSING = 9; + /** + * 业务单已提交待配货 + */ + public static final Integer ORDER_STATUS_ALLOCATE = 11; + public static final Integer ORDER_DELIVERY_STATUS_UN = 1; public static final Integer ORDER_DELIVERY_STATUS_ED = 2; @@ -285,5 +290,11 @@ public class ConstantStatus { public static final int INVIN_BACK = 2; public static final int INVIN_USE = 3; + public static final int SCAN_NO_BUS = 0; //无业业务单扫码拣货 + public static final int SCAN_BUS_PI = 1; //有业务单有三期拣货 + public static final int SCAN_NO_PI = 2; //有业务单无三期拣货 + public static final int SCAN_ALL_PI = 3; //有业务单拣货(有无三期) + + } diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index 13b8bac0..5561f0de 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -630,12 +630,18 @@ public class IoCodeTempController extends BaseController { } if (StringUtils.isBlank(exitLocalEntity.getSerialNo())) { - if (bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.isCheckWebNew() && addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL) { + if (bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.getCheckWebNew() == 1 && addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL) { String errMsg = ioCheckInoutService.checkCode(genDetaiEntity); if (errMsg != null) { return ResultVOUtils.error(500, errMsg); } else codeTempService.updateById(exitLocalEntity); + } else if (bussinessTypeEntity.isCheckEnable() && (bussinessTypeEntity.getCheckWebNew() == 2 || (bussinessTypeEntity.getCheckWebNew() == 3 && addOrderRequest.getFromVailPi() == 1)) && addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL) { + String errMsg = ioCheckInoutService.checkNoPiCode(genDetaiEntity); + if (errMsg != null) { + return ResultVOUtils.error(500, errMsg); + } else + codeTempService.updateById(exitLocalEntity); } else { codeTempService.updateById(exitLocalEntity); } @@ -735,8 +741,7 @@ public class IoCodeTempController extends BaseController { } - if (addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.isCheckWebNew()) { - + if (addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.getCheckWebNew() != 0) { boolean isBillExit = orderDetailBizService.isExit(orderEntity.getBillNo()); if (!isBillExit) { orderService.deleteByBillNo(orderEntity.getBillNo()); @@ -777,12 +782,18 @@ public class IoCodeTempController extends BaseController { } //是否边扫边校验 - if (addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.isCheckWebNew()) { + if (addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.getCheckWebNew() == 1) { String errMsg = ioCheckInoutService.checkCode(codeEnttity); if (errMsg != null) { return ResultVOUtils.error(500, errMsg); } else codeTempService.insert(codeEnttity); + } else if (bussinessTypeEntity.isCheckEnable() && (bussinessTypeEntity.getCheckWebNew() == 2 || (bussinessTypeEntity.getCheckWebNew() == 3 && addOrderRequest.getFromVailPi() == 1)) && addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL) { + String errMsg = ioCheckInoutService.checkNoPiCode(codeEnttity); + if (errMsg != null) { + return ResultVOUtils.error(500, errMsg); + } else + codeTempService.insert(codeEnttity); } else { codeTempService.insert(codeEnttity); } @@ -1002,8 +1013,8 @@ public class IoCodeTempController extends BaseController { } IoOrderEntity orderEntity = orderService.findByBillNo(codeTempEntity.getOrderId()); BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); - - if (orderEntity.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.isCheckWebNew()) { + //todo 可能会出问题 + if (orderEntity.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.getCheckWebNew() == 1) { String errMsg = ioCheckInoutService.checkCode(codeTempEntity); if (errMsg != null) { return ResultVOUtils.error(500, errMsg); 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 db387529..8de2ba04 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -142,13 +142,16 @@ public class IoOrderController extends BaseController { if (orderDetailBizEntity.getCount() == 0) { return ResultVOUtils.error(500, orderDetailBizEntity.getCoName() + "产品数量不能为0!"); } - if (StrUtil.isEmpty(orderDetailBizEntity.getBatchNo()) && StrUtil.isEmpty(orderDetailBizEntity.getProductDate()) && StrUtil.isEmpty(orderDetailBizEntity.getExpireDate())) { + if (addOrderRequest.getFromVailPi() != 2 && + StrUtil.isEmpty(orderDetailBizEntity.getBatchNo()) + && StrUtil.isEmpty(orderDetailBizEntity.getProductDate()) + && StrUtil.isEmpty(orderDetailBizEntity.getExpireDate())) { return ResultVOUtils.error(500, orderDetailBizEntity.getCoName() + "三期不能全为空!"); } } IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo()); - ioAddInoutService.dealBusProcess(orderEntity); + ioAddInoutService.dealBusProcess(orderEntity, addOrderRequest.getFromVailPi()); return ResultVOUtils.success("提交成功!"); } @@ -250,6 +253,52 @@ public class IoOrderController extends BaseController { return ResultVOUtils.success("提交成功!"); } + //带配货-立即提交 + @AuthRuleAnnotation("") + @PostMapping("warehouse/inout/waitAllocate/submitOrderWeb") + @Log(title = "单据管理", businessType = BusinessType.UPDATE) + public BaseResponse submitWaitAllocateWeb(@RequestBody AddOrderRequest addOrderRequest) { + + //校验单据是否已完成 + IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo()); + List orderDetailBizEntities = orderDetailBizService.findByOrderId(addOrderRequest.getBillNo()); + List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(addOrderRequest.getBillNo()); + + if (CollUtil.isEmpty(orderDetailCodeEntities)) { + return ResultVOUtils.error(500, "单据还未扫码或和扫码校验存在异常无法提交!"); + } + String errMsg = checkInoutService.bizNoPiCheck(orderDetailBizEntities, orderEntity); + if (StrUtil.isNotEmpty(errMsg)) { + return ResultVOUtils.error(500, errMsg); + } + orderDetailBizService.deleteByOrderId(addOrderRequest.getBillNo()); + for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) { + IoOrderDetailBizEntity orderDetailBizEntity = new IoOrderDetailBizEntity(); + BeanUtils.copyProperties(orderDetailCodeEntity, orderDetailBizEntity); + orderDetailBizEntity.setId(null); + getSomeBiz(orderDetailBizEntities, orderDetailBizEntity); + orderDetailBizService.insert(orderDetailBizEntity); + } + saveOrderWeb(addOrderRequest); + orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); + orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); + orderService.update(orderEntity); + + ioAddInoutService.dealProcess(orderEntity); + checkInoutService.check(addOrderRequest.getBillNo()); + return ResultVOUtils.success("提交成功!"); + } + + + public void getSomeBiz(List orderDetailBizEntities, IoOrderDetailBizEntity resutBizEntity) { + for (IoOrderDetailBizEntity orderDetailBizEntity : orderDetailBizEntities) { + if (orderDetailBizEntity.getBindRlFk().longValue() == resutBizEntity.getBindRlFk().longValue()) { + resutBizEntity.setCertCode(orderDetailBizEntity.getCertCode()); + resutBizEntity.setPrice(orderDetailBizEntity.getPrice()); + } + } + } + @Resource IoCodeService codeService; diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java index 8cfc8fbb..04f9a76f 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java @@ -131,5 +131,13 @@ public class IoOrderDetailResultController extends BaseController { return ResultVOUtils.success(checkInoutService.combineCheck(orderDetailBizEntities, orderDetailCodeEntities)); } + @AuthRuleAnnotation("") + @GetMapping("/udiwms/inout/waitAllocate/filterList") + public BaseResponse waitAllocate(FilterOrderDetailResultRequest orderDetailResultRequest) { + IoOrderEntity orderEntity = orderService.findByBillNo(orderDetailResultRequest.getOrderIdFk()); + List orderDetailBizEntities = orderDetailBizService.findByOrderId(orderDetailResultRequest.getOrderIdFk()); + checkInoutService.bizNoPiCheck(orderDetailBizEntities, orderEntity); + return ResultVOUtils.success(orderDetailBizEntities); + } } diff --git a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailCodeDao.java b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailCodeDao.java index 7581490a..bea93f42 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailCodeDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailCodeDao.java @@ -4,6 +4,7 @@ import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.req.inout.FilterOrderDetailCodeRequest; import com.glxp.api.res.inout.IoOrderDetailCodeResponse; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -23,4 +24,6 @@ public interface IoOrderDetailCodeDao extends BaseMapperPlus { List filterInvBusUser(FilterInvBusUserRequest filterInvBusUserRequest); @@ -28,7 +29,8 @@ public interface InvBusUserService { boolean deleteByscAction(String subInvCode, List selectedCodes); - boolean isExitByAction(String action); + boolean exitBus(String userId, String action); + } diff --git a/src/main/java/com/glxp/api/service/auth/impl/InvBusUserServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/InvBusUserServiceImpl.java index 0a0b2f3a..f68d8822 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/InvBusUserServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/InvBusUserServiceImpl.java @@ -2,6 +2,7 @@ package com.glxp.api.service.auth.impl; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.auth.InvBusUserDao; import com.glxp.api.entity.auth.InvBusUserEntity; @@ -19,7 +20,7 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class InvBusUserServiceImpl implements InvBusUserService { +public class InvBusUserServiceImpl extends ServiceImpl implements InvBusUserService { @Resource InvBusUserDao invBusUserDao; @@ -110,4 +111,9 @@ public class InvBusUserServiceImpl implements InvBusUserService { public boolean isExitByAction(String action) { return invBusUserDao.exists(new QueryWrapper().eq("scAction", action)); } + + @Override + public boolean exitBus(String userId, String action) { + return invBusUserDao.exists(new QueryWrapper().eq("userId", userId).eq("scAction", action)); + } } 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 37cbeffc..662d6c87 100644 --- a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java @@ -239,7 +239,7 @@ public class IoAddInoutService { //新增业务单据处理 - public void dealBusProcess(IoOrderEntity orderEntity) { + public void dealBusProcess(IoOrderEntity orderEntity, Integer fromVailPi) { orderEntity.setErrMsg("正在处理!"); orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESSING); orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); @@ -295,7 +295,11 @@ public class IoAddInoutService { return; } - orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); + if (fromVailPi != null && fromVailPi == 2) + orderEntity.setStatus(ConstantStatus.ORDER_STATUS_ALLOCATE); + else + orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); + orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); orderEntity.setUpdateTime(new Date()); orderService.update(orderEntity); diff --git a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java index 3939ab98..5fa15509 100644 --- a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java @@ -80,39 +80,39 @@ public class IoCheckInoutService { return false; } else { if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_UDIMS) { - if (!bussinessTypeEntity.isCheckUdims()) { + if (bussinessTypeEntity.getCheckUdims() == 0) { return false; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_WEBNEW) { - if (!bussinessTypeEntity.isCheckWebNew()) { + if (bussinessTypeEntity.getCheckWebNew() == 0) { return false; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PDAED) { - if (!bussinessTypeEntity.isCheckPdaEd()) { + if (bussinessTypeEntity.getCheckPdaEd() == 0) { return false; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PDAUN) { - if (!bussinessTypeEntity.isCheckPdaUn()) { + if (bussinessTypeEntity.getCheckPdaUn() == 0) { return false; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PC) { - if (!bussinessTypeEntity.isCheckPc()) { + if (bussinessTypeEntity.getCheckPc() == 0) { return false; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_CHANGE) { - if (!bussinessTypeEntity.isCheckChange()) { + if (bussinessTypeEntity.getCheckChange() == 0) { return false; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PEACE_CHANGE) { - if (!bussinessTypeEntity.isCheckBalance()) { + if (bussinessTypeEntity.getCheckBalance() == 0) { return false; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_UDISP) { - if (!bussinessTypeEntity.isCheckSp()) { + if (bussinessTypeEntity.getCheckSp() == 0) { return false; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_COPY) { - if (!bussinessTypeEntity.isCheckCopy()) { + if (bussinessTypeEntity.getCheckCopy() == 0) { return false; } } @@ -131,47 +131,47 @@ public class IoCheckInoutService { unCheckFirstFinish(orderEntity); } else { if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_UDIMS) { - if (!bussinessTypeEntity.isCheckUdims()) { + if (bussinessTypeEntity.getCheckUdims() == 0) { unCheckFirstFinish(orderEntity); return; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_WEBNEW) { - if (!bussinessTypeEntity.isCheckWebNew()) { + if (bussinessTypeEntity.getCheckWebNew() == 0) { unCheckFirstFinish(orderEntity); return; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PDAED) { - if (!bussinessTypeEntity.isCheckPdaEd()) { + if (bussinessTypeEntity.getCheckPdaEd() == 0) { unCheckFirstFinish(orderEntity); return; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PDAUN) { - if (!bussinessTypeEntity.isCheckPdaUn()) { + if (bussinessTypeEntity.getCheckPdaUn() == 0) { unCheckFirstFinish(orderEntity); return; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PC) { - if (!bussinessTypeEntity.isCheckPc()) { + if (bussinessTypeEntity.getCheckPc() == 0) { unCheckFirstFinish(orderEntity); return; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_CHANGE) { - if (!bussinessTypeEntity.isCheckChange()) { + if (bussinessTypeEntity.getCheckChange() == 0) { unCheckFirstFinish(orderEntity); return; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PEACE_CHANGE) { - if (!bussinessTypeEntity.isCheckBalance()) { + if (bussinessTypeEntity.getCheckBalance() == 0) { unCheckFirstFinish(orderEntity); return; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_UDISP) { - if (!bussinessTypeEntity.isCheckSp()) { + if (bussinessTypeEntity.getCheckSp() == 0) { unCheckFirstFinish(orderEntity); return; } } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_COPY) { - if (!bussinessTypeEntity.isCheckCopy()) { + if (bussinessTypeEntity.getCheckCopy() == 0) { unCheckFirstFinish(orderEntity); return; } @@ -192,7 +192,7 @@ public class IoCheckInoutService { UdiEntity udiEntity = FilterUdiUtils.getUdi(codeEntity.getCode()); IoCodeLostEntity codeLostEntity = codeLostService.findByCode(codeEntity.getCode()); - if (codeLostEntity == null) { + if (codeLostEntity == null) { codeLostEntity = new IoCodeLostEntity(); codeLostEntity.setNameCode(udiEntity.getUdi()); codeLostEntity.setCode(codeEntity.getCode()); @@ -251,6 +251,31 @@ public class IoCheckInoutService { return null; } + + // 无三期拣货校验 + public String checkNoPiCode(IoCodeTempEntity codeTempEntity) { + boolean isBillExit = orderDetailBizService.isExit(codeTempEntity.getOrderId()); + if (!isBillExit) { + return "请先录入业务详情"; + } + IoOrderDetailBizEntity bizEntity = orderDetailBizService.findByRelId(codeTempEntity.getOrderId(), codeTempEntity.getRelId()); + if (bizEntity == null) { + return "非此单产品!"; + } + Integer detailCount = orderDetailCodeService.findByRelIdCount(codeTempEntity.getOrderId(), codeTempEntity.getRelId()); + int curCount = 0; + if (detailCount != null) { + curCount = detailCount + codeTempEntity.getMyReCount(); + } else { + curCount = codeTempEntity.getMyReCount(); + } + if (curCount > bizEntity.getCount()) { + return "当前产品数量超出!"; + } + return null; + } + + //一次校验(无需校验)完成 public void unCheckFirstFinish(IoOrderEntity orderEntity) { @@ -422,6 +447,35 @@ public class IoCheckInoutService { } } + //业务单正向校验 + public String bizNoPiCheck(List orderDetailBizEntities, IoOrderEntity orderEntity) { + + String errMsg = ""; + for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) { + bizEntity.setCheckSuccess(false); + } + for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) { + String msg = ""; + int count = orderDetailCodeService.findByRelIdCount(orderEntity.getBillNo(), bizEntity.getBindRlFk()); + if (bizEntity.getCount() == count) { + bizEntity.setCheckSuccess(true); + bizEntity.setScanCount(count); + } else { + msg = "数量不匹配"; + bizEntity.setScanCount(count); + bizEntity.setCheckSuccess(false); + } + bizEntity.setErrMsg(msg); + } + for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) { + if (!bizEntity.isCheckSuccess()) { + errMsg = errMsg + bizEntity.getCoName() + bizEntity.getErrMsg() + ";"; + } + } + return errMsg; + } + + //业务单正向校验 public String bizOrderCheck(List orderDetailBizEntities, List orderDetailCodeEntities) { String errMsg = ""; diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java index ea8110db..ab3008c8 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailBizService.java @@ -30,6 +30,8 @@ public interface IoOrderDetailBizService { IoOrderDetailBizEntity findByUnique(String orderId, Long relId, String bacthNo, String productDate, String expireDate); + IoOrderDetailBizEntity findByRelId(String orderId, Long relId); + List filterList(FilterOrderDetailBizRequest orderDetailBizRequest); IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk); diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java b/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java index eb429e15..b475649f 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderDetailCodeService.java @@ -12,6 +12,8 @@ public interface IoOrderDetailCodeService { IoOrderDetailCodeEntity findByUnique(String orderId, Long relId, String bacthNo); + Integer findByRelIdCount(String orderId, Long relId); + int insert(IoOrderDetailCodeEntity orderDetailCodeEntity); int update(IoOrderDetailCodeEntity orderDetailCodeEntity); diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java index 5af2f6aa..e435b746 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java @@ -1,17 +1,21 @@ package com.glxp.api.service.inout.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; +import com.glxp.api.constant.ConstantStatus; import com.glxp.api.dao.inout.IoOrderDetailBizDao; import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; +import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.req.inout.FilterOrderDetailBizRequest; import com.glxp.api.res.inout.IoOrderDetailBizResponse; import com.glxp.api.res.inout.IoOrderInvoiceResponse; import com.glxp.api.service.inout.IoCheckInoutService; import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderDetailCodeService; +import com.glxp.api.service.inout.IoOrderService; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -91,6 +95,17 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { return ioOrderDetailBizDao.selectOrderDetailBiz(orderId, relId, bacthNo, productDate, expireDate); } + @Override + public IoOrderDetailBizEntity findByRelId(String orderId, Long relId) { + if (relId == null) + return null; + List orderDetailBizEntities = ioOrderDetailBizDao.selectList(new QueryWrapper().eq("orderIdFk", orderId).eq("bindRlFk", relId)); + if (CollUtil.isNotEmpty(orderDetailBizEntities)) { + return orderDetailBizEntities.get(0); + } + return null; + } + @Override public List filterList(FilterOrderDetailBizRequest orderDetailBizRequest) { if (null == orderDetailBizRequest) { @@ -122,13 +137,20 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { @Resource @Lazy IoCheckInoutService checkInoutService; + @Resource + IoOrderService orderService; @Override public List checkOrderList(String orderId) { - + IoOrderEntity orderEntity = orderService.findByBillNo(orderId); List orderDetailBizEntities = findByOrderId(orderId); - List codeEntities = orderDetailCodeService.findByOrderId(orderId); - checkInoutService.bizOrderCheck(orderDetailBizEntities, codeEntities); + if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_ALLOCATE) { + checkInoutService.bizNoPiCheck(orderDetailBizEntities, orderEntity); + } else { + List codeEntities = orderDetailCodeService.findByOrderId(orderId); + checkInoutService.bizOrderCheck(orderDetailBizEntities, codeEntities); + } + return orderDetailBizEntities; } diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailCodeServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailCodeServiceImpl.java index ca0a4a8f..b7937cd2 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailCodeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailCodeServiceImpl.java @@ -48,6 +48,11 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService { .isNull(StrUtil.isEmpty(bacthNo), "batchNo")); } + @Override + public Integer findByRelIdCount(String orderId, Long relId) { + return ioOrderDetailCodeDao.findByRelIdCount(orderId, relId); + } + @Override public int insert(IoOrderDetailCodeEntity orderDetailCodeEntity) { orderDetailCodeEntity.setId(null); diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java index ef4f50dc..4b686096 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java @@ -2,6 +2,7 @@ package com.glxp.api.service.inout.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.UUID; import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; @@ -146,6 +147,9 @@ public class IoOrderServiceImpl implements IoOrderService { @Override public int insertOrder(IoOrderEntity orderEntity) { orderEntity.setId(null); + if (StrUtil.isEmpty(orderEntity.getRelKey())) { + orderEntity.setRelKey(UUID.fastUUID().toString(true)); + } orderEntity.setExportStatus(0); //上传状态:未上传 return orderDao.insert(orderEntity); } @@ -630,6 +634,9 @@ public class IoOrderServiceImpl implements IoOrderService { filterOrderRequest.setStatuses(Arrays.asList(10, 7)); filterOrderRequest.setDealStatuses(Arrays.asList(3, 4)); break; + case Constant.ORDER_STATUS_UN_ALLOCATE: + filterOrderRequest.setStatuses(Arrays.asList(ConstantStatus.ORDER_STATUS_ALLOCATE)); + filterOrderRequest.setDealStatuses(Arrays.asList(2)); default: break; } diff --git a/src/main/resources/mybatis/mapper/auth/SysMenuDao.xml b/src/main/resources/mybatis/mapper/auth/SysMenuDao.xml index b3b3b5bb..39263779 100644 --- a/src/main/resources/mybatis/mapper/auth/SysMenuDao.xml +++ b/src/main/resources/mybatis/mapper/auth/SysMenuDao.xml @@ -3,7 +3,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - @@ -36,41 +35,79 @@ - + INSERT INTO auth_menu(`menu_id`, `menu_name`, parent_id, `order_num`, `path`, component - , query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, + , query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, remark, create_by, create_time, update_time, update_by) values (#{menuId}, #{menuName}, #{parentId}, #{orderNum}, #{path}, #{component}, #{queryParam}, #{isFrame}, #{isCache} - , #{menuType}, #{visible}, #{status}, #{perms}, #{icon}, #{remark} - , #{createBy}, #{createTime}, #{updateTime}, #{updateBy}) + , #{menuType}, #{visible}, #{status}, #{perms}, #{icon}, #{remark} + , #{createBy}, #{createTime}, #{updateTime}, #{updateBy}) UPDATE auth_menu - `menu_name`=#{menuName}, - `parent_id`=#{parentId}, - order_num=#{orderNum}, - `path`=#{path}, - component=#{component}, - `query_param`=#{queryParam}, - is_frame=#{isFrame}, - is_cache=#{isCache}, - updateTime=#{updateTime}, - `menu_type`=#{menuType}, - `visible`=#{visible}, - status=#{status}, - perms=#{perms}, - icon=#{icon}, - remark=#{remark}, - create_by=#{createBy}, - create_time=#{createTime}, - update_time=#{updateTime}, - update_by=#{updateBy}, + + `menu_name`=#{menuName}, + + + `parent_id`=#{parentId}, + + + order_num=#{orderNum}, + + + `path`=#{path}, + + + component=#{component}, + + + `query_param`=#{queryParam}, + + + is_frame=#{isFrame}, + + + is_cache=#{isCache}, + + + updateTime=#{updateTime}, + + + `menu_type`=#{menuType}, + + + `visible`=#{visible}, + + + status=#{status}, + + + perms=#{perms}, + + + icon=#{icon}, + + + remark=#{remark}, + + + create_by=#{createBy}, + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + update_by=#{updateBy}, + - WHERE menu_id=#{menuId} + WHERE menu_id = #{menuId} @@ -81,20 +118,17 @@ - @@ -103,22 +137,22 @@ select * FROM auth_menu - + and menu_id = #{menuId} - - AND menu_name LIKE CONCAT('%',#{menuName},'%') + + AND menu_name LIKE CONCAT('%', #{menuName}, '%') - + AND `parent_name` = #{parentName} - + AND `parent_id` = #{parentId} - + AND `order_num` = #{orderNum} - + and menu_id ]]> #{neMenuId} @@ -144,9 +178,9 @@ m.order_num, m.create_time from auth_menu m - left join auth_role_menu rm on m.menu_id = rm.menu_id - left join auth_user_role sur on rm.role_id = sur.role_id - left join auth_role ro on sur.role_id = ro.role_id + left join auth_role_menu rm on m.menu_id = rm.menu_id + left join auth_user_role sur on rm.role_id = sur.role_id + left join auth_role ro on sur.role_id = ro.role_id select m.menu_id from auth_menu m - left join auth_role_menu rm on m.menu_id = rm.menu_id - where rm.role_id = #{roleId} + left join auth_role_menu rm on m.menu_id = rm.menu_id + where rm.role_id = #{roleId} - and m.menu_id not in (select m.parent_id from auth_menu m inner join auth_role_menu rm on m.menu_id = - rm.menu_id and rm.role_id = #{roleId}) + and m.menu_id not in (select m.parent_id + from auth_menu m + inner join auth_role_menu rm on m.menu_id = + rm.menu_id and rm.role_id = #{roleId}) order by m.parent_id, m.order_num @@ -192,16 +228,16 @@ select distinct m.perms from auth_menu m - left join auth_role_menu rm on m.menu_id = rm.menu_id + left join auth_role_menu rm on m.menu_id = rm.menu_id where m.status = '0' and rm.role_id = #{roleId} - diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDetailCodeDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDetailCodeDao.xml index 530a01aa..57553e2a 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDetailCodeDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDetailCodeDao.xml @@ -5,8 +5,8 @@ select io_order_detail_code.*, (select `name` from basic_corp where erpId = io_order_detail_code.supId) supName from io_order_detail_code - left join basic_udirel bu on bu.id = io_order_detail_code.bindRlFk - left join basic_products bp on bp.uuid = bu.uuid + left join basic_udirel bu on bu.id = io_order_detail_code.bindRlFk + left join basic_products bp on bp.uuid = bu.uuid AND orderIdFk = #{orderIdFk} @@ -31,6 +31,18 @@ - update io_order_detail_code set count = #{count}, reCount = #{reCount} where id = #{id} + update io_order_detail_code + set count = #{count}, + reCount = #{reCount} + where id = #{id} - \ No newline at end of file + + +