资质代码同步

master
郑明梁 2 years ago
parent e4e94c3118
commit b0543b862a

@ -510,5 +510,13 @@ public class BasicCorpController {
return ResultVOUtils.success(rMap);
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/basic/unit/maintain/getCorpList")
public BaseResponse getCorpList() {
List<BasicCorpEntity> getCorpList=basicUnitMaintainService.getCorpList();
return ResultVOUtils.success(getCorpList);
}
}

@ -695,4 +695,18 @@ public class UdiRelevanceController extends BaseController {
return ResultVOUtils.success(ggxhList);
}
//资质证书选入产品列表 产品名称,生产企业过滤
@AuthRuleAnnotation("")
@GetMapping("/udi/cert/filterUdi")
public BaseResponse filterCertUdi(FilterUdiRelRequest filterUdiRelRequest) {
List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceService.filterCertUdi(filterUdiRelRequest);
PageInfo<UdiRelevanceResponse> pageInfo;
pageInfo = new PageInfo<>(udiRelevanceResponses);
PageSimpleResponse<UdiRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(udiRelevanceResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -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<String> 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<SupCertEntity> 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<String> 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<SupCertEntity> 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<String> 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<SupCertEntity> 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<String, Object> 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<String> urlList = Arrays.asList(obj.getFilePath().split(","));
for (String url : urlList) {
//组装数据
Map<String, Object> 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<String, Object> 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<String> urlList = Arrays.asList(obj.getFilePath().split(","));
for (String url : urlList) {
//组装数据
Map<String, Object> 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<String, Object> 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<String> urlList = Arrays.asList(obj.getFilePath().split(","));
for (String url : urlList) {
//组装数据
Map<String, Object> 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<String> urlList = Arrays.asList(filterImageRequest.getImageUrl().split(","));
List<String> list = new ArrayList<>();
for (String obj : urlList) {
String url = filterImageRequest.getCertFileUrl() + obj;
list.add(url);
}
return ResultVOUtils.success("成功");
return ResultVOUtils.success(list);
}
}

@ -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);

@ -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());

@ -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<SupCertEntity> supCertEntityList = supCertService.findAll(companyEntity.getCustomerId()); for(SupCertEntity obj:supCertEntityList){
if(obj.getAuditStatus()==0){
return ResultVOUtils.error(999,"证书中存在草稿不允许提交!");
if (companyEntity.getAuditStatus() == 6) {
List<SupCertEntity> 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<SupCertEntity> 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<SupCertEntity> 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) {

@ -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<SupManufacturerEntity> 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<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
List<SupCertEntity> 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<SupCertSetEntity> 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<SupManufacturerEntity> 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<SupManufacturerEntity> 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<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
List<SupCertEntity> 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<SupCertSetEntity> 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<SupCertEntity> 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)

@ -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<SupCertSetEntity> 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<SupCertEntity> 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<SupCertEntity> 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<SupCertEntity> 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)

@ -63,4 +63,6 @@ public interface BasicCorpDao extends BaseMapperPlus<BasicCorpDao, BasicCorpEnti
* @return
*/
String selectNameByErpId(@Param("supId") String supId);
List<BasicCorpEntity> getCorpList();
}

@ -19,6 +19,7 @@ public interface UdiRelevanceDao extends BaseMapperPlus<UdiRelevanceDao, UdiRele
List<UdiRelevanceResponse> filterCertUdi(FilterUdiRelRequest filterUdiRelRequest);
List<UdiRelevanceResponse> filterCertUdi(FilterUdiRelRequest filterUdiRelRequest);
List<UdiRelevanceResponse> filterUdiGp(FilterUdiRelRequest filterUdiRelRequest);

@ -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);
}

@ -199,5 +199,7 @@ public class SupManufacturerEntity{
private String failCout;
@TableField(exist = false)
private String passCout;
@TableField("agentName")
private String agentName;
}

@ -0,0 +1,12 @@
package com.glxp.api.req.purchase;
import lombok.Data;
@Data
public class FilterImageRequest {
private String imageUrl;
private String certFileUrl;
}

@ -19,4 +19,5 @@ public class FilterPoductRequest extends ListPageRequest {
private String customerId;
private Integer auditStatus;
private String lastUpdateTime;
private String relIdFk;
}

@ -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<BasicCorpEntity> getCorpList();
}

@ -91,6 +91,8 @@ public interface UdiRelevanceService extends IService<UdiRelevanceEntity> {
*/
String findUuidById(String relId);
UdiRelevanceResponse selectUdiId(Long id);
List<UdiRelevanceResponse> selectGroupByNameCode(String nameCode, Boolean isDisable);

@ -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<BasicCorpEntity> 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<BasicCorpEntity> getCorpList() {
return basicCorpDao.getCorpList();
}
@Override
public BasicCorpEntity selectById(String id) {
return basicCorpDao.selectById(id);

@ -400,4 +400,30 @@ public class UdiRelevanceServiceImpl extends ServiceImpl<UdiRelevanceDao, UdiRel
UdiEntity udi = FilterUdiUtils.getUdi(code);
return udiRelevanceDao.selectRelIdByNameCode(udi.getUdi());
}
@Override
public UdiRelevanceResponse selectUdiId(Long id) {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
filterUdiRelRequest.setId(id);
List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest);
if (data != null && data.size() > 0)
return data.get(0);
return null;
}
@Override
public List<UdiRelevanceResponse> 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<UdiRelevanceResponse> data = udiRelevanceDao.filterCertUdi(filterUdiRelRequest);
return data;
}
}

@ -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<SupCertEntity> {
List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest);
@ -21,6 +22,8 @@ public interface SupCertService {
List<SupCertEntity> findAll(String customerId, String manufacturerId, String productId);
List<SupCertEntity> selectCompanyCert(FilterSupCertRequest filterSupCertRequest);
List<SupCertEntity> getCompanyCert(FilterSupCertRequest filterSupCertRequest);

@ -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<SupCertSetEntity> {
List<SupCertSetEntity> filterCertSets(FilterCertSetsRequest filterCertSetsRequest);

@ -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> {
SupCompanyEntity findCompanyByUnitFk(String unitFk);

@ -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> {
SupManufacturerEntity findCompany(Long id);

@ -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> {
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);
}
}

@ -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<SupCertDao, SupCertEntity> implements SupCertService {
@Resource
SupCertDao supCertDao;
@ -34,6 +35,20 @@ public class SupCertServiceImpl implements SupCertService {
return supCertDao.filterCompanyCert(filterSupCertRequest);
}
@Override
public List<SupCertEntity> 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<SupCertEntity> companyEntities = supCertDao.getCompanyCert(filterSupCertRequest);
return companyEntities;
}
@Override
public List<SupCertEntity> 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

@ -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<SupCertSetDao, SupCertSetEntity> implements SupCertSetService {
@Resource
SupCertSetDao supCertSetDao;

@ -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<SupCompanyDao,SupCompanyEntity> implements SupCompanyService {
@Resource
SupCompanyDao supCompanyDao;

@ -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<SupManufacturerDao, SupManufacturerEntity> implements SupManufacturerService {
@Resource
SupManufacturerDao supManufacturerDao;

@ -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<SupProductDao, SupProductEntity> implements SupProductService {
@Resource
SupProductDao supProductDao;
@ -69,6 +71,37 @@ public class SupProductServiceImpl implements SupProductService {
return null;
}
@Override
public SupProductEntity findByRelIdFk(String relIdFk) {
List<SupProductEntity> supProductEntities = supProductDao.selectList(new QueryWrapper<SupProductEntity>().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<SupProductEntity> 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<SupProductEntity> 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);

@ -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<SystemPDFModuleEntity> findByLastTime(Date lastUpdateTime);
SysPdfTemplateRelevanceStatemenEntity selectByStatemenId(String id);
}

@ -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<SystemPDFModuleEntity> queryPage(FilterPdfModuleRequest FilterPDFModuleRequest) {
int offset = (FilterPDFModuleRequest.getPage() - 1) * FilterPDFModuleRequest.getLimit();
@ -67,4 +72,9 @@ public class SystemPDFModuleServiceImpl implements SystemPDFModuleService {
public List<SystemPDFModuleEntity> findByLastTime(Date lastUpdateTime) {
return systemPDFModuleDao.selectByLastTime(lastUpdateTime);
}
@Override
public SysPdfTemplateRelevanceStatemenEntity selectByStatemenId(String id) {
return systemPDFTemplateRelevanceDao.selectByStatemenId(id);
}
}

@ -312,4 +312,15 @@
<select id="selectNameByErpId" resultType="java.lang.String">
select name from basic_corp where erpId = #{supId}
</select>
<select id="getCorpList" resultType="com.glxp.api.entity.basic.BasicCorpEntity">
SELECT
*
FROM
basic_corp
WHERE
erpId NOT IN ( SELECT customerId FROM sup_company )
AND corpType = 2;
</select>
</mapper>

@ -1248,4 +1248,174 @@
</where>
limit 1
</select>
<!-- 资质证书选入产品分组查询-->
<select id="filterCertUdi" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
select basic_udirel.*,
bht.name classifyName,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8
FROM basic_products
inner JOIN basic_udirel
ON basic_products.uuid = basic_udirel.uuid
left join basic_hosp_type bht on basic_udirel.relCode = bht.code
inner join company_product_relevance on company_product_relevance.udiRlIdFk = basic_udirel.id
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
</if>
<if test="manufactory != '' and manufactory != null">
AND manufactory LIKE concat('%', #{manufactory}, '%')
</if>
<if test="relCode != '' and relCode != null">
AND relCode = #{relCode}
</if>
<if test="bindType != '' and bindType != null">
AND relCode is null
or trim(relCode) = ''
</if>
<if test="supName != '' and supName != null">
AND supName LIKE concat('%', #{supName}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%', #{ggxh}, '%')
</if>
<if test="unionCode != '' and unionCode != null">
and (
nameCode LIKE concat('%', #{unionCode}, '%')
or ybbm LIKE concat('%', #{unionCode}, '%')
or sptm LIKE concat('%', #{unionCode}, '%'))
</if>
<if test="isDisable == false">
AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false)
</if>
<if test="thrPiId != '' and thrPiId != null">
and (thirdId LIKE concat('%', #{thrPiId}, '%')
or thirdId1 LIKE concat('%', #{thrPiId}, '%')
or thirdId2 LIKE concat('%', #{thrPiId}, '%')
or thirdId3 LIKE concat('%', #{thrPiId}, '%')
or thirdId4 LIKE concat('%', #{thrPiId}, '%'))
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="udplatCode != '' and udplatCode != null">
AND udplatCode = #{udplatCode}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
</if>
<if test="diType != '' and diType != null">
AND diType = #{diType}
</if>
<if test="filterType != null and filterType == 1">
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '')
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 2">
AND basic_products.originUuid is NULL
</if>
<if test="filterType != null and filterType == 3">
AND (mainId is NULL or mainId = '')
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 4">
AND thirdId1 is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 5">
AND thirdId2 is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 6">
AND thirdId3 is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 7">
AND thirdId4 is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 10">
AND basic_udirel.updateTime is NULL
</if>
<if test="lockStatus != '' and lockStatus != null">
AND basic_udirel.lockStatus = #{lockStatus}
</if>
<if test="mainId != '' and mainId != null">
AND mainId = #{mainId}
</if>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
<if test="customerId != '' and customerId != null">
AND company_product_relevance.unitFk = #{customerId}
</if>
<if test="tyshxydm != '' and tyshxydm != null">
AND basic_products.tyshxydm = #{tyshxydm}
</if>
</where>
GROUP BY cpmctymc, manufactory
</select>
</mapper>

@ -36,6 +36,20 @@
ORDER BY id DESC
</select>
<select id="selectCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
SELECT * FROM sup_cert
<where>
<if test="customerId != null and customerId != ''">
and customerId = #{customerId}
</if>
<if test="name != null and name != ''">
and #{name}
</if>
</where>
</select>
<select id="findCompanyCertByName" parameterType="java.lang.String"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
@ -57,7 +71,12 @@
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
and manufacturerIdFk = #{manufacturerIdFk}
</if>
<if test="productIdFk != null and productIdFk != ''">
and productIdFk = #{productIdFk}
</if>
<if test="type != null">
and type = #{type}
</if>
</where>
</select>
@ -170,4 +189,4 @@
ORDER BY id DESC
</select>
</mapper>
</mapper>

@ -15,10 +15,10 @@
<select id="filterCompany" parameterType="com.glxp.api.req.purchase.FilterSupCompanyRequest"
resultType="com.glxp.api.entity.purchase.SupCompanyEntity">
SELECT
*
*
<if test="manufacturerStatus!=null">
,(SELECT count(*) FROM sup_manufacturer WHERE sup_company.customerId=sup_manufacturer.customerId AND sup_manufacturer.auditStatus!=1 AND sup_manufacturer.auditStatus!=0 AND sup_manufacturer.auditStatus!=4 ) as failCout,
(SELECT count(*) FROM sup_manufacturer WHERE sup_company.customerId=sup_manufacturer.customerId AND (sup_manufacturer.auditStatus=1 OR sup_manufacturer.auditStatus=4) ) as passCout
,(SELECT count(*) FROM sup_manufacturer WHERE sup_company.customerId=sup_manufacturer.customerId AND sup_manufacturer.auditStatus!=1 AND sup_manufacturer.auditStatus!=0 AND sup_manufacturer.auditStatus!=4 ) as failCout,
(SELECT count(*) FROM sup_manufacturer WHERE sup_company.customerId=sup_manufacturer.customerId AND (sup_manufacturer.auditStatus=1 OR sup_manufacturer.auditStatus=4) ) as passCout
,(SELECT count(*) FROM sup_product WHERE sup_company.customerId=sup_product.customerId AND sup_product.auditStatus!=0 AND sup_product.auditStatus!=1 AND sup_product.auditStatus!=4 ) as productFailCout,
(SELECT count(*) FROM sup_product WHERE sup_company.customerId=sup_product.customerId AND (sup_product.auditStatus=1 OR sup_product.auditStatus=4) ) as prouctPassCout
</if>
@ -187,7 +187,5 @@
#{auditTime}, #{auditComment}, #{editStatus})
</insert>
<select id="selectNameByCustomerId" resultType="java.lang.String">
select companyName from sup_company where customerId = #{customerId}
</select>
</mapper>
</mapper>

@ -99,6 +99,7 @@
<if test="manufacturerId != null">manufacturerId=#{manufacturerId},</if>
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
<if test="auditComment != null">auditComment=#{auditComment},</if>
<if test="agentName != null">agentName=#{agentName},</if>
</set>
@ -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})
</insert>
<delete id="deleteById" parameterType="Map">
@ -157,7 +158,4 @@
</where>
</select>
<select id="selectNameByManufacturerId" resultType="java.lang.String">
select companyName from sup_manufacturer where manufacturerId = #{manufacturerId}
</select>
</mapper>

@ -2,7 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.purchase.SupProductDao">
<select id="findRegistration" parameterType="java.lang.Long"
resultType="com.glxp.api.entity.purchase.SupProductEntity">
SELECT *
@ -19,7 +18,8 @@
<select id="filterProducts" parameterType="com.glxp.api.req.purchase.FilterPoductRequest"
resultType="com.glxp.api.entity.purchase.SupProductEntity">
SELECT sup_product.* FROM sup_product
SELECT sup_product.*
FROM sup_product
<where>
<if test="id != null and id != ''">
and sup_product.id = #{id}
@ -30,14 +30,21 @@
<if test="enterpriseId != null and enterpriseId != ''">
and sup_product.enterpriseId = #{enterpriseId}
</if>
<if test="relIdFk != null and relIdFk != ''">
and sup_product.relIdFk = #{relIdFk}
</if>
<if test="manufactory != null and manufactory != ''">
and sup_product.manufactory = #{manufactory}
</if>
<if test="recordCode != null and recordCode != ''">
and sup_product.recordCode like concat('%',#{recordCode},'%')
and sup_product.recordCode like concat('%', #{recordCode}, '%')
</if>
<if test="recordProductName != null and recordProductName != ''">
and sup_product.recordProductName like concat('%',#{recordProductName},'%')
and sup_product.recordProductName like concat('%', #{recordProductName}, '%')
</if>
<if test="recordPeopleName != null and recordPeopleName != ''">
and sup_product.recordPeopleName like concat('%',#{recordPeopleName},'%')
and sup_product.recordPeopleName like concat('%', #{recordPeopleName}, '%')
</if>
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
and sup_product.manufacturerIdFk = #{manufacturerIdFk}
@ -45,24 +52,24 @@
<if test="customerId != null and customerId != ''">
and sup_product.customerId = #{customerId}
</if>
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=22 and auditStatus !=21">
<if test="auditStatus != null and auditStatus != 20 and auditStatus != 22 and auditStatus != 21">
and sup_product.auditStatus = #{auditStatus}
</if>
<if test="manufactory != null and manufactory != ''">
and sup_product.manufactory = #{manufactory}
</if>
<if test="auditStatus ==20">
and (sup_product.auditStatus = 0 or sup_product.auditStatus=5 or
sup_product.auditStatus=2)
<if test="auditStatus == 20">
and (sup_product.auditStatus = 0 or sup_product.auditStatus = 5 or
sup_product.auditStatus = 2)
</if>
<if test="auditStatus ==21">
and <![CDATA[ sup_product.auditStatus <> 0 ]]>
<if test="auditStatus == 21">
and <![CDATA[ sup_product.auditStatus <> 0
]]>
</if>
<if test="auditStatus ==22">
and (sup_product.auditStatus = 1 or sup_product.auditStatus=4 )
<if test="auditStatus == 22">
and (sup_product.auditStatus = 1 or sup_product.auditStatus = 4)
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
@ -70,19 +77,68 @@
<select id="getRegistration" parameterType="com.glxp.api.req.purchase.FilterPoductRequest"
resultType="com.glxp.api.res.purchase.SupProductResponse">
SELECT sup_product.* ,sup_company.companyName
supName,sup_manufacturer.companyName manufacturerName FROM sup_product
inner join sup_company
on sup_product.customerId = sup_company.customerId
INNER JOIN sup_manufacturer
on sup_manufacturer.manufacturerId =
sup_product.manufacturerIdFk
SELECT sup_product.id,
sup_product.productId,
sup_product.enterpriseId,
sup_product.recordCode,
sup_product.recordProductName,
sup_product.productManageType,
sup_product.recordPeopleName,
sup_product.recordPeopleArea,
sup_product.recordPeopleAreaCode,
sup_product.recordPeopleAddress,
sup_product.productType,
sup_product.productDirectoryCode,
sup_product.agentArea,
sup_product.agentAreaCode,
sup_product.agentAddress,
sup_product.instructions,
sup_product.productAddress,
sup_product.recordText,
sup_product.placeOrigin,
sup_product.productionRegion,
sup_product.productionCompanyName,
sup_product.afterSale,
sup_product.specification,
sup_product.structure,
sup_product.scope,
sup_product.other,
sup_product.filePath,
sup_product.manufacturerIdFk,
sup_product.customerId,
sup_product.auditStatus,
sup_product.auditComment,
sup_product.sptm,
sup_product.ybbm,
sup_product.measname,
sup_product.cpms,
sup_product.relIdFk,
sup_product.hchzsb,
sup_product.remark,
sup_product.createUser,
sup_product.createTime,
sup_product.updateUser,
sup_product.updateTime,
sup_product.manufactory,
sup_product.allowNoBatch,
sup_product.allowNoExpire,
sup_product.allowNoProduct,
sup_product.allowNoSerial,
sup_company.companyName supName,
sup_manufacturer.companyName manufacturerName,
sup_manufacturer.companyName,
sup_manufacturer.agentName
FROM sup_product
inner join sup_company
on sup_product.customerId = sup_company.customerId
INNER JOIN sup_manufacturer
on sup_manufacturer.manufacturerId =
sup_product.manufacturerIdFk
<where>
<if test="id != null and id != ''">
and sup_product.id = #{id}
</if>
<if test="productId != null and productId != ''">
and sup_product.productId = #{productId}
</if>
@ -90,13 +146,13 @@
and sup_product.enterpriseId = #{enterpriseId}
</if>
<if test="recordCode != null and recordCode != ''">
and sup_product.recordCode like concat('%',#{recordCode},'%')
and sup_product.recordCode like concat('%', #{recordCode}, '%')
</if>
<if test="recordProductName != null and recordProductName != ''">
and sup_product.recordProductName like concat('%',#{recordProductName},'%')
and sup_product.recordProductName like concat('%', #{recordProductName}, '%')
</if>
<if test="recordPeopleName != null and recordPeopleName != ''">
and sup_product.recordPeopleName like concat('%',#{recordPeopleName},'%')
and sup_product.recordPeopleName like concat('%', #{recordPeopleName}, '%')
</if>
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
and sup_product.manufacturerIdFk = #{manufacturerIdFk}
@ -104,138 +160,222 @@
<if test="customerId != null and customerId != ''">
and sup_product.customerId = #{customerId}
</if>
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=22 and auditStatus !=21">
<if test="auditStatus != null and auditStatus != 20 and auditStatus != 22 and auditStatus != 21">
and sup_product.auditStatus = #{auditStatus}
</if>
<if test="auditStatus ==20">
and (sup_product.auditStatus = 0 or sup_product.auditStatus=5 or
sup_product.auditStatus=2)
<if test="auditStatus == 20">
and (sup_product.auditStatus = 0 or sup_product.auditStatus = 5 or
sup_product.auditStatus = 2)
</if>
<if test="auditStatus ==21">
and <![CDATA[ sup_product.auditStatus <> 0 ]]>
<if test="auditStatus == 21">
and <![CDATA[ sup_product.auditStatus <> 0
]]>
</if>
<if test="relIdFk != null and relIdFk != ''">
and sup_product.relIdFk = #{relIdFk}
</if>
<if test="manufactory != null and manufactory != ''">
and sup_product.manufactory = #{manufactory}
</if>
<if test="auditStatus ==22">
and (sup_product.auditStatus = 1 or sup_product.auditStatus=4 )
<if test="auditStatus == 22">
and (sup_product.auditStatus = 1 or sup_product.auditStatus = 4)
</if>
</where>
</select>
<update id="modifyRegistration" parameterType="com.glxp.api.entity.purchase.SupProductEntity">
UPDATE sup_product
<set>
<if test="enterpriseId != null">enterpriseId=#{enterpriseId},</if>
<if test="recordCode != null">recordCode=#{recordCode},</if>
<if test="recordProductName != null">recordProductName=#{recordProductName},</if>
<if test="productManageType != null">productManageType=#{productManageType},</if>
<if test="recordPeopleName != null">recordPeopleName=#{recordPeopleName},</if>
<if test="recordPeopleArea != null">recordPeopleArea=#{recordPeopleArea},</if>
<if test="recordPeopleAreaCode != null">recordPeopleAreaCode=#{recordPeopleAreaCode},</if>
<if test="recordPeopleAddress != null">recordPeopleAddress=#{recordPeopleAddress},</if>
<if test="productType != null">productType=#{productType},</if>
<if test="productDirectoryCode != null">productDirectoryCode=#{productDirectoryCode},</if>
<if test="agentName != null">agentName=#{agentName},</if>
<if test="agentArea != null">agentArea=#{agentArea},</if>
<if test="agentAreaCode != null">agentAreaCode=#{agentAreaCode},</if>
<if test="agentAddress != null">agentAddress=#{agentAddress},</if>
<if test="instructions != null">instructions=#{instructions},</if>
<if test="productAddress != null">productAddress=#{productAddress},</if>
<if test="recordText != null">recordText=#{recordText},</if>
<if test="placeOrigin != null">placeOrigin=#{placeOrigin},</if>
<if test="productionRegion != null">productionRegion=#{productionRegion},</if>
<if test="productionCompanyName != null">productionCompanyName=#{productionCompanyName},</if>
<if test="afterSale != null">afterSale=#{afterSale},</if>
<if test="specification != null">specification=#{specification},</if>
<if test="structure != null">structure=#{structure},</if>
<if test="scope != null">scope=#{scope},</if>
<if test="other != null">other=#{other},</if>
<if test="filePath != null">filePath=#{filePath},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="createTime != null">createTime=#{createTime},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="manufacturerIdFk != null">manufacturerIdFk=#{manufacturerIdFk},</if>
<if test="customerId != null">customerId=#{customerId},</if>
<if test="productId != null">productId=#{productId},</if>
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
<if test="auditComment != null">auditComment=#{auditComment},</if>
<if test="sptm != null">sptm=#{sptm},</if>
<if test="ybbm != null">ybbm=#{ybbm},</if>
<if test="measname != null">measname=#{measname},</if>
<if test="cpms != null">cpms=#{cpms},</if>
<if test="hchzsb != null">hchzsb=#{hchzsb},</if>
<if test="relIdFk != null">relIdFk=#{relIdFk},</if>
<if test="manufactory != null">manufactory=#{manufactory},</if>
<if test="allowNoBatch != null">allowNoBatch=#{allowNoBatch},</if>
<if test="allowNoExpire != null">allowNoExpire=#{allowNoExpire},</if>
<if test="allowNoProduct != null">allowNoProduct=#{allowNoProduct},</if>
<if test="allowNoSerial != null">allowNoSerial=#{allowNoSerial},</if>
<if test="enterpriseId != null">
enterpriseId=#{enterpriseId},
</if>
<if test="recordCode != null">
recordCode=#{recordCode},
</if>
<if test="recordProductName != null">
recordProductName=#{recordProductName},
</if>
<if test="productManageType != null">
productManageType=#{productManageType},
</if>
<if test="recordPeopleName != null">
recordPeopleName=#{recordPeopleName},
</if>
<if test="recordPeopleArea != null">
recordPeopleArea=#{recordPeopleArea},
</if>
<if test="recordPeopleAreaCode != null">
recordPeopleAreaCode=#{recordPeopleAreaCode},
</if>
<if test="recordPeopleAddress != null">
recordPeopleAddress=#{recordPeopleAddress},
</if>
<if test="productType != null">
productType=#{productType},
</if>
<if test="productDirectoryCode != null">
productDirectoryCode=#{productDirectoryCode},
</if>
<if test="agentName != null">
agentName=#{agentName},
</if>
<if test="agentArea != null">
agentArea=#{agentArea},
</if>
<if test="agentAreaCode != null">
agentAreaCode=#{agentAreaCode},
</if>
<if test="agentAddress != null">
agentAddress=#{agentAddress},
</if>
<if test="instructions != null">
instructions=#{instructions},
</if>
<if test="productAddress != null">
productAddress=#{productAddress},
</if>
<if test="recordText != null">
recordText=#{recordText},
</if>
<if test="placeOrigin != null">
placeOrigin=#{placeOrigin},
</if>
<if test="productionRegion != null">
productionRegion=#{productionRegion},
</if>
<if test="productionCompanyName != null">
productionCompanyName=#{productionCompanyName},
</if>
<if test="afterSale != null">
afterSale=#{afterSale},
</if>
<if test="specification != null">
specification=#{specification},
</if>
<if test="structure != null">
structure=#{structure},
</if>
<if test="scope != null">
scope=#{scope},
</if>
<if test="other != null">
other=#{other},
</if>
<if test="filePath != null">
filePath=#{filePath},
</if>
<if test="remark != null">
remark=#{remark},
</if>
<if test="createTime != null">
createTime=#{createTime},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="manufacturerIdFk != null">
manufacturerIdFk=#{manufacturerIdFk},
</if>
<if test="customerId != null">
customerId=#{customerId},
</if>
<if test="productId != null">
productId=#{productId},
</if>
<if test="auditStatus != null">
auditStatus=#{auditStatus},
</if>
<if test="auditComment != null">
auditComment=#{auditComment},
</if>
<if test="sptm != null">
sptm=#{sptm},
</if>
<if test="ybbm != null">
ybbm=#{ybbm},
</if>
<if test="measname != null">
measname=#{measname},
</if>
<if test="hchzsb != null">
hchzsb=#{hchzsb},
</if>
<if test="relIdFk != null">
relIdFk=#{relIdFk},
</if>
<if test="manufactory != null">
manufactory=#{manufactory},
</if>
<if test="allowNoBatch != null">
allowNoBatch=#{allowNoBatch},
</if>
<if test="allowNoExpire != null">
allowNoExpire=#{allowNoExpire},
</if>
<if test="allowNoProduct != null">
allowNoProduct=#{allowNoProduct},
</if>
<if test="allowNoSerial != null">
allowNoSerial=#{allowNoSerial},
</if>
</set>
WHERE id=#{id}
WHERE id = #{id}
</update>
<insert id="insertRegistration" parameterType="com.glxp.api.entity.purchase.SupProductEntity">
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})
</insert>
<delete id="deleteById" parameterType="Map">
@ -249,5 +389,4 @@
FROM sup_product
WHERE enterpriseId = #{enterpriseId}
</delete>
</mapper>
</mapper>

@ -128,4 +128,11 @@
</if>
</where>
</select>
<select id="selectByStatemenId" parameterType="java.lang.String"
resultType="com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity">
select *
FROM sys_pdf_template_relevance_statemen
WHERE id = #{id}
</select>
</mapper>

Loading…
Cancel
Save