From ec9daf6d9d1880b9b258b30a12fc1b558083fd91 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 26 Oct 2021 20:42:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=8D=95=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E5=8D=95=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api-admin/pom.xml | 2 + .../sale/admin/constant/ConstantStatus.java | 10 + .../controller/auth/RegisterController.java | 35 +- .../basic/BussinessLocalTypeController.java | 93 ++++++ .../basic/BussinessTypeController.java | 24 +- .../basic/CorpImportLogController.java | 20 +- .../basic/UdiRelevanceController.java | 3 +- .../controller/inout/OrderController.java | 31 +- .../inout/OrderDetailController.java | 85 ++--- .../inout/StockOrderController.java | 86 ++++- .../inout/StockOrderDetailController.java | 58 ++-- .../inout/StockQRCodeTextController.java | 4 +- .../controller/inout/WareHouseController.java | 303 +----------------- .../inout/utils/ContrastErpUtil.java | 46 ++- .../dao/basic/BussinessLocalTypeDao.java | 24 ++ .../dao/info/CompanyProductRelevanceDao.java | 2 +- .../admin/entity/auth/UserRegisterEntity.java | 1 + .../basic/BussinessLocalTypeEntity.java | 15 + .../entity/basic/BussinessTypeEntity.java | 2 + .../sale/admin/entity/info/CompanyEntity.java | 1 + .../admin/entity/inout/StockOrderEntity.java | 4 +- .../admin/entity/inout/WarehouseEntity.java | 1 + .../admin/entity/thrsys/ThrOrderEntity.java | 2 +- .../admin/req/auth/RegisterCheckRequest.java | 1 + .../req/auth/UserResisterFilterRequest.java | 5 +- .../BussinessLocalTypeFilterRequest.java | 15 + .../admin/req/info/FilterCompanyRequest.java | 1 + .../admin/req/inout/FilterOrderRequest.java | 2 + .../req/inout/ImportErpOrderRequest.java | 3 +- .../req/inout/StockOrderFilterRequest.java | 7 +- .../req/inout/StockOrderPostRequest.java | 3 +- .../req/inout/WarehouseQueryRequest.java | 1 + .../admin/req/inout/WarehouseSaveRequest.java | 16 +- .../req/thrsys/FilterThrOrderRequest.java | 1 + .../admin/res/basic/BussinessTypResponse.java | 1 + .../admin/res/inout/ErpOrderResponse.java | 45 +++ .../basic/BussinessLocalTypeService.java | 23 ++ .../impl/BasicUnitMaintainServiceImpl.java | 1 - .../impl/BussinessLocalTypeServiceImpl.java | 77 +++++ .../info/CompanyProductRelevanceService.java | 2 +- .../CompanyProductRelevanceServiceImpl.java | 4 +- .../admin/thread/IoTransInoutService.java | 111 ++++--- .../admin/thread/ThrOrderImportService.java | 12 +- .../admin/util/StockOrderBillNoUtils.java | 2 +- .../main/resources/application-pro.properties | 3 +- .../main/resources/mybatis/configuration.xml | 6 +- .../mybatis/mapper/auth/UserRegisterDao.xml | 10 +- .../mapper/basic/BussinessLocalTypeDao.xml | 78 +++++ .../mybatis/mapper/basic/BussinessTypeDao.xml | 47 ++- .../mybatis/mapper/info/CompanyDao.xml | 12 +- .../info/CompanyProductRelevanceDao.xml | 5 +- .../mybatis/mapper/inout/CodesDao.xml | 18 +- .../mybatis/mapper/inout/OrderDao.xml | 10 +- .../mybatis/mapper/inout/StockOrderDao.xml | 36 ++- .../mybatis/mapper/thrsys/ThrOrderDao.xml | 13 +- 55 files changed, 917 insertions(+), 506 deletions(-) create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessLocalTypeController.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessLocalTypeDao.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessLocalTypeFilterRequest.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessLocalTypeService.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessLocalTypeServiceImpl.java create mode 100644 api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml diff --git a/api-admin/pom.xml b/api-admin/pom.xml index 1635ec8..00c1970 100644 --- a/api-admin/pom.xml +++ b/api-admin/pom.xml @@ -247,6 +247,7 @@ true + org.mybatis.generator mybatis-generator-maven-plugin @@ -274,6 +275,7 @@ + diff --git a/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java b/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java index 46b833c..3f228c1 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java @@ -23,4 +23,14 @@ public class ConstantStatus { public static final Integer ORDER_SIGN_UN = 0; //未签字 public static final Integer ORDER_SIGN_ED = 1; //已签字 public static final Integer ORDER_SIGN_FAIL = 2; //签字失败 + + + //业务单据状态 + public static String SORDER_DRAFT = "1";//草稿 + public static String SORDER_ALLOC = "2";//未配货 + public static String SORDER_CHECK = "3";//待校验 + + public static String SORDER_PRINT_UN = "101";//101:未打印,102:已打印 + public static String SORDER_PRINT_ED = "102";// + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/RegisterController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/RegisterController.java index d5af1cd..7162a09 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/RegisterController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/RegisterController.java @@ -198,22 +198,22 @@ public class RegisterController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } log.info(httpSession.getId()); - JSONObject userCode = (JSONObject) httpSession.getAttribute("code"); - if (userCode == null) { - return ResultVOUtils.error(500, "验证码已失效,请重新获取"); - } - long lastTime = userCode.getLong("createTime"); - int checkCode = (Integer) userCode.get("code"); - String phoneNum = userCode.getString("memPhone"); - if ((System.currentTimeMillis() - lastTime) > 1000 * 60 * 5) { - return ResultVOUtils.error(500, "验证码已过期,请重新获取"); - } - if (checkCode != userRegisterEntity.getCheckCode()) { - return ResultVOUtils.error(500, "验证码错误,请重新获取"); - } - if (!phoneNum.equals(userRegisterEntity.getMobile())) { - return ResultVOUtils.error(500, "手机号与获取验证码不一致"); - } +// JSONObject userCode = (JSONObject) httpSession.getAttribute("code"); +// if (userCode == null) { +// return ResultVOUtils.error(500, "验证码已失效,请重新获取"); +// } +// long lastTime = userCode.getLong("createTime"); +// int checkCode = (Integer) userCode.get("code"); +// String phoneNum = userCode.getString("memPhone"); +// if ((System.currentTimeMillis() - lastTime) > 1000 * 60 * 5) { +// return ResultVOUtils.error(500, "验证码已过期,请重新获取"); +// } +// if (checkCode != userRegisterEntity.getCheckCode()) { +// return ResultVOUtils.error(500, "验证码错误,请重新获取"); +// } +// if (!phoneNum.equals(userRegisterEntity.getMobile())) { +// return ResultVOUtils.error(500, "手机号与获取验证码不一致"); +// } boolean isExitPhone = userRegisterService.isExit(userRegisterEntity.getMobile()); if (isExitPhone) { return ResultVOUtils.error(500, "该手机号已被注册"); @@ -295,6 +295,7 @@ public class RegisterController { if (StringUtils.isNotBlank(registerCheckRequest.getCompanyName())) { UserRegisterEntity userRegisterEntity = new UserRegisterEntity(); userRegisterEntity.setId(registerCheckRequest.getId()); + userRegisterEntity.setCompanyId(registerCheckRequest.getCompanyId()); userRegisterEntity.setCompanyName(registerCheckRequest.getCompanyName()); userRegisterService.updateUserRegister(userRegisterEntity); } @@ -364,10 +365,12 @@ public class RegisterController { companyEntity.setMobile(userRegisterEntity.getMobile()); companyEntity.setTel(userRegisterEntity.getTel()); companyEntity.setCompanyName(userRegisterEntity.getCompanyName()); + companyEntity.setUnitIdFk(userRegisterEntity.getCompanyId()); companyEntity.setClasses(userRegisterEntity.getBussinessStatus() + ""); companyEntity.setBussinessStatus(userRegisterEntity.getBussinessStatus()); companyEntity.setCreditNum(userRegisterEntity.getCreditNum()); + FilterAliCertRequest filterAliCertRequest = new FilterAliCertRequest(); filterAliCertRequest.setId(registerCheckRequest.getAliCertId()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessLocalTypeController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessLocalTypeController.java new file mode 100644 index 0000000..d534d3c --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessLocalTypeController.java @@ -0,0 +1,93 @@ +package com.glxp.sale.admin.controller.basic; + +import com.github.pagehelper.PageInfo; +import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity; +import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest; +import com.glxp.sale.admin.req.info.DeleteRequest; +import com.glxp.sale.admin.res.PageSimpleResponse; +import com.glxp.sale.admin.service.basic.BussinessLocalTypeService; +import com.glxp.sale.common.enums.ResultEnum; +import com.glxp.sale.common.res.BaseResponse; +import com.glxp.sale.common.util.ResultVOUtils; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +@RestController +public class BussinessLocalTypeController { + + + @Resource + private BussinessLocalTypeService bussinessTypeService; + + + @GetMapping("/udiwms/localBusType/filterJoin") + public BaseResponse filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List bussinessTypeEntities; + bussinessTypeEntities = bussinessTypeService.filterJoin( + bussinessTypeFilterRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(bussinessTypeEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(bussinessTypeEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + + @GetMapping("/udiwms/localBusType/filter") + public BaseResponse filterBussinessType(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List bussinessTypeEntities; + bussinessTypeEntities = bussinessTypeService.filterList(bussinessTypeFilterRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(bussinessTypeEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(bussinessTypeEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + + @PostMapping("/udiwms/localBusType/delete") + public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + String id = deleteRequest.getId(); + bussinessTypeService.deleteById(id); + return ResultVOUtils.success("删除成功"); + } + + @PostMapping("/udiwms/localBusType/update") + public BaseResponse updateBussinessType(@RequestBody BussinessLocalTypeEntity bussinessTypeEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + if (bussinessTypeEntity != null) { + bussinessTypeService.updateBusLocalType(bussinessTypeEntity); + } else { + ResultVOUtils.error(999, "参数错误"); + } + return ResultVOUtils.success("更新成功"); + } + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessTypeController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessTypeController.java index 61f9c48..26e5db6 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessTypeController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessTypeController.java @@ -2,13 +2,15 @@ package com.glxp.sale.admin.controller.basic; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; -import com.glxp.sale.admin.req.inout.DeleteRequest; import com.glxp.sale.admin.req.basic.BussinessTypeFilterRequest; +import com.glxp.sale.admin.req.info.DeleteRequest; import com.glxp.sale.admin.res.PageSimpleResponse; +import com.glxp.sale.admin.res.basic.BussinessTypResponse; import com.glxp.sale.admin.service.basic.BussinessTypeService; import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; +import org.springframework.beans.BeanUtils; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; /** * 业务类型维护 @@ -47,6 +50,25 @@ public class BussinessTypeController { return ResultVOUtils.success(pageSimpleResponse); } + @GetMapping("/udiwms/bussinessType/joinFilter") + public BaseResponse filterJoinBussinessType(BussinessTypeFilterRequest bussinessTypeFilterRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List bussinessTypeEntities; + bussinessTypeEntities = bussinessTypeService.filterJoinList(bussinessTypeFilterRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(bussinessTypeEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(bussinessTypeEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + + @PostMapping("/udiwms/bussinessType/delete") public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpImportLogController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpImportLogController.java index 6492bb9..8f9b881 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpImportLogController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpImportLogController.java @@ -295,20 +295,20 @@ public class CorpImportLogController { } if (basicThirdSysEntity != null) { if ("thirdId".equals(basicThirdSysEntity.getThirdId())) { - corpImportDetailEntity.setThirdId(corpImportDetailEntity.getErpId()); - corpImportDetailEntity.setThirdName(corpImportDetailEntity.getName()); + corpImportDetailEntity.setThirdId(corpImportDetailEntity.getThirdId()); + corpImportDetailEntity.setThirdName(corpImportDetailEntity.getThirdName()); } else if ("thirdId1".equals(basicThirdSysEntity.getThirdId())) { - corpImportDetailEntity.setThirdId1(corpImportDetailEntity.getErpId()); - corpImportDetailEntity.setThirdName1(corpImportDetailEntity.getName()); + corpImportDetailEntity.setThirdId1(corpImportDetailEntity.getThirdId1()); + corpImportDetailEntity.setThirdName1(corpImportDetailEntity.getThirdName1()); } else if ("thirdId2".equals(basicThirdSysEntity.getThirdId())) { - corpImportDetailEntity.setThirdId2(corpImportDetailEntity.getErpId()); - corpImportDetailEntity.setThirdName2(corpImportDetailEntity.getName()); + corpImportDetailEntity.setThirdId2(corpImportDetailEntity.getThirdId2()); + corpImportDetailEntity.setThirdName2(corpImportDetailEntity.getThirdName2()); } else if ("thirdId3".equals(basicThirdSysEntity.getThirdId())) { - corpImportDetailEntity.setThirdId3(corpImportDetailEntity.getErpId()); - corpImportDetailEntity.setThirdName3(corpImportDetailEntity.getName()); + corpImportDetailEntity.setThirdId3(corpImportDetailEntity.getThirdId3()); + corpImportDetailEntity.setThirdName3(corpImportDetailEntity.getThirdName3()); } else if ("thirdId4".equals(basicThirdSysEntity.getThirdId())) { - corpImportDetailEntity.setThirdId4(corpImportDetailEntity.getErpId()); - corpImportDetailEntity.setThirdName4(corpImportDetailEntity.getName()); + corpImportDetailEntity.setThirdId4(corpImportDetailEntity.getThirdId4()); + corpImportDetailEntity.setThirdName4(corpImportDetailEntity.getThirdName4()); } } else { corpImportDetailEntity.setThirdId(corpImportDetailEntity.getErpId()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java index a550282..7316f6e 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java @@ -136,7 +136,8 @@ public class UdiRelevanceController { if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0) { for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) { - CompanyProductRelevanceEntity companyProductRelevanceEntity = companyProductRelevanceService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceResponse.getId() + ""); + CompanyProductRelevanceEntity companyProductRelevanceEntity = + companyProductRelevanceService.findCompanyProductRelevanceByUdiRlIdFk(udiRelevanceResponse.getId() + "", filterUdiInfoRequest.getCustomerId()); if (companyProductRelevanceEntity != null) { udiRelevanceResponse.setIsSelect(true); } else { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java index bf46e80..ebbc747 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil; import com.glxp.sale.admin.controller.inout.utils.InoutUtils; +import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.entity.inout.ErpOrderEntity; import com.glxp.sale.admin.entity.inout.FilterErpOrderRequest; @@ -14,6 +15,7 @@ import com.glxp.sale.admin.httpclient.ErpOrderClient; import com.glxp.sale.admin.req.inout.*; import com.glxp.sale.admin.req.param.SystemParamConfigRequest; import com.glxp.sale.admin.res.PageSimpleResponse; +import com.glxp.sale.admin.service.basic.BussinessTypeService; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; import com.glxp.sale.admin.service.param.SystemParamConfigService; @@ -51,7 +53,8 @@ public class OrderController { private UdiRelevanceService udiRelevanceService; @Resource private SystemParamConfigService systemParamConfigService; - + @Resource + private BussinessTypeService bussinessTypeService; @Value("${UCLOD_SERVER_URL}") private String ucloudUrl; @@ -63,14 +66,28 @@ public class OrderController { return ResultVOUtils.success(udiEntity); } + @GetMapping("udiwms/inout/order/status") + public BaseResponse listOrderByStatus(OrderFilterRequest orderFilterRequest) { + List orderEntityList = orderService.filterList(orderFilterRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(orderEntityList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(orderEntityList); + return ResultVOUtils.success(pageSimpleResponse); + } + + @GetMapping("udiwms/inout/order/error") public BaseResponse listOrderError(OrderFilterRequest orderFilterRequest) { // orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_FAIL); // orderFilterRequest.setStatusOrOne(ConstantStatus.ORDER_STATUS_TEMP_SAVE); - if (StringUtils.isBlank(orderFilterRequest.getCustomerId())) return ResultVOUtils.success(); - if (orderFilterRequest.getCustomerId().equals("110")) orderFilterRequest.setCustomerId(null); - List orderEntityList = orderService.filterListOr(orderFilterRequest); -// List orderEntityList = orderService.filterList(orderFilterRequest); + if (StringUtils.isBlank(orderFilterRequest.getCustomerId())) + return ResultVOUtils.success(); + if (orderFilterRequest.getCustomerId().equals("110")) + orderFilterRequest.setCustomerId(null); +// List orderEntityList = orderService.filterListOr(orderFilterRequest); + List orderEntityList = orderService.filterList(orderFilterRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(orderEntityList); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); @@ -213,6 +230,7 @@ public class OrderController { orderService.deleteByOrderId(orderList.get(i)); } OrderEntity mainOrderEntity = orderService.findById(mainOrder); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(mainOrderEntity.getAction()); List docids = getDocids(mergeList); String docidStr = ""; if (docids != null && docids.size() > 0) { @@ -228,7 +246,8 @@ public class OrderController { List returnOrders = new ContrastErpUtil().transErp(erpOrderEntities, udiRelevanceService, mainOrder); orderDetailService.insertErpOrders(returnOrders); List warehouseEntityList = codesService.findByReceiptId(mainOrder); - new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, warehouseEntityList, systemParamConfigService); + new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, warehouseEntityList, + systemParamConfigService,bussinessTypeEntity); } else { orderService.updateContrastStatus(mainOrder, "error"); orderService.updateRemark(mainOrder, "U8Cloud获取ERP单失败"); 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 5cb30e8..1ec8e88 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 @@ -3,10 +3,14 @@ package com.glxp.sale.admin.controller.inout; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil; +import com.glxp.sale.admin.entity.auth.AuthAdmin; +import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; +import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.inout.*; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity; import com.glxp.sale.admin.entity.thrsys.ThrOrderEntity; +import com.glxp.sale.admin.exception.JsonException; import com.glxp.sale.admin.httpclient.ErpOrderClient; import com.glxp.sale.admin.req.inout.*; import com.glxp.sale.admin.req.param.SystemParamConfigRequest; @@ -15,14 +19,17 @@ import com.glxp.sale.admin.req.thrsys.FilterThrOrderRequest; import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.res.inout.ErpOrderResponse; import com.glxp.sale.admin.res.inout.PurchaseinResponse; +import com.glxp.sale.admin.service.basic.BussinessTypeService; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; +import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.*; import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.service.thrsys.ThrOrderDetailService; import com.glxp.sale.admin.service.thrsys.ThrOrderService; import com.glxp.sale.admin.thread.InvDlErpStockService; import com.glxp.sale.admin.thread.IoTransInoutService; +import com.glxp.sale.admin.util.DateUtil; import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; @@ -33,9 +40,13 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -72,6 +83,11 @@ public class OrderDetailController { @Resource private StockOrderDetailService stockOrderDetailService; + @Resource + private CompanyService companyService; + @Resource + private BussinessTypeService bussinessTypeService; + @GetMapping("/udiwms/erpOrder/filter") public BaseResponse filterErpOrder(FilterOrderRequest filterErpOrderRequest, BindingResult bindingResult) { @@ -80,27 +96,18 @@ public class OrderDetailController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } -// BasicThirdSysDetailEntity basicThirdSysDetailEntity = bussinessTypeService.findByActionKey(filterErpOrderRequest.getBillAction(), "orderQueryUrl"); -// if (basicThirdSysDetailEntity.getValue() == null) { -// return ResultVOUtils.error(500, "业务单据查询接口未定义"); -// } -// if(!basicThirdSysDetailEntity.getEnabled()){ -// return ResultVOUtils.error(500, "第三方业务单据服务未启用"); -// } -// -// if (basicThirdSysDetailEntity.getFromType() == 0 && !basicThirdSysDetailEntity.getItrCache()) { -// -// return new ErpOrderClient(basicThirdSysDetailEntity.getValue()).getErpOrderResponse(filterErpOrderRequest); -// } else { - //todo 订单查询,需加日期 + FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest(); BeanUtils.copyProperties(filterErpOrderRequest, filterThrOrderRequest); -// if (filterThrOrderRequest.getBillAction() != null) { -// BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(filterErpOrderRequest.getBillAction()); -// filterThrOrderRequest.setBillAction(bussinessTypeEntity.getName()); -// } filterThrOrderRequest.setPage(filterErpOrderRequest.getPage()); filterThrOrderRequest.setLimit(filterErpOrderRequest.getLimit()); + + if (filterErpOrderRequest.getCustomerId() != null) { + CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterErpOrderRequest.getCustomerId())); + filterThrOrderRequest.setUnitIdFk(companyEntity.getUnitIdFk()); + } + + List erpOrderResponses = new ArrayList<>(); List data = thrOrderService.filterThrOrder(filterThrOrderRequest); if (data != null && data.size() > 0) { @@ -134,7 +141,7 @@ public class OrderDetailController { @GetMapping("/udiwms/erpOrder/addStockOrder") public BaseResponse addStockOrder(FilterOrderRequest filterErpOrderRequest, - BindingResult bindingResult) { + BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); @@ -146,10 +153,14 @@ public class OrderDetailController { } StockOrderEntity stockOrderEntity = new StockOrderEntity(); BeanUtils.copyProperties(thrOrderEntity, stockOrderEntity); + + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(thrOrderEntity.getBillType()); + stockOrderEntity.setBillType(bussinessTypeEntity.getLocalAction()); stockOrderEntity.setId(null); - stockOrderEntity.setStatus("101");//未提交 + stockOrderEntity.setStatus(ConstantStatus.SORDER_DRAFT);//未提交 stockOrderEntity.setSourceType("2");//外部提交 - stockOrderEntity.setStatus2("101");//未打印 + stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印 + stockOrderEntity.setBilldate(DateUtil.formatDate(new Date(), "yyyy-MM-dd")); boolean b = stockOrderService.insertStockOrder(stockOrderEntity); if (b) { FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest(); @@ -161,6 +172,8 @@ public class OrderDetailController { for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) { StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity(); BeanUtils.copyProperties(thrOrderDetailEntity, stockOrderDetailEntity); + stockOrderDetailEntity.setCount(thrOrderDetailEntity.getCount() + ""); + stockOrderDetailEntity.setReCount(thrOrderDetailEntity.getReCount() + ""); stockOrderDetailEntity.setOrderIdFk(stockOrderEntity.getId()); stockOrderDetailEntity.setSweepCount(0 + ""); stockOrderDetailEntityList.add(stockOrderDetailEntity); @@ -285,29 +298,29 @@ public class OrderDetailController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - List docids = importErpOrderRequest.getPurchaseinResponses(); + List docids = importErpOrderRequest.getPurchaseinResponses(); String docidStr = ""; if (docids != null && docids.size() > 0) { - for (PurchaseinResponse temp : docids) { - docidStr = docidStr + "," + temp.getVbillcode(); + for (ErpOrderResponse temp : docids) { + docidStr = docidStr + "," + temp.getBillNo(); } docidStr = docidStr.substring(1); } List erpOrderEntities = new ArrayList<>(); if (docids != null && docids.size() > 0) { - for (PurchaseinResponse purchaseinResponse : docids) { - for (PurchaseinResponse.SubPurchase subPurchase : purchaseinResponse.getSubPurchases()) { + for (ErpOrderResponse purchaseinResponse : docids) { + for (ErpOrderResponse.SubErpOrder subPurchase : purchaseinResponse.getSubErpOrders()) { ErpOrderEntity erpOrderEntity = new ErpOrderEntity(); - erpOrderEntity.setErpOrderId(purchaseinResponse.getVbillcode()); - erpOrderEntity.setCompanyid(purchaseinResponse.getProvider_code()); - erpOrderEntity.setCompanyname(purchaseinResponse.getProvider_name()); - erpOrderEntity.setCredate(purchaseinResponse.getDbilldate()); - erpOrderEntity.setGoodsid(subPurchase.getInventory_code()); - erpOrderEntity.setGoodsname(subPurchase.getInventory_name()); - erpOrderEntity.setBatchNo(subPurchase.getVbatchcode()); - erpOrderEntity.setErpCount(Math.abs(subPurchase.getDtlgoodsqty())); + erpOrderEntity.setErpOrderId(purchaseinResponse.getBillNo()); + erpOrderEntity.setCompanyid(purchaseinResponse.getCorpId()); + erpOrderEntity.setCompanyname(purchaseinResponse.getCorpName()); + erpOrderEntity.setCredate(purchaseinResponse.getBilldate()); + erpOrderEntity.setGoodsid(subPurchase.getProductId()); + erpOrderEntity.setGoodsname(subPurchase.getProductName()); + erpOrderEntity.setBatchNo(subPurchase.getBatchNo()); + erpOrderEntity.setErpCount(Math.abs(subPurchase.getCount())); erpOrderEntity.setReCount(Math.abs(subPurchase.getReCount())); - erpOrderEntity.setGoodsunit(subPurchase.getInvspec()); + erpOrderEntity.setGoodsunit(subPurchase.getSpec()); erpOrderEntities.add(erpOrderEntity); } } @@ -323,6 +336,7 @@ public class OrderDetailController { OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); orderFilterRequest.setId(importErpOrderRequest.getOrderId()); OrderEntity orderEntity = orderService.findOne(orderFilterRequest); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction()); ErpOrderEntity exitErp = new ContrastErpUtil().vailErpExit(orderDetailService, erpOrderEntities, importErpOrderRequest.getOrderId()); if (exitErp != null) { String errMsg = "所选ERP单" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定"; @@ -338,7 +352,7 @@ public class OrderDetailController { List returnOrders = new ContrastErpUtil().transErp(erpOrderEntities, udiRelevanceService, importErpOrderRequest.getOrderId()); orderDetailService.insertErpOrders(returnOrders); List warehouseEntityList = codesService.findByReceiptId(importErpOrderRequest.getOrderId()); - new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, warehouseEntityList, systemParamConfigService); + new ContrastErpUtil().contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, warehouseEntityList, systemParamConfigService, bussinessTypeEntity); } else { @@ -362,5 +376,4 @@ public class OrderDetailController { return ResultVOUtils.success("后台已开始校验,请稍后刷新重试!"); } - } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java index b7d070d..74120a5 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java @@ -10,17 +10,24 @@ import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil; import com.glxp.sale.admin.controller.inout.utils.InoutUtils; import com.glxp.sale.admin.entity.basic.UdiInfoEntity; import com.glxp.sale.admin.entity.basic.StockPrintEntity; +import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.inout.*; import com.glxp.sale.admin.entity.inventory.InCodeLogEntity; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; +import com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity; +import com.glxp.sale.admin.entity.thrsys.ThrOrderEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.httpclient.ErpOrderClient; import com.glxp.sale.admin.req.inout.*; import com.glxp.sale.admin.req.inventory.PostStockPrintRequest; import com.glxp.sale.admin.req.param.SystemParamConfigRequest; +import com.glxp.sale.admin.req.thrsys.FilterThrOrderDetailRequest; +import com.glxp.sale.admin.req.thrsys.FilterThrOrderRequest; import com.glxp.sale.admin.res.PageSimpleResponse; +import com.glxp.sale.admin.res.inout.ErpOrderResponse; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; +import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.*; import com.glxp.sale.admin.service.inventory.InCodeLogService; import com.glxp.sale.admin.service.inventory.InvStockPrintService; @@ -76,6 +83,8 @@ public class StockOrderController { InvStockPrintService stockPrintService; @Resource InCodeLogService inCodeLogService; + @Resource + CompanyService companyService; @GetMapping("/udiwms/stock/order/error") public BaseResponse listStockOrderNoDealWith(StockOrderFilterRequest stockOrderFilterRequest) { @@ -97,8 +106,8 @@ public class StockOrderController { StockOrderEntity stockOrderEntity = new StockOrderEntity(); BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity); - stockOrderEntity.setStatus(101 + "");//未处理 - stockOrderEntity.setStatus2("101");//未打印 + stockOrderEntity.setStatus(ConstantStatus.SORDER_DRAFT);//未处理 + stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印 stockOrderEntity.setSourceType(2 + "");//外部提交 // stockOrderEntity.setId(String.valueOf(new Date().getTime())); boolean b = stockOrderService.insertStockOrder(stockOrderEntity); @@ -148,7 +157,7 @@ public class StockOrderController { stockOrderEntity.setStatus( StringUtils.isBlank(stockOrderEntity.getStatus()) ? 501 + ""//未提交 : stockOrderEntity.getStatus()); - stockOrderEntity.setStatus2("101");//未打印 + stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印 stockOrderEntity.setSourceType(1 + "");//本地网页新增 boolean b = false; if (stockOrderEntity.getStatus().equals("502")) {//已提交 @@ -161,11 +170,14 @@ public class StockOrderController { } } if (StringUtils.isBlank(stockOrderEntity.getId())) { + + CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderPostRequest.getCustomerId())); + stockOrderEntity.setUnitIdFk(companyEntity.getUnitIdFk()); + stockOrderEntity.setCustomerId(stockOrderPostRequest.getCustomerId()); b = stockOrderService.insertStockOrder(stockOrderEntity); } else { stockOrderService.updateById(stockOrderEntity); } -// if (b && stockOrderPostRequest.getSubErpOrders() != null) { if (stockOrderPostRequest.getSubErpOrders() != null) { List stockOrderDetailEntityList = stockOrderPostRequest.getSubErpOrders(); for (StockOrderDetailEntity stockOrderDetailEntity : stockOrderDetailEntityList) { @@ -227,12 +239,16 @@ public class StockOrderController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } List stockOrderEntityList; - if (stockOrderFilterRequest.getStatus() == null) { - stockOrderFilterRequest.setStatus(0 + ""); - } - if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId()) && stockOrderFilterRequest.getCorpId().equals("110")) { - stockOrderFilterRequest.setCorpId(""); +// if (stockOrderFilterRequest.getStatus() == null) { +// stockOrderFilterRequest.setStatus(0 + ""); +// } + + if (StringUtils.isNotBlank(stockOrderFilterRequest.getCorpId())) { + CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderFilterRequest.getCorpId())); + stockOrderFilterRequest.setUnitIdFk(companyEntity.getUnitIdFk()); + stockOrderFilterRequest.setCorpId(null); } + stockOrderEntityList = stockOrderService.filterListOr(stockOrderFilterRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(stockOrderEntityList); @@ -242,6 +258,58 @@ public class StockOrderController { return ResultVOUtils.success(pageSimpleResponse); } + + @GetMapping("/udiwms/stock/order/filterDetail") + public BaseResponse filterDetail(StockOrderFilterRequest stockOrderFilterRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + if (stockOrderFilterRequest.getBillType() == null) { + stockOrderFilterRequest.setBillType(stockOrderFilterRequest.getBillAction()); + } + List erpOrderResponses = new ArrayList<>(); + if (stockOrderFilterRequest.getCustomerId() != null) { + CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(stockOrderFilterRequest.getCustomerId())); + stockOrderFilterRequest.setUnitIdFk(companyEntity.getUnitIdFk()); + } + + List stockOrderEntityList; + stockOrderEntityList = stockOrderService.filterListOr(stockOrderFilterRequest); + if (stockOrderEntityList != null && stockOrderEntityList.size() > 0) { + + + for (StockOrderEntity stockOrderEntity : stockOrderEntityList) { + ErpOrderResponse erpOrderResponse = new ErpOrderResponse(); + BeanUtils.copyProperties(stockOrderEntity, erpOrderResponse); + + StockOrderDetailFilterRequest stockOrderDetailFilterRequest = new StockOrderDetailFilterRequest(); + stockOrderDetailFilterRequest.setOrderIdFk(stockOrderEntity.getId()); + List stockOrderDetailEntityList + = stockOrderDetailService.filterStockOrderDetail(stockOrderDetailFilterRequest); + + List subErpOrders = new ArrayList<>(); + if (stockOrderDetailEntityList != null && stockOrderDetailEntityList.size() > 0) { + for (StockOrderDetailEntity thrOrderDetailEntity : stockOrderDetailEntityList) { + ErpOrderResponse.SubErpOrder subErpOrder = new ErpOrderResponse.SubErpOrder(); + BeanUtils.copyProperties(thrOrderDetailEntity, subErpOrder); + subErpOrders.add(subErpOrder); + } + } + erpOrderResponse.setSubErpOrders(subErpOrders); + erpOrderResponses.add(erpOrderResponse); + } + } + PageInfo pageInfo; + pageInfo = new PageInfo<>(stockOrderEntityList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(erpOrderResponses); + return ResultVOUtils.success(pageSimpleResponse); + } + + @GetMapping("/udiwms/stock/order/submit") public BaseResponse submitStockOrder(@RequestParam("id") String id) { StockOrderEntity stockOrderEntity = new StockOrderEntity(); 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 483e35b..5d73701 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 @@ -1,6 +1,7 @@ package com.glxp.sale.admin.controller.inout; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil; @@ -12,16 +13,19 @@ import com.glxp.sale.admin.entity.inout.WarehouseEntity; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.httpclient.ErpOrderClient; +import com.glxp.sale.admin.req.basic.CompanyProductRelevanceRequest; import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest; import com.glxp.sale.admin.req.inout.*; import com.glxp.sale.admin.req.param.SystemParamConfigRequest; import com.glxp.sale.admin.res.PageSimpleResponse; +import com.glxp.sale.admin.res.basic.CompanyProductRelevanceResponse; import com.glxp.sale.admin.res.basic.UdiRelevanceResponse; import com.glxp.sale.admin.res.inout.PurchaseinResponse; import com.glxp.sale.admin.res.inout.StockOrderDetailQueryProductResponse; import com.glxp.sale.admin.res.inout.StockOrderDetailResponse; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; +import com.glxp.sale.admin.service.info.CompanyProductRelevanceService; import com.glxp.sale.admin.service.inout.*; import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.thread.InvDlErpStockService; @@ -38,10 +42,7 @@ import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @RestController @@ -57,7 +58,8 @@ public class StockOrderDetailController { UdiInfoService udiInfoService; @Resource private UdiRelevanceService udiRelevanceService; - + @Resource + private CompanyProductRelevanceService companyProductRelevanceService; @Resource private IoTransInoutService transInoutService; @@ -83,7 +85,7 @@ public class StockOrderDetailController { @GetMapping("/udiwms/stock/order/detail/filter2") public BaseResponse filterStockOrderDetail2(StockOrderDetailFilterRequest stockOrderDetailFilterRequest, - BindingResult bindingResult) { + BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); @@ -104,7 +106,7 @@ public class StockOrderDetailController { @GetMapping("/udiwms/stock/order/detail/temp/filter") public BaseResponse filterStockOrderDetailTemp(StockOrderDetailFilterRequest stockOrderDetailFilterRequest, - BindingResult bindingResult) { + BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); @@ -122,7 +124,7 @@ public class StockOrderDetailController { @GetMapping("/udiwms/stock/order/detail/getStockOrderDetails") public BaseResponse getStockOrderDetails(StockOrderDetailFilterRequest stockOrderDetailFilterRequest, - BindingResult bindingResult) { + BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); @@ -140,7 +142,7 @@ public class StockOrderDetailController { @GetMapping(value = "/udiwms/stock/order/detail") public BaseResponse stockOrderDetail(StockOrderDetailFilterRequest stockOrderDetailFilterRequest, - BindingResult bindingResult) { + BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } @@ -182,7 +184,7 @@ public class StockOrderDetailController { if (systemParamConfigEntitySODCountMax == null || StringUtils.isNotBlank(systemParamConfigEntitySODCountMax.getParamValue()) && - systemParamConfigEntitySODCountMax.getParamValue().equals("1")) { + systemParamConfigEntitySODCountMax.getParamValue().equals("1")) { if (Integer.parseInt(tempStockOrderDetailEntity.getCount()) < Integer.parseInt(tempStockOrderDetailEntity.getReCount())) { return ResultVOUtils.error(500, "配货数量超过订单数量"); @@ -226,11 +228,14 @@ public class StockOrderDetailController { List stockOrderDetailEntityList = new ArrayList<>(); for (String id : stockOrderIdsRequest.getIds()) { - UdiInfoEntity udiInfoEntity = - udiInfoService.findById(id); - if (udiInfoEntity != null) { + CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest(); + companyProductRelevanceRequest.setId(id); + List companyProductRelevanceResponses = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest); + + if (companyProductRelevanceResponses != null && companyProductRelevanceResponses.size() > 0) { + CompanyProductRelevanceResponse udiInfoEntity = companyProductRelevanceResponses.get(0); StockOrderDetailEntity stockOrderDetailEntity = new StockOrderDetailEntity(); - stockOrderDetailEntity.setProductId(udiInfoEntity.getUuid()); + stockOrderDetailEntity.setProductId(udiInfoEntity.getThirdId()); stockOrderDetailEntity.setProductName(udiInfoEntity.getCpmctymc()); stockOrderDetailEntity.setSpec(udiInfoEntity.getGgxh()); if (stockOrderIdsRequest.getUdiEntity() != null) { @@ -243,7 +248,6 @@ public class StockOrderDetailController { stockOrderDetailEntity.setReCount(0 + ""); stockOrderDetailEntity.setYlqxzcrbarmc(udiInfoEntity.getYlqxzcrbarmc()); stockOrderDetailEntity.setZczbhhzbapzbh(udiInfoEntity.getZczbhhzbapzbh()); - stockOrderDetailEntityList.add(stockOrderDetailEntity); } } @@ -297,7 +301,7 @@ public class StockOrderDetailController { @GetMapping("/udiwms/stock/order/detail/addFromCodeById") public BaseResponse addStockOrderDetailFromCodeById(@RequestParam("orderId") String orderId, - @RequestParam("id") String id) { + @RequestParam("id") String id) { UdiInfoEntity udiInfoEntity = udiInfoService.findById(id); if (udiInfoEntity != null) { @@ -390,14 +394,24 @@ public class StockOrderDetailController { } filterUdiInfoRequest.setNameCode(nameCode); - List udiRelevanceResponseList = - udiInfoService.filterUdiInfo2(filterUdiInfoRequest); + CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest(); + BeanUtils.copyProperties(filterUdiInfoRequest, companyProductRelevanceRequest); + + List basicInstrumentMaintainRelevanceResponses = null; + basicInstrumentMaintainRelevanceResponses = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest); + if (basicInstrumentMaintainRelevanceResponses != null && basicInstrumentMaintainRelevanceResponses.size() > 0) { + for (CompanyProductRelevanceResponse basicInstrumentMaintainRelevanceResponse : basicInstrumentMaintainRelevanceResponses) { + if (basicInstrumentMaintainRelevanceResponse.getDiType() == 2 && basicInstrumentMaintainRelevanceResponse.getIsUseDy() != 1) { + basicInstrumentMaintainRelevanceResponse.setNameCode(basicInstrumentMaintainRelevanceResponse.getSjcpbm()); + } + } + } - PageInfo pageInfo; - pageInfo = new PageInfo<>(udiRelevanceResponseList); - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + PageInfo pageInfo; + pageInfo = new PageInfo<>(basicInstrumentMaintainRelevanceResponses); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pageInfo.getTotal()); - pageSimpleResponse.setList(udiRelevanceResponseList); + pageSimpleResponse.setList(basicInstrumentMaintainRelevanceResponses); return ResultVOUtils.success(pageSimpleResponse); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockQRCodeTextController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockQRCodeTextController.java index 07eef78..c2b7218 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockQRCodeTextController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockQRCodeTextController.java @@ -133,7 +133,7 @@ public class StockQRCodeTextController { StockOrderEntity updateStockOrderEntity = new StockOrderEntity(); updateStockOrderEntity.setId(stockQRCodeTextEntity.getOrderId()); - updateStockOrderEntity.setStatus2("102"); + updateStockOrderEntity.setPrintStatus("102"); stockOrderService.updateById(updateStockOrderEntity); } @@ -192,7 +192,7 @@ public class StockQRCodeTextController { StockOrderEntity updateStockOrderEntity = new StockOrderEntity(); updateStockOrderEntity.setId(stockOrderEntity.getId()); - updateStockOrderEntity.setStatus2("102"); + updateStockOrderEntity.setPrintStatus("102"); stockOrderService.updateById(updateStockOrderEntity); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java index e1f950a..0a15c81 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil; import com.glxp.sale.admin.controller.inout.utils.InoutUtils; +import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.inout.ErpOrderEntity; import com.glxp.sale.admin.entity.inout.OrderEntity; import com.glxp.sale.admin.entity.inout.WarehouseEntity; @@ -14,6 +15,7 @@ import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.req.inout.*; import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.res.inout.WarehouseResponse; +import com.glxp.sale.admin.service.basic.BussinessTypeService; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; import com.glxp.sale.admin.service.inout.CodesTempService; @@ -51,22 +53,15 @@ public class WareHouseController { @Resource private OrderService orderService; @Resource - private MipsBarcodeService mipsBarcodeService; - @Resource - private ProductInfoService productInfoService; - @Resource private MyErpOrderService myErpOrderService; @Resource private IoTransInoutService ioTransInoutService; @Resource private CodesTempService codesTempService; + @Resource - private UdiInfoService udiInfoService; - @Resource - private UdiRelevanceService udiRelevanceService; - @Resource - private SystemParamConfigService systemParamConfigService; + private BussinessTypeService bussinessTypeService; @GetMapping("admin/warehouse/inout/list") public BaseResponse list(WarehouseQueryRequest warehouseQueryRequest) { @@ -166,100 +161,6 @@ public class WareHouseController { } -// @PostMapping("/admin/warehouse/inout/adList")//TODO 出入库 -// public BaseResponse adList(@RequestParam("warehouseEntities") String warehouseEntities) { -// -// try { -// List warehouseEntityList = FastJsonUtils.getJsonToList(warehouseEntities, WarehouseEntity.class); -// List orders = new ArrayList<>(); -// List warehousetempList = new WarehousBeanUtils().entityToTemp(warehouseEntityList); -// new Thread(() -> { -// String id = null; -// String orderId = null; -// List> orderList = new ArrayList<>(); -// List orderOne = null; -// if (warehousetempList != null && warehousetempList.size() > 0) { -// for (int i = 0; i < warehousetempList.size(); i++) { -// Warehousetemp warehouseEntity = warehousetempList.get(i); -// if (!orders.contains(warehouseEntity.getCorporderid())) { -// orderOne = new ArrayList<>(); -// orderList.add(orderOne); -// orders.add(warehouseEntity.getCorporderid()); -// id = System.currentTimeMillis() + i + ""; -// OrderEntity orderSaveRequest = new OrderEntity(); -// orderSaveRequest.setId(id); -// if (warehouseEntity.getActdate() != null) { -// orderSaveRequest.setActDate(warehouseEntity.getActdate()); -// } -// -// orderSaveRequest.setAction(warehouseEntity.getAction()); -// orderSaveRequest.setActor(warehouseEntity.getActor()); -// orderSaveRequest.setCorpOrderId(warehouseEntity.getCorporderid()); -// orderSaveRequest.setFromCorpId(warehouseEntity.getFromcorpid()); -// orderSaveRequest.setMainAction(warehouseEntity.getMainaction()); -// orderSaveRequest.setFromCorp(warehouseEntity.getFromcorp()); -// orderSaveRequest.setFromType("手持终端"); -// orderSaveRequest.setStatus(3);//error -// orderSaveRequest.setExportStatus(0);//未上传 -// orderService.insertOrder(orderSaveRequest); -// } -// -// warehouseEntity.setOrderid(id); -// warehousetempList.get(i).setOrderid(id); -// orderOne.add(warehouseEntity); -// } -// } -// boolean b = codesService.insertTempWarehouses(warehousetempList); -// -// for (int i = 0; i < orderList.size(); i++) { -// List filterList = orderList.get(i); -// List insertList = new ArrayList<>(); -// String result; -// for (int j = 0; j < filterList.size(); j++) { -// Warehousetemp warehousetemp = filterList.get(j); -// result = new InoutUtils().filterCode(codesService, warehousetemp,systemParamConfigService); -// if (result == null) { -// insertList.add(warehousetemp); -// -// } else { -// orderService.updateRemark(warehousetemp.getOrderid(), result); -// insertList.clear(); -// break; -// } -// } -// if (insertList.size() > 0) { -// orderId = insertList.get(0).getOrderid(); -// codesService.insertWarehouses(new WarehousBeanUtils().tempsToEntitys(insertList)); -// Warehousetemp warehousetemp = insertList.get(0); -// CommitRequest commitRequest = new CommitRequest(); -// commitRequest.setOrderId(warehousetemp.getOrderid()); -// List warehousetemps = codesService.findTempByOrderId(commitRequest); -// orderService.updateOrderStatus(orderId, ConstantStatus.ORDER_STATUS_SUCCESS);//"success" -// List ids = new ArrayList<>(); -// for (Warehousetemp w : warehousetemps) { -// ids.add(w.getId()); -// } -// codesService.deleteTempWarehouses(ids); -// insertList.clear(); -// List transData = codesService.findByReceiptId(orderId); -// new ContrastErpUtil().contrastErp(basicInstrumentMaintainService, basicInstrumentMaintainRelevanceService, myErpOrderService, orderService, transData, systemParamConfigService); -// } -// -// } -// -// -//// List transData = codesService.findByReceiptId(orderId); -//// new InoutUtils().generateConstrastDetail(productInfoService, myErpOrderService, transData); -// -// }).start(); -// -// } catch (Exception e) { -// return ResultVOUtils.error(ResultEnum.NOT_NETWORK); -// } -// -// return ResultVOUtils.success("添加成功"); -// } - @PostMapping("/warehouse/inout/commit")//TODO 重新提交 public BaseResponse commitOrder(@RequestBody CommitRequest commitRequest, BindingResult bindingResult) { @@ -271,105 +172,6 @@ public class WareHouseController { return ResultVOUtils.success("提交成功"); } -// @PostMapping("warehouse/inout/postCodes") -// public BaseResponse postCodes(@RequestBody PostErpOrderRequest postErpOrderRequest, BindingResult bindingResult) { -// -// if (bindingResult.hasErrors()) { -// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); -// } -// List erpOrderEntities = postErpOrderRequest.getErpOrderEntities(); -// try { -// List warehouseEntityList = postErpOrderRequest.getCodes(); -// List orders = new ArrayList<>(); -// List warehousetempList = new WarehousBeanUtils().entityToTemp(warehouseEntityList); -// new Thread(() -> { -// String id = null; -// String orderId = null; -// List> orderList = new ArrayList<>(); -// List orderOne = null; -// if (warehousetempList != null && warehousetempList.size() > 0) { -// for (int i = 0; i < warehousetempList.size(); i++) { -// Warehousetemp warehouseEntity = warehousetempList.get(i); -// if (!orders.contains(warehouseEntity.getCorporderid())) { -// orderOne = new ArrayList<>(); -// orderList.add(orderOne); -// orders.add(warehouseEntity.getCorporderid()); -// id = System.currentTimeMillis() + i + ""; -// OrderEntity orderSaveRequest = new OrderEntity(); -// orderSaveRequest.setId(id); -// if (warehouseEntity.getActdate() != null) { -// orderSaveRequest.setActDate(warehouseEntity.getActdate()); -// } -// -// orderSaveRequest.setAction(warehouseEntity.getAction()); -// orderSaveRequest.setActor(warehouseEntity.getActor()); -// orderSaveRequest.setCorpOrderId(warehouseEntity.getCorporderid()); -// orderSaveRequest.setFromCorpId(warehouseEntity.getFromcorpid()); -// orderSaveRequest.setMainAction(warehouseEntity.getMainaction()); -// orderSaveRequest.setFromCorp(warehouseEntity.getFromcorp()); -// orderSaveRequest.setFromType("手持终端"); -// orderSaveRequest.setStatus(3);//error -// orderSaveRequest.setExportStatus(0);//未上传 -// orderService.insertOrder(orderSaveRequest); -// } -// -// warehouseEntity.setOrderid(id); -// warehousetempList.get(i).setOrderid(id); -// orderOne.add(warehouseEntity); -// } -// } -// boolean b = codesService.insertTempWarehouses(warehousetempList); -// for (int i = 0; i < orderList.size(); i++) { -// List filterList = orderList.get(i); -// List insertList = new ArrayList<>(); -// String result; -// for (int j = 0; j < filterList.size(); j++) { -// Warehousetemp warehousetemp = filterList.get(j); -// result = new InoutUtils().filterCode(codesService, warehousetemp,systemParamConfigService); -// if (result == null) { -// insertList.add(warehousetemp); -// -// } else { -// orderService.updateRemark(warehousetemp.getOrderid(), result); -// insertList.clear(); -// break; -// } -// } -// if (insertList.size() > 0) { -// orderId = insertList.get(0).getOrderid(); -// codesService.insertWarehouses(new WarehousBeanUtils().tempsToEntitys(insertList)); -// Warehousetemp warehousetemp = insertList.get(0); -// CommitRequest commitRequest = new CommitRequest(); -// commitRequest.setOrderId(warehousetemp.getOrderid()); -// List warehousetemps = codesService.findTempByOrderId(commitRequest); -// orderService.updateOrderStatus(orderId, ConstantStatus.ORDER_STATUS_SUCCESS);//"success" -// List ids = new ArrayList<>(); -// for (Warehousetemp w : warehousetemps) { -// ids.add(w.getId()); -// } -// codesService.deleteTempWarehouses(ids); -// if (erpOrderEntities != null && erpOrderEntities.size() > 0) { -// updateErpOrderId(erpOrderEntities, insertList.get(0).getCorporderid(), orderId); -// List transData = codesService.findByReceiptId(orderId); -// new ContrastErpUtil().contrastErp(basicInstrumentMaintainService, basicInstrumentMaintainRelevanceService, myErpOrderService, orderService, transData,systemParamConfigService); -// } else { -// List datas = codesService.findByReceiptId(orderId); -// new InoutUtils().generateConstrastDetail(basicInstrumentMaintainService, basicInstrumentMaintainRelevanceService, myErpOrderService, datas); -// } -// -// insertList.clear(); -// } -// } -// -// }).start(); -// -// } catch (Exception e) { -// return ResultVOUtils.error(ResultEnum.NOT_NETWORK); -// } -// -// return ResultVOUtils.success("导入成功"); -// } - @GetMapping("warehouse/inout/submitOrderWeb") public BaseResponse submitOrderWeb(@RequestParam("orderId") String orderId) { @@ -397,8 +199,9 @@ public class WareHouseController { if (StringUtils.isBlank(code)) return ResultVOUtils.error(ResultEnum.DATA_ERROR); UdiEntity udiEntity = FilterUdiUtils.getUdi(code); if (udiEntity == null) - return ResultVOUtils.error(500,"UDI码格式错误!"); + return ResultVOUtils.error(500, "UDI码格式错误!"); String orderId = addOrderRequest.getOrderId(); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(addOrderRequest.getBillType()); if (StringUtils.isBlank(orderId)) { orderId = System.currentTimeMillis() + new Random().nextInt(10) + ""; OrderEntity orderSaveRequest = new OrderEntity(); @@ -406,8 +209,11 @@ public class WareHouseController { if (addOrderRequest.getActDate() != null) { orderSaveRequest.setActDate(addOrderRequest.getActDate()); } - orderSaveRequest.setMainAction(addOrderRequest.getMainAction()); - orderSaveRequest.setAction(addOrderRequest.getAction()); + + + + orderSaveRequest.setMainAction(bussinessTypeEntity.getMainAction()); + orderSaveRequest.setAction(bussinessTypeEntity.getAction()); orderSaveRequest.setActor(addOrderRequest.getActor()); orderSaveRequest.setCorpOrderId(addOrderRequest.getCorpOrderId()); orderSaveRequest.setFromCorpId(addOrderRequest.getFromCorpId()); @@ -438,8 +244,8 @@ public class WareHouseController { warehouseEntity.setOrderId(orderId); warehouseEntity.setCorpOrderId(addOrderRequest.getCorpOrderId()); warehouseEntity.setActDate(addOrderRequest.getActDate()); - warehouseEntity.setMainAction(addOrderRequest.getMainAction()); - warehouseEntity.setAction(addOrderRequest.getAction()); + warehouseEntity.setMainAction(bussinessTypeEntity.getMainAction()); + warehouseEntity.setAction(bussinessTypeEntity.getAction()); warehouseEntity.setActor(addOrderRequest.getActor()); warehouseEntity.setFromCorpId(addOrderRequest.getFromCorpId()); warehouseEntity.setFromCorp(addOrderRequest.getFromCorp()); @@ -507,89 +313,6 @@ public class WareHouseController { } -// @PostMapping("warehouse/inout/mipsToInout") -// public BaseResponse mipsToInout(@RequestBody MipsToInoutRequest mipsToInoutRequest, BindingResult bindingResult) { -// new Thread(() -> { -// List productOrderEntities = mipsToInoutRequest.getProductOrderEntities(); -// if (productOrderEntities != null && productOrderEntities.size() > 0) { -// String orderId = "0"; -// OrderEntity orderSaveRequest = new OrderEntity(); -// String id = System.currentTimeMillis() + ""; -// orderSaveRequest.setId(id); -// orderId = id; -// orderSaveRequest.setActDate(DateUtil.getDateTime()); -// orderSaveRequest.setFromType("单据转换"); -// orderSaveRequest.setAction(mipsToInoutRequest.getAction()); -//// orderSaveRequest.setCorpOrderId(productOrderEntity.getOrderNo()); -// if (mipsToInoutRequest.getAction().substring(mipsToInoutRequest.getAction().length() - 2).equals("In")) { -// orderSaveRequest.setMainAction("WareHouseIn"); -// } else { -// orderSaveRequest.setMainAction("WareHouseOut"); -// } -// orderSaveRequest.setStatus(3);//error -// orderSaveRequest.setRemark("该订单无条码"); -// orderSaveRequest.setExportStatus(0);//未上传 -// orderService.insertOrder(orderSaveRequest); -// List mipsBarcodeEntities = new ArrayList<>(); -// for (int i = 0; i < productOrderEntities.size(); i++) { -// ProductOrderDetailEntity productOrderEntity = productOrderEntities.get(i); -// List temps = mipsBarcodeService.selectAllByOrderId(productOrderEntity.getOrderNo()); -// if (temps != null && temps.size() > 0) { -// mipsBarcodeEntities.addAll(temps); -// } -// } -// if (mipsBarcodeEntities.size() > 0) { -// List warehousetempList = new ArrayList<>(); -// for (MipsBarcodeEntity mipsBarcodeEntity : mipsBarcodeEntities) { -// Warehousetemp warehousetemp = new Warehousetemp(); -// warehousetemp.setOrderid(id); -// warehousetemp.setMainaction(orderSaveRequest.getMainAction()); -// warehousetemp.setAction(mipsToInoutRequest.getAction()); -// warehousetemp.setCode(mipsBarcodeEntity.getCode()); -// warehousetemp.setBatchno(mipsBarcodeEntity.getBatchNo()); -// warehousetemp.setActdate(DateUtil.getDateTime()); -// warehousetempList.add(warehousetemp); -// } -// boolean b = codesService.insertTempWarehouses(warehousetempList); -// if (warehousetempList != null && warehousetempList.size() > 0) { -// String result; -// List insertList = new ArrayList<>(); -// for (int j = 0; j < warehousetempList.size(); j++) { -// Warehousetemp warehousetemp = warehousetempList.get(j); -// result = new InoutUtils().filterCode(codesService, warehousetemp,systemParamConfigService); -// if (result == null) { -// insertList.add(warehousetemp); -// } else { -// orderService.updateRemark(warehousetemp.getOrderid(), result); -// insertList.clear(); -// break; -// } -// } -// if (insertList.size() > 0) { -// codesService.insertWarehouses(new WarehousBeanUtils().tempsToEntitys(insertList)); -// Warehousetemp warehousetemp = insertList.get(0); -// CommitRequest commitRequest = new CommitRequest(); -// commitRequest.setOrderId(warehousetemp.getOrderid()); -// List warehousetemps = codesService.findTempByOrderId(commitRequest); -// orderService.updateOrderStatus(insertList.get(0).getOrderid(), ConstantStatus.ORDER_STATUS_SUCCESS);//"success" -// List ids = new ArrayList<>(); -// for (Warehousetemp w : warehousetemps) { -// ids.add(w.getId()); -// } -// codesService.deleteTempWarehouses(ids); -// -// } -// } -// } -// List transData = codesService.findByReceiptId(orderId); -// new InoutUtils().generateConstrastDetail(basicInstrumentMaintainService, basicInstrumentMaintainRelevanceService, myErpOrderService, transData); -// -// } -// }).start(); -// -// return ResultVOUtils.success("后台已开始转换,请稍后刷新重试!"); -// } - @PostMapping("/admin/warehouse/inout/save") public BaseResponse save(@RequestBody @Valid WarehouseSaveRequest warehouseSaveRequest, diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/ContrastErpUtil.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/ContrastErpUtil.java index a311e63..8aceef0 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/ContrastErpUtil.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/ContrastErpUtil.java @@ -2,6 +2,7 @@ package com.glxp.sale.admin.controller.inout.utils; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.entity.basic.BasicInstrumentMaintainRelevanceEntity; +import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.basic.UdiInfoEntity; import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; @@ -41,7 +42,7 @@ public class ContrastErpUtil { public void contrastErp(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, OrderDetailService orderDetailService, OrderService orderService, - List warehouseEntityList, SystemParamConfigService setupService) { + List warehouseEntityList, SystemParamConfigService setupService, BussinessTypeEntity bussinessTypeEntity) { String orderIdFk = warehouseEntityList.get(0).getOrderId(); FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest(); filterErpOrderRequest.setOrderId(orderIdFk); @@ -61,7 +62,7 @@ public class ContrastErpUtil { } List udiRelevanceEntities = udiRelevanceService.selectByUuid(udiInfoEntity.getUuid()); if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 0) { - UdiRelevanceEntity udiRelevanceEntity = checkGoodsId(udiRelevanceEntities); + UdiRelevanceEntity udiRelevanceEntity = checkGoodsId(udiRelevanceEntities,bussinessTypeEntity); if (udiRelevanceEntity != null) { udiInfoEntity.setThirdId(udiRelevanceEntity.getThirdId()); udiInfoEntity.setThirdName(udiRelevanceEntity.getThirdName()); @@ -90,8 +91,8 @@ public class ContrastErpUtil { ErpOrderEntity vailExitMsg = vailErpExit(orderDetailService, mErpOrderEntities, orderIdFk); SystemParamConfigRequest systemParamConfigRequest = new SystemParamConfigRequest(); systemParamConfigRequest.setParamKey("erp_forbidSameErp"); - SystemParamConfigEntity systemParamConfigEntity = setupService.selectByParamKey(systemParamConfigRequest); - if (vailExitMsg != null && systemParamConfigEntity!=null && systemParamConfigEntity.getParamValue().equals("1")) { + SystemParamConfigEntity systemParamConfigEntity = setupService.selectByParamKey(systemParamConfigRequest); + if (vailExitMsg != null && systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) { errMsg = "所选ERP单" + vailExitMsg.getErpOrderId() + "已被其他出入库单" + vailExitMsg.getOrderIdFk() + "绑定!"; } if (mErpOrderEntities != null && mErpOrderEntities.size() > 0) @@ -113,13 +114,44 @@ public class ContrastErpUtil { } } - public UdiRelevanceEntity checkGoodsId(List udiRelevanceEntities) { + public UdiRelevanceEntity checkGoodsId(List udiRelevanceEntities, BussinessTypeEntity bussinessTypeEntity) { if (mErpOrderEntities.size() > 0) { for (ErpOrderEntity erpOrderEntity : mErpOrderEntities) { for (UdiRelevanceEntity udiRelevanceEntity : udiRelevanceEntities) { - if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId())) { - return udiRelevanceEntity; + if (bussinessTypeEntity.getThirdSysFk() == null) { + if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId())) { + return udiRelevanceEntity; + } + } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId")) { + if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId())) { + return udiRelevanceEntity; + } + } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId1")) { + if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId1())) { + udiRelevanceEntity.setThirdId(udiRelevanceEntity.getThirdId1()); + udiRelevanceEntity.setThirdName(udiRelevanceEntity.getThirdName1()); + return udiRelevanceEntity; + } + } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId2")) { + if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId2())) { + udiRelevanceEntity.setThirdId(udiRelevanceEntity.getThirdId2()); + udiRelevanceEntity.setThirdName(udiRelevanceEntity.getThirdName2()); + return udiRelevanceEntity; + } + } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId3")) { + if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId3())) { + udiRelevanceEntity.setThirdId(udiRelevanceEntity.getThirdId3()); + udiRelevanceEntity.setThirdName(udiRelevanceEntity.getThirdName3()); + return udiRelevanceEntity; + } + } else if (bussinessTypeEntity.getThirdSysFk().equals("thirdId4")) { + if (erpOrderEntity.getGoodsid().equals(udiRelevanceEntity.getThirdId4())) { + udiRelevanceEntity.setThirdId(udiRelevanceEntity.getThirdId4()); + udiRelevanceEntity.setThirdName(udiRelevanceEntity.getThirdName4()); + return udiRelevanceEntity; + } } + } } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessLocalTypeDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessLocalTypeDao.java new file mode 100644 index 0000000..663c204 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessLocalTypeDao.java @@ -0,0 +1,24 @@ +package com.glxp.sale.admin.dao.basic; + +import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity; +import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface BussinessLocalTypeDao { + + List filterList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest); + + List filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest); + + BussinessLocalTypeEntity findBTByAction(String action); + + BussinessLocalTypeEntity findBTByName(String name); + + boolean updateBusLocalType(BussinessLocalTypeEntity bussinessTypeEntity); + + boolean deleteById(@Param("id") String id); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/info/CompanyProductRelevanceDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/info/CompanyProductRelevanceDao.java index a7d8188..2b0bd43 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/dao/info/CompanyProductRelevanceDao.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/info/CompanyProductRelevanceDao.java @@ -21,7 +21,7 @@ public interface CompanyProductRelevanceDao { CompanyProductRelevanceEntity findCompanyProductRelevanceByProductId(String productId); - CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(@Param("udiRlIdFk") String udiRlIdFk); + CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(@Param("udiRlIdFk") String udiRlIdFk, @Param("customerId") String customerId); CompanyProductRelevanceEntity findCompanyProductRelevanceByProductUuid(CompanyProductRelevanceEntity companyProductRelevanceEntity); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/auth/UserRegisterEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/auth/UserRegisterEntity.java index 1c3b996..79918be 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/auth/UserRegisterEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/auth/UserRegisterEntity.java @@ -13,6 +13,7 @@ public class UserRegisterEntity { private String mobile; private String userId; private String email; + private String companyId; private String companyName; private String creditNum; private String area; 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 new file mode 100644 index 0000000..4287d1f --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessLocalTypeEntity.java @@ -0,0 +1,15 @@ +package com.glxp.sale.admin.entity.basic; + +import lombok.Data; + +@Data +public class BussinessLocalTypeEntity { + + private Integer id; + private String action; + private String name; + private String remark; + private Boolean enable; + + +} 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 fb9f76b..19956ea 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 @@ -10,5 +10,7 @@ public class BussinessTypeEntity { private Boolean enable; private String remark; private String mainAction; + private String thirdSysFk; + private String localAction; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/info/CompanyEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/info/CompanyEntity.java index e078116..fd312ff 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/info/CompanyEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/info/CompanyEntity.java @@ -45,6 +45,7 @@ public class CompanyEntity { private String kaihuzhanghao; private String auditStatus; + private String unitIdFk; private String filePath; private String newFilePath; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderEntity.java index 4bd4a22..9e5292a 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/StockOrderEntity.java @@ -17,5 +17,7 @@ public class StockOrderEntity { private String statusInfo; private String type; private String sourceType; - private String status2; + private String printStatus; + private String unitIdFk; + private String customerId; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/WarehouseEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/WarehouseEntity.java index 7e28d38..6f54341 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/WarehouseEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/inout/WarehouseEntity.java @@ -23,4 +23,5 @@ public class WarehouseEntity { private String warehouseCode; private String customerId; + private String nameCode; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrOrderEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrOrderEntity.java index 0c08250..5101571 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrOrderEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrOrderEntity.java @@ -17,5 +17,5 @@ public class ThrOrderEntity { private String thirdSysFk; private Date updateTime; private String originType; - + private String unitIdFk; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/auth/RegisterCheckRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/RegisterCheckRequest.java index f4ecc0a..192d832 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/auth/RegisterCheckRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/RegisterCheckRequest.java @@ -9,5 +9,6 @@ public class RegisterCheckRequest { private Integer checkType; private Long roles; private String aliCertId; + private String companyId; private String companyName; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/auth/UserResisterFilterRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/UserResisterFilterRequest.java index c598897..aa1aa72 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/auth/UserResisterFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/UserResisterFilterRequest.java @@ -6,6 +6,7 @@ import lombok.Data; @Data public class UserResisterFilterRequest extends ListPageRequest { - private String companyName; - private String checkType; + private String companyName; + private String checkType; + private String companyId; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessLocalTypeFilterRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessLocalTypeFilterRequest.java new file mode 100644 index 0000000..cdf44a5 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessLocalTypeFilterRequest.java @@ -0,0 +1,15 @@ +package com.glxp.sale.admin.req.basic; + +import com.glxp.sale.admin.req.ListPageRequest; +import lombok.Data; + +@Data +public class BussinessLocalTypeFilterRequest extends ListPageRequest { + + private String action; + private String name; + private String mainAction; + private Boolean enabled; + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/info/FilterCompanyRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/info/FilterCompanyRequest.java index 76020e5..d82fabd 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/info/FilterCompanyRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/info/FilterCompanyRequest.java @@ -12,6 +12,7 @@ public class FilterCompanyRequest extends ListPageRequest { private String companyName; private String creditNum; private String auditStatus; + private String unitIdFk; private List auditStatusList; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/FilterOrderRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/FilterOrderRequest.java index e98e0b7..c269812 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/FilterOrderRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/FilterOrderRequest.java @@ -15,4 +15,6 @@ public class FilterOrderRequest { private Integer limit; private Integer page; + private String customerId; + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/ImportErpOrderRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/ImportErpOrderRequest.java index f12bc37..66bea57 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/ImportErpOrderRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/ImportErpOrderRequest.java @@ -1,5 +1,6 @@ package com.glxp.sale.admin.req.inout; +import com.glxp.sale.admin.res.inout.ErpOrderResponse; import com.glxp.sale.admin.res.inout.PurchaseinResponse; import lombok.Data; @@ -9,7 +10,7 @@ import java.util.List; public class ImportErpOrderRequest { List docids; - List purchaseinResponses; + List purchaseinResponses; List ids; private String orderId; private boolean isFilter; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderFilterRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderFilterRequest.java index ebc77d0..ccdaec9 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderFilterRequest.java @@ -12,11 +12,16 @@ public class StockOrderFilterRequest extends ListPageRequest { private String corpId; private String corpName; private String billType; + private String billAction; private String billFlag; private String thirdSysFk; private String status; private String statusInfo; private String type; private String sourceType; - private String status2; + private String printStatus; + private String unitIdFk; + private String customerId; + private String startDate; //起始日期 + private String endDate; //结束日期 } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderPostRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderPostRequest.java index f901f47..b5c8860 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderPostRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/StockOrderPostRequest.java @@ -20,7 +20,8 @@ public class StockOrderPostRequest { private String statusInfo; private String type; private String sourceType; - private String status2; + private String printStatus; private List subErpOrders; + private String customerId; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseQueryRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseQueryRequest.java index 15d38ca..124c355 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseQueryRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseQueryRequest.java @@ -11,4 +11,5 @@ public class WarehouseQueryRequest extends ListPageRequest { private String udi; private String batchNo; private String orderId; + private String nameCode; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseSaveRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseSaveRequest.java index dd3e713..43d0725 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseSaveRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/WarehouseSaveRequest.java @@ -5,15 +5,25 @@ import lombok.Data; @Data public class WarehouseSaveRequest { + + private Long id; private String action; private String mainAction; private String code; private String corpOrderId; private String actor; private String actDate; - private long wrongCode; - private String upperCorpOrderId; private String fromCorpId; - private long id; private String fromCorp; + private String orderId; + private String batchNo; + private String produceDate; + private String expireDate; + private String serialNo; + private Integer count; + private String packageLevel; + private String warehouseCode; + + private String customerId; + private String nameCode; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/thrsys/FilterThrOrderRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/thrsys/FilterThrOrderRequest.java index f47b9fb..b44f094 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/thrsys/FilterThrOrderRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/thrsys/FilterThrOrderRequest.java @@ -17,6 +17,7 @@ public class FilterThrOrderRequest extends ListPageRequest { private String billFlag; //单据状态,0.未签字,1.已签字 private String billAction; private String corpName; + private String unitIdFk; private List erpOrderResponses; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java index 35c1390..c753393 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java @@ -15,5 +15,6 @@ public class BussinessTypResponse { private String thirdId; private String thirdName; private Boolean enabled; + private String localAction; } 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 fb1b600..40f953a 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 @@ -12,8 +12,26 @@ public class ErpOrderResponse { private String billType; private boolean signFlag; private String billFlag; + private String unitIdFk; + private String customerId; private List subErpOrders; + public String getUnitIdFk() { + return unitIdFk; + } + + public void setUnitIdFk(String unitIdFk) { + this.unitIdFk = unitIdFk; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + public Integer getId() { return id; } @@ -95,6 +113,9 @@ public class ErpOrderResponse { private String productDate; private int count; //账面数量 private int reCount; //实际数量 + private String sweepCount; + private String ylqxzcrbarmc; + private String zczbhhzbapzbh; public String getProductId() { return productId; @@ -159,6 +180,30 @@ public class ErpOrderResponse { public void setReCount(int reCount) { this.reCount = reCount; } + + public String getSweepCount() { + return sweepCount; + } + + public void setSweepCount(String sweepCount) { + this.sweepCount = sweepCount; + } + + public String getYlqxzcrbarmc() { + return ylqxzcrbarmc; + } + + public void setYlqxzcrbarmc(String ylqxzcrbarmc) { + this.ylqxzcrbarmc = ylqxzcrbarmc; + } + + public String getZczbhhzbapzbh() { + return zczbhhzbapzbh; + } + + public void setZczbhhzbapzbh(String zczbhhzbapzbh) { + this.zczbhhzbapzbh = zczbhhzbapzbh; + } } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessLocalTypeService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessLocalTypeService.java new file mode 100644 index 0000000..18bd886 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessLocalTypeService.java @@ -0,0 +1,23 @@ +package com.glxp.sale.admin.service.basic; + + +import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity; +import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest; + +import java.util.List; + +public interface BussinessLocalTypeService { + + + List filterList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest); + + List filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest); + + BussinessLocalTypeEntity findBTByAction(String action); + + BussinessLocalTypeEntity findBTByName(String name); + + boolean updateBusLocalType(BussinessLocalTypeEntity bussinessTypeEntity); + + boolean deleteById(String id); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BasicUnitMaintainServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BasicUnitMaintainServiceImpl.java index edd174e..7edd8e7 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BasicUnitMaintainServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BasicUnitMaintainServiceImpl.java @@ -68,7 +68,6 @@ public class BasicUnitMaintainServiceImpl implements BasicUnitMaintainService { } else if ("thirdId4".equals(thirdSys)) { filterUdiInfoRequest.setThirdId4(thirdId); } - return basicUnitMaintainDao.selectByThirdId(filterUdiInfoRequest); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessLocalTypeServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessLocalTypeServiceImpl.java new file mode 100644 index 0000000..7bbd249 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessLocalTypeServiceImpl.java @@ -0,0 +1,77 @@ +package com.glxp.sale.admin.service.basic.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.sale.admin.dao.basic.BussinessLocalTypeDao; +import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity; +import com.glxp.sale.admin.req.basic.BussinessLocalTypeFilterRequest; +import com.glxp.sale.admin.service.basic.BussinessLocalTypeService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Service +public class BussinessLocalTypeServiceImpl implements BussinessLocalTypeService { + + @Resource + BussinessLocalTypeDao bussinessLocalTypeDao; + + @Override + public List filterList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest) { + if (bussinessTypeFilterRequest == null) { + return Collections.emptyList(); + } + if (bussinessTypeFilterRequest.getPage() != null) { + int offset = (bussinessTypeFilterRequest.getPage() - 1) * bussinessTypeFilterRequest.getLimit(); + PageHelper.offsetPage(offset, bussinessTypeFilterRequest.getLimit()); + } + List data = bussinessLocalTypeDao.filterList(bussinessTypeFilterRequest); + return data; + } + + @Override + public List filterJoin(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest) { + if (bussinessTypeFilterRequest == null) { + return Collections.emptyList(); + } + if (bussinessTypeFilterRequest.getPage() != null) { + int offset = (bussinessTypeFilterRequest.getPage() - 1) * bussinessTypeFilterRequest.getLimit(); + PageHelper.offsetPage(offset, bussinessTypeFilterRequest.getLimit()); + } + List data = bussinessLocalTypeDao.filterJoin(bussinessTypeFilterRequest); + return data; + } + + @Override + public BussinessLocalTypeEntity findBTByAction(String action) { + BussinessLocalTypeFilterRequest bussinessTypeFilterRequest = new BussinessLocalTypeFilterRequest(); + bussinessTypeFilterRequest.setAction(action); + List data = bussinessLocalTypeDao.filterList(bussinessTypeFilterRequest); + if (data != null && data.size() > 0) { + return data.get(0); + } + return null; + } + + @Override + public BussinessLocalTypeEntity findBTByName(String name) { + BussinessLocalTypeFilterRequest bussinessTypeFilterRequest = new BussinessLocalTypeFilterRequest(); + bussinessTypeFilterRequest.setName(name); + List data = bussinessLocalTypeDao.filterList(bussinessTypeFilterRequest); + if (data != null && data.size() > 0) { + return data.get(0); + } + return null; + } + + @Override + public boolean updateBusLocalType(BussinessLocalTypeEntity bussinessTypeEntity) { + return bussinessLocalTypeDao.updateBusLocalType(bussinessTypeEntity); + } + + @Override + public boolean deleteById(String id) { + return bussinessLocalTypeDao.deleteById(id); + } +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/info/CompanyProductRelevanceService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/info/CompanyProductRelevanceService.java index 8d3b239..a54756a 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/info/CompanyProductRelevanceService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/info/CompanyProductRelevanceService.java @@ -19,7 +19,7 @@ public interface CompanyProductRelevanceService { CompanyProductRelevanceEntity findCompanyProductRelevanceByProductId(String productId); - CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk); + CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk,String customerId); CompanyProductRelevanceEntity findCompanyProductRelevanceByProductUuid(CompanyProductRelevanceEntity companyProductRelevanceEntity); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/info/impl/CompanyProductRelevanceServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/info/impl/CompanyProductRelevanceServiceImpl.java index 70c3605..02f4966 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/info/impl/CompanyProductRelevanceServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/info/impl/CompanyProductRelevanceServiceImpl.java @@ -67,8 +67,8 @@ public class CompanyProductRelevanceServiceImpl implements CompanyProductRelevan } @Override - public CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk) { - return companyProductRelevanceDao.findCompanyProductRelevanceByUdiRlIdFk(udiRlIdFk); + public CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk,String customerId) { + return companyProductRelevanceDao.findCompanyProductRelevanceByUdiRlIdFk(udiRlIdFk,customerId); } @Override 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 68b193c..208741b 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 @@ -1,26 +1,32 @@ package com.glxp.sale.admin.thread; +import com.glxp.sale.admin.config.WebSocketServer; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.controller.inout.utils.ContrastErpUtil; import com.glxp.sale.admin.controller.inout.utils.DataTransUtil; import com.glxp.sale.admin.controller.inout.utils.InoutUtils; -import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; +import com.glxp.sale.admin.entity.basic.BasicThirdSysDetailEntity; +import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.inout.ErpOrderEntity; import com.glxp.sale.admin.entity.inout.OrderEntity; import com.glxp.sale.admin.entity.inout.WarehouseEntity; +import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.httpclient.ErpOrderClient; import com.glxp.sale.admin.req.inout.CommitRequest; import com.glxp.sale.admin.req.inout.OrderFilterRequest; import com.glxp.sale.admin.req.inout.PostOrderRequest; import com.glxp.sale.admin.req.inout.WarehouseQueryRequest; -import com.glxp.sale.admin.req.param.SystemParamConfigRequest; +import com.glxp.sale.admin.service.basic.BussinessTypeService; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; -import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.service.inout.CodesService; import com.glxp.sale.admin.service.inout.CodesTempService; import com.glxp.sale.admin.service.inout.OrderDetailService; import com.glxp.sale.admin.service.inout.OrderService; +import com.glxp.sale.admin.service.param.SystemParamConfigService; +import com.glxp.sale.admin.service.thrsys.ThrDataService; +import com.glxp.sale.admin.service.thrsys.ThrOrderService; +import com.glxp.sale.admin.util.FilterUdiUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,11 +44,11 @@ public class IoTransInoutService { private static final Logger logger = LoggerFactory.getLogger(IoTransInoutService.class); @Resource - private CodesService codesService; + private CodesService warehouseService; @Resource private OrderService orderService; @Resource - private OrderDetailService orderDetailService; + private OrderDetailService myErpOrderService; @Resource UdiRelevanceService udiRelevanceService; @Resource @@ -50,12 +56,19 @@ public class IoTransInoutService { @Value("${UDI_SERVER_URL}") private String udiUrl; - @Resource private CodesTempService codesTempService; @Autowired private SystemParamConfigService systemParamConfigService; + @Resource + private BussinessTypeService bussinessTypeService; + @Resource + private ThrOrderService thrOrderService; + @Resource + ThrDataService thrDataService; + + //web端新增订单, @Async public void creatOrderWeb(PostOrderRequest postOrderRequest) { List postOrders = postOrderRequest.getPostOrder(); @@ -66,7 +79,7 @@ public class IoTransInoutService { if (warehouseEntityList != null && warehouseEntityList.size() > 0) { if (StringUtils.isNotBlank(postOrderRequest.getOldOrderId())) { orderService.deleteById(postOrderRequest.getOldOrderId()); - orderDetailService.deleteByOrderId(postOrderRequest.getOldOrderId()); + myErpOrderService.deleteByOrderId(postOrderRequest.getOldOrderId()); } WarehouseEntity warehouseEntity = warehouseEntityList.get(0); String orderId = System.currentTimeMillis() + i + ""; @@ -118,6 +131,14 @@ public class IoTransInoutService { PostOrderRequest.PostOrder postOrder = postOrders.get(i); List warehouseEntityList = postOrder.getCodes(); if (warehouseEntityList != null && warehouseEntityList.size() > 0) { + + //解析条码 + for (WarehouseEntity temp : warehouseEntityList) { + UdiEntity udiEntity = FilterUdiUtils.getUdi(temp.getCode()); + temp.setNameCode(udiEntity.getUdi()); + } + + WarehouseEntity warehouseEntity = warehouseEntityList.get(0); String orderId = System.currentTimeMillis() + i + ""; OrderEntity orderSaveRequest = new OrderEntity(); @@ -183,7 +204,7 @@ public class IoTransInoutService { for (int j = 0; j < filterList.size(); j++) { WarehouseEntity warehouseEntity = filterList.get(j); - String result = new InoutUtils().filterCode(codesService, warehouseEntity, systemParamConfigService); + String result = new InoutUtils().filterCode(warehouseService, warehouseEntity, systemParamConfigService); if (result == null) { insertList.add(warehouseEntity); } else { @@ -195,15 +216,15 @@ public class IoTransInoutService { } if (insertList.size() > 0) { - codesService.insertWarehouses(insertList); + warehouseService.insertWarehouses(insertList); WarehouseQueryRequest tempQuery = new WarehouseQueryRequest(); tempQuery.setOrderId(orderEntity.getId()); List temps = codesTempService.findByOrderId(tempQuery); - if (orderEntity.getErpFk() != null) { + if (orderEntity.getErpFk() != null && !"".equals(orderEntity.getErpFk())) { orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_CHECK); } else { - //因为只需用到条码,所以不需要重新读取 TODO - new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, orderDetailService, insertList); + //因为只需用到条码,所以不需要重新读取 + new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, insertList); orderService.updateOrderStatus(orderEntity.getId(), ConstantStatus.ORDER_STATUS_SUCCESS); } @@ -232,49 +253,47 @@ public class IoTransInoutService { public void checkOrder(OrderEntity orderEntity) { orderEntity = orderService.findById(orderEntity.getId()); List erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk()); - List transData = codesService.findByReceiptId(orderEntity.getId()); + List transData = warehouseService.findByReceiptId(orderEntity.getId()); if (erpIds != null && erpIds.size() > 0) { - SystemParamConfigRequest systemParamConfigRequest = new SystemParamConfigRequest(); - systemParamConfigRequest.setParamKey("erp_order_query"); - SystemParamConfigEntity systemParamConfigEntityBUMErpQuery = systemParamConfigService.selectByParamKey(systemParamConfigRequest); - if (systemParamConfigEntityBUMErpQuery == null) { - orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL); - orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); - orderEntity.setRemark("获取ERP出入库单据接口地址未定义"); - orderService.updateOrder(orderEntity); - } else { - String erpOrderUrl = systemParamConfigEntityBUMErpQuery.getParamValue(); - List cloudErps = new ErpOrderClient(erpOrderUrl).getErpOrder(erpIds,orderEntity.getAction()); - 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; - } - } - orderDetailService.deleteByOrderId(orderEntity.getId()); - orderDetailService.insertErpOrders(returnOrders); - new ContrastErpUtil(udiUrl).contrastErp(udiInfoService, udiRelevanceService, orderDetailService, orderService, transData, systemParamConfigService); - } else { + + List erpOrderEntities = thrDataService.getStockOrders(erpIds); + checkThirdOrder(erpOrderEntities, orderEntity, transData); + + } else { + orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL); + orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); + orderEntity.setRemark("未选入第三方出入库单据进行校验,请手动选择"); + orderService.updateOrder(orderEntity); + myErpOrderService.deleteByOrderId(orderEntity.getId()); + new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, transData); + } + } + + 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出入库单据失败"); + orderEntity.setRemark("选择Erp订单往来单位不一致"); orderService.updateOrder(orderEntity); - orderDetailService.deleteByOrderId(orderEntity.getId()); - new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, orderDetailService, transData); + 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单据进行校验,请手动选择"); + orderEntity.setRemark("获取ERP出入库单据失败"); orderService.updateOrder(orderEntity); + myErpOrderService.deleteByOrderId(orderEntity.getId()); + new InoutUtils(udiUrl).generateConstrastDetail(udiInfoService, udiRelevanceService, myErpOrderService, transData); } } @@ -284,6 +303,7 @@ public class IoTransInoutService { OrderEntity orderEntity = orderService.findById(commitRequest.getOrderId()); if (orderEntity != null) { transInout(orderEntity); + WebSocketServer.sendInfo("重码校验已完成,请刷新查看!", null); } } @@ -292,6 +312,7 @@ public class IoTransInoutService { public void repeatCheck(String orderId) { OrderEntity orderEntity = orderService.findById(orderId); checkOrder(orderEntity); + WebSocketServer.sendInfo("单据:" + orderId + "校验已完成,请刷新查看!", null); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/ThrOrderImportService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/ThrOrderImportService.java index 04c5de5..8199d2d 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/ThrOrderImportService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/ThrOrderImportService.java @@ -1,12 +1,14 @@ package com.glxp.sale.admin.thread; import com.glxp.sale.admin.constant.BasicProcessStatus; +import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity; import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity; import com.glxp.sale.admin.entity.thrsys.ThrOrderEntity; import com.glxp.sale.admin.entity.thrsys.ThrOrderImportDetailEntity; import com.glxp.sale.admin.entity.thrsys.ThrOrderImportLogEntity; import com.glxp.sale.admin.req.basic.FilterUdiIpLogRequest; +import com.glxp.sale.admin.service.basic.BasicUnitMaintainService; import com.glxp.sale.admin.service.basic.BussinessTypeService; import com.glxp.sale.admin.service.thrsys.ThrOrderDetailService; import com.glxp.sale.admin.service.thrsys.ThrOrderImportDetailService; @@ -35,6 +37,8 @@ public class ThrOrderImportService { ThrOrderDetailService thrOrderDetailService; @Resource BussinessTypeService bussinessTypeService; + @Resource + BasicUnitMaintainService basicUnitMaintainService; @Async public void importThrOrder(String genKey) { @@ -49,10 +53,16 @@ public class ThrOrderImportService { ThrOrderImportDetailEntity thrOrderImportDetailEntity = datas.get(0); ThrOrderEntity thrOrderEntity = new ThrOrderEntity(); BeanUtils.copyProperties(thrOrderImportDetailEntity, thrOrderEntity); + //转换往来单位ID thrOrderEntity.setUpdateTime(new Date()); - BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByName(thrOrderEntity.getBillType()); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(thrOrderEntity.getBillType()); if (bussinessTypeEntity != null) { thrOrderEntity.setBillType(bussinessTypeEntity.getAction()); + thrOrderEntity.setThirdSysFk(bussinessTypeEntity.getThirdSysFk()); + BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByThirdId(thrOrderImportDetailEntity.getCorpId(), thrOrderImportDetailEntity.getThirdSysFk()); + if(basicUnitMaintainEntity!=null){ + thrOrderEntity.setUnitIdFk(basicUnitMaintainEntity.getErpId()); + } } thrOrderService.insertThrOrder(thrOrderEntity); thrOrderEntity = thrOrderService.findByUnique(thrOrderEntity.getBillNo(), thrOrderEntity.getThirdSysFk()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/util/StockOrderBillNoUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/util/StockOrderBillNoUtils.java index 1d32aab..93990ae 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/util/StockOrderBillNoUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/util/StockOrderBillNoUtils.java @@ -14,7 +14,7 @@ public class StockOrderBillNoUtils { prefix = "SHD"; break; default: - prefix = "NULL"; + prefix = "SP"; break; } diff --git a/api-admin/src/main/resources/application-pro.properties b/api-admin/src/main/resources/application-pro.properties index ed1b6fb..b77a8b0 100644 --- a/api-admin/src/main/resources/application-pro.properties +++ b/api-admin/src/main/resources/application-pro.properties @@ -2,8 +2,7 @@ server.port=9996 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -#spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3307/srmms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true -spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/srmms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true +spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true spring.datasource.username=root spring.datasource.password=123456 server.servlet.context-path= diff --git a/api-admin/src/main/resources/mybatis/configuration.xml b/api-admin/src/main/resources/mybatis/configuration.xml index fae2a1e..cc95ac8 100644 --- a/api-admin/src/main/resources/mybatis/configuration.xml +++ b/api-admin/src/main/resources/mybatis/configuration.xml @@ -8,7 +8,7 @@ 如果不知道maven本地仓库地址,可以使用EveryThing工具全局搜索mysql-connector-java,找到jar包位置; 也可以手动下载一个jar放在指定位置,进行引用。 --> - + @@ -18,9 +18,9 @@ + password="123456"> diff --git a/api-admin/src/main/resources/mybatis/mapper/auth/UserRegisterDao.xml b/api-admin/src/main/resources/mybatis/mapper/auth/UserRegisterDao.xml index 9cd9c99..e1dc71d 100644 --- a/api-admin/src/main/resources/mybatis/mapper/auth/UserRegisterDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/auth/UserRegisterDao.xml @@ -28,7 +28,7 @@ tel, mobile, userId, email, companyName, creditNum, area, detailAddr, bussinessStatus, - checkType, registerTime, checkTime,comments,areaCode,userName,licenseUrl + checkType, registerTime, checkTime,comments,areaCode,userName,licenseUrl,companyId ) values ( @@ -37,13 +37,13 @@ #{email},#{companyName},#{creditNum}, #{area},#{detailAddr},#{bussinessStatus}, #{checkType},#{registerTime},#{checkTime}, - #{comments},#{areaCode},#{userName},#{licenseUrl} + #{comments},#{areaCode},#{userName},#{licenseUrl},#{companyId} ) UPDATE user_register - + `nickName`=#{nickName}, password=#{password}, `realName`=#{realName}, @@ -62,8 +62,8 @@ areaCode=#{areaCode}, userName=#{userName}, licenseUrl=#{licenseUrl}, - - + companyId=#{companyId}, + WHERE id=#{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml new file mode 100644 index 0000000..29701d7 --- /dev/null +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + INSERT INTO basic_bustype_local + (action,name,enable,remark) + values + ( + #{action}, + #{name}, + #{enable}, + #{remark}, + ) + + + + UPDATE basic_bustype_local + + action = #{action}, + name = #{name}, + enable = #{enable}, + remark = #{remark}, + + WHERE id = #{id} + + + + DELETE FROM basic_bustype_local WHERE id = #{id} + + + + + 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 84cb4c1..295dd24 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml @@ -17,7 +17,28 @@ AND action LIKE concat(#{mainAction},'%') - AND enabled =#{enabled} + AND enable =#{enabled} + + + + + + AND company_product_relevance.auditStatus = #{auditStatus} + + AND company_product_relevance.id = #{id} + ORDER BY updateTime DESC @@ -121,7 +124,7 @@ diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml index 175a228..2186d13 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml @@ -24,13 +24,22 @@ and batchNo =#{batchNo} + + and nameCode =#{nameCode} + + ORDER BY actDate - INSERT INTO io_codes(action,mainAction,code,corpOrderId,actor,actDate,upperCorpOrderId,fromCorpId,fromCorp) + INSERT INTO + io_codes( + action,mainAction,code,corpOrderId,actor,actDate, + fromCorpId,fromCorp,orderId,batchNo,produceDate,expireDate, + serialNo,count,packageLevel,warehouseCode,nameCode + ) values( #{action}, #{mainAction}, @@ -39,7 +48,8 @@ #{actor}, #{actDate}, #{fromCorpId}, - #{fromCorp},#{orderId}) + #{fromCorp},#{orderId},#{batchNo},#{produceDate},#{expireDate},#{serialNo},#{count},#{packageLevel},#{warehouseCode}, + #{nameCode}) @@ -51,7 +61,7 @@ actor, actDate, fromCorpId,fromCorp,orderId,batchNo,produceDate,expireDate, - serialNo,count,packageLevel,warehouseCode) + serialNo,count,packageLevel,warehouseCode,nameCode) VALUES @@ -70,7 +80,7 @@ ,#{item.expireDate} ,#{item.serialNo} ,#{item.count} - ,#{item.packageLevel} ,#{item.warehouseCode}) + ,#{item.packageLevel} ,#{item.warehouseCode},#{item.nameCode}) diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml index dcb3300..f543379 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml @@ -187,9 +187,12 @@ and `action` ]]> 'StockCheck' - + and status = #{status} + + and ( status = 1 or status=-1) + and exportStatus = #{exportStatus} @@ -208,10 +211,13 @@ - + + and customerId =#{customerId} + ORDER BY actDate DESC + diff --git a/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml index 0cd6404..6d6f1f9 100644 --- a/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml @@ -19,6 +19,9 @@ AND billFlag = #{billFlag} + + AND unitIdFk = #{unitIdFk} + AND thirdSysFk = #{thirdSysFk} @@ -39,7 +42,7 @@ replace INTO thr_order ( - billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk, updateTime,originType + billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk, updateTime,originType,unitIdFk ) values ( @@ -49,14 +52,14 @@ #{corpName}, #{billType}, #{billFlag}, - #{thirdSysFk},#{updateTime},#{originType} + #{thirdSysFk},#{updateTime},#{originType},#{unitIdFk} ) replace INTO thr_order ( - billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk,updateTime,originType + billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk,updateTime,originType,unitIdFk ) values @@ -69,7 +72,7 @@ #{item.corpName}, #{item.billType}, #{item.billFlag}, - #{item.thirdSysFk},#{item.updateTime},#{item.originType} + #{item.thirdSysFk},#{item.updateTime},#{item.originType},#{item.unitIdFk} ) @@ -94,6 +97,8 @@ thirdSysFk=#{thirdSysFk}, updateTime=#{updateTime}, originType=#{originType}, + unitIdFk=#{unitIdFk}, + WHERE id = #{id}