From 5736662672ee522d4ab407d7a92f43236a0c5aa0 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Mon, 4 Apr 2022 12:55:29 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/auth/LoginController.java | 5 +- .../basic/BasicUnitMaintainController.java | 1 + .../inout/OrderDetailController.java | 34 +-- .../inout/StockOrderDetailController.java | 3 +- .../inout/utils/CheckOrderUtils.java | 57 ++--- .../controller/inout/utils/InoutUtils.java | 10 - .../inventory/InvProductsController.java | 25 ++- .../basic/BussinessLocalTypeEntity.java | 2 + .../entity/basic/BussinessTypeEntity.java | 2 + .../entity/inout/StockOrderDetailEntity.java | 1 + .../BussinessOriginTypeFilterRequest.java | 3 + .../inventory/FilterInvProductRequest.java | 1 + .../res/basic/BasicUnitMaintainResponse.java | 3 + .../basic/BussinessOriginTypeResponse.java | 1 + .../admin/res/inout/ErpOrderResponse.java | 9 + .../basic/BussinessOriginTypeService.java | 6 +- .../impl/BussinessOriginTypeServiceImpl.java | 26 ++- .../admin/thread/IoTransInoutService.java | 201 +----------------- .../mapper/basic/BussinessLocalTypeDao.xml | 3 +- .../mapper/basic/BussinessOriginTypeDao.xml | 17 +- .../mybatis/mapper/basic/BussinessTypeDao.xml | 8 +- .../mybatis/mapper/inout/StockOrderDetail.xml | 12 +- .../mapper/inventory/InvWarehouseDao.xml | 2 +- 23 files changed, 151 insertions(+), 281 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/LoginController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/LoginController.java index c6cb704..0642d51 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/LoginController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/LoginController.java @@ -74,6 +74,9 @@ public class LoginController { authAdmin = authAdminService.findByUser(loginRequest.getUsername(), Constant.SYSTEM_CUSTOMER_ID); } else { authAdmin = authAdminService.findByUserName(loginRequest.getUsername()); + if (authAdmin == null) { + throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误"); + } if (authAdmin.getCustomerId() != 110) { if (authAdmin.getUserFlag() == 0) { throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!"); @@ -85,7 +88,7 @@ public class LoginController { if (customerInfoEntity.getUserFlag() == 0) { throw new JsonException(ResultEnum.DATA_NOT, "该企业账户已被禁用!"); } - }else{ + } else { if (authAdmin.getUserFlag() == 0) { throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!"); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java index b5145e2..3d053eb 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java @@ -151,6 +151,7 @@ public class BasicUnitMaintainController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } + basicUnitMaintainFilterRequest.setOutType(ConstantStatus.CORP_SICK_SICK); List basicUnitMaintainEntities; basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderDetailController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderDetailController.java index 19659ec..580b290 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderDetailController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderDetailController.java @@ -118,10 +118,10 @@ public class OrderDetailController { filterThrOrderRequest.setPage(filterErpOrderRequest.getPage()); filterThrOrderRequest.setLimit(filterErpOrderRequest.getLimit()); - if (filterErpOrderRequest.getCustomerId() != null) { - CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterErpOrderRequest.getCustomerId())); - filterThrOrderRequest.setUnitIdFk(companyEntity.getUnitIdFk()); - } +// if (filterErpOrderRequest.getCustomerId() != null) { +// CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterErpOrderRequest.getCustomerId())); +// filterThrOrderRequest.setUnitIdFk(companyEntity.getUnitIdFk()); +// } // filterErpOrderRequest.setBillAction(filterErpOrderRequest.getOriginType()); List erpOrderResponses = new ArrayList<>(); @@ -218,6 +218,9 @@ public class OrderDetailController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } + String customerId = customerService.getCustomerId() + ""; + + ThrOrderEntity thrOrderEntity = thrOrderService.findById(String.valueOf(filterErpOrderRequest.getId())); if (thrOrderEntity == null) { return ResultVOUtils.error(ResultEnum.DATA_NOT); @@ -228,21 +231,21 @@ public class OrderDetailController { return ResultVOUtils.error(500, "单据已被选入,请勿重复选入!"); } - StockOrderEntity stockOrderEntity = new StockOrderEntity(); BeanUtils.copyProperties(thrOrderEntity, stockOrderEntity); String billNo = CustomUtil.getId(); stockOrderEntity.setBillNo(billNo); - BussinessOriginTypeResponse bussinessOriginTypeResponse = bussinessOriginTypeService.finAllByAction(thrOrderEntity.getBillType()); - + BussinessOriginTypeResponse bussinessOriginTypeResponse = bussinessOriginTypeService.finByThirdAction(thrOrderEntity.getBillType()); stockOrderEntity.setBillType(bussinessOriginTypeResponse.getLocalAction()); stockOrderEntity.setId(null); + stockOrderEntity.setCustomerId(customerId); + stockOrderEntity.setUnitIdFk(customerId); stockOrderEntity.setStatus(ConstantStatus.SORDER_ALLOC);//未提交 stockOrderEntity.setThirdOrderFk(thrOrderEntity.getBillNo()); stockOrderEntity.setSourceType(ConstantStatus.ST_THIRD_SEL);//外部提交 stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印 stockOrderEntity.setBilldate(DateUtil.formatDate(new Date())); - + boolean b = stockOrderService.insertStockOrder(stockOrderEntity); stockOrderEntity = stockOrderService.findByBillNo(billNo); FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest(); filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + ""); @@ -252,13 +255,13 @@ public class OrderDetailController { List stockOrderDetailEntityList = new ArrayList<>(); for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) { StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity(); - UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(thrOrderDetailEntity.getProductId(), thrOrderDetailEntity.getThirdSysFk()); - - if (udiRelevanceEntity == null) { - return ResultVOUtils.error(500, "单据里含有未维护的产品信息,选入失败!"); - } +// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(thrOrderDetailEntity.getProductId(), thrOrderDetailEntity.getThirdSysFk()); +// +// if (udiRelevanceEntity == null) { +// return ResultVOUtils.error(500, "单据里含有未维护的产品信息,选入失败!"); +// } BeanUtils.copyProperties(thrOrderDetailEntity, stockOrderDetailEntity); - stockOrderDetailEntity.setProductId(udiRelevanceEntity.getId()); + stockOrderDetailEntity.setProductId(thrOrderDetailEntity.getProductId()); stockOrderDetailEntity.setCount(thrOrderDetailEntity.getCount() + ""); stockOrderDetailEntity.setReCount(thrOrderDetailEntity.getReCount() + ""); stockOrderDetailEntity.setOrderIdFk(stockOrderEntity.getId()); @@ -267,7 +270,7 @@ public class OrderDetailController { } stockOrderDetailService.insertStockOrderDetails(stockOrderDetailEntityList); } - boolean b = stockOrderService.insertStockOrder(stockOrderEntity); + return ResultVOUtils.success(); } @@ -449,6 +452,7 @@ public class OrderDetailController { erpOrderEntity.setErpCount(Math.abs(Integer.parseInt(subPurchase.getCount()))); erpOrderEntity.setReCount(Math.abs(Integer.parseInt(subPurchase.getReCount()))); erpOrderEntity.setGoodsunit(subPurchase.getSpec()); + erpOrderEntity.setBindRlFk(subPurchase.getRelId()); erpOrderEntities.add(erpOrderEntity); } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java index ad4ef26..eafe351 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java @@ -228,7 +228,7 @@ public class StockOrderDetailController { udiInfoService.findByNameCode(udiEntity.getUdi()); if (udiInfoEntity != null) { StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity(); - stockOrderDetailEntity.setProductId(udiInfoEntity.getNameCode()); +// stockOrderDetailEntity.setProductId(udiInfoEntity.getNameCode()); stockOrderDetailEntity.setProductName(udiInfoEntity.getCpmctymc()); stockOrderDetailEntity.setSpec(udiInfoEntity.getGgxh()); stockOrderDetailEntity.setBatchNo(udiEntity.getBatchNo()); @@ -274,6 +274,7 @@ public class StockOrderDetailController { CompanyProductRelevanceResponse udiInfoEntity = companyProductRelevanceResponses.get(0); StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity(); stockOrderDetailEntity.setProductId(udiInfoEntity.getRlId() + ""); + stockOrderDetailEntity.setRelId(udiInfoEntity.getRlId() + ""); stockOrderDetailEntity.setProductName(udiInfoEntity.getCpmctymc()); stockOrderDetailEntity.setSpec(udiInfoEntity.getGgxh()); stockOrderDetailEntity.setCount(0 + ""); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java index ff8f6b4..8d8e9df 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java @@ -7,7 +7,9 @@ import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.inout.*; import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest; import com.glxp.sale.admin.req.inout.StockOrderFilterRequest; +import com.glxp.sale.admin.res.basic.BussinessOriginTypeResponse; import com.glxp.sale.admin.res.basic.UdiRelevanceResponse; +import com.glxp.sale.admin.service.basic.BussinessOriginTypeService; import com.glxp.sale.admin.service.basic.BussinessTypeService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; import com.glxp.sale.admin.service.inout.OrderDetailService; @@ -37,6 +39,9 @@ public class CheckOrderUtils { @Resource BussinessTypeService bussinessTypeService; + @Resource + BussinessOriginTypeService bussinessOriginTypeService; + public void check(String orderId, List vailOrderEntities) { FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest(); filterErpOrderRequest.setOrderId(orderId); @@ -47,30 +52,9 @@ public class CheckOrderUtils { for (ErpOrderEntity myErpOrder : myErpOrders) { FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest(); filterUdiInfoRequest.setNameCode(myErpOrder.getNameCode()); - UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(myErpOrder.getBindRlFk()); -// List udiRelevanceEntities = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest); -// if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 1 && myErpOrder.getBindRlFk() == null) { -// myErpOrder.setBindStatus(ConstantStatus.ORDER_DETAIL_DI_MUTI); -// orderDetailService.updateErpOrder(myErpOrder); -// orderEntity.setRemark("该产品DI绑定多个产品ID,请在扫码单据详情绑定对应产品ID"); -// orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); -// orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL); -// orderService.updateOrder(orderEntity); -// return; -// } else { for (ErpOrderEntity vailOrderEntity : vailOrderEntities) { -// UdiRelevanceResponse udiRelevanceResponse = null; -// if (udiRelevanceEntities.size() == 1) { -// udiRelevanceResponse = udiRelevanceEntities.get(0); -// } else { -// for (UdiRelevanceResponse temps : udiRelevanceEntities) { -// if ((temps.getId() + "").equals(myErpOrder.getBindRlFk())) { -// udiRelevanceResponse = temps; -// } -// } -// } - if (checkId(vailOrderEntity, udiRelevanceResponse) == null + if (checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity) == null && checkBatchNo(vailOrderEntity, myErpOrder) == null && checkProductDate(vailOrderEntity, myErpOrder) == null && checkExpireDate(vailOrderEntity, myErpOrder) == null @@ -91,7 +75,7 @@ public class CheckOrderUtils { } else { errMsg = checkBatchNo(vailOrderEntity, myErpOrder); if (errMsg == null) { - errMsg = checkId(vailOrderEntity, udiRelevanceResponse); + errMsg = checkId(vailOrderEntity, udiRelevanceResponse, bussinessTypeEntity); if (errMsg == null) { errMsg = checkProductDate(vailOrderEntity, myErpOrder); if (errMsg == null) { @@ -232,13 +216,34 @@ public class CheckOrderUtils { return true; } - public String checkId(ErpOrderEntity vailOrderEntity, UdiRelevanceResponse udiRelevanceResponse) { + public String checkId(ErpOrderEntity vailOrderEntity, UdiRelevanceResponse udiRelevanceResponse, BussinessTypeEntity bussinessTypeEntity) { if (vailOrderEntity.getGoodsid() != null && udiRelevanceResponse != null) { if (vailOrderEntity.getBindRlFk() != null) { if (vailOrderEntity.getBindRlFk().equals(udiRelevanceResponse.getId() + "")) return null; - } else if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getId() + "")) - return null; + } else { //如果未绑定关联ID,则对比产品ID + + BussinessOriginTypeResponse bussinessOriginTypeResponse = bussinessOriginTypeService.finByMainAction(bussinessTypeEntity.getAction()); + if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId")) { + if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId() + "")) + return null; + } else if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId1")) { + if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId1() + "")) + return null; + } else if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId2")) { + if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId2() + "")) + return null; + } else if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId3")) { + if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId3() + "")) + return null; + } else if (bussinessOriginTypeResponse.getThirdSys().equals("thirdId4")) { + if (vailOrderEntity.getGoodsid().equals(udiRelevanceResponse.getThirdId4() + "")) + return null; + } + return "产品ID不匹配!"; + } + + } else { return "产品ID不匹配!"; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/InoutUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/InoutUtils.java index 514298c..70f7f83 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/InoutUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/InoutUtils.java @@ -264,16 +264,6 @@ public class InoutUtils { } } -// public int getActCount(UdiInfoEntity udiInfoBean) { -// if (udiInfoBean != null) { -// if (udiInfoBean.getZxxsbzbhsydysl() > 1) { -// return udiInfoBean.getZxxsbzbhsydysl() * udiInfoBean.getBhzxxsbzsl(); -// } else { -// return udiInfoBean.getBhzxxsbzsl(); -// } -// } -// return 1; -// } public int getActCount(WarehouseEntity warehouseEntity, UdiRelevanceService udiRelevanceService) { UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java index 35e8582..d2ce696 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java @@ -77,10 +77,15 @@ public class InvProductsController { @GetMapping("spms/inv/products/filter") public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) { boolean showSup = false; - if (SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { + String customerId = customerService.getCustomerId() + ""; + if (StrUtil.isNotEmpty(filterInvProductRequest.getUdiCode())) { + filterInvProductRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvProductRequest.getUdiCode())); + } + + if (SYSTEM_CUSTOMER_ID.equals(customerId)) { filterInvProductRequest.setCustomerId(null); showSup = true; - if (StrUtil.isEmpty(filterInvProductRequest.getInvStorageCode() )) { + if (StrUtil.isEmpty(filterInvProductRequest.getInvStorageCode())) { List warehouseUserEntities = warehouseUserService.selectCodeByUser(customerService.getUserId() + ""); if (!warehouseUserEntities.isEmpty()) { List invCodes = new ArrayList<>(); @@ -93,7 +98,7 @@ public class InvProductsController { } } else { - CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId())); + CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(customerId)); filterInvProductRequest.setSupId(companyEntity.getUnitIdFk()); InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true); filterInvProductRequest.setInvStorageCode(invWarehouseEntity.getCode()); @@ -259,15 +264,15 @@ public class InvProductsController { UdiEntity udiEntity = FilterUdiUtils.getUdi(filterCodeTraceRequest.getCode()); UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); List udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid()); - String code = null; - if (udiInfoEntities != null && udiInfoEntities.size() > 1) { - code = FilterUdiUtils.transGlxpNoSerStr(udiEntity); - } else { - code = filterCodeTraceRequest.getCode(); - } +// String code = null; +// if (udiInfoEntities != null && udiInfoEntities.size() > 1) { +// code = FilterUdiUtils.transGlxpNoSerStr(udiEntity); +// } else { +// code = filterCodeTraceRequest.getCode(); +// } FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); - filterInvProductDetailRequest.setCode(code); + filterInvProductDetailRequest.setCode(filterCodeTraceRequest.getCode()); filterInvProductDetailRequest.setSupId(filterCodeTraceRequest.getSupId()); List invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductDetailRequest); if (invProductDetailEntities.size() > 0) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java index b44655f..b4afbec 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java @@ -21,4 +21,6 @@ public class BussinessLocalTypeEntity { private int corpType; private String defaultUnit; private boolean genUnit; + private String thirdAction; + private String thirdSys; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java index 21f4e89..94cc31b 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java @@ -44,5 +44,7 @@ public class BussinessTypeEntity { //补单类型 private String supplementOrderType; + private String thirdAction; + private String thirdSys; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderDetailEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderDetailEntity.java index 0872f62..653db09 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderDetailEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderDetailEntity.java @@ -21,6 +21,7 @@ public class StockOrderDetailEntity { private String ylqxzcrbarmc; private String zczbhhzbapzbh; private BigDecimal price; + private String relId; //销售清单号(第二票) private String secSalesListNo; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessOriginTypeFilterRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessOriginTypeFilterRequest.java index 38533c6..90a2f42 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessOriginTypeFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessOriginTypeFilterRequest.java @@ -10,4 +10,7 @@ public class BussinessOriginTypeFilterRequest extends ListPageRequest { private String thirdSys; private String thirdSysName; private Boolean enable; + private String thirdAction; + private String mainAction; + private String localAction; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductRequest.java index 9f7abb6..bcb933f 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inventory/FilterInvProductRequest.java @@ -36,4 +36,5 @@ public class FilterInvProductRequest extends ListPageRequest { private String groupType; private List invCodes; + private String udiCode; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BasicUnitMaintainResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BasicUnitMaintainResponse.java index fb2578d..0f6b20e 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BasicUnitMaintainResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BasicUnitMaintainResponse.java @@ -18,4 +18,7 @@ public class BasicUnitMaintainResponse { private String mobile; private String thirdName; private String unitId; + private int corpType; + private int outType; + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessOriginTypeResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessOriginTypeResponse.java index 359bdb9..7eb5e2d 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessOriginTypeResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessOriginTypeResponse.java @@ -8,4 +8,5 @@ public class BussinessOriginTypeResponse { private String action; private String localAction; private String thirdAction; + private String thirdSys; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/inout/ErpOrderResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/inout/ErpOrderResponse.java index f2606d7..92329fe 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/inout/ErpOrderResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/inout/ErpOrderResponse.java @@ -231,6 +231,15 @@ public class ErpOrderResponse { private String detailId; //明细ID private String corpName; //往来单位 private BigDecimal price; //单价 + private String relId; + + public String getRelId() { + return relId; + } + + public void setRelId(String relId) { + this.relId = relId; + } public String getDetailId() { return detailId; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessOriginTypeService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessOriginTypeService.java index cc9ef46..c077fef 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessOriginTypeService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessOriginTypeService.java @@ -16,7 +16,11 @@ public interface BussinessOriginTypeService { List filterEnableList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest); - BussinessOriginTypeResponse finAllByAction(String action); + BussinessOriginTypeResponse finByThirdAction(String action); + + BussinessOriginTypeResponse finByLocalAction(String action); + + BussinessOriginTypeResponse finByMainAction(String action); BasicThirdSysDetailEntity findSysByAction(String action, String key); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java index 426366c..5352eaa 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java @@ -39,9 +39,31 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic } @Override - public BussinessOriginTypeResponse finAllByAction(String action) { + public BussinessOriginTypeResponse finByThirdAction(String action) { BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); - bussinessOriginTypeFilterRequest.setAction(action); + bussinessOriginTypeFilterRequest.setThirdAction(action); + List bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest); + if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) { + return bussinessOriginTypeEntities.get(0); + } + return null; + } + + @Override + public BussinessOriginTypeResponse finByLocalAction(String action) { + BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); + bussinessOriginTypeFilterRequest.setThirdAction(action); + List bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest); + if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) { + return bussinessOriginTypeEntities.get(0); + } + return null; + } + + @Override + public BussinessOriginTypeResponse finByMainAction(String action) { + BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); + bussinessOriginTypeFilterRequest.setMainAction(action); List bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest); if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) { return bussinessOriginTypeEntities.get(0); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java index adb0ba8..20f5456 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java @@ -106,8 +106,6 @@ public class IoTransInoutService { @Resource private CheckOrderUtils checkOrderUtils; @Resource - InvProductDetailService invProductDetailService; - @Resource InvProductService invProductService; @Resource InvPreProductService invPreProductService; @@ -428,14 +426,6 @@ public class IoTransInoutService { orderService.updateRemark(orderEntity.getId(), "udi码:" + warehouseEntity.getCode() + "该产品不允许以使用单元入库!"); return; } -// if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { -// CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findByUdiRlIdUnitFk(udiRelevanceResponse.getId() + "", warehouseEntity.getFromCorpId()); -// if (companyProductRelevanceEntity == null) { -// orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL); -// orderService.updateRemark(orderEntity.getId(), udiRelevanceResponse.getCpmctymc() + "该产品非此供应商配送"); -// return; -// } -// } } } @@ -702,145 +692,6 @@ public class IoTransInoutService { new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, warehouseEntityList); } - public void checkMutiDi(String orderId, BussinessTypeEntity bussinessTypeEntity) { - //校验是否di绑定多个产品ID - OrderEntity orderEntity = orderService.findById(orderId); - FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest(); - filterErpOrderRequest.setOrderId(orderId); - List erpOrderEntities = myErpOrderService.filterAllMyErpOrder(filterErpOrderRequest); - int checkStatus = ConstantStatus.ORDER_STATUS_CHECK; - if (erpOrderEntities != null && erpOrderEntities.size() > 0) { - for (ErpOrderEntity erpOrderEntity : erpOrderEntities) { - - //校验DI是否绑定多个产品ID - FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest(); - filterUdiInfoRequest.setNameCode(erpOrderEntity.getNameCode()); - List udiRelevanceEntities = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest); - if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 1 && erpOrderEntity.getBindRlFk() == null) { - - erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_DI_MUTI); - myErpOrderService.updateErpOrder(erpOrderEntity); - orderEntity.setRemark("该产品维护多个产品信息,请在扫码单据详情绑定对应产品产品信息"); - checkStatus = ConstantStatus.ORDER_CHECK_FAIL; - - } else { - if ((erpOrderEntity.getSupId() == null || erpOrderEntity.getSupId().equals("MUTI"))) { - if (erpOrderEntity.getSupId() == null) { - erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_NONE); - orderEntity.setRemark("该产品未指定供应商"); - } else { - erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_MUTI); - orderEntity.setRemark("该产品指定多个供应商"); - } - checkStatus = ConstantStatus.ORDER_CHECK_FAIL; - } else { - CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findByUdiRlIdUnitFk(erpOrderEntity.getBindRlFk(), erpOrderEntity.getSupId()); - if (companyProductRelevanceEntity == null) { - orderEntity.setRemark(erpOrderEntity.getCoName() + "该产品非此供应商配送"); - checkStatus = ConstantStatus.ORDER_CHECK_FAIL; - } else { - orderEntity.setContrastStatus(checkStatus); - orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); - orderService.updateOrder(orderEntity); - erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_SUP_ONE); - } - - - } - } - myErpOrderService.updateErpOrder(erpOrderEntity); - - - } - - orderEntity.setContrastStatus(checkStatus); - orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); - orderService.updateOrder(orderEntity); - - } - - } - - public void updateSuccess(OrderEntity orderEntity, int checkStatus, int status, String remark) { - orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); - orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); - orderService.updateOrder(orderEntity); - } - - - // //校验ERP单 - @Async - public void checkOrder() { - - OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); - orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK); - List orderEntities = orderService.findAllOrders(orderFilterRequest); - for (int i = 0; i < orderEntities.size(); i++) { - OrderEntity orderEntity = orderEntities.get(i); - checkOrder(orderEntity); - } - } - - - @Async - public void repeatPrint(OrderEntity orderEntity) { - syncprintOrder(orderEntity.getId()); - invProductsTrService.genInvProducts(orderEntity.getId()); - } - - public void checkOrder(OrderEntity orderEntity) { - orderEntity = orderService.findById(orderEntity.getId()); - List erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk()); - List transData = warehouseService.findByReceiptId(orderEntity.getId()); - myErpOrderService.deleteByOrderId(orderEntity.getId()); - genOrderDetail(transData); - if (erpIds != null && erpIds.size() > 0) { - List erpOrderEntities = thrDataService.getStockOrders(erpIds); - checkOrderUtils.check(orderEntity.getId(), erpOrderEntities); - } else { -// orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); -// orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); -// orderEntity.setRemark("未选入第三方出入库单据进行校验,请手动选择"); -// orderService.updateOrder(orderEntity); -// myErpOrderService.deleteByOrderId(orderEntity.getId()); -// new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, transData); -// printOrder(orderEntity.getId()); -// if (orderEntity.getCustomerId().equals(Constant.SYSTEM_CUSTOMER_ID)) { -// invProductsTrService.genInvProducts(orderEntity.getId()); -// } - } - - - } - - public void checkThirdOrder(List cloudErps, OrderEntity orderEntity, List transData) { - if (cloudErps != null && cloudErps.size() > 0) { - List returnOrders = new ContrastErpUtil().transErp(cloudErps, udiRelevanceService, orderEntity.getId()); - ErpOrderEntity temp = returnOrders.get(0); - for (int i = 0; i < returnOrders.size(); i++) { - if (!temp.getCompanyname().equals(returnOrders.get(i).getCompanyname())) { - orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL); - orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); - orderEntity.setRemark("选择Erp订单往来单位不一致"); - orderService.updateOrder(orderEntity); - return; - } - } - myErpOrderService.deleteByOrderId(orderEntity.getId()); - myErpOrderService.insertErpOrders(returnOrders); - BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction()); - new ContrastErpUtil(udiUrl).contrastErp(udiInfoService, udiRelevanceService, myErpOrderService, - orderService, transData, systemParamConfigService, bussinessTypeEntity); - - } else { - orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL); - orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); - orderEntity.setRemark("获取ERP出入库单据失败"); - orderService.updateOrder(orderEntity); - myErpOrderService.deleteByOrderId(orderEntity.getId()); - new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, transData); - } - } //重码校验错误重新提交 @Async @@ -852,13 +703,6 @@ public class IoTransInoutService { } } - //重新校验 - @Async - public void repeatCheck(String orderId) { - OrderEntity orderEntity = orderService.findById(orderId); - checkOrder(orderEntity); - WebSocketServer.sendInfo("单据:" + orderId + "校验已完成,请刷新查看!", null); - } //校验ERP单后,订单详情转入等待打印 @Async @@ -886,6 +730,7 @@ public class IoTransInoutService { for (ErpOrderEntity erpOrderEntity : erpOrderEntities) { StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity(); stockOrderDetailEntity.setProductId(erpOrderEntity.getGoodsid()); + stockOrderDetailEntity.setRelId(erpOrderEntity.getGoodsid()); stockOrderDetailEntity.setProductName(erpOrderEntity.getGoodsname()); if (erpOrderEntity.getGoodsid() == null) @@ -910,27 +755,6 @@ public class IoTransInoutService { if (erpOrderEntity.getErpCount() != null) { stockOrderDetailEntity.setCount(erpOrderEntity.getErpCount() + ""); } -// FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest(); -// filterUdiInfoRequest.setNameCode(erpOrderEntity.getNameCode()); -// List udiRelevanceEntities = udiRelevanceService.filterUdiRelevance(filterUdiInfoRequest); -// if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 1 && erpOrderEntity.getBindRlFk() == null) { -// isError = true; -// erpOrderEntity.setBindStatus(ConstantStatus.ORDER_DETAIL_DI_MUTI); -// myErpOrderService.updateErpOrder(erpOrderEntity); -// } else if (udiRelevanceEntities.size() == 1) { -// UdiRelevanceResponse udiRelevanceEntity = udiRelevanceEntities.get(0); -// setThridName(bussinessTypeEntity, stockOrderDetailEntity, udiRelevanceEntity); -// -// } else if (erpOrderEntity.getBindRlFk() != null) { -// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(erpOrderEntity.getBindRlFk()); -// UdiRelevanceResponse udiRelevanceResponse = new UdiRelevanceResponse(); -// BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceResponse); -// udiRelevanceResponse.setId(Integer.parseInt(udiRelevanceEntity.getId())); -// setThridName(bussinessTypeEntity, stockOrderDetailEntity, udiRelevanceResponse); -// erpOrderEntity.setGoodsid(stockOrderDetailEntity.getProductId()); -// erpOrderEntity.setGoodsname(stockOrderDetailEntity.getProductName()); -// myErpOrderService.updateErpOrder(erpOrderEntity); -// } stockOrderDetailEntities.add(stockOrderDetailEntity); } @@ -1024,29 +848,6 @@ public class IoTransInoutService { return stockOrderEntity; } - - public void setThridName(BussinessTypeEntity bussinessTypeEntity, StockOrderDetailEntity stockOrderDetailEntity, UdiRelevanceResponse udiRelevanceEntity) { - - if (bussinessTypeEntity.getThirdSysFk() == null) { - stockOrderDetailEntity.setProductId(udiRelevanceEntity.getId() + ""); - } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId")) { - stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId()); - stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName()); - } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId1")) { - stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId1()); - stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName1()); - } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId2")) { - stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId2()); - stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName2()); - } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId3")) { - stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId3()); - stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName3()); - } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId4")) { - stockOrderDetailEntity.setProductId(udiRelevanceEntity.getThirdId4()); - stockOrderDetailEntity.setProductName(udiRelevanceEntity.getThirdName4()); - } - - } } diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml index 2063d1b..c657ad5 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml @@ -59,12 +59,13 @@ basic_bussiness_type.name , basic_bussiness_type.action,basic_bussiness_type.checkEnable,basic_bustype_local.advanceType,basic_bustype_local.changeEnable, basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.corpType,basic_bussiness_type.mainAction, - basic_bussiness_type.defaultUnit,basic_bussiness_type.genUnit + basic_bussiness_type.defaultUnit,basic_bussiness_type.genUnit,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys FROM basic_bustype_local inner join basic_bussiness_type on basic_bustype_local.action = basic_bussiness_type.localAction INNER JOIN inv_warehouse_bussiness_type on basic_bussiness_type.action = inv_warehouse_bussiness_type.action INNER JOIN inv_warehouse on inv_warehouse_bussiness_type.`code` = inv_warehouse.`code` INNER JOIN inv_warehouse_user on inv_warehouse.`code` =inv_warehouse_user.`code` + left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action AND basic_bustype_local.name LIKE concat('%',#{name},'%') diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml index 3a7767f..2050a40 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml @@ -23,20 +23,27 @@ select basic_bustype_origin.name, basic_bustype_origin.action thirdAction, basic_bussiness_type.action, - basic_bustype_local.action localAction, + basic_bustype_local.action localAction,basic_bustype_origin.thirdSys from basic_bustype_origin - LEFT JOIN basic_bussiness_type on basic_bussiness_type.thirdAction = basic_bustype_origin.action LEFT JOIN basic_bustype_local on basic_bustype_local.originAction = basic_bustype_origin.action + LEFT JOIN basic_bussiness_type on basic_bussiness_type.localAction = basic_bustype_local.action AND basic_bustype_origin.name LIKE concat(#{name},'%') + + AND basic_bustype_origin.action = #{thirdAction} + + + AND basic_bussiness_type.action = #{mainAction} + + + AND basic_bustype_local.action = #{localAction} + - AND basic_bustype_origin.action LIKE concat(#{action},'%') + AND basic_bustype_origin.action = #{thirdAction} - - GROUP BY basic_bustype_origin.action; diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml index 1a2d792..e626495 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml @@ -16,9 +16,10 @@ basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType, basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder, basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne, - basic_bussiness_type.secCheckBalacne, defaultUnit + basic_bussiness_type.secCheckBalacne, defaultUnit,basic_bustype_origin.action thirdAction,basic_bustype_origin.thirdSys FROM basic_bussiness_type LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction = basic_bustype_local.action + left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action AND basic_bussiness_type.name LIKE concat('%',#{name},'%') @@ -39,7 +40,7 @@ AND basic_bustype_local.spUse =#{spUse} - + GROUP BY basic_bussiness_type.id