上线bug修改,同步修改,发票修改
							parent
							
								
									3d28e40a03
								
							
						
					
					
						commit
						cc248bab94
					
				| @ -0,0 +1,62 @@ | |||||||
|  | package com.glxp.api.controller.inout; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.collection.CollUtil; | ||||||
|  | import cn.hutool.core.util.StrUtil; | ||||||
|  | import com.glxp.api.annotation.AuthRuleAnnotation; | ||||||
|  | import com.glxp.api.annotation.Log; | ||||||
|  | import com.glxp.api.common.res.BaseResponse; | ||||||
|  | import com.glxp.api.common.util.ResultVOUtils; | ||||||
|  | import com.glxp.api.constant.BusinessType; | ||||||
|  | import com.glxp.api.dao.inout.IoOrderInvoiceMapper; | ||||||
|  | import com.glxp.api.entity.inout.IoOrderInvoiceEntity; | ||||||
|  | import com.glxp.api.http.sync.SpGetHttpClient; | ||||||
|  | import com.glxp.api.idc.service.FileService; | ||||||
|  | import com.glxp.api.req.inout.AddBizProductReqeust; | ||||||
|  | import com.glxp.api.req.inout.RefreshInoiceRequest; | ||||||
|  | import com.glxp.api.service.inout.IoOrderInvoiceService; | ||||||
|  | import com.glxp.api.service.inout.IoOrderService; | ||||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||||
|  | import org.springframework.web.bind.annotation.RestController; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @RestController | ||||||
|  | public class IoOrderInvoiceController { | ||||||
|  |     @Resource | ||||||
|  |     IoOrderInvoiceMapper orderInvoiceMapper; | ||||||
|  |     @Resource | ||||||
|  |     SpGetHttpClient spGetHttpClient; | ||||||
|  |     @Resource | ||||||
|  |     FileService fileService; | ||||||
|  | 
 | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @PostMapping("/udiwms/inout/order/refrshInvoice") | ||||||
|  |     @Log(title = "发票", businessType = BusinessType.INSERT) | ||||||
|  |     public BaseResponse addBizProduct(@RequestBody RefreshInoiceRequest refreshInoiceRequest) { | ||||||
|  |         BaseResponse<List<IoOrderInvoiceEntity>> baseResponse = spGetHttpClient.getIoOrderInvoices(refreshInoiceRequest); | ||||||
|  |         if (baseResponse.getCode() == 20000) { | ||||||
|  |             List<IoOrderInvoiceEntity> orderInvoiceEntities = baseResponse.getData(); | ||||||
|  |             if (CollUtil.isNotEmpty(orderInvoiceEntities)) { | ||||||
|  |                 List<String> syncFiles = new ArrayList<>(); | ||||||
|  |                 for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) { | ||||||
|  |                     if (StrUtil.isNotEmpty(orderInvoiceEntity.getLicenseUrl())) { | ||||||
|  |                         syncFiles.add(orderInvoiceEntity.getLicenseUrl()); | ||||||
|  |                     } | ||||||
|  |                     orderInvoiceMapper.insertOrUpdate(orderInvoiceEntity); | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |                 if (CollUtil.isNotEmpty(syncFiles)) { | ||||||
|  |                     fileService.download(syncFiles); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             return ResultVOUtils.success("更新成功!"); | ||||||
|  |         } else | ||||||
|  |             return baseResponse; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,11 @@ | |||||||
|  | package com.glxp.api.req.inout; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class RefreshInoiceRequest { | ||||||
|  |     private Long id; | ||||||
|  |     private String orderIdFk; | ||||||
|  |     private Long bizIdFk; | ||||||
|  | 
 | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in New Issue