From b0543b862a195c84e66324b7269d4e8bee57c426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Fri, 21 Apr 2023 14:51:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E4=BB=A3=E7=A0=81=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/basic/BasicCorpController.java | 8 + .../basic/UdiRelevanceController.java | 14 + .../purchase/SupCertController.java | 322 ++++++++----- .../purchase/SupCertRemindMsgController.java | 4 + .../purchase/SupCertSetController.java | 6 +- .../purchase/SupCompanyController.java | 49 +- .../purchase/SupManufacturerController.java | 93 ++-- .../purchase/SupProductController.java | 100 +++-- .../com/glxp/api/dao/basic/BasicCorpDao.java | 2 + .../glxp/api/dao/basic/UdiRelevanceDao.java | 1 + .../system/SystemPDFTemplateRelevanceDao.java | 3 + .../purchase/SupManufacturerEntity.java | 2 + .../api/req/purchase/FilterImageRequest.java | 12 + .../api/req/purchase/FilterPoductRequest.java | 1 + .../api/service/basic/BasicCorpService.java | 5 + .../service/basic/UdiRelevanceService.java | 2 + .../basic/impl/BasicCorpServiceImpl.java | 14 + .../basic/impl/UdiRelevanceServiceImpl.java | 26 ++ .../api/service/purchase/SupCertService.java | 5 +- .../service/purchase/SupCertSetService.java | 5 +- .../service/purchase/SupCompanyService.java | 3 +- .../purchase/SupManufacturerService.java | 5 +- .../service/purchase/SupProductService.java | 10 +- .../purchase/impl/SupCertServiceImpl.java | 21 +- .../purchase/impl/SupCertSetServiceImpl.java | 3 +- .../purchase/impl/SupCompanyServiceImpl.java | 3 +- .../impl/SupManufacturerServiceImpl.java | 3 +- .../purchase/impl/SupProductServiceImpl.java | 35 +- .../system/SystemPDFModuleService.java | 3 + .../impl/SystemPDFModuleServiceImpl.java | 10 + .../mybatis/mapper/basic/BasicCorpDao.xml | 11 + .../mybatis/mapper/basic/UdiRelevanceDao.xml | 170 +++++++ .../mybatis/mapper/purchase/SupCertDao.xml | 23 +- .../mybatis/mapper/purchase/SupCompanyDao.xml | 12 +- .../mapper/purchase/SupManufacturerDao.xml | 8 +- .../mybatis/mapper/purchase/SupProductDao.xml | 425 ++++++++++++------ .../system/SystemPDFTemplateRelevanceDao.xml | 7 + 37 files changed, 1041 insertions(+), 385 deletions(-) create mode 100644 src/main/java/com/glxp/api/req/purchase/FilterImageRequest.java diff --git a/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java b/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java index e97ca7653..c9dd8147e 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java @@ -510,5 +510,13 @@ public class BasicCorpController { return ResultVOUtils.success(rMap); } + @AuthRuleAnnotation("") + @PostMapping("/udiwms/basic/unit/maintain/getCorpList") + public BaseResponse getCorpList() { + + List getCorpList=basicUnitMaintainService.getCorpList(); + return ResultVOUtils.success(getCorpList); + } + } diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java index 8175aa350..bc2d87f17 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java @@ -695,4 +695,18 @@ public class UdiRelevanceController extends BaseController { return ResultVOUtils.success(ggxhList); } + //资质证书选入产品列表 产品名称,生产企业过滤 + @AuthRuleAnnotation("") + @GetMapping("/udi/cert/filterUdi") + public BaseResponse filterCertUdi(FilterUdiRelRequest filterUdiRelRequest) { + List udiRelevanceResponses = udiRelevanceService.filterCertUdi(filterUdiRelRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(udiRelevanceResponses); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(udiRelevanceResponses); + return ResultVOUtils.success(pageSimpleResponse); + } + + } 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 5b662468d..c146736bb 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -5,20 +5,20 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.purchase.*; -import com.glxp.api.entity.system.SystemPDFModuleEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.exception.JsonException; import com.glxp.api.req.inout.InspectionPDFTemplateRequest; -import com.glxp.api.req.inout.SystemPDFModuleRequest; import com.glxp.api.req.purchase.*; import com.glxp.api.req.system.DeleteCompanyFileRequest; -import com.glxp.api.req.system.FilterPdfModuleRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.purchase.SupProductResponse; import com.glxp.api.service.auth.AuthAdminService; @@ -83,6 +83,7 @@ public class SupCertController { @AuthRuleAnnotation("") @PostMapping("/sup/info/selectAllCert") + @Log(title = "资质证书", businessType = BusinessType.INSERT) public BaseResponse selectAllCert(@RequestBody PostSelCertRequest postSelCertRequest) { String customerId = null; if (StrUtil.isEmpty(postSelCertRequest.getCustomerId())) @@ -96,6 +97,76 @@ public class SupCertController { if (postSelCertRequest.getCertType() == null) { return ResultVOUtils.error(500, "参数错误!"); } + if (postSelCertRequest.getManufacturerIdFk() == null) { + String errMsg = ""; + ArrayList list = new ArrayList<>(); + int i = postSelCertRequest.getSupCertSetEntities().size(); + for (SupCertSetEntity supCertSetEntity : postSelCertRequest.getSupCertSetEntities()) { + i--; + FilterSupCertRequest supCertRequest = new FilterSupCertRequest(); + supCertRequest.setName(supCertSetEntity.getName()); + supCertRequest.setCustomerId(customerId); + List supCertEntities = supCertService.selectCompanyCert(supCertRequest); + if (supCertEntities.size() != 0) { + list.add(supCertEntities.get(0).getName()); + if (supCertEntities.size() != 0 && i == 0) { + for (String s : list) { + errMsg = errMsg + "," + s; + } + return ResultVOUtils.error(999, errMsg.substring(1) + "已存在!"); + } + } + } + }else{ + if(postSelCertRequest.getProductIdFk()==null) { + String errMsg = ""; + ArrayList list = new ArrayList<>(); + int i = postSelCertRequest.getSupCertSetEntities().size(); + for (SupCertSetEntity supCertSetEntity : postSelCertRequest.getSupCertSetEntities()) { + i--; + FilterSupCertRequest supCertRequest = new FilterSupCertRequest(); + supCertRequest.setName(supCertSetEntity.getName()); + supCertRequest.setCustomerId(customerId); + supCertRequest.setManufacturerIdFk(postSelCertRequest.getManufacturerIdFk()); + supCertRequest.setType(2); + List supCertEntities = supCertService.selectCompanyCert(supCertRequest); + if (supCertEntities.size() != 0) { + list.add(supCertEntities.get(0).getName()); + if (supCertEntities.size() != 0 && i == 0) { + for (String s : list) { + errMsg = errMsg + "," + s; + } + return ResultVOUtils.error(999, errMsg.substring(1) + "已存在!"); + } + } + } + }else{ + String errMsg = ""; + ArrayList list = new ArrayList<>(); + int i = postSelCertRequest.getSupCertSetEntities().size(); + for (SupCertSetEntity supCertSetEntity : postSelCertRequest.getSupCertSetEntities()) { + i--; + FilterSupCertRequest supCertRequest = new FilterSupCertRequest(); + supCertRequest.setName(supCertSetEntity.getName()); + supCertRequest.setCustomerId(customerId); + supCertRequest.setManufacturerIdFk(postSelCertRequest.getManufacturerIdFk()); + supCertRequest.setProductIdFk(postSelCertRequest.getProductIdFk()); + supCertRequest.setType(3); + List supCertEntities = supCertService.selectCompanyCert(supCertRequest); + if (supCertEntities.size() != 0) { + list.add(supCertEntities.get(0).getName()); + if (supCertEntities.size() != 0 && i == 0) { + for (String s : list) { + errMsg = errMsg + "," + s; + } + return ResultVOUtils.error(999, errMsg.substring(1) + "已存在!"); + } + } + } + } + } + + for (SupCertSetEntity supCertSetEntity : postSelCertRequest.getSupCertSetEntities()) { SupCertEntity supCertEntity = new SupCertEntity(); supCertEntity.setName(supCertSetEntity.getName()); @@ -127,9 +198,11 @@ public class SupCertController { @AuthRuleAnnotation("") @PostMapping("/sup/info/insertCompanyCert") + @Log(title = "资质证书", businessType = BusinessType.INSERT) public BaseResponse insertCompanyCert(@RequestBody SupCertEntity supCertEntity) { supCertEntity.setCreateTime(new Date()); supCertEntity.setUpdateTime(new Date()); + supCertEntity.setStatus(0); boolean b = supCertService.insertCompanyCert(supCertEntity); return ResultVOUtils.success("成功"); } @@ -137,6 +210,7 @@ public class SupCertController { @AuthRuleAnnotation("") @PostMapping("/sale/sup/cert/audit") + @Log(title = "资质证书", businessType = BusinessType.UPDATE) public BaseResponse auditSupCert(@RequestBody SupCertEntity supCertEntity) { supCertEntity.setCreateTime(new Date()); supCertEntity.setUpdateTime(new Date()); @@ -144,6 +218,38 @@ public class SupCertController { return ResultVOUtils.success("成功"); } + //撤回单据 + @AuthRuleAnnotation("") + @PostMapping("/sale/sup/cert/revoke") + @Log(title = "单据管理", businessType = BusinessType.UPDATE) + public BaseResponse revokeSupCert(@RequestBody SupCertEntity supCertEntity) { + supCertEntity.setCreateTime(new Date()); + supCertEntity.setUpdateTime(new Date()); + boolean b = supCertService.updateCompanyCert(supCertEntity); + if (supCertEntity.getType() == ConstantStatus.CERT_COMPANY) { + SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supCertEntity.getCustomerId()); + supCompanyEntity.setAuditStatus(ConstantStatus.AUDIT_UN); + supCompanyEntity.setUpdateTime(new Date()); + supCompanyService.modifyCompany(supCompanyEntity); + } else if (supCertEntity.getType() == ConstantStatus.CERT_MANUFACTURER) { + SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supCertEntity.getManufacturerIdFk()); + supManufacturerEntity.setAuditStatus(ConstantStatus.AUDIT_UN); + supManufacturerEntity.setUpdateTime(new Date()); + supManufacturerService.modifyCompany(supManufacturerEntity); + } else if (supCertEntity.getType() == ConstantStatus.CERT_PRODUCT) { + SupProductResponse supProductResponse = supProductService.findByProductId(supCertEntity.getProductIdFk()); + SupProductEntity supProductEntity = new SupProductEntity(); + supProductEntity.setId(supProductResponse.getId()); + supProductEntity.setUpdateTime(new Date()); + supProductEntity.setAuditStatus(ConstantStatus.AUDIT_UN); + supProductService.modifyRegistration(supProductEntity); + } + + + return ResultVOUtils.success("成功"); + } + + @Resource SupCompanyService supCompanyService; @Resource @@ -153,9 +259,21 @@ public class SupCertController { @AuthRuleAnnotation("") @PostMapping("/sup/info/updateCompanyCert") + @Log(title = "资质证书", businessType = BusinessType.UPDATE) public BaseResponse updateCompanyCert(@RequestBody PostSupCertRequest postSupCertRequest) { SupCertEntity supCertEntity = new SupCertEntity(); BeanUtils.copyProperties(postSupCertRequest, supCertEntity); + + + if(postSupCertRequest.getVailDate() !=null && postSupCertRequest.getExpireDate() != null){ + if(postSupCertRequest.getVailDate().getTime()>postSupCertRequest.getExpireDate().getTime()){ + return ResultVOUtils.error(999,"生效期不能小于失效期!"); + } + } + + + + if (postSupCertRequest.getRepeatUpload() == 1) { //已审核的重新提交 //1.修改对应的资质信息进入变更审核状态, @@ -219,18 +337,17 @@ public class SupCertController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!"); } //查询模板文件是否存在 - FilterPdfModuleRequest filterPdfModuleRequest = new FilterPdfModuleRequest(); - filterPdfModuleRequest.setId(inspectionPDFTemplateRequest.getModuleId()); - SystemPDFModuleEntity systemPDFModule = systemPDFModuleService.findSystemPDFModule(filterPdfModuleRequest); - if (null == systemPDFModule) { + + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getId()); + if (null == sysPdfTemplateRelevanceStatemenEntity) { return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); } - SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(systemPDFModule.getTemplateId())); + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); if (null == systemPDFTemplateEntity) { return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); } - return ResultVOUtils.success(systemPDFModule.getTemplateId()); + return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()); } /** @@ -258,27 +375,31 @@ public class SupCertController { int i = 1; if (selectSupCertList != null && selectSupCertList.size() > 0) { for (SupCertEntity obj : selectSupCertList) { - //组装数据 - Map supData = new HashMap<>(); - supData.put("companyName", supCompanyEntity.getCompanyName() == null ? ' ' : supCompanyEntity.getCompanyName()); - supData.put("creditNum", supCompanyEntity.getCreditNum() == null ? ' ' : supCompanyEntity.getCreditNum()); - supData.put("classes", supCompanyEntity.getClasses().equals(1) ? "医院" : "经营企业"); - supData.put("area", supCompanyEntity.getArea() == null ? ' ' : supCompanyEntity.getArea()); - supData.put("contacts", supCompanyEntity.getContacts() == null ? ' ' : supCompanyEntity.getContacts()); - supData.put("detailAddr", supCompanyEntity.getDetailAddr() == null ? ' ' : supCompanyEntity.getDetailAddr()); - supData.put("mobile", supCompanyEntity.getMobile() == null ? ' ' : supCompanyEntity.getMobile()); - supData.put("email", supCompanyEntity.getEmail() == null ? ' ' : supCompanyEntity.getEmail()); - supData.put("index", String.valueOf(i)); - supData.put("name", obj.getName() == null ? ' ' : obj.getName()); - supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); - supData.put("vaiDate", formatter.format(obj.getVailDate())); - supData.put("expireDate", formatter.format(obj.getExpireDate())); - supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); - supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); - supData.put("remark", obj.getRemark() == null ? ' ' : obj.getRemark()); - supData.put("filePath", "D:/udi/udiwms/udiwmsfile/register/image2/" + obj.getFilePath()); - list.add(supData); - i++; + List urlList = Arrays.asList(obj.getFilePath().split(",")); + for (String url : urlList) { + //组装数据 + Map supData = new HashMap<>(); + supData.put("companyName", supCompanyEntity.getCompanyName() == null ? ' ' : supCompanyEntity.getCompanyName()); + supData.put("creditNum", supCompanyEntity.getCreditNum() == null ? ' ' : supCompanyEntity.getCreditNum()); + supData.put("classes", supCompanyEntity.getClasses().equals(1) ? "医院" : "经营企业"); + supData.put("area", supCompanyEntity.getArea() == null ? ' ' : supCompanyEntity.getArea()); + supData.put("contacts", supCompanyEntity.getContacts() == null ? ' ' : supCompanyEntity.getContacts()); + supData.put("detailAddr", supCompanyEntity.getDetailAddr() == null ? ' ' : supCompanyEntity.getDetailAddr()); + supData.put("mobile", supCompanyEntity.getMobile() == null ? ' ' : supCompanyEntity.getMobile()); + supData.put("email", supCompanyEntity.getEmail() == null ? ' ' : supCompanyEntity.getEmail()); + supData.put("index", String.valueOf(i)); + supData.put("name", obj.getName() == null ? ' ' : obj.getName()); + supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); + supData.put("vaiDate", obj.getVailDate() == null ? ' ' : formatter.format(obj.getVailDate())); + supData.put("expireDate", obj.getExpireDate() == null ? ' ' : formatter.format(obj.getExpireDate())); + supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); + supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); + supData.put("remark", obj.getRemark() == null ? ' ' : obj.getRemark()); + supData.put("filePath", filePath + "register/image2/" + url); + list.add(supData); + i++; + } + } } @@ -368,29 +489,32 @@ public class SupCertController { int i = 1; if (selectSupCertList != null && selectSupCertList.size() > 0) { for (SupCertEntity obj : selectSupCertList) { - //组装数据 - Map supData = new HashMap<>(); - supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName()); - supData.put("companyName", supManufacturerEntity.getCompanyName() == null ? ' ' : supManufacturerEntity.getCompanyName()); - supData.put("companyType", supManufacturerEntity.getCompanyType().equals(1) ? "境内企业" : "境外企业"); - supData.put("creditCode", supManufacturerEntity.getCreditCode() == null ? ' ' : supManufacturerEntity.getCreditCode()); - supData.put("placeArea", supManufacturerEntity.getPlaceArea() == null ? ' ' : supManufacturerEntity.getPlaceArea()); - supData.put("productionArea", supManufacturerEntity.getProductionArea() == null ? ' ' : supManufacturerEntity.getProductionArea()); - supData.put("registerStatus", getRegisterStatus(supManufacturerEntity.getRegisterStatus())); - supData.put("placeAddress", supManufacturerEntity.getPlaceAddress() == null ? ' ' : supManufacturerEntity.getPlaceAddress()); - supData.put("productionAddress", supManufacturerEntity.getProductionAddress() == null ? ' ' : supManufacturerEntity.getProductionAddress()); - supData.put("remark1", supManufacturerEntity.getRemark() == null ? ' ' : supManufacturerEntity.getRemark()); - supData.put("index", String.valueOf(i)); - supData.put("name", obj.getName() == null ? ' ' : obj.getName()); - supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); - supData.put("vaiDate", formatter.format(obj.getVailDate())); - supData.put("expireDate", formatter.format(obj.getExpireDate())); - supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); - supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); - supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark()); - supData.put("filePath", "d:/1s/udiwms/register/file/image2/" + obj.getFilePath()); - list.add(supData); - i++; + List urlList = Arrays.asList(obj.getFilePath().split(",")); + for (String url : urlList) { + //组装数据 + Map supData = new HashMap<>(); + supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName()); + supData.put("companyName", supManufacturerEntity.getCompanyName() == null ? ' ' : supManufacturerEntity.getCompanyName()); + supData.put("companyType", supManufacturerEntity.getCompanyType().equals(1) ? "境内企业" : "境外企业"); + supData.put("creditCode", supManufacturerEntity.getCreditCode() == null ? ' ' : supManufacturerEntity.getCreditCode()); + supData.put("placeArea", supManufacturerEntity.getPlaceArea() == null ? ' ' : supManufacturerEntity.getPlaceArea()); + supData.put("productionArea", supManufacturerEntity.getProductionArea() == null ? ' ' : supManufacturerEntity.getProductionArea()); + supData.put("registerStatus", getRegisterStatus(supManufacturerEntity.getRegisterStatus())); + supData.put("placeAddress", supManufacturerEntity.getPlaceAddress() == null ? ' ' : supManufacturerEntity.getPlaceAddress()); + supData.put("productionAddress", supManufacturerEntity.getProductionAddress() == null ? ' ' : supManufacturerEntity.getProductionAddress()); + supData.put("remark1", supManufacturerEntity.getRemark() == null ? ' ' : supManufacturerEntity.getRemark()); + supData.put("index", String.valueOf(i)); + supData.put("name", obj.getName() == null ? ' ' : obj.getName()); + supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); + supData.put("vaiDate", obj.getVailDate() == null ? ' ' : formatter.format(obj.getVailDate())); + supData.put("expireDate", obj.getExpireDate() == null ? ' ' : formatter.format(obj.getExpireDate())); + supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); + supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); + supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark()); + supData.put("filePath", filePath + "register/image2/" + url); + list.add(supData); + i++; + } } } @@ -428,31 +552,35 @@ public class SupCertController { int i = 1; if (selectSupCertList != null && selectSupCertList.size() > 0) { for (SupCertEntity obj : selectSupCertList) { - //组装数据 - Map supData = new HashMap<>(); - supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName()); - supData.put("manufacturerldFk", supManufacturerEntity.getCompanyName() == null ? ' ' : supManufacturerEntity.getCompanyName()); - supData.put("recordProductName", supProductEntity.getRecordProductName() == null ? ' ' : supProductEntity.getRecordProductName()); - supData.put("recordCode", supProductEntity.getRecordCode() == null ? ' ' : supProductEntity.getRecordCode()); - supData.put("recordPeopleName", supProductEntity.getRecordPeopleName() == null ? ' ' : supProductEntity.getRecordPeopleName()); - supData.put("hchzsb", supProductEntity.getHchzsb() == null ? ' ' : supProductEntity.getHchzsb()); - supData.put("productType", supProductEntity.getProductType() == null ? ' ' : supProductEntity.getProductType()); - supData.put("productDirectoryCode", supProductEntity.getProductDirectoryCode() == null ? ' ' : supProductEntity.getProductDirectoryCode()); - supData.put("specification", supProductEntity.getSpecification() == null ? ' ' : supProductEntity.getSpecification()); - supData.put("cpms", supProductEntity.getCpms() == null ? ' ' : supProductEntity.getCpms()); - supData.put("remark1", supProductEntity.getRemark() == null ? ' ' : supProductEntity.getRemark()); - - supData.put("index", String.valueOf(i)); - supData.put("name", obj.getName() == null ? ' ' : obj.getName()); - supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); - supData.put("vaiDate", formatter.format(obj.getVailDate())); - supData.put("expireDate", formatter.format(obj.getExpireDate())); - supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); - supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); - supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark()); - supData.put("filePath", "d:/1s/udiwms/register/file/image2/" + obj.getFilePath()); - list.add(supData); - i++; + + List urlList = Arrays.asList(obj.getFilePath().split(",")); + for (String url : urlList) { + //组装数据 + Map supData = new HashMap<>(); + supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName()); + supData.put("manufacturerldFk", supManufacturerEntity.getCompanyName() == null ? ' ' : supManufacturerEntity.getCompanyName()); + supData.put("recordProductName", supProductEntity.getRecordProductName() == null ? ' ' : supProductEntity.getRecordProductName()); + supData.put("recordCode", supProductEntity.getRecordCode() == null ? ' ' : supProductEntity.getRecordCode()); + supData.put("recordPeopleName", supProductEntity.getRecordPeopleName() == null ? ' ' : supProductEntity.getRecordPeopleName()); + supData.put("hchzsb", supProductEntity.getHchzsb() == null ? ' ' : supProductEntity.getHchzsb()); + supData.put("productType", supProductEntity.getProductType() == null ? ' ' : supProductEntity.getProductType()); + supData.put("productDirectoryCode", supProductEntity.getProductDirectoryCode() == null ? ' ' : supProductEntity.getProductDirectoryCode()); + supData.put("specification", supProductEntity.getSpecification() == null ? ' ' : supProductEntity.getSpecification()); +// supData.put("cpms", supProductEntity.getCpms() == null ? ' ' : supProductEntity.getCpms()); + supData.put("remark1", supProductEntity.getRemark() == null ? ' ' : supProductEntity.getRemark()); + + supData.put("index", String.valueOf(i)); + supData.put("name", obj.getName() == null ? ' ' : obj.getName()); + supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); + supData.put("vaiDate", obj.getVailDate() == null ? ' ' : formatter.format(obj.getVailDate())); + supData.put("expireDate", obj.getExpireDate() == null ? ' ' : formatter.format(obj.getExpireDate())); + supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); + supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); + supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark()); + supData.put("filePath", filePath + "register/image2/" + url); + list.add(supData); + i++; + } } } @@ -460,35 +588,17 @@ public class SupCertController { JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); } - - //撤回单据 - @AuthRuleAnnotation("") - @PostMapping("/sale/sup/cert/revoke") - public BaseResponse revokeSupCert(@RequestBody SupCertEntity supCertEntity) { - supCertEntity.setCreateTime(new Date()); - supCertEntity.setUpdateTime(new Date()); - boolean b = supCertService.updateCompanyCert(supCertEntity); - if (supCertEntity.getType() == ConstantStatus.CERT_COMPANY) { - SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supCertEntity.getCustomerId()); - supCompanyEntity.setAuditStatus(ConstantStatus.AUDIT_UN); - supCompanyEntity.setUpdateTime(new Date()); - supCompanyService.modifyCompany(supCompanyEntity); - } else if (supCertEntity.getType() == ConstantStatus.CERT_MANUFACTURER) { - SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supCertEntity.getManufacturerIdFk()); - supManufacturerEntity.setAuditStatus(ConstantStatus.AUDIT_UN); - supManufacturerEntity.setUpdateTime(new Date()); - supManufacturerService.modifyCompany(supManufacturerEntity); - } else if (supCertEntity.getType() == ConstantStatus.CERT_PRODUCT) { - SupProductResponse supProductResponse = supProductService.findByProductId(supCertEntity.getProductIdFk()); - SupProductEntity supProductEntity = new SupProductEntity(); - supProductEntity.setId(supProductResponse.getId()); - supProductEntity.setUpdateTime(new Date()); - supProductEntity.setAuditStatus(ConstantStatus.AUDIT_UN); - supProductService.modifyRegistration(supProductEntity); + //首营预览文件 + @PostMapping("/udiwms/image/register/file") + public BaseResponse uploadRegisterFile(@RequestBody FilterImageRequest filterImageRequest) { + List urlList = Arrays.asList(filterImageRequest.getImageUrl().split(",")); + List list = new ArrayList<>(); + for (String obj : urlList) { + String url = filterImageRequest.getCertFileUrl() + obj; + list.add(url); } - - - return ResultVOUtils.success("成功"); + return ResultVOUtils.success(list); } + } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertRemindMsgController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertRemindMsgController.java index 74c0336b2..a42ef4e9b 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertRemindMsgController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertRemindMsgController.java @@ -2,9 +2,11 @@ package com.glxp.api.controller.purchase; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; import com.glxp.api.req.purchase.FilterCertRemindMsgRequest; import com.glxp.api.res.purchase.SupCertRemindMsgResponse; import com.glxp.api.service.purchase.SupCertRemindMsgService; @@ -46,6 +48,7 @@ public class SupCertRemindMsgController { * @return */ @GetMapping("/sup/cert/remind/msg/confirmMsg") + @Log(title = "资质预警", businessType = BusinessType.UPDATE) public BaseResponse confirmMsg(Integer id, String handleMsg) { if (null == id || StrUtil.isBlank(handleMsg)) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); @@ -61,6 +64,7 @@ public class SupCertRemindMsgController { * @return */ @GetMapping("/sup/cert/remind/msg/ignoreMsg") + @Log(title = "资质预警", businessType = BusinessType.UPDATE) public BaseResponse ignoreMsg(Integer id, Integer ignoreStatus) { if (null == id || null == ignoreStatus) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertSetController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertSetController.java index dc0d134fd..677d958a6 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertSetController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertSetController.java @@ -2,11 +2,12 @@ package com.glxp.api.controller.purchase; import cn.hutool.core.collection.CollUtil; import com.github.pagehelper.PageInfo; - import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; import com.glxp.api.entity.purchase.SupCertSetEntity; import com.glxp.api.req.purchase.FilterCertSetsRequest; import com.glxp.api.req.system.DeleteRequest; @@ -51,6 +52,7 @@ public class SupCertSetController { @AuthRuleAnnotation("") @PostMapping("/sup/cert/set/add") + @Log(title = "资质证书", businessType = BusinessType.INSERT) public BaseResponse addCertSet(@RequestBody SupCertSetEntity supCertSetEntity) { if (supCertSetEntity == null) { supCertSetEntity = new SupCertSetEntity(); @@ -77,6 +79,7 @@ public class SupCertSetController { @AuthRuleAnnotation("") @PostMapping("/sup/cert/set/update") + @Log(title = "资质证书", businessType = BusinessType.UPDATE) public BaseResponse updateCertSet(@RequestBody SupCertSetEntity supCertSetEntity) { if (CollUtil.isNotEmpty(supCertSetEntity.getFlbmList())) { String flbm = supCertSetEntity.getFlbmList().stream().collect(Collectors.joining(",")); @@ -99,6 +102,7 @@ public class SupCertSetController { @AuthRuleAnnotation("") @PostMapping("/sup/cert/set/delete") + @Log(title = "资质证书", businessType = BusinessType.DELETE) public BaseResponse deleteCertSet(@RequestBody DeleteRequest deleteRequest) { boolean b = supCertSetService.deleteById(deleteRequest.getId()); diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCompanyController.java b/src/main/java/com/glxp/api/controller/purchase/SupCompanyController.java index b6584ea13..e6836e322 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCompanyController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCompanyController.java @@ -5,9 +5,11 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.extra.pinyin.PinyinUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.basic.BasicCorpEntity; @@ -65,6 +67,7 @@ public class SupCompanyController { SupCompanyService supCompanyService; + @AuthRuleAnnotation("") @GetMapping("/api/pur/getSupComapnys") public BaseResponse getSupComapnys(FilterSupCompanyRequest companyRequest) { @@ -79,14 +82,16 @@ public class SupCompanyController { @AuthRuleAnnotation("") @PostMapping("/api/pur/addCompany") + @Log(title = "资质证书", businessType = BusinessType.INSERT) public BaseResponse insertCompany(@RequestBody SupCompanyEntity companyEntity) { //判断是不是存在草稿 - if(companyEntity.getAuditStatus()==6){ - List supCertEntityList = supCertService.findAll(companyEntity.getCustomerId()); for(SupCertEntity obj:supCertEntityList){ - if(obj.getAuditStatus()==0){ - return ResultVOUtils.error(999,"证书中存在草稿不允许提交!"); + if (companyEntity.getAuditStatus() == 6) { + List supCertEntityList = supCertService.findAll(companyEntity.getCustomerId()); + for (SupCertEntity obj : supCertEntityList) { + if (obj.getAuditStatus() == 0) { + return ResultVOUtils.error(999, "证书中存在草稿不允许提交!"); } } @@ -122,18 +127,16 @@ public class SupCompanyController { } - - String customerId = CustomUtil.getId(); //重新生成customerId CustomerContactEntity customerContactEntity = new CustomerContactEntity(); customerContactEntity.setTel(companyEntity.getTel()); customerContactEntity.setMobile(companyEntity.getMobile()); customerContactEntity.setEmail(companyEntity.getEmail()); customerContactEntity.setContacts(companyEntity.getContacts()); - customerContactEntity.setCustomerId(customerId); + customerContactEntity.setCustomerId(companyEntity.getCustomerId()); customerContactService.insertCustomerContact(customerContactEntity); //更新相关证书对应的customerId - supCertService.updateCustomerId(companyEntity.getCustomerId(), customerId,ConstantStatus.AUDIT_UN); - companyEntity.setCustomerId(customerId); + supCertService.updateCustomerId(companyEntity.getCustomerId(), companyEntity.getCustomerId(), ConstantStatus.AUDIT_UN); + companyEntity.setCustomerId(companyEntity.getCustomerId()); companyEntity.setCreateTime(new Date()); companyEntity.setUpdateTime(new Date()); @@ -146,14 +149,15 @@ public class SupCompanyController { @AuthRuleAnnotation("") @PostMapping("/api/pur/modifyCompany") + @Log(title = "资质证书", businessType = BusinessType.UPDATE) public BaseResponse modifyCompany(@RequestBody SupCompanyEntity companyEntity) { if (companyEntity.getAuditStatus() == ConstantStatus.AUDIT_UN || companyEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE) { //判断是不是存在草稿 List supCertEntityList = supCertService.findAll(companyEntity.getCustomerId()); - for(SupCertEntity obj:supCertEntityList){ - if(obj.getAuditStatus()==0){ - return ResultVOUtils.error(999,"证书中存在草稿不允许提交!"); + for (SupCertEntity obj : supCertEntityList) { + if (obj.getAuditStatus() == 0) { + return ResultVOUtils.error(999, "证书中存在草稿不允许提交!"); } } @@ -204,10 +208,11 @@ public class SupCompanyController { @AuthRuleAnnotation("") @PostMapping("/api/pur/auditCompany") + @Log(title = "资质证书", businessType = BusinessType.UPDATE) public BaseResponse auditCompany(@RequestBody SupCompanyEntity companyEntity) { - if(companyEntity.getAuditStatus()==1){ + if (companyEntity.getAuditStatus() == 1) { //查询用户上传的证书 FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest(); filterSupCertRequest.setCustomerId(companyEntity.getCustomerId()); @@ -241,7 +246,7 @@ public class SupCompanyController { return ResultVOUtils.error(500, "必传证书不齐全!"); } } - + String msg = ""; //查询是否包含审核未通过的证书 if (companyEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS || companyEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS) { @@ -252,18 +257,22 @@ public class SupCompanyController { List supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest); if (CollUtil.isNotEmpty(supCertEntityList)) { for (SupCertEntity supCertEntity : supCertEntityList) { - supCertEntity.setAuditStatus(ConstantStatus.AUDIT_PASS); - supCertService.updateCompanyCert(supCertEntity); + msg += supCertEntity.getName() + ","; } -// return ResultVOUtils.error(500, "审核失败,剩余" + supCertEntityList.size() + "个证书还未审核或审核未通过!"); + return ResultVOUtils.error(500, "审核失败,还有必须提交证书未确认(" + msg.substring(0, msg.length() - 1) + ")"); } } + + AuthAdmin authAdmin = getUser(); companyEntity.setAuditor(authAdmin.getId() + ""); companyEntity.setAuditTime(new Date()); companyEntity.setUpdateTime(new Date()); + if(companyEntity.getAuditComment() == null){ + companyEntity.setAuditComment(""); + } boolean b = companyService.modifyCompany(companyEntity); CustomerContactEntity customerContactEntity = new CustomerContactEntity(); customerContactEntity.setTel(companyEntity.getTel()); @@ -283,7 +292,7 @@ public class SupCompanyController { basicCorpEntity.setMobile(companyEntity.getMobile()); basicCorpEntity.setCorpType(ConstantStatus.CORP_SP); basicCorpEntity.setUpdateTime(new Date()); - basicCorpService.insertBasicUnitMaintain(basicCorpEntity); + basicCorpService.updateByErpId(basicCorpEntity); return ResultVOUtils.success("修改成功"); } @@ -307,6 +316,7 @@ public class SupCompanyController { @AuthRuleAnnotation("") @PostMapping("api/pur/supCompany/delete") + @Log(title = "资质证书", businessType = BusinessType.DELETE) public BaseResponse deleteSupCompany(@RequestBody DeleteRequest deleteRequest) { boolean b = supCompanyService.deleteCompany(deleteRequest.getId()); if (b) @@ -316,6 +326,9 @@ public class SupCompanyController { } } + + + public String getCustomerId() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes == null) { diff --git a/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java b/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java index 78dda0076..20127a48e 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java @@ -4,9 +4,11 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.purchase.SupCertEntity; @@ -91,29 +93,30 @@ public class SupManufacturerController { @AuthRuleAnnotation("") @PostMapping("/sup/manufacturer/addCompany") + @Log(title = "资质证书", businessType = BusinessType.INSERT) public BaseResponse addCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) { //判断用户名和社会信用代码不能重复 - FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest(); + FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest(); filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName()); filterSupManufacturerRequest.setCustomerId(getCustomerId()); List companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - if(companyEntities.size()>0){ - return ResultVOUtils.error(999,"企业名称不能重复!"); + if (companyEntities.size() > 0) { + return ResultVOUtils.error(999, "企业名称不能重复!"); } - filterSupManufacturerRequest=new FilterSupManufacturerRequest(); + filterSupManufacturerRequest = new FilterSupManufacturerRequest(); filterSupManufacturerRequest.setCustomerId(getCustomerId()); filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode()); companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - if(companyEntities.size()>0){ - return ResultVOUtils.error(999,"统一社会信用代码不能重复!"); + if (companyEntities.size() > 0) { + return ResultVOUtils.error(999, "统一社会信用代码不能重复!"); } //提交审核 if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) { //判断是否上级供应商是否审核通过 SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId()); - if (supCompanyEntity.getAuditStatus() != ConstantStatus.AUDIT_PASS - ) { + if (supCompanyEntity.getAuditStatus() == null || supCompanyEntity.getAuditStatus() != ConstantStatus.AUDIT_PASS + ) { return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!"); } @@ -124,27 +127,27 @@ public class SupManufacturerController { List supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest); List supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId()); //判断存在有草稿的未提交的就不能通过 - for(SupCertEntity obj:supCertEntityList){ + for (SupCertEntity obj : supCertEntityList) { if (obj.getAuditStatus() == 0.) { - return ResultVOUtils.error(999,"资质证书存在草稿不能提交!"); + return ResultVOUtils.error(999, "资质证书存在草稿不能提交!"); } } ListIterator iterable = supCertSetEntities.listIterator(); while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 + if ((supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || ( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && supManufacturerEntity.getCompanyType().equals("1")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 3 && supManufacturerEntity.getCompanyType().equals("1"))) { for (SupCertEntity supCertEntity : supCertEntityList) { @@ -186,34 +189,36 @@ public class SupManufacturerController { @AuthRuleAnnotation("") @PostMapping("/sup/manufacturer/modifyCompany") + @Log(title = "资质证书", businessType = BusinessType.UPDATE) public BaseResponse modifyCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) { if (StrUtil.isEmpty(supManufacturerEntity.getManufacturerId()) || StrUtil.isEmpty(supManufacturerEntity.getCustomerId())) { return ResultVOUtils.error(500, "参数错误!"); } - - //判断用户名和社会信用代码不能重复 - FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest(); - filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName()); - filterSupManufacturerRequest.setCustomerId(getCustomerId()); - List companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - if(companyEntities.size()>0){ - return ResultVOUtils.error(999,"企业名称不能重复!"); - } - filterSupManufacturerRequest=new FilterSupManufacturerRequest(); - filterSupManufacturerRequest.setCustomerId(getCustomerId()); - filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode()); - companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - if(companyEntities.size()>0){ - return ResultVOUtils.error(999,"统一社会信用代码不能重复!"); + if (supManufacturerEntity.getId() == 0) {//新增 + //判断用户名和社会信用代码不能重复 + FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest(); + filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName()); + filterSupManufacturerRequest.setCustomerId(getCustomerId()); + List companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); + if (companyEntities.size() > 0) { + return ResultVOUtils.error(999, "企业名称不能重复!"); + } + filterSupManufacturerRequest = new FilterSupManufacturerRequest(); + filterSupManufacturerRequest.setCustomerId(getCustomerId()); + filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode()); + companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); + if (companyEntities.size() > 0) { + return ResultVOUtils.error(999, "统一社会信用代码不能重复!"); + } } //提交审核 if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) { //判断是否上级供应商是否审核通过 SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId()); - if (supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_UN - || supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT) { + if (supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_UN || supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_REJECT + || supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT || supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_REJECT) { return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!"); } @@ -224,27 +229,27 @@ public class SupManufacturerController { List supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest); List supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId()); //判断存在有草稿的未提交的就不能通过 - for(SupCertEntity obj:supCertEntityList){ + for (SupCertEntity obj : supCertEntityList) { if (obj.getAuditStatus() == 0.) { - return ResultVOUtils.error(999,"资质证书存在草稿不能提交!"); + return ResultVOUtils.error(999, "资质证书存在草稿不能提交!"); } } ListIterator iterable = supCertSetEntities.listIterator(); while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 + if ((supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || ( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && supManufacturerEntity.getCompanyType().equals("1")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 3 && supManufacturerEntity.getCompanyType().equals("1"))) { for (SupCertEntity supCertEntity : supCertEntityList) { @@ -290,6 +295,7 @@ public class SupManufacturerController { @AuthRuleAnnotation("") @PostMapping("/udiwms/sup/manufacturer/audit") + @Log(title = "资质证书", businessType = BusinessType.UPDATE) public BaseResponse auditMmanufacturer(@RequestBody SupManufacturerEntity supManufacturerEntity) { if (StrUtil.isEmpty(supManufacturerEntity.getManufacturerId()) || StrUtil.isEmpty(supManufacturerEntity.getCustomerId())) { @@ -297,8 +303,7 @@ public class SupManufacturerController { } - - if(supManufacturerEntity.getAuditStatus()==1 || supManufacturerEntity.getAuditStatus()==4){ + if (supManufacturerEntity.getAuditStatus() == 1 || supManufacturerEntity.getAuditStatus() == 4) { //查询上传的资质证书 FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest(); filterSupCertRequest.setCustomerId(supManufacturerEntity.getCustomerId()); @@ -314,18 +319,18 @@ public class SupManufacturerController { while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 + if ((supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || ( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && supManufacturerEntity.getCompanyType().equals("1")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 3 && supManufacturerEntity.getCompanyType().equals("1"))) { for (SupCertEntity supCertEntity : supCertEntityList) { @@ -347,7 +352,7 @@ public class SupManufacturerController { } } - + String msg = ""; // 查询是否包含审核未通过的证书 if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS) { @@ -359,10 +364,9 @@ public class SupManufacturerController { List supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest); if (CollUtil.isNotEmpty(supCertEntityList)) { for (SupCertEntity supCertEntity : supCertEntityList) { - supCertEntity.setAuditStatus(ConstantStatus.AUDIT_PASS); - supCertService.updateCompanyCert(supCertEntity); + msg += supCertEntity.getName() + ","; } -// return ResultVOUtils.error(500, "审核失败,剩余" + supCertEntityList.size() + "个证书还未审核或审核未通过!"); + return ResultVOUtils.error(500, "审核失败,还有必须提交证书未确认(" + msg.substring(0, msg.length() - 1) + ")"); } } @@ -382,6 +386,7 @@ public class SupManufacturerController { @AuthRuleAnnotation("") @GetMapping("/sup/manufacturer/basic/delete") + @Log(title = "资质证书", businessType = BusinessType.DELETE) public BaseResponse deleteContact(DeleteRequest deleteRequest) { boolean b = supManufacturerService.deleteById(deleteRequest.getId()); if (b) 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 e5588a4d6..be7e3525d 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java @@ -3,13 +3,15 @@ package com.glxp.api.controller.purchase; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; - import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.basic.UdiRelevanceEntity; import com.glxp.api.entity.purchase.SupCertEntity; import com.glxp.api.entity.purchase.SupCertSetEntity; import com.glxp.api.entity.purchase.SupManufacturerEntity; @@ -29,9 +31,6 @@ import com.glxp.api.service.purchase.SupCertService; import com.glxp.api.service.purchase.SupCertSetService; import com.glxp.api.service.purchase.SupManufacturerService; import com.glxp.api.service.purchase.SupProductService; -import com.glxp.api.service.thrsys.ThrProductsService; -import com.glxp.api.service.thrsys.ThrSystemService; -import com.glxp.api.util.GennerOrderUtils; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -84,6 +83,7 @@ public class SupProductController { @AuthRuleAnnotation("") @PostMapping("/sup/product/addRegistration") + @Log(title = "资质证书", businessType = BusinessType.INSERT) public BaseResponse addRegistration(@RequestBody SupProductEntity supProductEntity) { //提交审核 @@ -105,14 +105,14 @@ public class SupProductController { ListIterator iterable = supCertSetEntities.listIterator(); while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (supCertSetEntity.getImports()!=null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部") + if (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部") || StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部") || (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2 && StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进")) || (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 3 && !StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进")) || (StrUtil.trimToEmpty(supProductEntity.getProductType()).equals(supCertSetEntity.getCplx())) || (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb())) - || StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) &&(supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode()))) + || StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) && (supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode()))) ) { for (SupCertEntity supCertEntity : supCertEntityList) { if (supCertEntity.getName().equals(supCertSetEntity.getName())) { @@ -149,25 +149,30 @@ public class SupProductController { @PostMapping("/sup/product/selectBind") public BaseResponse selectBind(@RequestBody SelectProductBindRequest selectProductBindRequest) { + UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectUdiId(Long.valueOf(selectProductBindRequest.getRelIdFk())); + SupProductEntity supProductEntity = supProductService.findByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory(),selectProductBindRequest.getManufacturerId()); + if (supProductEntity != null) { + 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()); + } - UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(Long.valueOf(selectProductBindRequest.getRelIdFk())); - - SupProductEntity supProductEntity = new SupProductEntity(); - BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity); - supProductEntity.setProductId(selectProductBindRequest.getProductId()); - supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh()); - supProductEntity.setRelIdFk(selectProductBindRequest.getRelIdFk()); - 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.setAuditStatus(selectProductBindRequest.getAuditStatus()); return ResultVOUtils.success(supProductEntity); // boolean b = supProductService.insertRegistration(supProductEntity); @@ -181,19 +186,23 @@ public class SupProductController { @AuthRuleAnnotation("") @PostMapping("/sup/product/modifyRegistration") + @Log(title = "资质证书", businessType = BusinessType.UPDATE) public BaseResponse modifyRegistration(@RequestBody SupProductEntity supProductEntity) { if (StrUtil.isEmpty(supProductEntity.getProductId()) || StrUtil.isEmpty(supProductEntity.getManufacturerIdFk()) || StrUtil.isEmpty(supProductEntity.getCustomerId())) { return ResultVOUtils.error(500, "参数错误!"); } - //判断是不是存在草稿 - List supCertEntityList1 = supCertService.findAll(supProductEntity.getCustomerId(), supProductEntity.getManufacturerIdFk(), supProductEntity.getProductId()); - for(SupCertEntity obj:supCertEntityList1){ - if(obj.getAuditStatus()==0){ - return ResultVOUtils.error(999,"证书中存在草稿不允许提交!"); - } - } + //提交审核 + if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) { + + //判断是不是存在草稿 + List supCertEntityList1 = supCertService.findAll(supProductEntity.getCustomerId(), supProductEntity.getManufacturerIdFk(), supProductEntity.getProductId()); + for (SupCertEntity obj : supCertEntityList1) { + if (obj.getAuditStatus() == 0) { + return ResultVOUtils.error(999, "证书中存在草稿不允许提交!"); + } + } //判断是否上级供应商是否审核通过 @@ -212,14 +221,14 @@ public class SupProductController { while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (supCertSetEntity.getImports()!=null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部") + if (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部") || StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部") || (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2 && StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进")) || (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 3 && !StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进")) || (StrUtil.trimToEmpty(supProductEntity.getProductType()).equals(supCertSetEntity.getCplx())) || (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb())) - || StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) &&(supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode()))) + || StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) && (supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode()))) ) { for (SupCertEntity supCertEntity : supCertEntityList) { if (supCertEntity.getName().equals(supCertSetEntity.getName())) { @@ -241,7 +250,7 @@ public class SupProductController { return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!"); } - + } supProductEntity.setUpdateTime(new Date()); SupProductResponse originEntity = supProductService.findByProductId(supProductEntity.getProductId()); supCertService.updateProductId(originEntity.getCustomerId(), supProductEntity.getCustomerId(), originEntity.getManufacturerIdFk(), @@ -262,7 +271,7 @@ public class SupProductController { if (supProductEntity.getAuditStatus() == null) { return ResultVOUtils.error(500, "参数错误!"); } - if(supProductEntity.getAuditStatus()==1){ + if (supProductEntity.getAuditStatus() == 1) { //查询用户上传的证书 FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest(); filterSupCertRequest.setCustomerId(supProductEntity.getCustomerId()); @@ -280,14 +289,14 @@ public class SupProductController { while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (supCertSetEntity.getImports()!=null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部") + if (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部") || StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部") || (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2 && StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进")) || (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 3 && !StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进")) || (StrUtil.trimToEmpty(supProductEntity.getProductType()).equals(supCertSetEntity.getCplx())) || (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb())) - || StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) &&(supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode()))) + || StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) && (supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode()))) ) { for (SupCertEntity supCertEntity : supCertEntityList) { if (supCertEntity.getName().equals(supCertSetEntity.getName())) { @@ -309,7 +318,7 @@ public class SupProductController { return ResultVOUtils.error(500, "必传证书不齐全"); } } - + String msg = ""; // 查询是否包含审核未通过的证书 if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS || supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS) { @@ -322,17 +331,23 @@ public class SupProductController { List supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest); if (CollUtil.isNotEmpty(supCertEntityList)) { for (SupCertEntity supCertEntity : supCertEntityList) { - supCertEntity.setAuditStatus(ConstantStatus.AUDIT_PASS); - supCertService.updateCompanyCert(supCertEntity); + msg += supCertEntity.getName() + ","; } - -// return ResultVOUtils.error(500, "审核失败,剩余" + supCertEntityList.size() + "个证书还未审核或审核未通过!"); + return ResultVOUtils.error(500, "审核失败,还有必须提交证书未确认(" + msg.substring(0, msg.length() - 1) + ")"); } } supProductEntity.setUpdateTime(new Date()); boolean b = supProductService.modifyRegistration(supProductEntity); + if (StrUtil.isNotEmpty(supProductEntity.getRelIdFk())) { + UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(Long.parseLong(supProductEntity.getRelIdFk())); + if (udiRelevanceEntity != null) { + udiRelevanceEntity.setDispatch(true); + udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); + } + + } // if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS) { // SupProductResponse supProductResponse = supProductService.findJoinRegistration(supProductEntity.getId()); @@ -414,6 +429,7 @@ public class SupProductController { @AuthRuleAnnotation("") @GetMapping("/sup/product/delete") + @Log(title = "资质证书", businessType = BusinessType.DELETE) public BaseResponse delete(DeleteCompanyFileRequest deleteCompanyFileRequest) { boolean b = supProductService.deleteById(deleteCompanyFileRequest.getId()); if (b) diff --git a/src/main/java/com/glxp/api/dao/basic/BasicCorpDao.java b/src/main/java/com/glxp/api/dao/basic/BasicCorpDao.java index 879d5438f..0f9d411f7 100644 --- a/src/main/java/com/glxp/api/dao/basic/BasicCorpDao.java +++ b/src/main/java/com/glxp/api/dao/basic/BasicCorpDao.java @@ -63,4 +63,6 @@ public interface BasicCorpDao extends BaseMapperPlus getCorpList(); } diff --git a/src/main/java/com/glxp/api/dao/basic/UdiRelevanceDao.java b/src/main/java/com/glxp/api/dao/basic/UdiRelevanceDao.java index 576270101..27db8099d 100644 --- a/src/main/java/com/glxp/api/dao/basic/UdiRelevanceDao.java +++ b/src/main/java/com/glxp/api/dao/basic/UdiRelevanceDao.java @@ -19,6 +19,7 @@ public interface UdiRelevanceDao extends BaseMapperPlus filterCertUdi(FilterUdiRelRequest filterUdiRelRequest); + List filterCertUdi(FilterUdiRelRequest filterUdiRelRequest); List filterUdiGp(FilterUdiRelRequest filterUdiRelRequest); diff --git a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateRelevanceDao.java b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateRelevanceDao.java index 1f7c16a46..d2ba6779e 100644 --- a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateRelevanceDao.java +++ b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateRelevanceDao.java @@ -1,5 +1,6 @@ package com.glxp.api.dao.system; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity; import com.glxp.api.req.system.FilterPdfTemplateRelevanceRequest; import com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse; @@ -60,4 +61,6 @@ public interface SystemPDFTemplateRelevanceDao { boolean udpateRl(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity); SystemPDFTemplateRelevanceEntity selectModuleldAndAction(@Param("moduleId") Integer moduleId,@Param("localAction") String localAction); + + SysPdfTemplateRelevanceStatemenEntity selectByStatemenId(String id); } diff --git a/src/main/java/com/glxp/api/entity/purchase/SupManufacturerEntity.java b/src/main/java/com/glxp/api/entity/purchase/SupManufacturerEntity.java index 04511a341..176efe79e 100644 --- a/src/main/java/com/glxp/api/entity/purchase/SupManufacturerEntity.java +++ b/src/main/java/com/glxp/api/entity/purchase/SupManufacturerEntity.java @@ -199,5 +199,7 @@ public class SupManufacturerEntity{ private String failCout; @TableField(exist = false) private String passCout; + @TableField("agentName") + private String agentName; } diff --git a/src/main/java/com/glxp/api/req/purchase/FilterImageRequest.java b/src/main/java/com/glxp/api/req/purchase/FilterImageRequest.java new file mode 100644 index 000000000..10caa21a2 --- /dev/null +++ b/src/main/java/com/glxp/api/req/purchase/FilterImageRequest.java @@ -0,0 +1,12 @@ +package com.glxp.api.req.purchase; + + +import lombok.Data; + +@Data +public class FilterImageRequest { + + private String imageUrl; + private String certFileUrl; + +} diff --git a/src/main/java/com/glxp/api/req/purchase/FilterPoductRequest.java b/src/main/java/com/glxp/api/req/purchase/FilterPoductRequest.java index bffdef85a..57fc3a7fa 100644 --- a/src/main/java/com/glxp/api/req/purchase/FilterPoductRequest.java +++ b/src/main/java/com/glxp/api/req/purchase/FilterPoductRequest.java @@ -19,4 +19,5 @@ public class FilterPoductRequest extends ListPageRequest { private String customerId; private Integer auditStatus; private String lastUpdateTime; + private String relIdFk; } diff --git a/src/main/java/com/glxp/api/service/basic/BasicCorpService.java b/src/main/java/com/glxp/api/service/basic/BasicCorpService.java index d93396b76..e96da293a 100644 --- a/src/main/java/com/glxp/api/service/basic/BasicCorpService.java +++ b/src/main/java/com/glxp/api/service/basic/BasicCorpService.java @@ -16,6 +16,8 @@ public interface BasicCorpService { boolean updateById(BasicCorpEntity basicCorpEntity); + boolean updateByErpId(BasicCorpEntity basicCorpEntity); + boolean insert(BasicCorpEntity basicUnitMaintainEntity); // boolean updateById(BasicUnitMaintainSaveRequest basicUnitMaintainSaveRequest); @@ -48,4 +50,7 @@ public interface BasicCorpService { * @return */ boolean verifyExists(BasicCorpEntity basicCorpEntity); + + List getCorpList(); + } diff --git a/src/main/java/com/glxp/api/service/basic/UdiRelevanceService.java b/src/main/java/com/glxp/api/service/basic/UdiRelevanceService.java index b89b809b4..0db9b7b55 100644 --- a/src/main/java/com/glxp/api/service/basic/UdiRelevanceService.java +++ b/src/main/java/com/glxp/api/service/basic/UdiRelevanceService.java @@ -91,6 +91,8 @@ public interface UdiRelevanceService extends IService { */ String findUuidById(String relId); + UdiRelevanceResponse selectUdiId(Long id); + List selectGroupByNameCode(String nameCode, Boolean isDisable); diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicCorpServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicCorpServiceImpl.java index f9a60e5eb..87accbbce 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicCorpServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicCorpServiceImpl.java @@ -1,6 +1,7 @@ package com.glxp.api.service.basic.impl; import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.basic.BasicCorpDao; import com.glxp.api.entity.basic.BasicCorpEntity; @@ -58,6 +59,14 @@ public class BasicCorpServiceImpl implements BasicCorpService { return basicCorpDao.customUpdateById(basicUnitMaintainSaveRequest)>0?true:false; } + @Override + public boolean updateByErpId(BasicCorpEntity basicCorpEntity) { + basicCorpEntity.setUpdateTime(new Date()); + QueryWrapper ew=new QueryWrapper<>(); + ew.eq("erpId",basicCorpEntity.getErpId()); + return basicCorpDao.update(basicCorpEntity,ew)>0?true:false; + } + @Override public boolean deleteById(String id) { return basicCorpDao.deleteById(id); @@ -114,6 +123,11 @@ public class BasicCorpServiceImpl implements BasicCorpService { return false; } + @Override + public List getCorpList() { + return basicCorpDao.getCorpList(); + } + @Override public BasicCorpEntity selectById(String id) { return basicCorpDao.selectById(id); diff --git a/src/main/java/com/glxp/api/service/basic/impl/UdiRelevanceServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/UdiRelevanceServiceImpl.java index 6f571bf09..6fe156188 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/UdiRelevanceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/UdiRelevanceServiceImpl.java @@ -400,4 +400,30 @@ public class UdiRelevanceServiceImpl extends ServiceImpl data = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest); + if (data != null && data.size() > 0) + return data.get(0); + return null; + } + + @Override + public List filterCertUdi(FilterUdiRelRequest filterUdiRelRequest) { + + + if (filterUdiRelRequest == null) { + return Collections.emptyList(); + } + if (filterUdiRelRequest.getPage() != null) { + int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(); + PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit()); + } + List data = udiRelevanceDao.filterCertUdi(filterUdiRelRequest); + return data; + + } } diff --git a/src/main/java/com/glxp/api/service/purchase/SupCertService.java b/src/main/java/com/glxp/api/service/purchase/SupCertService.java index c6d1f9378..ec2c80ce5 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupCertService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupCertService.java @@ -3,13 +3,14 @@ package com.glxp.api.service.purchase; +import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.purchase.SupCertEntity; import com.glxp.api.req.purchase.FilterSupCertRequest; import com.glxp.api.req.purchase.purPlanPrintRequest; import java.util.List; -public interface SupCertService { +public interface SupCertService extends IService { List filterCompanyCert(FilterSupCertRequest filterSupCertRequest); @@ -21,6 +22,8 @@ public interface SupCertService { List findAll(String customerId, String manufacturerId, String productId); + List selectCompanyCert(FilterSupCertRequest filterSupCertRequest); + List getCompanyCert(FilterSupCertRequest filterSupCertRequest); diff --git a/src/main/java/com/glxp/api/service/purchase/SupCertSetService.java b/src/main/java/com/glxp/api/service/purchase/SupCertSetService.java index 30d345d3f..b25a1ca84 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupCertSetService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupCertSetService.java @@ -1,14 +1,13 @@ package com.glxp.api.service.purchase; - - +import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.purchase.SupCertSetEntity; import com.glxp.api.req.purchase.FilterCertSetsRequest; import java.util.List; -public interface SupCertSetService { +public interface SupCertSetService extends IService { List filterCertSets(FilterCertSetsRequest filterCertSetsRequest); diff --git a/src/main/java/com/glxp/api/service/purchase/SupCompanyService.java b/src/main/java/com/glxp/api/service/purchase/SupCompanyService.java index 7f5ba1f5d..a71f11f17 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupCompanyService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupCompanyService.java @@ -2,12 +2,13 @@ package com.glxp.api.service.purchase; +import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.purchase.SupCompanyEntity; import com.glxp.api.req.purchase.FilterSupCompanyRequest; import java.util.List; -public interface SupCompanyService { +public interface SupCompanyService extends IService { SupCompanyEntity findCompanyByUnitFk(String unitFk); diff --git a/src/main/java/com/glxp/api/service/purchase/SupManufacturerService.java b/src/main/java/com/glxp/api/service/purchase/SupManufacturerService.java index e868eb176..92565da47 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupManufacturerService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupManufacturerService.java @@ -1,14 +1,13 @@ package com.glxp.api.service.purchase; - - +import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.purchase.SupManufacturerEntity; import com.glxp.api.req.purchase.FilterSupManufacturerRequest; import java.util.List; -public interface SupManufacturerService { +public interface SupManufacturerService extends IService { SupManufacturerEntity findCompany(Long id); 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 461e5a72c..d27a20df5 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupProductService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupProductService.java @@ -1,6 +1,7 @@ package com.glxp.api.service.purchase; +import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.purchase.SupProductEntity; import com.glxp.api.req.purchase.FilterPoductRequest; import com.glxp.api.res.purchase.SupProductResponse; @@ -8,12 +9,17 @@ import org.apache.ibatis.annotations.Param; import java.util.List; -public interface SupProductService { +public interface SupProductService extends IService { SupProductEntity findRegistration(Long id); SupProductResponse findByProductId(String productId); + SupProductEntity findByRelIdFk(String relIdFk); + + + SupProductEntity findByManufactury(String cpmctymc, String manufactory,String manufacturerIdFk); + SupProductResponse findByPassByReCert(String registerCert); SupProductResponse findJoinRegistration(Long id); @@ -31,4 +37,4 @@ public interface SupProductService { boolean deleteById(@Param("id") String id); boolean deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId); -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java index 8eed10568..c11da8077 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java @@ -1,6 +1,7 @@ package com.glxp.api.service.purchase.impl; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.dao.purchase.SupCertDao; @@ -17,7 +18,7 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class SupCertServiceImpl implements SupCertService { +public class SupCertServiceImpl extends ServiceImpl implements SupCertService { @Resource SupCertDao supCertDao; @@ -34,6 +35,20 @@ public class SupCertServiceImpl implements SupCertService { return supCertDao.filterCompanyCert(filterSupCertRequest); } + @Override + public List selectCompanyCert(FilterSupCertRequest filterSupCertRequest) { + if (filterSupCertRequest == null) { + return Collections.emptyList(); + } + if (filterSupCertRequest.getPage() != null) { + int offset = (filterSupCertRequest.getPage() - 1) * filterSupCertRequest.getLimit(); + PageHelper.offsetPage(offset, filterSupCertRequest.getLimit()); + } + + List companyEntities = supCertDao.getCompanyCert(filterSupCertRequest); + return companyEntities; + } + @Override public List getCompanyCert(FilterSupCertRequest filterSupCertRequest) { @@ -97,8 +112,8 @@ public class SupCertServiceImpl implements SupCertService { } @Override - public boolean updateCustomerId(String oldId, String newId,Integer auditStatus) { - return supCertDao.updateCustomerId(oldId, newId,auditStatus); + public boolean updateCustomerId(String oldId, String newId, Integer auditStatus) { + return supCertDao.updateCustomerId(oldId, newId, auditStatus); } @Override diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupCertSetServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupCertSetServiceImpl.java index 64e460b5f..ce8be5769 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupCertSetServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupCertSetServiceImpl.java @@ -1,5 +1,6 @@ package com.glxp.api.service.purchase.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.purchase.SupCertSetDao; import com.glxp.api.entity.purchase.SupCertSetEntity; @@ -14,7 +15,7 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class SupCertSetServiceImpl implements SupCertSetService { +public class SupCertSetServiceImpl extends ServiceImpl implements SupCertSetService { @Resource SupCertSetDao supCertSetDao; diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java index a53f54bbc..d9554d6b1 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java @@ -1,5 +1,6 @@ package com.glxp.api.service.purchase.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.purchase.SupCompanyDao; import com.glxp.api.entity.purchase.SupCompanyEntity; @@ -14,7 +15,7 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class SupCompanyServiceImpl implements SupCompanyService { +public class SupCompanyServiceImpl extends ServiceImpl implements SupCompanyService { @Resource SupCompanyDao supCompanyDao; diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupManufacturerServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupManufacturerServiceImpl.java index cd7d5dc15..d75d7b3c9 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupManufacturerServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupManufacturerServiceImpl.java @@ -2,6 +2,7 @@ package com.glxp.api.service.purchase.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.purchase.SupManufacturerDao; import com.glxp.api.entity.purchase.SupManufacturerEntity; @@ -16,7 +17,7 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class SupManufacturerServiceImpl implements SupManufacturerService { +public class SupManufacturerServiceImpl extends ServiceImpl implements SupManufacturerService { @Resource SupManufacturerDao supManufacturerDao; 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 a8f4ec69c..8188e72d3 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 @@ -2,6 +2,8 @@ package com.glxp.api.service.purchase.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.dao.purchase.SupProductDao; @@ -18,7 +20,7 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class SupProductServiceImpl implements SupProductService { +public class SupProductServiceImpl extends ServiceImpl implements SupProductService { @Resource SupProductDao supProductDao; @@ -69,6 +71,37 @@ public class SupProductServiceImpl implements SupProductService { return null; } + @Override + public SupProductEntity findByRelIdFk(String relIdFk) { + + List supProductEntities = supProductDao.selectList(new QueryWrapper().eq("relIdFk", relIdFk) + .and(tmp -> tmp.eq("auditStatus", ConstantStatus.AUDIT_PASS).or().eq("auditStatus", ConstantStatus.AUDIT_PASS)) + .last("LIMIT 1")); + if (CollUtil.isNotEmpty(supProductEntities)) + return supProductEntities.get(0); + else return null; + } + + @Override + 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; + } + @Override public SupProductEntity findRegistrationByName(String recordProductName) { return supProductDao.findRegistrationByName(recordProductName); diff --git a/src/main/java/com/glxp/api/service/system/SystemPDFModuleService.java b/src/main/java/com/glxp/api/service/system/SystemPDFModuleService.java index cfcdf4a9f..70c2a92d0 100644 --- a/src/main/java/com/glxp/api/service/system/SystemPDFModuleService.java +++ b/src/main/java/com/glxp/api/service/system/SystemPDFModuleService.java @@ -1,6 +1,7 @@ package com.glxp.api.service.system; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFModuleEntity; import com.glxp.api.req.system.FilterPdfModuleRequest; import com.glxp.api.req.system.SysPdfModuleSaveRequest; @@ -26,4 +27,6 @@ public interface SystemPDFModuleService { boolean deleteById(Integer id); List findByLastTime(Date lastUpdateTime); + + SysPdfTemplateRelevanceStatemenEntity selectByStatemenId(String id); } diff --git a/src/main/java/com/glxp/api/service/system/impl/SystemPDFModuleServiceImpl.java b/src/main/java/com/glxp/api/service/system/impl/SystemPDFModuleServiceImpl.java index a9734e635..8e678373a 100644 --- a/src/main/java/com/glxp/api/service/system/impl/SystemPDFModuleServiceImpl.java +++ b/src/main/java/com/glxp/api/service/system/impl/SystemPDFModuleServiceImpl.java @@ -2,6 +2,8 @@ package com.glxp.api.service.system.impl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.system.SystemPDFModuleDao; +import com.glxp.api.dao.system.SystemPDFTemplateRelevanceDao; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFModuleEntity; import com.glxp.api.req.system.FilterPdfModuleRequest; import com.glxp.api.req.system.SysPdfModuleSaveRequest; @@ -19,6 +21,9 @@ public class SystemPDFModuleServiceImpl implements SystemPDFModuleService { @Resource SystemPDFModuleDao systemPDFModuleDao; + @Resource + SystemPDFTemplateRelevanceDao systemPDFTemplateRelevanceDao; + @Override public List queryPage(FilterPdfModuleRequest FilterPDFModuleRequest) { int offset = (FilterPDFModuleRequest.getPage() - 1) * FilterPDFModuleRequest.getLimit(); @@ -67,4 +72,9 @@ public class SystemPDFModuleServiceImpl implements SystemPDFModuleService { public List findByLastTime(Date lastUpdateTime) { return systemPDFModuleDao.selectByLastTime(lastUpdateTime); } + + @Override + public SysPdfTemplateRelevanceStatemenEntity selectByStatemenId(String id) { + return systemPDFTemplateRelevanceDao.selectByStatemenId(id); + } } diff --git a/src/main/resources/mybatis/mapper/basic/BasicCorpDao.xml b/src/main/resources/mybatis/mapper/basic/BasicCorpDao.xml index 9dcb7e49a..e8e61b424 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicCorpDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicCorpDao.xml @@ -312,4 +312,15 @@ + + + diff --git a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index b7caca542..dc5520f12 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -1248,4 +1248,174 @@ limit 1 + + + diff --git a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml index b7eb1c4fe..3c09c06da 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml @@ -36,6 +36,20 @@ ORDER BY id DESC + + @@ -170,4 +189,4 @@ ORDER BY id DESC - \ No newline at end of file + diff --git a/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml index 093b93fe8..109e69d1a 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml @@ -15,10 +15,10 @@ - select companyName from sup_company where customerId = #{customerId} - - \ No newline at end of file + + diff --git a/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml b/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml index 513170d97..b04df4abd 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml @@ -99,6 +99,7 @@ manufacturerId=#{manufacturerId}, auditStatus=#{auditStatus}, auditComment=#{auditComment}, + agentName=#{agentName}, @@ -114,7 +115,7 @@ registerStatus, productionLicenceNum, productionLicenceDate, productionRecordNum, productionRecordSection, productionRecordDate, remark, createTime, updateTime, customerId, manufacturerId, - auditStatus, auditComment) + auditStatus, auditComment,agentName) values (#{companyName}, #{creditCode}, #{companyType}, #{placeArea}, #{placeAreaCode}, #{placeAddress}, #{legalPersonName}, #{legalPersonPapersType}, #{legalPersonPapersCode}, @@ -122,7 +123,7 @@ #{registerStatus}, #{productionLicenceNum}, #{productionLicenceDate}, #{productionRecordNum}, #{productionRecordSection}, #{productionRecordDate}, #{remark}, #{createTime}, #{updateTime}, #{customerId}, #{manufacturerId}, #{auditStatus}, - #{auditComment}) + #{auditComment},#{agentName}) @@ -157,7 +158,4 @@ - \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml b/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml index c32ac8ba7..8fe545e1c 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml @@ -2,7 +2,6 @@ - - SELECT sup_product.* FROM sup_product + SELECT sup_product.* + FROM sup_product and sup_product.id = #{id} @@ -30,14 +30,21 @@ and sup_product.enterpriseId = #{enterpriseId} + + and sup_product.relIdFk = #{relIdFk} + + + and sup_product.manufactory = #{manufactory} + + - and sup_product.recordCode like concat('%',#{recordCode},'%') + and sup_product.recordCode like concat('%', #{recordCode}, '%') - and sup_product.recordProductName like concat('%',#{recordProductName},'%') + and sup_product.recordProductName like concat('%', #{recordProductName}, '%') - and sup_product.recordPeopleName like concat('%',#{recordPeopleName},'%') + and sup_product.recordPeopleName like concat('%', #{recordPeopleName}, '%') and sup_product.manufacturerIdFk = #{manufacturerIdFk} @@ -45,24 +52,24 @@ and sup_product.customerId = #{customerId} - + and sup_product.auditStatus = #{auditStatus} - - and sup_product.manufactory = #{manufactory} - - - and (sup_product.auditStatus = 0 or sup_product.auditStatus=5 or - sup_product.auditStatus=2) + + and (sup_product.auditStatus = 0 or sup_product.auditStatus = 5 or + sup_product.auditStatus = 2) - - and 0 ]]> + + and 0 + ]]> - - and (sup_product.auditStatus = 1 or sup_product.auditStatus=4 ) + + and (sup_product.auditStatus = 1 or sup_product.auditStatus = 4) - - = DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> + + = DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') + ]]> @@ -70,19 +77,68 @@ - UPDATE sup_product - enterpriseId=#{enterpriseId}, - recordCode=#{recordCode}, - recordProductName=#{recordProductName}, - productManageType=#{productManageType}, - recordPeopleName=#{recordPeopleName}, - recordPeopleArea=#{recordPeopleArea}, - recordPeopleAreaCode=#{recordPeopleAreaCode}, - recordPeopleAddress=#{recordPeopleAddress}, - productType=#{productType}, - productDirectoryCode=#{productDirectoryCode}, - agentName=#{agentName}, - agentArea=#{agentArea}, - agentAreaCode=#{agentAreaCode}, - agentAddress=#{agentAddress}, - instructions=#{instructions}, - productAddress=#{productAddress}, - recordText=#{recordText}, - placeOrigin=#{placeOrigin}, - productionRegion=#{productionRegion}, - productionCompanyName=#{productionCompanyName}, - afterSale=#{afterSale}, - specification=#{specification}, - structure=#{structure}, - scope=#{scope}, - other=#{other}, - filePath=#{filePath}, - remark=#{remark}, - createTime=#{createTime}, - updateTime=#{updateTime}, - manufacturerIdFk=#{manufacturerIdFk}, - customerId=#{customerId}, - productId=#{productId}, - auditStatus=#{auditStatus}, - auditComment=#{auditComment}, - sptm=#{sptm}, - ybbm=#{ybbm}, - measname=#{measname}, - cpms=#{cpms}, - hchzsb=#{hchzsb}, - relIdFk=#{relIdFk}, - manufactory=#{manufactory}, - allowNoBatch=#{allowNoBatch}, - allowNoExpire=#{allowNoExpire}, - allowNoProduct=#{allowNoProduct}, - allowNoSerial=#{allowNoSerial}, - + + enterpriseId=#{enterpriseId}, + + + recordCode=#{recordCode}, + + + recordProductName=#{recordProductName}, + + + productManageType=#{productManageType}, + + + recordPeopleName=#{recordPeopleName}, + + + recordPeopleArea=#{recordPeopleArea}, + + + recordPeopleAreaCode=#{recordPeopleAreaCode}, + + + recordPeopleAddress=#{recordPeopleAddress}, + + + productType=#{productType}, + + + productDirectoryCode=#{productDirectoryCode}, + + + agentName=#{agentName}, + + + agentArea=#{agentArea}, + + + agentAreaCode=#{agentAreaCode}, + + + agentAddress=#{agentAddress}, + + + instructions=#{instructions}, + + + productAddress=#{productAddress}, + + + recordText=#{recordText}, + + + placeOrigin=#{placeOrigin}, + + + productionRegion=#{productionRegion}, + + + productionCompanyName=#{productionCompanyName}, + + + afterSale=#{afterSale}, + + + specification=#{specification}, + + + structure=#{structure}, + + + scope=#{scope}, + + + other=#{other}, + + + filePath=#{filePath}, + + + remark=#{remark}, + + + createTime=#{createTime}, + + + updateTime=#{updateTime}, + + + manufacturerIdFk=#{manufacturerIdFk}, + + + customerId=#{customerId}, + + + productId=#{productId}, + + + auditStatus=#{auditStatus}, + + + auditComment=#{auditComment}, + + + sptm=#{sptm}, + + + ybbm=#{ybbm}, + + + measname=#{measname}, + + + hchzsb=#{hchzsb}, + + + relIdFk=#{relIdFk}, + + + manufactory=#{manufactory}, + + + allowNoBatch=#{allowNoBatch}, + + + allowNoExpire=#{allowNoExpire}, + + + allowNoProduct=#{allowNoProduct}, + + + allowNoSerial=#{allowNoSerial}, + - WHERE id=#{id} - + WHERE id = #{id} replace - INTO sup_product(enterpriseId, recordCode, recordProductName, - productManageType, recordPeopleName, recordPeopleArea, - recordPeopleAreaCode, recordPeopleAddress, productType, - productDirectoryCode, agentName, agentArea, - agentAreaCode, agentAddress, instructions, - productAddress, recordText, placeOrigin, - productionRegion, productionCompanyName, afterSale, - specification, structure, `scope`, - other, filePath, remark, - createTime, updateTime, manufacturerIdFk, customerId, productId - , auditStatus, auditComment, sptm, ybbm, measname, cpms, hchzsb,relIdFk,manufactory, allowNoBatch, + INTO sup_product(enterpriseId, recordCode, recordProductName, + productManageType, recordPeopleName, recordPeopleArea, + recordPeopleAreaCode, recordPeopleAddress, productType, + productDirectoryCode, agentName, agentArea, + agentAreaCode, agentAddress, instructions, + productAddress, recordText, placeOrigin, + productionRegion, productionCompanyName, afterSale, + specification, structure, `scope`, + other, filePath, remark, + createTime, updateTime, manufacturerIdFk, customerId, productId + , auditStatus, auditComment, sptm, ybbm, measname, hchzsb, relIdFk, manufactory, allowNoBatch, allowNoExpire, allowNoProduct, allowNoSerial) - values ( - #{enterpriseId}, - #{recordCode}, - #{recordProductName}, - #{productManageType}, - #{recordPeopleName}, - #{recordPeopleArea}, - #{recordPeopleAreaCode}, - #{recordPeopleAddress}, - #{productType}, - #{productDirectoryCode}, - #{agentName}, - #{agentArea}, - #{agentAreaCode}, - #{agentAddress}, - #{instructions}, - #{productAddress}, - #{recordText}, - #{placeOrigin}, - #{productionRegion}, - #{productionCompanyName}, - #{afterSale}, - #{specification}, - #{structure}, - #{scope}, - #{other}, - #{filePath}, - #{remark}, - #{createTime}, - #{updateTime}, - #{manufacturerIdFk}, - #{customerId}, - #{productId}, - #{auditStatus}, - #{auditComment}, - #{sptm}, - #{ybbm}, - #{measname}, - #{cpms}, - #{hchzsb}, - #{relIdFk}, - #{manufactory}, #{allowNoBatch}, #{allowNoExpire}, #{allowNoProduct}, - #{allowNoSerial} - ) + values (#{enterpriseId}, + #{recordCode}, + #{recordProductName}, + #{productManageType}, + #{recordPeopleName}, + #{recordPeopleArea}, + #{recordPeopleAreaCode}, + #{recordPeopleAddress}, + #{productType}, + #{productDirectoryCode}, + #{agentName}, + #{agentArea}, + #{agentAreaCode}, + #{agentAddress}, + #{instructions}, + #{productAddress}, + #{recordText}, + #{placeOrigin}, + #{productionRegion}, + #{productionCompanyName}, + #{afterSale}, + #{specification}, + #{structure}, + #{scope}, + #{other}, + #{filePath}, + #{remark}, + #{createTime}, + #{updateTime}, + #{manufacturerIdFk}, + #{customerId}, + #{productId} + , + #{auditStatus}, + #{auditComment}, + #{sptm}, + #{ybbm}, + #{measname}, + #{hchzsb}, #{relIdFk}, #{manufactory}, #{allowNoBatch}, #{allowNoExpire}, #{allowNoProduct}, + #{allowNoSerial}) @@ -249,5 +389,4 @@ FROM sup_product WHERE enterpriseId = #{enterpriseId} - - \ No newline at end of file + diff --git a/src/main/resources/mybatis/mapper/system/SystemPDFTemplateRelevanceDao.xml b/src/main/resources/mybatis/mapper/system/SystemPDFTemplateRelevanceDao.xml index c27c54cbe..0c2c30fe0 100644 --- a/src/main/resources/mybatis/mapper/system/SystemPDFTemplateRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/system/SystemPDFTemplateRelevanceDao.xml @@ -128,4 +128,11 @@ + +