|  |  |  | @ -17,6 +17,7 @@ import com.glxp.api.admin.req.purchase.FilterSupCertRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.admin.req.purchase.FilterSupManufacturerRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.admin.res.PageSimpleResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.admin.service.auth.AuthAdminService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.admin.service.info.CompanyService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.admin.service.purchase.SupCertService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.admin.service.purchase.SupCertSetService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.admin.service.purchase.SupCompanyService; | 
			
		
	
	
		
			
				
					|  |  |  | @ -51,7 +52,8 @@ public class SupManufacturerController { | 
			
		
	
		
			
				
					|  |  |  |  |     private SupCompanyService supCompanyService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     SupCertSetService supCertSetService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private CompanyService companyService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
			
				
					|  |  |  |  |     @GetMapping("/sup/manufacturer/getCompanyInfo") | 
			
		
	
	
		
			
				
					|  |  |  | @ -91,9 +93,21 @@ public class SupManufacturerController { | 
			
		
	
		
			
				
					|  |  |  |  |     @PostMapping("/sup/manufacturer/addCompany") | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse addCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //判断用户名和社会信用代码不能重复
 | 
			
		
	
		
			
				
					|  |  |  |  |         FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |         filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName()); | 
			
		
	
		
			
				
					|  |  |  |  |         filterSupManufacturerRequest.setCustomerId(getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |  |         List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         if(companyEntities.size()>0){ | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999,"企业名称不能重复!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         filterSupManufacturerRequest=new FilterSupManufacturerRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |         filterSupManufacturerRequest.setCustomerId(getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |  |         filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode()); | 
			
		
	
		
			
				
					|  |  |  |  |         companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         if(companyEntities.size()>0){ | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999,"统一社会信用代码不能重复!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         //提交审核
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) { | 
			
		
	
		
			
				
					|  |  |  |  |             //判断是否上级供应商是否审核通过
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -109,27 +123,28 @@ public class SupManufacturerController { | 
			
		
	
		
			
				
					|  |  |  |  |             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.isNeed() | 
			
		
	
		
			
				
					|  |  |  |  |                 if ((           supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 | 
			
		
	
		
			
				
					|  |  |  |  |                         && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) | 
			
		
	
		
			
				
					|  |  |  |  |                         || | 
			
		
	
		
			
				
					|  |  |  |  |                         (!supCertSetEntity.isNeed() && | 
			
		
	
		
			
				
					|  |  |  |  |                                 supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 | 
			
		
	
		
			
				
					|  |  |  |  |                                 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) | 
			
		
	
		
			
				
					|  |  |  |  |                         || | 
			
		
	
		
			
				
					|  |  |  |  |                         (!supCertSetEntity.isNeed() && | 
			
		
	
		
			
				
					|  |  |  |  |                         ( | 
			
		
	
		
			
				
					|  |  |  |  |                                 supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 | 
			
		
	
		
			
				
					|  |  |  |  |                                 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) | 
			
		
	
		
			
				
					|  |  |  |  |                                         && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) | 
			
		
	
		
			
				
					|  |  |  |  |                         || | 
			
		
	
		
			
				
					|  |  |  |  |                         (!supCertSetEntity.isNeed() | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supCertSetEntity.getForeign() != null | 
			
		
	
		
			
				
					|  |  |  |  |                         (       supCertSetEntity.getForeign() != null | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supCertSetEntity.getForeign() == 1 | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supManufacturerEntity.getCompanyType().equals("1")) | 
			
		
	
		
			
				
					|  |  |  |  |                         || | 
			
		
	
		
			
				
					|  |  |  |  |                         (!supCertSetEntity.isNeed() | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supCertSetEntity.getForeign() != null | 
			
		
	
		
			
				
					|  |  |  |  |                         (       supCertSetEntity.getForeign() != null | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supCertSetEntity.getForeign() == 3 | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supManufacturerEntity.getCompanyType().equals("1"))) { | 
			
		
	
		
			
				
					|  |  |  |  |                     for (SupCertEntity supCertEntity : supCertEntityList) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -176,6 +191,23 @@ public class SupManufacturerController { | 
			
		
	
		
			
				
					|  |  |  |  |         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.getCompany(filterSupManufacturerRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         if(companyEntities.size()>0){ | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999,"企业名称不能重复!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         filterSupManufacturerRequest=new FilterSupManufacturerRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |         filterSupManufacturerRequest.setCustomerId(getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |  |         filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode()); | 
			
		
	
		
			
				
					|  |  |  |  |         companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         if(companyEntities.size()>0){ | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999,"统一社会信用代码不能重复!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //提交审核
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) { | 
			
		
	
		
			
				
					|  |  |  |  |             //判断是否上级供应商是否审核通过
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -191,27 +223,28 @@ public class SupManufacturerController { | 
			
		
	
		
			
				
					|  |  |  |  |             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.isNeed() | 
			
		
	
		
			
				
					|  |  |  |  |                         || | 
			
		
	
		
			
				
					|  |  |  |  |                         (!supCertSetEntity.isNeed() && | 
			
		
	
		
			
				
					|  |  |  |  |                                 supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 | 
			
		
	
		
			
				
					|  |  |  |  |                                 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) | 
			
		
	
		
			
				
					|  |  |  |  |                 if ((           supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 | 
			
		
	
		
			
				
					|  |  |  |  |                         && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) | 
			
		
	
		
			
				
					|  |  |  |  |                         || | 
			
		
	
		
			
				
					|  |  |  |  |                         (!supCertSetEntity.isNeed() && | 
			
		
	
		
			
				
					|  |  |  |  |                         ( | 
			
		
	
		
			
				
					|  |  |  |  |                                 supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 | 
			
		
	
		
			
				
					|  |  |  |  |                                 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) | 
			
		
	
		
			
				
					|  |  |  |  |                                         && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) | 
			
		
	
		
			
				
					|  |  |  |  |                         || | 
			
		
	
		
			
				
					|  |  |  |  |                         (!supCertSetEntity.isNeed() | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supCertSetEntity.getForeign() != null | 
			
		
	
		
			
				
					|  |  |  |  |                         (       supCertSetEntity.getForeign() != null | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supCertSetEntity.getForeign() == 1 | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supManufacturerEntity.getCompanyType().equals("1")) | 
			
		
	
		
			
				
					|  |  |  |  |                         || | 
			
		
	
		
			
				
					|  |  |  |  |                         (!supCertSetEntity.isNeed() | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supCertSetEntity.getForeign() != null | 
			
		
	
		
			
				
					|  |  |  |  |                         (       supCertSetEntity.getForeign() != null | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supCertSetEntity.getForeign() == 3 | 
			
		
	
		
			
				
					|  |  |  |  |                                 && supManufacturerEntity.getCompanyType().equals("1"))) { | 
			
		
	
		
			
				
					|  |  |  |  |                     for (SupCertEntity supCertEntity : supCertEntityList) { | 
			
		
	
	
		
			
				
					|  |  |  | 
 |