|  |  |  | @ -2,19 +2,27 @@ package com.glxp.api.controller.purchase; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 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.CustomerInfoEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.purchase.SupCertEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.purchase.SupCompanyEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.purchase.SupManufacturerEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.purchase.SupProductEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.purchase.FilterImageRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.purchase.FilterSupCertRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.purchase.FilterSupCompanyRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.res.PageSimpleResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.res.purchase.SupProductResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.auth.CustomerInfoService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.purchase.SupCertService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.purchase.SupCompanyService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.purchase.SupManufacturerService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.purchase.SupProductService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.system.CompanyService; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.validation.BindingResult; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
			
		
	
	
		
			
				
					|  |  |  | @ -25,10 +33,17 @@ import org.springframework.web.bind.annotation.RestController; | 
			
		
	
		
			
				
					|  |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.ArrayList; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Arrays; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Date; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | @RestController | 
			
		
	
		
			
				
					|  |  |  |  | public class SupCompanyController { | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     SupProductService supProductService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     SupManufacturerService supManufacturerService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     SupCompanyService supCompanyService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private SupCertService supCertService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
	
		
			
				
					|  |  |  | @ -71,18 +86,38 @@ public class SupCompanyController { | 
			
		
	
		
			
				
					|  |  |  |  |         return ResultVOUtils.success(pageSimpleResponse); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     //撤回单据
 | 
			
		
	
		
			
				
					|  |  |  |  |     @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("成功"); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | //    //首营预览文件
 | 
			
		
	
		
			
				
					|  |  |  |  | //    @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);
 | 
			
		
	
		
			
				
					|  |  |  |  | //    }
 | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |