diff --git a/src/main/java/com/glxp/api/controller/auth/AuthAdminController.java b/src/main/java/com/glxp/api/controller/auth/AuthAdminController.java index 05e8769d..63924439 100644 --- a/src/main/java/com/glxp/api/controller/auth/AuthAdminController.java +++ b/src/main/java/com/glxp/api/controller/auth/AuthAdminController.java @@ -169,6 +169,28 @@ public class AuthAdminController { } + @AuthRuleAnnotation("admin/auth/admin/customerRoles") + @GetMapping("/admin/auth/admin/customerRolesList") + public BaseResponse customerRolesList(@RequestParam(value = "page", defaultValue = "1") Integer page, + @RequestParam(value = "limit", defaultValue = "100") Integer limit) { + + List authRoleList = authRoleService.listCustomerRoles(page, limit, 1); +// List authRoleList = authRoleService.listAuthRoles2(page, limit); + PageInfo pageInfo = new PageInfo<>(authRoleList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + List authAdminRoleResponses = authRoleList.stream().map(e -> { + AuthAdminRoleResponse authAdminRoleResponse = new AuthAdminRoleResponse(); + BeanUtils.copyProperties(e, authAdminRoleResponse); + return authAdminRoleResponse; + }).collect(Collectors.toList()); + pageSimpleResponse.setList(authAdminRoleResponses); + + return ResultVOUtils.success(pageSimpleResponse); + } + + + /** * 新增 * diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 5211914f..88475046 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -159,7 +159,7 @@ public class IoOrderDetailBizController extends BaseController { // todo 查询产品是否已经通过认证 if (isVailCert && udiRelevanceResponse.isNeedCert()) { - SupProductEntity supProductEntity = supProductService.findByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory()); + SupProductEntity supProductEntity = supProductService.findByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory(),""); if (supProductEntity != null && (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS || supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS)) { } else { diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 513dfc18..80730ada 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -267,12 +267,16 @@ public class SupCertController { SupCertEntity supCertEntity = new SupCertEntity(); BeanUtils.copyProperties(postSupCertRequest, supCertEntity); - if(postSupCertRequest.getVailDate().getTime()>postSupCertRequest.getExpireDate().getTime()){ - return ResultVOUtils.error(999,"生效期不能小于失效期!"); + + if(postSupCertRequest.getVailDate() !=null && postSupCertRequest.getExpireDate() != null){ + if(postSupCertRequest.getVailDate().getTime()>postSupCertRequest.getExpireDate().getTime()){ + return ResultVOUtils.error(999,"生效期不能小于失效期!"); + } } + if (postSupCertRequest.getRepeatUpload() == 1) { //已审核的重新提交 //1.修改对应的资质信息进入变更审核状态, diff --git a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java index 5df65313..54485fc4 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java @@ -154,27 +154,29 @@ public class SupProductController { public BaseResponse selectBind(@RequestBody SelectProductBindRequest selectProductBindRequest) { UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectUdiId(Long.valueOf(selectProductBindRequest.getRelIdFk())); - SupProductEntity supProductEntity = supProductService.findByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory()); + SupProductEntity supProductEntity = supProductService.findByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory(),selectProductBindRequest.getManufacturerId()); if (supProductEntity != null) { - return ResultVOUtils.error(500, "资质证书已存在,请勿重复添加!"); + return ResultVOUtils.error(500, "该产品资质已存在,请勿重复添加!"); + }else{ + supProductEntity = new SupProductEntity(); + BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity); + supProductEntity.setProductId(selectProductBindRequest.getProductId()); + supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh()); + supProductEntity.setRelIdFk(udiRelevanceResponse.getId() + ""); + supProductEntity.setRecordProductName(udiRelevanceResponse.getCpmctymc()); + supProductEntity.setProductType(udiRelevanceResponse.getQxlb()); + supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm()); + supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc()); + supProductEntity.setSpecification(udiRelevanceResponse.getGgxh()); + supProductEntity.setCreateTime(new Date()); + supProductEntity.setUpdateTime(new Date()); + supProductEntity.setManufacturerIdFk(selectProductBindRequest.getManufacturerId()); + supProductEntity.setCustomerId(selectProductBindRequest.getCustomerId()); + supProductEntity.setHchzsb(udiRelevanceResponse.getCplb()); + supProductEntity.setCompanyName(selectProductBindRequest.getCompanyName()); + supProductEntity.setAuditStatus(selectProductBindRequest.getAuditStatus()); } - supProductEntity = new SupProductEntity(); - BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity); - supProductEntity.setProductId(selectProductBindRequest.getProductId()); - supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh()); - supProductEntity.setRelIdFk(udiRelevanceResponse.getId() + ""); - supProductEntity.setRecordProductName(udiRelevanceResponse.getCpmctymc()); - supProductEntity.setProductType(udiRelevanceResponse.getQxlb()); - supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm()); - supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc()); - supProductEntity.setSpecification(udiRelevanceResponse.getGgxh()); - supProductEntity.setCreateTime(new Date()); - supProductEntity.setUpdateTime(new Date()); - supProductEntity.setManufacturerIdFk(selectProductBindRequest.getManufacturerId()); - supProductEntity.setCustomerId(selectProductBindRequest.getCustomerId()); - supProductEntity.setHchzsb(udiRelevanceResponse.getCplb()); - supProductEntity.setCompanyName(selectProductBindRequest.getCompanyName()); - supProductEntity.setAuditStatus(selectProductBindRequest.getAuditStatus()); + return ResultVOUtils.success(supProductEntity); // boolean b = supProductService.insertRegistration(supProductEntity); diff --git a/src/main/java/com/glxp/api/req/purchase/SelectProductBindRequest.java b/src/main/java/com/glxp/api/req/purchase/SelectProductBindRequest.java index 1abcae22..672b0748 100644 --- a/src/main/java/com/glxp/api/req/purchase/SelectProductBindRequest.java +++ b/src/main/java/com/glxp/api/req/purchase/SelectProductBindRequest.java @@ -11,4 +11,5 @@ public class SelectProductBindRequest { private String customerId; private Integer auditStatus; private String companyName; + private String manufacturerIdFk; } diff --git a/src/main/java/com/glxp/api/service/auth/impl/AuthRoleServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/AuthRoleServiceImpl.java index 8b5f8411..251b0fb4 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/AuthRoleServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/AuthRoleServiceImpl.java @@ -99,7 +99,7 @@ public class AuthRoleServiceImpl implements AuthRoleService { limit = limit != null && limit > 0 && limit < 100 ? limit : 100; int offset = (page - 1) * limit; PageHelper.offsetPage(offset, limit); - List list = authRoleDao.getCustomerRoles(isCustomer); + List list = authRoleDao.listCustomerRoles(isCustomer); return list; } diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java index f93b0633..0a478c77 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderDetailBizServiceImpl.java @@ -138,6 +138,12 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService { @Override public List filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest) { + if (null == orderDetailBizRequest) { + return Collections.emptyList(); + } + if (null != orderDetailBizRequest.getPage() && null != orderDetailBizRequest.getLimit()) { + PageHelper.offsetPage((orderDetailBizRequest.getPage() - 1) * orderDetailBizRequest.getLimit(), orderDetailBizRequest.getLimit()); + } return ioOrderDetailBizDao.filterListInv(orderDetailBizRequest); } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvRemindSetServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvRemindSetServiceImpl.java index 1e0c4564..a8673055 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvRemindSetServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvRemindSetServiceImpl.java @@ -140,6 +140,20 @@ public class InvRemindSetServiceImpl implements InvRemindSetService { public BaseResponse getInfoByInvId(Integer invId) { InvRemindSetResponse response = invRemindSetDao.selectInfoByInvId(invId); if (null != response) { + //查询是否已有库存预警设置信息,若已存在预警设置,则回显旧数据 + InvRemindSetEntity invRemindSetEntity = invRemindSetDao.selectOne(new QueryWrapper() + .eq("deptCode", response.getDeptCode()) + .eq("invCode", response.getInvCode()) + .eq("relId", response.getRelId()) + ); + + if (null != invRemindSetEntity) { + response.setLackStock(invRemindSetEntity.getLackStock()); + response.setLowStock(invRemindSetEntity.getLowStock()); + response.setOverStock(invRemindSetEntity.getOverStock()); + response.setExpireDate(invRemindSetEntity.getExpireDate()); + response.setRecentDate(invRemindSetEntity.getRecentDate()); + } if (response.getIsDateBy() == 1 && null != response.getRecentDateTime()) { //将近效期预警值由小时换算成天 response.setRecentDateTime(response.getRecentDateTime() / 24); diff --git a/src/main/java/com/glxp/api/service/purchase/SupProductService.java b/src/main/java/com/glxp/api/service/purchase/SupProductService.java index f764afe6..3cdcc6bc 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupProductService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupProductService.java @@ -17,7 +17,7 @@ public interface SupProductService { SupProductEntity findByRelIdFk(String relIdFk); - SupProductEntity findByManufactury(String cpmctymc, String manufactory); + SupProductEntity findByManufactury(String cpmctymc, String manufactory,String manufacturerIdFk); SupProductResponse findByPassByReCert(String registerCert); diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java index d776303b..b46f88ad 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java @@ -82,10 +82,20 @@ public class SupProductServiceImpl implements SupProductService { } @Override - public SupProductEntity findByManufactury(String cpmctymc, String manufactory) { - List supProductEntities = supProductDao.selectList(new QueryWrapper().eq("manufactory", manufactory) - .eq("recordProductName", cpmctymc) - .last("LIMIT 1")); + public SupProductEntity findByManufactury(String cpmctymc, String manufactory,String manufacturerIdFk) { + + QueryWrapper ew=new QueryWrapper<>(); + if(StrUtil.isNotEmpty(manufactory)){ + ew.eq("manufactory",manufactory); + } + if(StrUtil.isNotEmpty(cpmctymc)){ + ew.eq("recordProductName",cpmctymc); + } + if(StrUtil.isNotEmpty(manufacturerIdFk)){ + ew.eq("manufacturerIdFk",manufacturerIdFk); + } + ew.last("limit 1"); + List supProductEntities = supProductDao.selectList(ew); if (CollUtil.isNotEmpty(supProductEntities)) return supProductEntities.get(0); else return null;