From 0b38bfd61625b84d6904332a4edccaae837b621c Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Sun, 24 Apr 2022 14:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E7=BB=A7=E6=9C=8D=E5=8A=A1=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=EF=BC=8C=E6=B3=A8=E5=86=8C=E7=A0=81=EF=BC=8C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=A4=87=E4=BB=BD=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/constant/BasicProcessStatus.java | 1 + .../controller/auth/AuthCheckController.java | 69 +++++ .../controller/auth/LoginController.java | 76 ++++- .../basic/BasicThirdSysController.java | 24 ++ .../basic/BasicUnitMaintainController.java | 29 +- .../basic/BussinessTypeController.java | 29 ++ .../basic/SpsSyncDownloadController.java | 31 +- .../basic/SpsSyncUploadController.java | 10 + .../basic/UdiCompanyController.java | 11 + .../basic/UdiRelevanceController.java | 46 ++- .../controller/inout/OrderController.java | 3 + .../inout/StockOrderDetailController.java | 2 +- .../controller/inout/WareHouseController.java | 19 +- .../inventory/InvProductsController.java | 22 +- .../sale/admin/dao/auth/AuthCheckDao.java | 21 ++ .../sale/admin/dao/auth/AuthLicenseDao.java | 2 + .../sale/admin/dao/basic/UdiCompanyDao.java | 1 + .../admin/entity/auth/AuthCheckEntity.java | 14 + .../sale/admin/req/auth/AuthCheckRequest.java | 13 + .../sale/admin/req/auth/PCLoginRequest.java | 19 ++ .../BussinessOriginTypeFilterRequest.java | 1 + .../sale/admin/req/basic/CombineRequest.java | 1 + .../admin/req/basic/UdiCompanyRequest.java | 2 +- .../admin/res/basic/SpSyncUdiResponse.java | 14 + .../admin/res/basic/UdiRelevanceResponse.java | 2 +- .../admin/service/auth/AuthAdminService.java | 1 - .../admin/service/auth/AuthCheckService.java | 18 ++ .../admin/service/auth/CustomerService.java | 17 +- .../auth/impl/AuthCheckServiceImpl.java | 45 +++ .../service/basic/UdiCompanyService.java | 2 + .../basic/impl/UdiCompanyServiceImpl.java | 7 + .../service/inout/WarehouseUserService.java | 2 + .../inout/impl/WarehouseUserServiceImpl.java | 9 + .../sale/admin/thread/AsyncHeartTask.java | 48 +-- .../thread/BasicBackUpdateProductService.java | 71 ++++- .../admin/thread/InvProductsTrService.java | 293 ++++++++---------- .../admin/thread/IoTransInoutService.java | 20 +- .../com/glxp/sale/admin/util/RsaUtils.java | 8 + .../main/resources/application-pro.properties | 6 +- .../mybatis/mapper/auth/AuthCheckDao.xml | 55 ++++ .../mybatis/mapper/auth/AuthLicenseDao.xml | 13 +- .../mapper/basic/BussinessLocalTypeDao.xml | 4 +- .../mapper/basic/BussinessOriginTypeDao.xml | 4 + .../mybatis/mapper/basic/ProductInfoDao.xml | 16 +- .../mybatis/mapper/basic/UdiCompanyDao.xml | 12 + .../mybatis/mapper/inout/OrderDao.xml | 13 +- 46 files changed, 846 insertions(+), 280 deletions(-) create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/controller/auth/AuthCheckController.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/dao/auth/AuthCheckDao.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/entity/auth/AuthCheckEntity.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/req/auth/AuthCheckRequest.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/req/auth/PCLoginRequest.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/res/basic/SpSyncUdiResponse.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/auth/AuthCheckService.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/auth/impl/AuthCheckServiceImpl.java create mode 100644 api-admin/src/main/resources/mybatis/mapper/auth/AuthCheckDao.xml diff --git a/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicProcessStatus.java b/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicProcessStatus.java index 6a0969f..d77afd3 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicProcessStatus.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicProcessStatus.java @@ -28,6 +28,7 @@ public class BasicProcessStatus { public static final int NEW_ALL_DATA = 7; public static final int NEW_ALL_BUS = 8; public static final int NEW_ALL_ORDER = 9; + public static final int NEW_ALL_DI = 10; public static final int SCHEDULE_NORMAL = 1; //常规任务 diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/AuthCheckController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/AuthCheckController.java new file mode 100644 index 0000000..c1b646c --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/AuthCheckController.java @@ -0,0 +1,69 @@ +package com.glxp.sale.admin.controller.auth; + +import com.github.pagehelper.PageInfo; +import com.glxp.sale.admin.entity.auth.AuthCheckEntity; +import com.glxp.sale.admin.req.auth.AuthCheckRequest; +import com.glxp.sale.admin.res.PageSimpleResponse; +import com.glxp.sale.admin.service.auth.AuthCheckService; +import com.glxp.sale.admin.util.RsaUtils; +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 javax.validation.Valid; +import java.util.List; + +@RestController +public class AuthCheckController { + + @Resource + private AuthCheckService authCheckService; + + @GetMapping("/udiwms/auth/device/filter") + public BaseResponse index(AuthCheckRequest authCheckRequest, + BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List authCheckEntityList = authCheckService.filterDevices(authCheckRequest); + + PageInfo authCheckEntityPageInfo = new PageInfo<>(authCheckEntityList); + PageSimpleResponse authAdminResponseList = new PageSimpleResponse<>(); + authAdminResponseList.setTotal(authCheckEntityPageInfo.getTotal()); + authAdminResponseList.setList(authCheckEntityList); + + return ResultVOUtils.success(authAdminResponseList); + + } + + @PostMapping("/udiwms/auth/device/save") + public BaseResponse save(@RequestBody @Valid AuthCheckEntity authCheckEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + String key = null; + try { + key = RsaUtils.publicKeyDecrypt(authCheckEntity.getRegisterCode(), RsaUtils.publicKey); + if (key != null && key.equals(authCheckEntity.getMachineInfo())) { + authCheckService.updateDevices(authCheckEntity); + return ResultVOUtils.success("注册成功!"); + } else { + return ResultVOUtils.error(500, "注册失败,注册码不匹配!"); + } + } catch (Exception e) { + e.printStackTrace(); + } + return ResultVOUtils.error(500, "注册失败!"); + + } + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/LoginController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/LoginController.java index cb1683a..835b134 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/LoginController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/LoginController.java @@ -11,6 +11,7 @@ import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.info.DeviceKeyEntity; import com.glxp.sale.admin.exception.JsonException; import com.glxp.sale.admin.req.auth.LoginRequest; +import com.glxp.sale.admin.req.auth.PCLoginRequest; import com.glxp.sale.admin.req.auth.UpdatePasswordRequest; import com.glxp.sale.admin.res.auth.LoginUserInfoResponse; import com.glxp.sale.admin.service.auth.AuthAdminService; @@ -18,10 +19,7 @@ import com.glxp.sale.admin.service.auth.AuthLoginService; import com.glxp.sale.admin.service.auth.CustomerInfoService; import com.glxp.sale.admin.service.auth.DeviceKeyService; import com.glxp.sale.admin.service.info.CompanyService; -import com.glxp.sale.admin.util.AppUtils; -import com.glxp.sale.admin.util.IpUtils; -import com.glxp.sale.admin.util.JwtUtils; -import com.glxp.sale.admin.util.PasswordUtils; +import com.glxp.sale.admin.util.*; import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; @@ -132,7 +130,6 @@ public class LoginController { // 登录成功后获取权限,这里面会设置到缓存 authLoginService.listRuleByAdminId(authAdmin.getId()); - Map claims = new HashMap<>(); claims.put("admin_id", authAdmin.getId()); String token = JwtUtils.createToken(claims, 86400L); // 一天后过期86400L @@ -144,6 +141,75 @@ public class LoginController { return ResultVOUtils.success(map); } + + /** + * 用户登录 + * + * @return + */ + @PostMapping(value = "/pc/login") + public BaseResponse pcLogin(@RequestBody @Valid PCLoginRequest loginRequest, + BindingResult bindingResult, + HttpServletRequest request) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + + AuthAdmin authAdmin; + authAdmin = authAdminService.findByUserName(loginRequest.getUsername()); + if (authAdmin == null) { + throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误"); + } + if (authAdmin.getCustomerId() != 110) { + if (authAdmin.getUserFlag() == 0) { + throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!"); + } + if (authAdmin.getUserFlag() == 2) { + throw new JsonException(ResultEnum.DATA_NOT, "该用户未验证!"); + } + CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(authAdmin.getCustomerId()); + if (customerInfoEntity.getUserFlag() == 0) { + throw new JsonException(ResultEnum.DATA_NOT, "该企业账户已被禁用!"); + } + } else { + if (authAdmin.getUserFlag() == 0) { + throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!"); + } + if (authAdmin.getUserFlag() == 2) { + throw new JsonException(ResultEnum.DATA_NOT, "该用户未验证!"); + } + } + if (authAdmin == null) { + throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误"); + } + + if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(authAdmin.getPassWord())) { + throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误"); + } + + // 更新登录状态 + AuthAdmin authAdminUp = new AuthAdmin(); + authAdminUp.setId(authAdmin.getId()); + authAdminUp.setLastLoginTime(new Date()); + authAdminUp.setLastLoginIp(IpUtils.getIpAddr(request)); + authAdminService.updateAuthAdmin(authAdminUp); + + // 登录成功后获取权限,这里面会设置到缓存 + authLoginService.listRuleByAdminId(authAdmin.getId()); + + Map claims = new HashMap<>(); + claims.put("admin_id", authAdmin.getId()); + String token = JwtUtils.createToken(claims, 86400L); // 一天后过期 + + Map map = new HashMap<>(); + map.put("id", authAdmin.getId()); + map.put("token", token); + map.put("time", DateUtil.getDateTime()); + + return ResultVOUtils.success(map); + } + + /** * 获取登录用户信息 * diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicThirdSysController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicThirdSysController.java index fbec264..9058010 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicThirdSysController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicThirdSysController.java @@ -7,6 +7,7 @@ import com.glxp.sale.admin.entity.basic.BasicThirdSysEntity; import com.glxp.sale.admin.req.basic.FilterBasicThirdSysDetailRequest; import com.glxp.sale.admin.req.basic.FilterBasicThirdSysRequest; import com.glxp.sale.admin.res.PageSimpleResponse; +import com.glxp.sale.admin.res.basic.BasicThirdSysResponse; import com.glxp.sale.admin.service.basic.BasicThirdSysDetailService; import com.glxp.sale.admin.service.basic.BasicThirdSysService; import com.glxp.sale.admin.service.basic.BasicUnitMaintainService; @@ -15,6 +16,7 @@ import com.glxp.sale.admin.service.param.SystemParamConfigService; 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; @@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.validation.Valid; import java.util.List; +import java.util.stream.Collectors; @RestController public class BasicThirdSysController { @@ -171,4 +174,25 @@ public class BasicThirdSysController { } return ResultVOUtils.success("更新成功"); } + + @AuthRuleAnnotation("") + @GetMapping("/udiwms/basic/thirdsys/get") + public BaseResponse get(FilterBasicThirdSysRequest filterBasicThirdSysRequest, + BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List basicThirdSysEntities; + basicThirdSysEntities = basicThirdSysService.filterBasicThiSys(filterBasicThirdSysRequest); + List basicThirdSysResponses = basicThirdSysEntities.stream().map(item -> + { + BasicThirdSysResponse basicThirdSysResponse = new BasicThirdSysResponse(); + BeanUtils.copyProperties(item, basicThirdSysResponse); + return basicThirdSysResponse; + }).collect(Collectors.toList()); + basicThirdSysResponses.add(new BasicThirdSysResponse("ybbm", "医保编码")); + basicThirdSysResponses.add(new BasicThirdSysResponse("sptm", "商品条码")); + basicThirdSysResponses.add(new BasicThirdSysResponse("udiCode", "UDI最小销售标识")); + return ResultVOUtils.success(basicThirdSysResponses); + } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java index 3d053eb..0d6a2c5 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java @@ -143,7 +143,7 @@ public class BasicUnitMaintainController { return ResultVOUtils.success("修改成功"); } - @AuthRuleAnnotation("") +// @AuthRuleAnnotation("") @GetMapping("/udiwms/unit/download") public BaseResponse downloadBasicUnit(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest, BindingResult bindingResult) { @@ -170,6 +170,33 @@ public class BasicUnitMaintainController { return ResultVOUtils.success(pageSimpleResponse); } + @AuthRuleAnnotation("") + @GetMapping("/udiwms/basic/unit/download") + public BaseResponse scdownloadBasicUnit(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + basicUnitMaintainFilterRequest.setOutType(ConstantStatus.CORP_SICK_SICK); + List basicUnitMaintainEntities; + basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest); + + List basicUnitMaintainResponses = basicUnitMaintainEntities.stream().map(item -> + { + BasicUnitMaintainResponse basicUnitMaintainResponse = new BasicUnitMaintainResponse(); + BeanUtils.copyProperties(item, basicUnitMaintainResponse); + basicUnitMaintainResponse.setUnitId(item.getErpId()); + return basicUnitMaintainResponse; + }).collect(Collectors.toList()); + PageInfo pageInfo; + pageInfo = new PageInfo<>(basicUnitMaintainResponses); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(basicUnitMaintainResponses); + return ResultVOUtils.success(pageSimpleResponse); + } + @AuthRuleAnnotation("") @PostMapping("/udiwms/basic/unit/maintain/combine") public BaseResponse combine(@RequestBody CombineUnitRequest combineRequest, BindingResult bindingResult) { 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 9feeb6e..0ab6065 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 @@ -27,6 +27,7 @@ import com.glxp.sale.admin.util.FileUtils; 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.*; import org.springframework.web.context.request.RequestContextHolder; @@ -38,6 +39,7 @@ import javax.servlet.http.HttpServletRequest; import java.io.InputStream; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; /** * 业务类型维护 @@ -115,6 +117,33 @@ public class BussinessTypeController { return ResultVOUtils.success(pageSimpleResponse); } + + @GetMapping("/udiwms/bussinessType/download") + public BaseResponse downloadJoinBussinessType(BussinessTypeFilterRequest bussinessTypeFilterRequest, + BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + String customerId = getCustomerId(); + if (!customerId.equals(Constant.SYSTEM_CUSTOMER_ID)) { + bussinessTypeFilterRequest.setSpUse(true); + } else { + bussinessTypeFilterRequest.setUserId(customerService.getUserId()); + } + List bussinessTypeEntities; + bussinessTypeEntities = bussinessTypeService.filterAllByUser(bussinessTypeFilterRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(bussinessTypeEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(bussinessTypeEntities); + return ResultVOUtils.success(pageSimpleResponse); + + } + + + + @AuthRuleAnnotation("") @GetMapping("/udiwms/bussinessType/filterAllByUser") public BaseResponse filterAllByUser(BussinessTypeFilterRequest bussinessTypeFilterRequest, diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java index 5bb7d63..759fc09 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java @@ -10,6 +10,7 @@ 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.inventory.InvWarehouseEntity; +import com.glxp.sale.admin.entity.receipt.ProductInfoEntity; import com.glxp.sale.admin.entity.thrsys.*; import com.glxp.sale.admin.req.basic.*; import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest; @@ -17,6 +18,7 @@ import com.glxp.sale.admin.req.inout.OrderFilterRequest; import com.glxp.sale.admin.req.inventory.FilterInvWarehouseRequest; import com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest; import com.glxp.sale.admin.req.thrsys.*; +import com.glxp.sale.admin.res.basic.SpSyncUdiResponse; import com.glxp.sale.admin.res.basic.SpsSyncBusResponse; import com.glxp.sale.admin.res.basic.SpsSyncDataResponse; import com.glxp.sale.admin.res.basic.SpsSyncOrderResponse; @@ -28,6 +30,7 @@ import com.glxp.sale.admin.service.inout.CodesService; import com.glxp.sale.admin.service.inout.OrderDetailService; import com.glxp.sale.admin.service.inout.OrderService; import com.glxp.sale.admin.service.inventory.InvWarehouseService; +import com.glxp.sale.admin.service.receipt.ProductInfoService; import com.glxp.sale.admin.service.thrsys.*; import com.glxp.sale.admin.util.BeanUtils; import com.glxp.sale.common.res.BaseResponse; @@ -155,13 +158,13 @@ public class SpsSyncDownloadController { @GetMapping("sps/sync/busType") public BaseResponse findBusType(SpsSyncDataRequest spsSyncDataRequest) { BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); - BeanUtils.copyProperties(spsSyncDataRequest,bussinessTypeFilterRequest); + BeanUtils.copyProperties(spsSyncDataRequest, bussinessTypeFilterRequest); List bussinessTypeEntities = bussinessTypeService.filterAllList(bussinessTypeFilterRequest); BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest(); - BeanUtils.copyProperties(spsSyncDataRequest,bussinessLocalTypeFilterRequest); + BeanUtils.copyProperties(spsSyncDataRequest, bussinessLocalTypeFilterRequest); List bussinessLocalTypeEntities = bussinessLocalTypeService.filterAllList(bussinessLocalTypeFilterRequest); BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); - BeanUtils.copyProperties(spsSyncDataRequest,bussinessOriginTypeFilterRequest); + BeanUtils.copyProperties(spsSyncDataRequest, bussinessOriginTypeFilterRequest); List bussinessOriginTypeEntities = bussinessOriginTypeService.filterList(bussinessOriginTypeFilterRequest); SpsSyncBusResponse spsSyncBusResponse = new SpsSyncBusResponse(); spsSyncBusResponse.setBussinessTypeEntities(bussinessTypeEntities); @@ -208,5 +211,27 @@ public class SpsSyncDownloadController { syncOrderResponse.setWarehouseEntityList(warehouseEntityList); return ResultVOUtils.success(syncOrderResponse); } + + + @Resource + ProductInfoService productInfoService; + @Resource + UdiCompanyService udiCompanyService; + + //udi同步数据 + @GetMapping("sps/sync/syncUdis") + public BaseResponse syncUdi(SpsSyncDataRequest spsSyncDataRequest) { + ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); + productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + List productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest); + UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest(); + udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + List udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest); + SpSyncUdiResponse spSyncUdiResponse = new SpSyncUdiResponse(); + spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities); + spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList); + return ResultVOUtils.success(spSyncUdiResponse); + + } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java index 41ea7bd..781a4cc 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.glxp.sale.admin.constant.BasicProcessStatus; +import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.dao.basic.*; import com.glxp.sale.admin.dao.info.CompanyProductRelevanceDao; import com.glxp.sale.admin.dao.inout.CodesDao; @@ -32,6 +33,7 @@ import com.glxp.sale.admin.service.info.CompanyProductRelevanceService; import com.glxp.sale.admin.service.inout.OrderService; import com.glxp.sale.admin.service.inventory.InvWarehouseService; import com.glxp.sale.admin.service.thrsys.*; +import com.glxp.sale.admin.thread.BasicBackUpdateProductService; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; import org.apache.ibatis.session.ExecutorType; @@ -56,6 +58,8 @@ public class SpsSyncUploadController { InvWarehouseService invWarehouseService; @Resource OrderService orderService; + @Resource + BasicBackUpdateProductService backUpdateProductService; @PostMapping("sps/sync/basic/upload") public BaseResponse findProductInfo(@RequestBody SpsSyncDataResponse syncDataResponse) { @@ -87,6 +91,12 @@ public class SpsSyncUploadController { public BaseResponse dealSchedule(@RequestBody BasicExportStatusEntity basicExportStatusEntity) { //todo //处理下游上传过来的任务 + if (basicExportStatusEntity.getScheduleType() == BasicProcessStatus.SCHEDULE_TRANSFER) { + if (basicExportStatusEntity.getId().equals("AsyncUpdateAllData")) { + backUpdateProductService.syncUpdatetTime(); + } + } + return ResultVOUtils.success("上传成功!"); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiCompanyController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiCompanyController.java index 44cd13a..422d745 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiCompanyController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiCompanyController.java @@ -1,6 +1,7 @@ package com.glxp.sale.admin.controller.basic; import com.github.pagehelper.PageInfo; +import com.glxp.sale.admin.annotation.AuthRuleAnnotation; import com.glxp.sale.admin.entity.basic.UdiCompanyEntity; import com.glxp.sale.admin.entity.receipt.ProductInfoEntity; import com.glxp.sale.admin.req.basic.UdiCompanyRequest; @@ -29,6 +30,16 @@ public class UdiCompanyController { @Resource ProductInfoService productInfoService; + //出入库同步下载 + @GetMapping("udidl/udiwms/syncCompany") + public BaseResponse syncCompany(UdiCompanyRequest udiCompanyRequest) { + + List udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest); + return ResultVOUtils.success(udiCompanyEntities); + + } + + @GetMapping("udi/company/filter") public BaseResponse filterCompany(@Valid UdiCompanyRequest udiCompanyRequest, BindingResult bindingResult) { 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 86045d1..40849ee 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 @@ -11,6 +11,7 @@ import com.glxp.sale.admin.entity.basic.BasicThirdSysEntity; import com.glxp.sale.admin.entity.basic.FilterSysEntity; import com.glxp.sale.admin.entity.basic.UdiInfoEntity; import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity; +import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity; import com.glxp.sale.admin.entity.inout.WarehouseEntity; import com.glxp.sale.admin.entity.inventory.InvProductEntity; @@ -28,6 +29,7 @@ import com.glxp.sale.admin.service.basic.BasicThirdSysService; 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.info.CompanyService; import com.glxp.sale.admin.service.inout.CodesService; import com.glxp.sale.admin.service.inventory.InvPreProductService; import com.glxp.sale.admin.service.inventory.InvProductService; @@ -50,6 +52,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -80,7 +83,8 @@ public class UdiRelevanceController { InvProductService invProductService; @Resource InvPreProductService invPreProductService; - + @Resource + CompanyService companyService; @Resource private CompanyProductRelevanceService companyProductRelevanceService; @Resource @@ -118,7 +122,7 @@ public class UdiRelevanceController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } List udiRelevanceResponses = null; - udiRelevanceResponses = udiRelevanceService.selectAllByNameCode(filterUdiInfoRequest.getNameCode(),filterUdiInfoRequest.getUnitFk()); + udiRelevanceResponses = udiRelevanceService.selectAllByNameCode(filterUdiInfoRequest.getNameCode(), filterUdiInfoRequest.getUnitFk()); PageInfo pageInfo; pageInfo = new PageInfo<>(udiRelevanceResponses); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); @@ -293,7 +297,7 @@ public class UdiRelevanceController { @AuthRuleAnnotation("") @PostMapping("/udi/udirel/revleance") public BaseResponse revleanceUdi(@RequestBody CombineRequest combineRequest) { - + combineRequest.setCustomerId(customerService.getCustomerId()); List keys = combineRequest.getKeys(); if (keys != null && keys.size() > 0) { for (String key : keys) { @@ -305,18 +309,38 @@ public class UdiRelevanceController { if (udiInfoEntities == null || udiInfoEntities.isEmpty()) { udiInfoEntities = udiDlHttpClient.getUdiByUuid(key); if (udiInfoEntities != null && !udiInfoEntities.isEmpty()) { -// for (UdiInfoEntity infoEntity : udiInfoEntities) { -// infoEntity.setManufactory(udiInfoEntity.getManufactory()); -// } udiInfoService.insertUdiInfos(udiInfoEntities); - if (combineRequest.getManufactory() != null) { - udiRelevanceEntity.setManufactory(combineRequest.getManufactory()); - } else - udiRelevanceEntity.setManufactory(udiInfoEntities.get(0).getYlqxzcrbarmc()); + } else { return ResultVOUtils.error(500, "连接UDI数据下载服务出错!"); } } + if (combineRequest.getManufactory() != null) { + udiRelevanceEntity.setManufactory(combineRequest.getManufactory()); + } else + udiRelevanceEntity.setManufactory(udiInfoEntities.get(0).getYlqxzcrbarmc()); + if (combineRequest.isIdSpliUdi()) { + udiRelevanceEntity.setThirdId(combineRequest.getThirdId()); + udiRelevanceEntity.setThirdName(combineRequest.getErpName()); + udiRelevanceEntity.setMainId(combineRequest.getThirdId()); + udiRelevanceEntity.setMainName(combineRequest.getErpName()); + udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime()); + udiRelevanceEntity.setUuid(key); + udiRelevanceService.insertUdiRelevance(udiRelevanceEntity); + udiRelevanceEntity = udiRelevanceService.selectUpteaByAll(udiRelevanceEntity.getUuid(), udiRelevanceEntity.getThirdId()); + CompanyEntity companyEntity = companyService.findCompany(combineRequest.getCustomerId()); + CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity(); + companyProductRelevanceEntity.setCreate_time(new Date()); + companyProductRelevanceEntity.setUpdate_time(new Date()); + companyProductRelevanceEntity.setAuditStatus("3"); + companyProductRelevanceEntity.setUnitFk(companyEntity.getUnitIdFk()); + companyProductRelevanceEntity.setUdiRlIdFk(Integer.parseInt(udiRelevanceEntity.getId())); + companyProductRelevanceEntity.setCustomerId(companyEntity.getCustomerId()); + boolean b = companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity); + return ResultVOUtils.success("拆分成功!"); + } + + if (combineRequest.getRelId() != null && !combineRequest.getRelId().equals("")) { //修改 //判断DI是否被使用,若使用则新增一条 @@ -375,10 +399,10 @@ public class UdiRelevanceController { udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime()); udiRelevanceEntity.setUuid(key); udiRelevanceService.insertUdiRelevance(udiRelevanceEntity); + } else { return ResultVOUtils.error(500, "重复关联!"); } - } 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 34b5e73..8aa219d 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 @@ -231,6 +231,9 @@ public class OrderController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } + + Integer userId = customerService.getUserId(); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderFilterRequest.getAction()); StockOrderEntity stockOrderEntity = stockOrderService.findByBillNo(orderFilterRequest.getOrderId()); if (stockOrderEntity == null || stockOrderEntity.getOrderIdFk() == null) { 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 a183939..59c1948 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 @@ -569,7 +569,7 @@ public class StockOrderDetailController { */ @AuthRuleAnnotation("") @PostMapping("/udiwms/stock/order/detail/update") - public BaseResponse updateStockOrderDetail(StockOrderDetailEntity stockOrderDetailEntity) { + public BaseResponse updateStockOrderDetail(@RequestBody StockOrderDetailEntity stockOrderDetailEntity) { if (null != stockOrderDetailEntity) stockOrderDetailService.updateById(stockOrderDetailEntity); return ResultVOUtils.success("更新成功"); 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 bbf10ad..ca9ac53 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 @@ -15,6 +15,7 @@ import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity; 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.inout.WarehouseUserEntity; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.exception.JsonException; @@ -660,15 +661,11 @@ public class WareHouseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - try { - AuthAdmin authAdmin = customerService.getUserBeanByKey(); + String customerId = customerService.getUserBeanByKey(); - postOrderRequest.setCustomerId(authAdmin.getCustomerId() + ""); - postOrderRequest.setUserId(authAdmin.getId().intValue()); - ioTransInoutService.createOrderUdims(postOrderRequest); - } catch (Exception e) { - return ResultVOUtils.error(ResultEnum.NOT_NETWORK); - } + postOrderRequest.setCustomerId(customerId); +// postOrderRequest.setUserId(authAdmin.getId().intValue()); + ioTransInoutService.createOrderUdims(postOrderRequest); return ResultVOUtils.success("导入成功"); } @@ -776,10 +773,10 @@ public class WareHouseController { @AuthRuleAnnotation("") @PostMapping("/warehouse/inout/updateDirector") - public BaseResponse updateDirector(Integer id) { - if (null == id) + public BaseResponse updateDirector(WarehouseUserEntity warehouseUserEntity) { + if (warehouseUserEntity == null) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); - warehouseUserService.updateDirector(id); + warehouseUserService.updateDirector(warehouseUserEntity); return ResultVOUtils.success(); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java index a35744e..d567deb 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java @@ -293,17 +293,25 @@ public class InvProductsController { return ResultVOUtils.success(); } UdiEntity udiEntity = FilterUdiUtils.getUdi(filterCodeTraceRequest.getCode()); + if (udiEntity == null) { + return ResultVOUtils.error(500, "无效条码"); + } UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); + if (udiInfoBean == null) { + return ResultVOUtils.error(500, "耗材字典不存在此产品!"); + } List udiInfoEntities = udiInfoService.findByUuids(udiInfoBean.getUuid()); + FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); // String code = null; -// if (udiInfoEntities != null && udiInfoEntities.size() > 1) { -// code = FilterUdiUtils.transGlxpNoSerStr(udiEntity); -// } else { -// code = filterCodeTraceRequest.getCode(); -// } + if (udiInfoEntities != null && udiInfoEntities.size() > 1) { + filterInvProductDetailRequest.setProductIdFk(udiInfoBean.getId() + ""); + filterInvProductDetailRequest.setBatchNo(udiEntity.getBatchNo()); + + } else { + filterInvProductDetailRequest.setOriginCode(filterCodeTraceRequest.getCode()); + } + - FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); - filterInvProductDetailRequest.setOriginCode(filterCodeTraceRequest.getCode()); filterInvProductDetailRequest.setSupId(filterCodeTraceRequest.getSupId()); List invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductDetailRequest); if (invProductDetailEntities.size() > 0) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/auth/AuthCheckDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/auth/AuthCheckDao.java new file mode 100644 index 0000000..75b4e43 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/auth/AuthCheckDao.java @@ -0,0 +1,21 @@ +package com.glxp.sale.admin.dao.auth; + +import com.glxp.sale.admin.entity.auth.AuthCheckEntity; +import com.glxp.sale.admin.req.auth.AuthCheckRequest; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface AuthCheckDao { + + List filterDevices(AuthCheckRequest authCheckRequest); + + AuthCheckEntity findByMachine(String machineInfo); + + boolean insertDevices(AuthCheckEntity authCheckEntity); + + boolean updateDevices(AuthCheckEntity authCheckEntity); + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/auth/AuthLicenseDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/auth/AuthLicenseDao.java index 45e1a52..84977a5 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/dao/auth/AuthLicenseDao.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/auth/AuthLicenseDao.java @@ -25,6 +25,8 @@ public interface AuthLicenseDao { */ AuthLicense selectLicenseByName(@Param("name") String name); + AuthLicense selectLicenseBykey(@Param("apikey") String apikey); + /** * 根据名称修改系统的授权码和秘钥 * diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/UdiCompanyDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/UdiCompanyDao.java index 1bf54f6..bf3fc5a 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/UdiCompanyDao.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/UdiCompanyDao.java @@ -27,5 +27,6 @@ public interface UdiCompanyDao { boolean updateUdiCompany(UdiCompanyEntity udiCompanyEntity); + List syncDlCompany(UdiCompanyRequest udiCompanyRequest); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/auth/AuthCheckEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/auth/AuthCheckEntity.java new file mode 100644 index 0000000..b72e0d6 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/auth/AuthCheckEntity.java @@ -0,0 +1,14 @@ +package com.glxp.sale.admin.entity.auth; + +import lombok.Data; + +import java.util.Date; + +@Data +public class AuthCheckEntity { + private Integer id; + private String machineInfo; + private String remark; + private String registerCode; + private Date createDate; +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/auth/AuthCheckRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/AuthCheckRequest.java new file mode 100644 index 0000000..fd9d8da --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/AuthCheckRequest.java @@ -0,0 +1,13 @@ +package com.glxp.sale.admin.req.auth; + +import com.glxp.sale.admin.req.ListPageRequest; +import lombok.Data; + +@Data +public class AuthCheckRequest extends ListPageRequest { + + private Integer id; + private String machineInfo; + private String registerCode; + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/auth/PCLoginRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/PCLoginRequest.java new file mode 100644 index 0000000..5d0e164 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/PCLoginRequest.java @@ -0,0 +1,19 @@ +package com.glxp.sale.admin.req.auth; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; + +@Data +public class PCLoginRequest { + + @NotEmpty(message = "用户名不能为空") + private String username; + + @NotEmpty(message = "密码不能为空") + private String password; + +// @NotEmpty(message = "机器码不能为空") + private String machineInfo; + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessOriginTypeFilterRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessOriginTypeFilterRequest.java index 2d9de23..a0a0199 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessOriginTypeFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BussinessOriginTypeFilterRequest.java @@ -14,4 +14,5 @@ public class BussinessOriginTypeFilterRequest extends ListPageRequest { private String mainAction; private String localAction; private String lastUpdateTime; + private Integer corpType; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/CombineRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/CombineRequest.java index bfba7b8..674b3a0 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/CombineRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/CombineRequest.java @@ -21,4 +21,5 @@ public class CombineRequest { private Long customerId; private Boolean supEnable; private String manufactory; + private boolean idSpliUdi; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/UdiCompanyRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/UdiCompanyRequest.java index b7387f9..dac1618 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/UdiCompanyRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/UdiCompanyRequest.java @@ -11,5 +11,5 @@ public class UdiCompanyRequest extends ListPageRequest { private String provinceCode; private String cityCode; private String areaCode; - + private String updateTime; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/SpSyncUdiResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/SpSyncUdiResponse.java new file mode 100644 index 0000000..644b04c --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/SpSyncUdiResponse.java @@ -0,0 +1,14 @@ +package com.glxp.sale.admin.res.basic; + +import com.glxp.sale.admin.entity.basic.UdiCompanyEntity; +import com.glxp.sale.admin.entity.receipt.ProductInfoEntity; +import lombok.Data; + +import java.util.List; + +@Data +public class SpSyncUdiResponse { + + List productInfoEntityList; + List udiCompanyEntities; +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/UdiRelevanceResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/UdiRelevanceResponse.java index c75b89e..5594b21 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/UdiRelevanceResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/UdiRelevanceResponse.java @@ -5,7 +5,7 @@ import lombok.Data; @Data public class UdiRelevanceResponse { - private int id; + private Integer id; private String thirdId; private String thirdName; private String uuid; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/auth/AuthAdminService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/auth/AuthAdminService.java index b62b10e..ca4ea64 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/auth/AuthAdminService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/auth/AuthAdminService.java @@ -18,7 +18,6 @@ public interface AuthAdminService { AuthAdmin findById(Long id); - AuthAdmin findPwdById(Long id); boolean insertAuthAdmin(AuthAdmin authAdmin); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/auth/AuthCheckService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/auth/AuthCheckService.java new file mode 100644 index 0000000..4b3f3ab --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/auth/AuthCheckService.java @@ -0,0 +1,18 @@ +package com.glxp.sale.admin.service.auth; + + +import com.glxp.sale.admin.entity.auth.AuthCheckEntity; +import com.glxp.sale.admin.req.auth.AuthCheckRequest; + +import java.util.List; + +public interface AuthCheckService { + + AuthCheckEntity findByMachine(String machineInfo); + + List filterDevices(AuthCheckRequest authCheckRequest); + + boolean insertDevices(AuthCheckEntity authCheckEntity); + + boolean updateDevices(AuthCheckEntity authCheckEntity); +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/auth/CustomerService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/auth/CustomerService.java index fac79e5..c64d8b1 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/auth/CustomerService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/auth/CustomerService.java @@ -43,25 +43,20 @@ public class CustomerService { } - public long getCustomerIdByKey() { - AuthAdmin authAdmin = getUserBeanByKey(); - return authAdmin.getCustomerId(); - } - - public Integer getUserIdByKey() { + public String getUserIdByKey() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes == null) { throw new JsonException(ResultEnum.NOT_NETWORK); } HttpServletRequest request = attributes.getRequest(); String userId = request.getHeader("api_key"); - return Integer.parseInt(userId); + return userId; } - public AuthAdmin getUserBeanByKey() { - Integer userId = getUserIdByKey(); - AuthAdmin authAdmin = authAdminService.findById(userId.longValue()); - return authAdmin; + public String getUserBeanByKey() { + String userId = getUserIdByKey(); + AuthLicense authAdmin = authLicenseDao.selectLicenseBykey(userId); + return authAdmin.getCustomerId(); } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/auth/impl/AuthCheckServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/auth/impl/AuthCheckServiceImpl.java new file mode 100644 index 0000000..9f67529 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/auth/impl/AuthCheckServiceImpl.java @@ -0,0 +1,45 @@ +package com.glxp.sale.admin.service.auth.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.sale.admin.dao.auth.AuthCheckDao; +import com.glxp.sale.admin.entity.auth.AuthCheckEntity; +import com.glxp.sale.admin.req.auth.AuthCheckRequest; +import com.glxp.sale.admin.service.auth.AuthCheckService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Service +public class AuthCheckServiceImpl implements AuthCheckService { + @Resource + private AuthCheckDao authCheckDao; + + @Override + public AuthCheckEntity findByMachine(String machineInfo) { + return authCheckDao.findByMachine(machineInfo); + } + + @Override + public List filterDevices(AuthCheckRequest authCheckRequest) { + if (authCheckRequest == null) { + return Collections.emptyList(); + } + if (authCheckRequest.getPage() != null) { + int offset = (authCheckRequest.getPage() - 1) * authCheckRequest.getLimit(); + PageHelper.offsetPage(offset, authCheckRequest.getLimit()); + } + return authCheckDao.filterDevices(authCheckRequest); + } + + @Override + public boolean insertDevices(AuthCheckEntity authCheckEntity) { + return authCheckDao.insertDevices(authCheckEntity); + } + + @Override + public boolean updateDevices(AuthCheckEntity authCheckEntity) { + return authCheckDao.updateDevices(authCheckEntity); + } +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/UdiCompanyService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/UdiCompanyService.java index aa517f1..a49adae 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/UdiCompanyService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/UdiCompanyService.java @@ -11,6 +11,8 @@ public interface UdiCompanyService { List selectAllTyshxyh(); + List syncDlCompany(UdiCompanyRequest udiCompanyRequest); + List selectContactBykey(String deviceRecordKey); List filterUdiCompany(UdiCompanyRequest udiCompanyRequest); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/UdiCompanyServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/UdiCompanyServiceImpl.java index 09f6c77..5b6e856 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/UdiCompanyServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/UdiCompanyServiceImpl.java @@ -22,6 +22,13 @@ public class UdiCompanyServiceImpl implements UdiCompanyService { return udiCompanyDao.selectAllTyshxyh(); } + @Override + public List syncDlCompany(UdiCompanyRequest udiCompanyRequest) { + int offset = (udiCompanyRequest.getPage() - 1) * udiCompanyRequest.getLimit() + 1; + udiCompanyRequest.setPage(offset); + return udiCompanyDao.syncDlCompany(udiCompanyRequest); + } + @Override public List selectContactBykey(String deviceRecordKey) { return udiCompanyDao.selectContactBykey(deviceRecordKey); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inout/WarehouseUserService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inout/WarehouseUserService.java index 9c3cec7..818f4fd 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inout/WarehouseUserService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inout/WarehouseUserService.java @@ -36,6 +36,8 @@ public interface WarehouseUserService { */ void updateDirector(Integer id); + void updateDirector(WarehouseUserEntity warehouseUserEntity); + /** * 移除关联用户 * diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/WarehouseUserServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/WarehouseUserServiceImpl.java index 34cf8b1..8043a4d 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/WarehouseUserServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/WarehouseUserServiceImpl.java @@ -71,6 +71,15 @@ public class WarehouseUserServiceImpl implements WarehouseUserService { } } + @Override + public void updateDirector(WarehouseUserEntity warehouseUserEntity) { + int value = 0; + if (warehouseUserEntity.isDirector()) { + value = 1; + } + warehouseUserDao.updateDirectorById(warehouseUserEntity.getId(), value); + } + @Override public void deleteWarehouseUser(Integer id) { if (null != id) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncHeartTask.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncHeartTask.java index 2817b73..c44d826 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncHeartTask.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncHeartTask.java @@ -35,6 +35,8 @@ public class AsyncHeartTask implements SchedulingConfigurer { RedisUtil redisUtil; @Resource BasicExportService basicExportService; + @Resource + BasicBackUpdateProductService backUpdateProductService; @Override public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { @@ -70,51 +72,7 @@ public class AsyncHeartTask implements SchedulingConfigurer { } if (curTime - lastTime > timeInterval) { - //自动创建要求被下载已完成单据任务 - BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData("AutoDownloadOrder", 0); - if (basicExportStatusEntity1 == null) { - BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); - orderStatusEntity.setId(CustomUtil.getId()); - orderStatusEntity.setIdDatas("AutoDownloadOrder"); - orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); - orderStatusEntity.setUpdateTime(new Date()); - orderStatusEntity.setStatus(0); - orderStatusEntity.setStartTime(new Date()); - orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); - basicExportService.insertExportStatus(orderStatusEntity); - } - - - //自动创建要求被下载单据类型任务 - BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData("AutoDownloadBusType", 0); - if (basicExportStatusEntity2 == null) { - BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity(); - busTypetatusEntity.setId(CustomUtil.getId()); - busTypetatusEntity.setIdDatas("AutoDownloadBusType"); - busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); - busTypetatusEntity.setUpdateTime(new Date()); - busTypetatusEntity.setStatus(0); - busTypetatusEntity.setStartTime(new Date()); - busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); - basicExportService.insertExportStatus(busTypetatusEntity); - } - - - //自动创建要求被下载基础信息任务 - BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData("AutoDownloadAllData", 0); - if (basicExportStatusEntity3 == null) { - BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); - basicExportStatusEntity.setId(CustomUtil.getId()); - basicExportStatusEntity.setIdDatas("AutoDownloadAllData"); - basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA); - basicExportStatusEntity.setUpdateTime(new Date()); - basicExportStatusEntity.setStatus(0); - basicExportStatusEntity.setStartTime(new Date()); - basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); - basicExportService.insertExportStatus(basicExportStatusEntity); - } - - + backUpdateProductService.syncUpdatetTime(); redisUtil.set("SPS_SYNC_GEN_DATA", curTime); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java index 8426ff8..30212e3 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java @@ -1,6 +1,8 @@ package com.glxp.sale.admin.thread; +import com.glxp.sale.admin.constant.BasicProcessStatus; import com.glxp.sale.admin.constant.ConstantStatus; +import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity; import com.glxp.sale.admin.entity.basic.BasicThirdSysEntity; import com.glxp.sale.admin.entity.basic.UdiInfoEntity; import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity; @@ -11,6 +13,7 @@ import com.glxp.sale.admin.req.basic.FilterErpGoodsRequest; import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest; import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.res.basic.ErpProductsResponse; +import com.glxp.sale.admin.service.basic.BasicExportService; import com.glxp.sale.admin.service.basic.BasicThirdSysService; import com.glxp.sale.admin.service.basic.UdiInfoService; import com.glxp.sale.admin.service.basic.UdiRelevanceService; @@ -25,10 +28,7 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Service public class BasicBackUpdateProductService { @@ -44,7 +44,8 @@ public class BasicBackUpdateProductService { BasicThirdSysService basicThirdSysService; @Resource private ErpBasicClient erpBasicClient; - + @Resource + BasicExportService basicExportService; @Resource RedisUtil redisUtil; @@ -246,7 +247,67 @@ public class BasicBackUpdateProductService { } } redisUtil.set("load_thrid_basic", "finish", 15 * 60); + } + + + public void syncUpdatetTime() { + //自动创建要求被下载已完成单据任务 + BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData("AutoDownloadOrder", 0); + if (basicExportStatusEntity1 == null) { + BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); + orderStatusEntity.setId(CustomUtil.getId()); + orderStatusEntity.setIdDatas("AutoDownloadOrder"); + orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); + orderStatusEntity.setUpdateTime(new Date()); + orderStatusEntity.setStatus(0); + orderStatusEntity.setStartTime(new Date()); + orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(orderStatusEntity); + } + + //自动创建要求被下载单据类型任务 + BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData("AutoDownloadBusType", 0); + if (basicExportStatusEntity2 == null) { + BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity(); + busTypetatusEntity.setId(CustomUtil.getId()); + busTypetatusEntity.setIdDatas("AutoDownloadBusType"); + busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); + busTypetatusEntity.setUpdateTime(new Date()); + busTypetatusEntity.setStatus(0); + busTypetatusEntity.setStartTime(new Date()); + busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(busTypetatusEntity); + } + + + //自动创建要求被下载基础信息任务 + BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData("AutoDownloadAllData", 0); + if (basicExportStatusEntity3 == null) { + BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); + basicExportStatusEntity.setId(CustomUtil.getId()); + basicExportStatusEntity.setIdDatas("AutoDownloadAllData"); + basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA); + basicExportStatusEntity.setUpdateTime(new Date()); + basicExportStatusEntity.setStatus(0); + basicExportStatusEntity.setStartTime(new Date()); + basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(basicExportStatusEntity); + } + + //自动创建要求被下载同步库DI信息 + BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData("AutoDownloadDiProducts", 0); + if (basicExportStatusEntity4 == null) { + BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); + basicExportStatusEntity.setId(CustomUtil.getId()); + basicExportStatusEntity.setIdDatas("AutoDownloadDiProducts"); + basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI); + basicExportStatusEntity.setUpdateTime(new Date()); + basicExportStatusEntity.setStatus(0); + basicExportStatusEntity.setStartTime(new Date()); + basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(basicExportStatusEntity); + } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java index 589c063..41ec62e 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java @@ -232,68 +232,75 @@ public class InvProductsTrService { List warehouseEntities = codesService.findByReceiptId(orderEntity.getId()); List inList = new ArrayList<>(); List preiInList = new ArrayList<>(); - for (WarehouseEntity warehouseEntity : warehouseEntities) { - /** - * 如果出库单据需要缺量自动补录入库单据? - * if(出库单据的当前仓库为1级库,仓库等级=1) - * {可能需要补录的入库单据有两种:《供应商入库》《寄售转入库》} - * else(仓库等级>1) - * {可能需要补录的入库单据有一种:《调拨入库》} - */ - InvWarehouseEntity locWarehouseEntity = invWarehouseService.selectByCode(warehouseEntity.getLocStorageCode()); - - if (locWarehouseEntity.getLevel() == 1 && isAdavnce(warehouseEntity)) {//补寄售转入 - - //获取当前条码实际数量 - int actCount = getActCount(warehouseEntity); - int count = 0; - UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); - String code = warehouseEntity.getCode(); - count = actCount * warehouseEntity.getCount(); + //缺量补单时是否全量补单 + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("ullage_supplement_all"); + if (systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) { + for (WarehouseEntity warehouseEntity : warehouseEntities) { + inList.add(warehouseEntity); + } + } else { + for (WarehouseEntity warehouseEntity : warehouseEntities) { /** - * 《寄售转入库》往来单位: - * 单据类型的当前仓库(如果当前仓库有设置,则判断该当前仓库是否为1级库并且仓库类型=寄售,如果没设置,那么往来单位自动为默认寄售仓库),当前仓库:出库单据的当前仓库 + * 如果出库单据需要缺量自动补录入库单据? + * if(出库单据的当前仓库为1级库,仓库等级=1) + * {可能需要补录的入库单据有两种:《供应商入库》《寄售转入库》} + * else(仓库等级>1) + * {可能需要补录的入库单据有一种:《调拨入库》} */ - BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(advChangeTypeEntity.getScAction()); - InvWarehouseEntity invWarehouseEntity; - if (!StrUtil.isEmpty(bussinessTypeEntity.getStorageCode())) { - invWarehouseEntity = invWarehouseService.selectByCode(bussinessTypeEntity.getStorageCode()); - if (!invWarehouseEntity.getAdvanceType() || invWarehouseEntity.getLevel() > 1) { - //todo 补单失败,当前仓库设置错误 - orderEntity.setRemark("该补录单,单据类型" + bussinessTypeEntity.getName() + "当前仓库设置错误,无法补单"); - orderEntity.setError(true); - } - } else - invWarehouseEntity = invWarehouseService.findDefault(true, true); + InvWarehouseEntity locWarehouseEntity = invWarehouseService.selectByCode(warehouseEntity.getLocStorageCode()); + if (locWarehouseEntity.getLevel() == 1 && isAdavnce(warehouseEntity)) {//补寄售转入 - int invCount = getCountByOrder(null, warehouseEntity); - warehouseEntity.setFromCorpId(invWarehouseEntity.getCode()); - warehouseEntity.setFromCorp(invWarehouseEntity.getName()); - if (invCount > 0) {//仓库已存在该产品 - if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 - UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); - if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 - preiInList.add(warehouseEntity); - } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 - int lea = count - invCount; - warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // - preiInList.add(warehouseEntity); + //获取当前条码实际数量 + int actCount = getActCount(warehouseEntity); + int count = 0; + UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); + String code = warehouseEntity.getCode(); + count = actCount * warehouseEntity.getCount(); + /** + * 《寄售转入库》往来单位: + * 单据类型的当前仓库(如果当前仓库有设置,则判断该当前仓库是否为1级库并且仓库类型=寄售,如果没设置,那么往来单位自动为默认寄售仓库),当前仓库:出库单据的当前仓库 + */ + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(advChangeTypeEntity.getScAction()); + InvWarehouseEntity invWarehouseEntity; + if (!StrUtil.isEmpty(bussinessTypeEntity.getStorageCode())) { + invWarehouseEntity = invWarehouseService.selectByCode(bussinessTypeEntity.getStorageCode()); + if (!invWarehouseEntity.getAdvanceType() || invWarehouseEntity.getLevel() > 1) { + //todo 补单失败,当前仓库设置错误 + orderEntity.setRemark("该补录单,单据类型" + bussinessTypeEntity.getName() + "当前仓库设置错误,无法补单"); + orderEntity.setError(true); } - } - } else { //结余数量《=0直接补 + } else + invWarehouseEntity = invWarehouseService.findDefault(true, true); + + + int invCount = getCountByOrder(null, warehouseEntity); + warehouseEntity.setFromCorpId(invWarehouseEntity.getCode()); + warehouseEntity.setFromCorp(invWarehouseEntity.getName()); + if (invCount > 0) {//仓库已存在该产品 + if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 + UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); + if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 + preiInList.add(warehouseEntity); + } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 + int lea = count - invCount; + warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // + preiInList.add(warehouseEntity); + } + } + } else { //结余数量《=0直接补 // warehouseEntity.setCount(count); - preiInList.add(warehouseEntity); - } - InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); - insetInvSingle(false, invProductDetailEntity); - warehouseEntity.setCode(code); + preiInList.add(warehouseEntity); + } + InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); + insetInvSingle(false, invProductDetailEntity); + warehouseEntity.setCode(code); - } else { - int actCount = getActCount(warehouseEntity); - UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); - String code = warehouseEntity.getCode(); - int count = actCount * warehouseEntity.getCount(); + } else { + int actCount = getActCount(warehouseEntity); + UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); + String code = warehouseEntity.getCode(); + int count = actCount * warehouseEntity.getCount(); // if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY // || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) { // warehouseEntity.setNameCode(udiInfoEntity.getNameCode()); @@ -303,53 +310,53 @@ public class InvProductsTrService { // count = warehouseEntity.getCount(); // } - int invCount = 0; - if (locWarehouseEntity.getLevel() > 1) {//补调拨入库 - /** - * 调拨入库》往来单位:出库单据的当前仓库的父级仓库,当前仓库:出库单据的当前仓库; - */ - InvWarehouseEntity pInWarehouseEntity = invWarehouseService.selectByCode(locWarehouseEntity.getPcode()); - warehouseEntity.setFromCorp(pInWarehouseEntity.getName()); - warehouseEntity.setFromCorpId(pInWarehouseEntity.getCode()); + int invCount = 0; + if (locWarehouseEntity.getLevel() > 1) {//补调拨入库 + /** + * 调拨入库》往来单位:出库单据的当前仓库的父级仓库,当前仓库:出库单据的当前仓库; + */ + InvWarehouseEntity pInWarehouseEntity = invWarehouseService.selectByCode(locWarehouseEntity.getPcode()); + warehouseEntity.setFromCorp(pInWarehouseEntity.getName()); + warehouseEntity.setFromCorpId(pInWarehouseEntity.getCode()); - invCount = getCountByOrder(null, warehouseEntity); + invCount = getCountByOrder(null, warehouseEntity); // invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), locWarehouseEntity.getPcode()); // if (invCount <= 0) { // invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), locWarehouseEntity.getPcode()); // } - norChangeTypeEntity = innorChangeTypeEntity; - } else { //补供应商入库 - /** - * 供应商入库》往来单位:根据产品指定的供应商,当前仓库:出库单据的当前仓库; - */ - //供应商 - warehouseEntity.setFromCorpId(warehouseEntity.getSupId()); - BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId()); - warehouseEntity.setFromCorp(basicUnitMaintainEntity.getName()); - invCount = getCountByOrder(null, warehouseEntity); + norChangeTypeEntity = innorChangeTypeEntity; + } else { //补供应商入库 + /** + * 供应商入库》往来单位:根据产品指定的供应商,当前仓库:出库单据的当前仓库; + */ + //供应商 + warehouseEntity.setFromCorpId(warehouseEntity.getSupId()); + BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId()); + warehouseEntity.setFromCorp(basicUnitMaintainEntity.getName()); + invCount = getCountByOrder(null, warehouseEntity); // invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), null); // if (invCount <= 0) { // invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), null); // } - norChangeTypeEntity = outChangeTypeEntity; - } + norChangeTypeEntity = outChangeTypeEntity; + } - if (invCount > 0) {//仓库已存在该产品 - if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 - UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); - if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 - inList.add(warehouseEntity); - } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 - int lea = count - invCount; - warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // - inList.add(warehouseEntity); + if (invCount > 0) {//仓库已存在该产品 + if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 + UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); + if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 + inList.add(warehouseEntity); + } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 + int lea = count - invCount; + warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // + inList.add(warehouseEntity); + } } - } - } else { //结余数量《=0直接补 + } else { //结余数量《=0直接补 // warehouseEntity.setCount(count); - inList.add(warehouseEntity); - } + inList.add(warehouseEntity); + } // if (invCount > 0) { // if (count > invCount) { // int lea = count - invCount; @@ -360,13 +367,15 @@ public class InvProductsTrService { // warehouseEntity.setCount(count); // inList.add(warehouseEntity); // } - InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); - insetInvSingle(false, invProductDetailEntity); - warehouseEntity.setCode(code); - } + InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); + insetInvSingle(false, invProductDetailEntity); + warehouseEntity.setCode(code); + } + } } + if (inList.size() > 0) { List temps = filterMapCodes(inList); buildInOrder(norChangeTypeEntity, temps, orderEntity); //3.生成采购入库流转单据 @@ -379,45 +388,6 @@ public class InvProductsTrService { } -// public List addOutOrder(OrderEntity -// orderEntity, List invProductDetailEntities) { -// List warehouseEntities = codesService.findByReceiptId(orderEntity.getId()); -// List inList = new ArrayList<>(); -// for (WarehouseEntity warehouseEntity : warehouseEntities) { -// //获取普通出入库结余数量 -// int actCount = getActCount(warehouseEntity); -// int count = 0; -// UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); -// String code = warehouseEntity.getCode(); -// if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY -// || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) { -// warehouseEntity.setNameCode(udiInfoEntity.getNameCode()); -// code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity); -// count = actCount * warehouseEntity.getCount(); -// } else { -// count = warehouseEntity.getCount(); -// } -// int invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId()); -// if (invCount <= 0) { -// invCount = getCountByOrder(null, code, warehouseEntity.getSupId()); -// } -// if (invCount > 0) { -// if (count > invCount) { -// int lea = count - invCount; -// warehouseEntity.setCount(lea / actCount); -// inList.add(warehouseEntity); -// } -// } else { -// warehouseEntity.setCount(count); -// inList.add(warehouseEntity); -// } -// InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); -// insetInvSingle(false, invProductDetailEntity); -// warehouseEntity.setCode(code); -// } -// return inList; -// } - //普通入库补单 public List addPutOrder(OrderEntity orderEntity, List invProductDetailEntities) { @@ -440,11 +410,18 @@ public class InvProductsTrService { List warehouseEntities = codesService.findByReceiptId(orderEntity.getId()); List prePutList = new ArrayList<>(); - for (WarehouseEntity warehouseEntity : warehouseEntities) { - int actCount = getActCount(warehouseEntity); - int count = actCount * warehouseEntity.getCount(); + + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("ullage_supplement_all"); + if (systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) { + for (WarehouseEntity warehouseEntity : warehouseEntities) { + prePutList.add(warehouseEntity); + } + } else { + for (WarehouseEntity warehouseEntity : warehouseEntities) { + int actCount = getActCount(warehouseEntity); + int count = actCount * warehouseEntity.getCount(); // String code = warehouseEntity.getCode(); - UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); + UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity); // if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY // || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) { // warehouseEntity.setNameCode(udiInfoEntity.getNameCode()); @@ -453,26 +430,29 @@ public class InvProductsTrService { // } else { // count = warehouseEntity.getCount(); // } - //获取寄售出入库结余数量 - int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode()); - if (invCount > 0) {//仓库已存在该产品 - if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 - UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); - if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 - prePutList.add(warehouseEntity); - } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 - int lea = count - invCount; - warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // - prePutList.add(warehouseEntity); + //获取寄售出入库结余数量 + int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode()); + if (invCount > 0) {//仓库已存在该产品 + if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 + UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); + if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 + prePutList.add(warehouseEntity); + } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 + int lea = count - invCount; + warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // + prePutList.add(warehouseEntity); + } } - } - } else { //结余数量《=0直接补 + } else { //结余数量《=0直接补 // warehouseEntity.setCount(count); - prePutList.add(warehouseEntity); + prePutList.add(warehouseEntity); + } + InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); + insetInvSingle(true, invProductDetailEntity); } - InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode()); - insetInvSingle(true, invProductDetailEntity); } + + return prePutList; } @@ -516,7 +496,7 @@ public class InvProductsTrService { outOrder.setErpFk(null); outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID); outOrder.setId("SM" + CustomUtil.getId()); - outOrder.setCorpOrderId(CustomUtil.getId()+"x"); + outOrder.setCorpOrderId(CustomUtil.getId() + "x"); outOrder.setFromCorp(invWarehouseEntity.getName()); outOrder.setFromCorpId(invWarehouseEntity.getCode()); outOrder.setLocStorageCode(defaultWarehouseEntity.getCode()); @@ -586,7 +566,7 @@ public class InvProductsTrService { outOrder.setFromCorp(basicUnitMaintainEntity.getName()); outOrder.setFromCorpId(corpName); outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); - outOrder.setCorpOrderId(CustomUtil.getId()+"x"); + outOrder.setCorpOrderId(CustomUtil.getId() + "x"); //互填单号 orderEntity.setUllageSupNo(outOrder.getId()); orderEntity.setUpdateTime(new Date()); @@ -691,7 +671,7 @@ public class InvProductsTrService { outOrder.setId("SM" + CustomUtil.getId()); outOrder.setFromCorpId(corpName); outOrder.setFromCorp(temps.get(0).getFromCorp()); - outOrder.setCorpOrderId(CustomUtil.getId()+"x"); + outOrder.setCorpOrderId(CustomUtil.getId() + "x"); outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); if ("1".equals(systemParamConfigEntity.getParamValue())) { @@ -764,7 +744,7 @@ public class InvProductsTrService { outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID); outOrder.setFromCorp(temps.get(0).getFromCorp()); outOrder.setFromCorpId(temps.get(0).getFromCorpId()); - outOrder.setCorpOrderId(CustomUtil.getId()+"x"); + outOrder.setCorpOrderId(CustomUtil.getId() + "x"); outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); outOrder.setErpFk(null); outOrder.setFromType(ConstantStatus.FROM_CHANGE); @@ -803,7 +783,6 @@ public class InvProductsTrService { } - //生成库存 private InvProductEntity buildInvProduct(String relId, ErpOrderEntity erpOrderEntity, OrderEntity orderEntity, WarehouseEntity warehouseEntity) { 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 b93c0b1..12034a4 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 @@ -263,6 +263,11 @@ public class IoTransInoutService { orderEntity.setExportStatus(ConstantStatus.ORDER_EXPORT_UN); orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); orderEntity.setSignStatus(ConstantStatus.ORDER_SIGN_UN); + orderEntity.setCustomerId(postUdimsOrderRequest.getCustomerId()); + InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true); + orderEntity.setLocStorageCode(invWarehouseEntity.getCode()); + orderEntity.setInvStorageCode(invWarehouseEntity.getCode()); + orderEntity.setUpdateTime(new Date()); orderService.insertOrder(orderEntity); List codeBeans = orderBean.getCodes(); List warehouseEntities = new ArrayList<>(); @@ -273,8 +278,10 @@ public class IoTransInoutService { warehouseEntity.setFromCorpId(companyEntity.getUnitIdFk()); warehouseEntity.setMainAction(orderEntity.getMainAction()); warehouseEntity.setAction(orderEntity.getAction()); - InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true); warehouseEntity.setLocStorageCode(invWarehouseEntity.getCode()); + warehouseEntity.setInvStorageCode(invWarehouseEntity.getCode()); + warehouseEntity.setSupId(orderEntity.getFromCorpId()); + warehouseEntity.setRelId(null); warehouseEntity.setOrderId(orderId); warehouseEntities.add(warehouseEntity); } @@ -321,6 +328,7 @@ public class IoTransInoutService { OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); orderFilterRequest.setCorpOrderId(orderEntity.getCorpOrderId()); orderFilterRequest.setCustomerId(orderEntity.getCustomerId()); + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); List orderEntities = orderService.findAllOrders(orderFilterRequest); if (orderEntities.size() > 1) { orderEntity.setRemark("单据重复上传"); @@ -409,6 +417,16 @@ public class IoTransInoutService { if (datas.size() <= 0) { orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL); orderService.updateRemark(orderEntity.getId(), "udi码:" + warehouseEntity.getCode() + "当前供应商不存在此配送产品"); + return; + } else { + + if (datas.size() == 1) { + warehouseEntity.setRelId(datas.get(0).getRlId() + ""); + } else { + orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL); + orderService.updateRemark(orderEntity.getId(), "di码:" + warehouseEntity.getNameCode() + "DI绑定多个产品ID,请指定对应产品!"); + return; + } } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/util/RsaUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/util/RsaUtils.java index c5c4060..a78e0ab 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/util/RsaUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/util/RsaUtils.java @@ -16,6 +16,14 @@ import java.security.spec.X509EncodedKeySpec; public class RsaUtils { + public static String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtaHLiDtscnwyee4lG9jC" + + "8GUEZYIuBoz49W3GSy2LEOVpKRyiQNCjRmybvQS5qKdsb3pV720HQJnv/nQLnsg/" + + "vWbFc9L09fEeJdDZxQOf8D7CHeVgLd8+fh/GezQCVLijGlbAVORXOrFo5McdyOds" + + "LJey1x4HxIR13a79JHB7sdve14A2aS6bQ7NPWu8hM9LpJd1hylsXgdBpR+iX3DPF" + + "eep8Sx8jPnWfUfGF2pDNE3h1uz9RylGBYUz4tDPzz0IXO7vZkyUFXeslzKFDFcmh" + + "hbn1tobX+al4XvfRpjoCjST2mRfqCt4aNuBDM1LHMzyMBVJpfui91ikLGMgP4Gdf" + + "swIDAQAB"; + public static String privateKeyEncrypt(String str, String privateKey) throws Exception { System.out.println("{}|RSA私钥加密前的数据|str:{}|publicKey:{}" + str + "\n" + privateKey); //base64编码的公钥 diff --git a/api-admin/src/main/resources/application-pro.properties b/api-admin/src/main/resources/application-pro.properties index 753a720..8a95857 100644 --- a/api-admin/src/main/resources/application-pro.properties +++ b/api-admin/src/main/resources/application-pro.properties @@ -1,10 +1,10 @@ # \u751F\u4EA7\u73AF\u5883 server.port=9996 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.jdbc-url=jdbc:mysql://139.159.187.130:3306/spms?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=root -#spring.datasource.password=123456 +#spring.datasource.password=root +spring.datasource.password=123456 #server.servlet.context-path= #logging.level.com.glxp.sale.admin.dao=debug # \u8DE8\u57DF\u8BBE\u7F6E diff --git a/api-admin/src/main/resources/mybatis/mapper/auth/AuthCheckDao.xml b/api-admin/src/main/resources/mybatis/mapper/auth/AuthCheckDao.xml new file mode 100644 index 0000000..98e00e1 --- /dev/null +++ b/api-admin/src/main/resources/mybatis/mapper/auth/AuthCheckDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + INSERT INTO auth_device_check + (machineInfo, remark, registerCode, createDate) + values (#{machineInfo}, + #{remark}, + #{registerCode}, #{createDate}) + + + + UPDATE auth_device_check + + remark=#{remark}, + registerCode=#{registerCode}, + createDate=#{createDate}, + + + WHERE machineInfo=#{machineInfo} + + + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/auth/AuthLicenseDao.xml b/api-admin/src/main/resources/mybatis/mapper/auth/AuthLicenseDao.xml index 11cabdd..907e14a 100644 --- a/api-admin/src/main/resources/mybatis/mapper/auth/AuthLicenseDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/auth/AuthLicenseDao.xml @@ -39,10 +39,19 @@ where customerId = #{customerId} - + select apikey, secretkey + from auth_license + where name = #{name} + + + + update auth_license diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml index 6d76011..b445594 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml @@ -38,7 +38,7 @@ AND originAction =#{originAction} - AND spUse =#{spUse} + AND basic_bustype_local.spUse =#{spUse} = DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> @@ -69,7 +69,7 @@ AND basic_bussiness_type.enable =#{enabled} - AND spUse =#{spUse} + AND basic_bustype_local.spUse =#{spUse} group by basic_bussiness_type.action diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml index 945cbaf..d9b96ba 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessOriginTypeDao.xml @@ -45,6 +45,10 @@ AND basic_bustype_origin.action = #{thirdAction} + + AND basic_bussiness_type.action = #{corpType} + + GROUP BY basic_bustype_origin.action; diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/ProductInfoDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/ProductInfoDao.xml index b951aa6..d985856 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/ProductInfoDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/ProductInfoDao.xml @@ -325,7 +325,7 @@ bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName, cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber ,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq, - ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime + ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime,cplx,hchzsb ) values ( @@ -366,7 +366,10 @@ #{cpms}, #{cpbsbmtxmc}, #{isNewest}, - #{updateTime} + #{updateTime}, + #{hchzsb}, + #{cplx}, + #{hchzsb} ) @@ -379,7 +382,7 @@ bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName, cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber ,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq, - ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime + ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime,cplx,hchzsb ) values @@ -472,7 +475,8 @@ diType=#{diType}, isNewest=#{isNewest}, updateTime=#{updateTime}, - + cplx=#{cplx}, + hchzsb=#{hchzsb}, WHERE id = #{id} @@ -491,6 +495,8 @@ cpbsbmtxmc=#{cpbsbmtxmc}, isNewest=#{isNewest}, updateTime=#{updateTime}, + cplx=#{cplx}, + hchzsb=#{hchzsb}, WHERE uuid = #{uuid} diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/UdiCompanyDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/UdiCompanyDao.xml index f80bd46..51fc38a 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/UdiCompanyDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/UdiCompanyDao.xml @@ -106,4 +106,16 @@ WHERE id = #{id} + + 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 79cea81..fb33ed1 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml @@ -207,16 +207,15 @@ and `action` ]]> 'StockCheck' - - and (status = #{status} - - or status = #{statusOrOne} - ) - and exportStatus = #{exportStatus} - + + and status = #{status} + + + and ( status = 1 or status=-1) + and (contrastStatus = 0 or contrastStatus = 2)