证书相关修改

cert
anthonywj 2 years ago
parent dce27004e7
commit c084d5910b

@ -113,81 +113,7 @@ public class SupCertController {
@AuthRuleAnnotation("")
@GetMapping("/directToCpt/sup/company/cert/filter")
public BaseResponse filterCompanyCert(FilterSupCertRequest filterSupCertRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<SupCertEntity> supCertEntityList
= supCertService.filterCompanyCert(filterSupCertRequest);
PageInfo<SupCertEntity> pageInfo;
pageInfo = new PageInfo<>(supCertEntityList);
PageSimpleResponse<SupCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(supCertEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
private BaseResponse insertCompanyCert(String customerId, PostSelCertRequest request) {
if (CollUtil.isEmpty(request.getSupCertSetEntities())) {
return ResultVOUtils.error(500, "请选入资质证书!");
}
if (request.getCertType() == null) {
return ResultVOUtils.error(500, "参数错误!");
}
int certType = request.getCertType();
String productIdFk = request.getProductIdFk();
String manufacturerIdFk = request.getManufacturerIdFk();
String errMsg = "";
ArrayList<String> list = new ArrayList<>();
int i = request.getSupCertSetEntities().size();
for (SupCertSetEntity supCertSetEntity : request.getSupCertSetEntities()) {
i--;
FilterSupCertRequest supCertRequest = new FilterSupCertRequest();
supCertRequest.setName(supCertSetEntity.getName());
supCertRequest.setCustomerId(customerId);
supCertRequest.setManufacturerIdFk(manufacturerIdFk);
if (productIdFk != null) {
supCertRequest.setProductIdFk(productIdFk);
supCertRequest.setType(3);
} else {
supCertRequest.setType(2);
}
List<SupCertEntity> supCertEntities = supCertService.selectCompanyCert(supCertRequest);
if (!supCertEntities.isEmpty()) {
list.add(supCertEntities.get(0).getName());
if (i == 0) {
errMsg = list.stream().map(s -> "," + s).collect(Collectors.joining());
return ResultVOUtils.error(999, errMsg.substring(1) + "已存在!");
}
}
}
for (SupCertSetEntity supCertSetEntity : request.getSupCertSetEntities()) {
SupCertEntity supCertEntity = new SupCertEntity();
supCertEntity.setName(supCertSetEntity.getName());
supCertEntity.setManufacturerIdFk(manufacturerIdFk);
supCertEntity.setProductIdFk(productIdFk);
supCertEntity.setCustomerId(customerId);
supCertEntity.setType(certType);
supCertEntity.setCreateTime(new Date());
supCertEntity.setStatus(0);
supCertEntity.setAuditStatus(ConstantStatus.AUDIT_DRAFT);
supCertEntity.setUpdateTime(new Date());
supCertEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = supCertService.insertCompanyCert(supCertEntity);
}
return ResultVOUtils.success("成功");
}
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/info/selectAllCert")
@PostMapping("/sup/info/selectAllCert")
@Log(title = "资质证书", businessType = BusinessType.INSERT)
public BaseResponse selectAllCert(@RequestBody PostSelCertRequest postSelCertRequest) {
@ -280,24 +206,7 @@ public class SupCertController {
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/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);
supCertEntity.setId(IdUtil.getSnowflakeNextId());
if (supCertEntity.getVailDate() != null && supCertEntity.getExpireDate() != null) {
if (supCertEntity.getVailDate().getTime() > supCertEntity.getExpireDate().getTime()) {
return ResultVOUtils.error(999, "失效期不能小于生效期!");
}
}
boolean b = supCertService.insertCompanyCert(supCertEntity);
return ResultVOUtils.success("成功");
}
// @AuthRuleAnnotation("")
@PostMapping("/sup/info/insertCompanyCert")
@Log(title = "资质证书", businessType = BusinessType.INSERT)
public BaseResponse cptInsertCompanyCert(@RequestBody SupCertEntity supCertEntity) {
@ -365,7 +274,7 @@ public class SupCertController {
SupProductService supProductService;
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/info/updateCompanyCert")
@PostMapping("/sup/info/updateCompanyCert")
@Log(title = "资质证书", businessType = BusinessType.UPDATE)
public BaseResponse updateCompanyCert(@RequestBody PostSupCertRequest postSupCertRequest) {
SupCertEntity supCertEntity = new SupCertEntity();
@ -407,7 +316,7 @@ public class SupCertController {
}
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/info/deleteCompanyCert")
@PostMapping("/sup/info/deleteCompanyCert")
public BaseResponse deleteCompanyCert(@RequestBody DeleteCompanyFileRequest deleteCompanyFileRequest, BindingResult bindingResult) {
boolean b = supCertService.deleteById(deleteCompanyFileRequest.getId());
String URL = filePath + "/register/file/image2/" + deleteCompanyFileRequest.getFilePath();
@ -703,21 +612,9 @@ public class SupCertController {
JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
}
//首营预览文件
@PostMapping("/directToCpt/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(list);
}
//首营预览文件
@PostMapping("/udiwms/image/register/file")
public BaseResponse uploadRegisterFile2(@RequestBody FilterImageRequest filterImageRequest) {
public BaseResponse uploadRegisterFile(@RequestBody FilterImageRequest filterImageRequest) {
List<String> urlList = Arrays.asList(filterImageRequest.getImageUrl().split(","));
List<String> list = new ArrayList<>();
for (String obj : urlList) {
@ -727,48 +624,6 @@ public class SupCertController {
return ResultVOUtils.success(list);
}
// @Resource
// private AuthAdminService authAdminService;
// @Resource
// private UserCertService userCertService;
// @Value("${file_path}")
// private String filePath;
@Resource
private UserCertSetService userCertSetService;
// @Resource
// private SystemPDFTemplateService systemPDFTemplateService;
// @Resource
// private SystemPDFModuleService systemPDFModuleService;
//
// @ApiOperation(value = "获取供应商资质信息",response = UserCertEntity.class)
// @GetMapping("/sup/company/cert/filterList")
// public BaseResponse filterCompanyCert(certRequest certRequest , BindingResult bindingResult){
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
// List<UserCertEntity> userCertEntities = userCertService.selectBybId(certRequest);
// PageInfo<UserCertEntity> pageInfo;
// pageInfo = new PageInfo<>(userCertEntities);
// PageSimpleResponse<UserCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
// pageSimpleResponse.setTotal(pageInfo.getTotal());
// pageSimpleResponse.setList(userCertEntities);
// return ResultVOUtils.success(pageSimpleResponse);
// }
//
//
// //资质证书添加
// @ApiOperation(value = "资质证书添加", response = BaseResponse.class)
// @PostMapping("/sup/company/cert/isertCert")
// public BaseResponse isertCert(@RequestBody UserCertEntity userCert) {
// userCert.setCreateTime(new Date());
// userCert.setUpdateTime(new Date());
// userCert.setStatus(1 + "");
// userCert.setCheckStatus(0 + "");
// userCert.setId(IdUtil.getSnowflakeNextId());
// supCertService.insertCert(userCert);
// return ResultVOUtils.success("成功");
// }
//删除
@ApiOperation(value = "删除资质证书", response = BaseResponse.class)
@ -783,46 +638,5 @@ public class SupCertController {
return ResultVOUtils.success("成功");
}
//
//
//
// //首营预览文件
// @ApiOperation(value = "上传注册人文件",response = BaseResponse.class)
// @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(list);
// }
//
//修改
// @ApiOperation(value = "修改资质证书", response = BaseResponse.class)
// @PostMapping("/sup/info/updateCert")
// public BaseResponse updateCert(@RequestBody UserCertEntity userCert) {
//
// if (userCert.getValidDate() != null && userCert.getExpireDate() != null) {
// if (userCert.getValidDate().getTime() > userCert.getExpireDate().getTime()) {
// return ResultVOUtils.error(999, "生效期不能小于失效期!");
// }
// }
// supCertService.updateCert(userCert);
//
// if ("key".equals(userCert.getKey())) {
// //插入记录表中
// UserCertSetEntity userCertSetEntity = new UserCertSetEntity();
// userCertSetEntity.setId(IdUtil.getSnowflakeNextId());
// userCertSetEntity.setCreateTime(new Date());
// userCertSetEntity.setCreateUser(userCert.getCreateUser());
// userCertSetEntity.setName(userCert.getName());
// userCertSetService.insert(userCertSetEntity);
//
// }
//
// return ResultVOUtils.success("修改成功");
// }
}

@ -32,7 +32,7 @@ public class SupCertSetController {
private SupCertSetService supCertSetService;
@AuthRuleAnnotation("")
@GetMapping("/directToCpt/sup/cert/set/filter")
@GetMapping("/sup/cert/set/filter")
public BaseResponse filterCertSet(FilterCertSetsRequest filterCertSetsRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -51,23 +51,23 @@ public class SupCertSetController {
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/cert/set/add")
@PostMapping("/sup/cert/set/add")
@Log(title = "资质证书", businessType = BusinessType.INSERT)
public BaseResponse addCertSet(@RequestBody SupCertSetEntity supCertSetEntity) {
if (supCertSetEntity == null) {
supCertSetEntity = new SupCertSetEntity();
}
//判断名字存在就返回
FilterCertSetsRequest filterCertSetsRequest=new FilterCertSetsRequest();
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(supCertSetEntity.getType());
filterCertSetsRequest.setName(supCertSetEntity.getName());
List<SupCertSetEntity> supCertEntityList = supCertSetService.filterCertSets(filterCertSetsRequest);
if(supCertEntityList.size()>0){
return ResultVOUtils.error(999,"该证书名称已存在!");
if (supCertEntityList.size() > 0) {
return ResultVOUtils.error(999, "该证书名称已存在!");
}
supCertSetEntity.setUpdateTime(new Date());
if(supCertSetEntity.getType()==3){
if(supCertSetEntity.getFlbmList().size()>0){
if (supCertSetEntity.getType() == 3) {
if (supCertSetEntity.getFlbmList().size() > 0) {
String flbm = String.join(",", supCertSetEntity.getFlbmList());
supCertSetEntity.setFlbm(flbm);
}
@ -79,7 +79,7 @@ public class SupCertSetController {
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/cert/set/update")
@PostMapping("/sup/cert/set/update")
@Log(title = "资质证书", businessType = BusinessType.UPDATE)
public BaseResponse updateCertSet(@RequestBody SupCertSetEntity supCertSetEntity) {
if (CollUtil.isNotEmpty(supCertSetEntity.getFlbmList())) {
@ -87,14 +87,14 @@ public class SupCertSetController {
supCertSetEntity.setFlbm(flbm);
}
//判断名字存在就返回
FilterCertSetsRequest filterCertSetsRequest=new FilterCertSetsRequest();
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(supCertSetEntity.getType());
filterCertSetsRequest.setName(supCertSetEntity.getName());
filterCertSetsRequest.setId(supCertSetEntity.getId());
filterCertSetsRequest.setUpdateType(1);
List<SupCertSetEntity> supCertEntityList = supCertSetService.filterCertSets(filterCertSetsRequest);
if(supCertEntityList.size()!=0){
return ResultVOUtils.error(999,"证书已存在!");
if (supCertEntityList.size() != 0) {
return ResultVOUtils.error(999, "证书已存在!");
}
boolean b = supCertSetService.updateCertSet(supCertSetEntity);
return ResultVOUtils.success("修改成功");
@ -102,7 +102,7 @@ public class SupCertSetController {
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/cert/set/delete")
@PostMapping("/sup/cert/set/delete")
@Log(title = "资质证书", businessType = BusinessType.DELETE)
public BaseResponse deleteCertSet(@RequestBody DeleteRequest deleteRequest) {

@ -50,10 +50,6 @@ import java.util.ListIterator;
@RestController
public class SupManufacturerController {
@Resource
BasicUdiRelService basicUdiRelService;
@Resource
private AuthAdminService authAdminService;
@Resource
private SupManufacturerService supManufacturerService;
@Resource
@ -74,29 +70,8 @@ public class SupManufacturerController {
}
//获取同步库UDI信息
@AuthRuleAnnotation("")
@ApiIgnore
@ApiOperation(value = "获取同步库UDI信息", response = BasicUdiRelResponse.class)
@GetMapping("/sup/manufacturer/getCompanyList")
public BaseResponse filterRel(FilterUdiRelRequest filterUdiRelRequest) {
System.out.println(filterUdiRelRequest.toString());
List<BasicUdiRelResponse> udiDlDeviceResponse = basicUdiRelService.filterCompanyList(filterUdiRelRequest);
PageInfo<BasicUdiRelResponse> basicUdiRelResponsePageInfo = new PageInfo<>(udiDlDeviceResponse);
PageSimpleResponse<BasicUdiRelResponse> basicUdiRelResponsePageSimpleResponse = new PageSimpleResponse<>();
basicUdiRelResponsePageSimpleResponse.setTotal(basicUdiRelResponsePageInfo.getTotal());
basicUdiRelResponsePageSimpleResponse.setList(udiDlDeviceResponse);
return ResultVOUtils.success(basicUdiRelResponsePageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("/directToCpt/sup/manufacturer/getCompanyList")
public BaseResponse directToCptGetCompanyList(FilterSupManufacturerRequest filterSupManufacturerRequest) {
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
PageInfo<SupManufacturerEntity> pageInfo = new PageInfo<>(companyEntities);
@ -106,24 +81,11 @@ public class SupManufacturerController {
return ResultVOUtils.success(pageSimpleResponse);
}
// @AuthRuleAnnotation("")
// @GetMapping("/sup/manufacturer/getCompanyList")
// public BaseResponse getCompanyList(FilterSupManufacturerRequest filterSupManufacturerRequest) {
// List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
// PageInfo<SupManufacturerEntity> pageInfo = new PageInfo<>(companyEntities);
// PageSimpleResponse<SupManufacturerEntity> pageSimpleResponse = new PageSimpleResponse<>();
// pageSimpleResponse.setTotal(pageInfo.getTotal());
// pageSimpleResponse.setList(companyEntities);
// return ResultVOUtils.success(pageSimpleResponse);
// }
@AuthRuleAnnotation("")
@GetMapping("/directToCpt/sup/manufacturer/getCompanyBySup")
@GetMapping("/sup/manufacturer/getCompanyBySup")
public BaseResponse getCompanyBySup(FilterSupManufacturerRequest filterSupManufacturerRequest) {
filterSupManufacturerRequest.setCustomerId(getCustomerId());
System.out.println("111111111111111111111111111111111111:"+getCustomerId());
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
PageInfo<SupManufacturerEntity> pageInfo = new PageInfo<>(companyEntities);
PageSimpleResponse<SupManufacturerEntity> pageSimpleResponse = new PageSimpleResponse<>();
@ -136,104 +98,6 @@ public class SupManufacturerController {
@AuthRuleAnnotation("")
@PostMapping("/sup/manufacturer/addCompany")
@Log(title = "资质证书", businessType = BusinessType.INSERT)
public BaseResponse addCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) {
String customerId = getCustomerId();
supManufacturerEntity.setCustomerId(customerId);
//判断用户名和社会信用代码不能重复
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() == null || supCompanyEntity.getAuditStatus() != ConstantStatus.AUDIT_PASS
) {
return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!");
}
//验证证书是否齐全
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_MANUFACTURER);
filterCertSetsRequest.setNeed(0);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
List<SupCertEntity> supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId());
//判断存在有草稿的未提交的就不能通过
for (SupCertEntity obj : supCertEntityList) {
if (obj.getAuditStatus() == 0.) {
return ResultVOUtils.error(999, "资质证书存在草稿不能提交!");
}
}
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
while (iterable.hasNext()) {
SupCertSetEntity supCertSetEntity = iterable.next();
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() == 1
&& supManufacturerEntity.getCompanyType().equals("1"))
||
(supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 3
&& supManufacturerEntity.getCompanyType().equals("1"))) {
for (SupCertEntity supCertEntity : supCertEntityList) {
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
iterable.remove();
break;
}
}
}
} else {
iterable.remove();
}
}
String errMsg = "";
if (supCertSetEntities.size() > 0) {
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
errMsg = errMsg + "," + supCertSetEntity.getName();
}
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
}
}
supManufacturerEntity.setCreateTime(new Date());
supManufacturerEntity.setUpdateTime(new Date());
supManufacturerEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = supManufacturerService.insertCompany(supManufacturerEntity);
if (b) {
return ResultVOUtils.success("添加成功");
} else {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
}
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/manufacturer/addCompany")
@Log(title = "资质证书", businessType = BusinessType.INSERT)
public BaseResponse directToCptAddCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) {
String customerId = getCustomerId();
@ -258,7 +122,7 @@ public class SupManufacturerController {
//判断是否上级供应商是否审核通过
SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId());
System.out.println(supCompanyEntity.toString());
System.out.println(supCompanyEntity.getAuditStatus()+"zhi");
System.out.println(supCompanyEntity.getAuditStatus() + "zhi");
if (supCompanyEntity.getAuditStatus() == null || supCompanyEntity.getAuditStatus() != ConstantStatus.AUDIT_PASS
) {
return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!");
@ -360,11 +224,11 @@ public class SupManufacturerController {
//提交审核
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_CHANGE_REJECT
|| supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT || supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_REJECT) {
return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!");
}
// SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId());
// 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, "所属配送企业资质未通过审核,暂时无法提交!");
// }
//验证证书是否齐全
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
@ -374,112 +238,7 @@ public class SupManufacturerController {
List<SupCertEntity> supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId());
//判断存在有草稿的未提交的就不能通过
for (SupCertEntity obj : supCertEntityList) {
if (obj.getAuditStatus() == 0.) {
return ResultVOUtils.error(999, "资质证书存在草稿不能提交!");
}
}
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
while (iterable.hasNext()) {
SupCertSetEntity supCertSetEntity = iterable.next();
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() == 1
&& supManufacturerEntity.getCompanyType().equals("1"))
||
(supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 3
&& supManufacturerEntity.getCompanyType().equals("1"))) {
for (SupCertEntity supCertEntity : supCertEntityList) {
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
iterable.remove();
break;
}
}
}
} else {
iterable.remove();
}
}
String errMsg = "";
if (supCertSetEntities.size() > 0) {
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
errMsg = errMsg + "," + supCertSetEntity.getName();
}
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
}
}
supManufacturerEntity.setUpdateTime(new Date());
SupManufacturerEntity originEntity = supManufacturerService.findManufacturer(supManufacturerEntity.getManufacturerId());
boolean b = supManufacturerService.modifyCompany(supManufacturerEntity);
//修改证书对应的供应商ID生产企业ID
supCertService.updateManufacturerId(originEntity.getCustomerId(), supManufacturerEntity.getCustomerId(), originEntity.getManufacturerId(), supManufacturerEntity.getManufacturerId());
if (b) {
return ResultVOUtils.success("修改成功");
} else {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
}
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/manufacturer/modifyCompany")
@Log(title = "资质证书", businessType = BusinessType.UPDATE)
public BaseResponse directToCptModifyCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) {
if (StrUtil.isEmpty(supManufacturerEntity.getManufacturerId()) || StrUtil.isEmpty(supManufacturerEntity.getCustomerId())) {
return ResultVOUtils.error(500, "参数错误!");
}
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_CHANGE_REJECT
|| supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT || supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_REJECT) {
return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!");
}
//验证证书是否齐全
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_MANUFACTURER);
filterCertSetsRequest.setNeed(0);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
List<SupCertEntity> supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId());
//判断存在有草稿的未提交的就不能通过
for (SupCertEntity obj : supCertEntityList) {
if (obj.getAuditStatus() == 0.) {
if (obj.getAuditStatus() == 0) {
return ResultVOUtils.error(999, "资质证书存在草稿不能提交!");
}
}
@ -634,7 +393,7 @@ public class SupManufacturerController {
@AuthRuleAnnotation("")
@GetMapping("/directToCpt/sup/manufacturer/basic/delete")
@GetMapping("/sup/manufacturer/basic/delete")
@Log(title = "资质证书", businessType = BusinessType.DELETE)
public BaseResponse deleteContact(DeleteRequest deleteRequest) {
boolean b = supManufacturerService.deleteById(deleteRequest.getId());
@ -646,16 +405,6 @@ public class SupManufacturerController {
}
// public String getCustomerId() {
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
// if (attributes == null) {
// throw new JsonException(ResultEnum.NOT_NETWORK);
// }
// HttpServletRequest request = attributes.getRequest();
// String userId = request.getHeader("ADMIN_ID");
// AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
// return authAdmin.getCustomerId() + "";
// }
public String getCustomerId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {

@ -171,7 +171,7 @@ public class UdiTraceController extends BaseController {
filterUdiRelRequest.setYlqxzcrbarmc(traceRecordRequest.getYlqxzcrbarmc());
filterUdiRelRequest.setCpmctymc(traceRecordRequest.getCpmctymc());
filterUdiRelRequest.setGgxh(traceRecordRequest.getGgxh());
userCompanyResponses = basicUdiRelService.findSourceByNameCode(udiEntity.getUdi());
userCompanyResponses = basicUdiRelService.findSourceByNameCode(traceRecordRequest.getNameCode());
if (CollUtil.isEmpty(userCompanyResponses)) {
return ResultVOUtils.error(500, "该产品信息未与企业关联!");
}

@ -16,9 +16,11 @@ import java.util.List;
@Mapper
public interface SupCertDao extends BaseMapperPlus<SupCertDao, SupCertEntity, SupCertEntity> {
List<SupCertEntity> filterCert(certRequest certRequest);
List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest);
List<SupCertEntity> filterUserCompanyCert(FilterSupCertRequest filterSupCertRequest);
SupCertEntity findCompanyCertByName(String name);
List<SupCertEntity> getCompanyCert(FilterSupCertRequest filterSupCertRequest);

@ -24,6 +24,7 @@ public class SupCertServiceImpl extends ServiceImpl<SupCertDao, SupCertEntity> i
@Resource
SupCertDao supCertDao;
@Override
public List<SupCertEntity> selectBybId(certRequest certRequest) {
@ -36,6 +37,7 @@ public class SupCertServiceImpl extends ServiceImpl<SupCertDao, SupCertEntity> i
}
return supCertDao.filterCert(certRequest);
}
@Override
public List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest) {
if (filterSupCertRequest == null) {
@ -47,6 +49,7 @@ public class SupCertServiceImpl extends ServiceImpl<SupCertDao, SupCertEntity> i
}
return supCertDao.filterCompanyCert(filterSupCertRequest);
}
@Override
public List<SupCertEntity> filterUserCompanyCert(FilterSupCertRequest filterSupCertRequest) {
if (filterSupCertRequest == null) {

@ -39,7 +39,7 @@
</select>
<select id="filterCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
select * from user_cert
select * from sup_cert
<where>
<if test="customerId != '' and customerId!=null">
and customerId = #{customerId}
@ -74,7 +74,7 @@
<select id="filterUserCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
select * from user_cert
select * from sup_cert
<where>
<if test="businessId != '' and businessId!=null">
and businessId = #{businessId}

@ -78,7 +78,6 @@
<if test="businessId != '' and businessId!=null">
and businessId = #{businessId}
</if>
</where>
ORDER BY id DESC
</select>

Loading…
Cancel
Save