库存校验比对
							parent
							
								
									3b819eab23
								
							
						
					
					
						commit
						d19f96d2ca
					
				| @ -0,0 +1,89 @@ | |||||||
|  | package com.glxp.api.controller.inv; | ||||||
|  | 
 | ||||||
|  | import com.github.pagehelper.PageInfo; | ||||||
|  | import com.glxp.api.annotation.AuthRuleAnnotation; | ||||||
|  | import com.glxp.api.common.res.BaseResponse; | ||||||
|  | import com.glxp.api.common.util.ResultVOUtils; | ||||||
|  | import com.glxp.api.req.inv.ErrorMsgRequest; | ||||||
|  | import com.glxp.api.req.inv.FilterInvPreProductRequest; | ||||||
|  | import com.glxp.api.req.inv.FilterInvPreinProductRequest; | ||||||
|  | import com.glxp.api.req.inv.FilterInvProductRequest; | ||||||
|  | import com.glxp.api.res.inv.InvPreProductResponse; | ||||||
|  | import com.glxp.api.res.inv.InvPreinProductResponse; | ||||||
|  | import com.glxp.api.res.inv.InvProductPageResponse; | ||||||
|  | import com.glxp.api.res.inv.InvProductResponse; | ||||||
|  | import com.glxp.api.service.inv.InvPreProductService; | ||||||
|  | import com.glxp.api.service.inv.InvPreinProductService; | ||||||
|  | import com.glxp.api.service.inv.InvProductService; | ||||||
|  | import com.glxp.api.util.FileUtils; | ||||||
|  | import org.springframework.beans.factory.annotation.Value; | ||||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||||
|  | 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.io.IOException; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 校验内外网库存接口 | ||||||
|  |  */ | ||||||
|  | @RestController | ||||||
|  | public class VailInvController { | ||||||
|  |     @Resource | ||||||
|  |     private InvProductService invProductService; | ||||||
|  |     @Resource | ||||||
|  |     private InvPreinProductService invPreinProductService; | ||||||
|  |     @Resource | ||||||
|  |     private InvPreProductService invPreProductService; | ||||||
|  | 
 | ||||||
|  |     @Value("${err_path}") | ||||||
|  |     String errPath; | ||||||
|  | 
 | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @GetMapping("/spms/inv/product/vail") | ||||||
|  |     public BaseResponse invProductVail(FilterInvProductRequest filterInvProductRequest) { | ||||||
|  | 
 | ||||||
|  |         List<InvProductResponse> list = invProductService.filterListProduct(filterInvProductRequest); | ||||||
|  |         PageInfo<InvProductResponse> pageInfo = new PageInfo<>(list); | ||||||
|  |         InvProductPageResponse<InvProductResponse> pageResponse = new InvProductPageResponse(); | ||||||
|  |         pageResponse.setList(pageInfo.getList()); | ||||||
|  |         pageResponse.setTotal(pageInfo.getTotal()); | ||||||
|  |         return ResultVOUtils.success(pageResponse); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @GetMapping("/spms/inv/pre/product/vail") | ||||||
|  |     public BaseResponse invPreProductVail(FilterInvPreProductRequest filterInvProductRequest) { | ||||||
|  | 
 | ||||||
|  |         List<InvPreProductResponse> list = invPreProductService.filterList(filterInvProductRequest); | ||||||
|  |         PageInfo<InvPreProductResponse> pageInfo = new PageInfo<>(list); | ||||||
|  |         InvProductPageResponse<InvPreProductResponse> pageResponse = new InvProductPageResponse(); | ||||||
|  |         pageResponse.setList(pageInfo.getList()); | ||||||
|  |         pageResponse.setTotal(pageInfo.getTotal()); | ||||||
|  |         return ResultVOUtils.success(pageResponse); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @GetMapping("/spms/inv/preIn/product/vail") | ||||||
|  |     public BaseResponse invPreInProductVail(FilterInvPreinProductRequest filterInvProductRequest) { | ||||||
|  |         List<InvPreinProductResponse> list = invPreinProductService.filterList(filterInvProductRequest); | ||||||
|  |         PageInfo<InvPreinProductResponse> pageInfo = new PageInfo<>(list); | ||||||
|  |         InvProductPageResponse<InvPreinProductResponse> pageResponse = new InvProductPageResponse(); | ||||||
|  |         pageResponse.setList(pageInfo.getList()); | ||||||
|  |         pageResponse.setTotal(pageInfo.getTotal()); | ||||||
|  |         return ResultVOUtils.success(pageResponse); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/spms/inv/vail/errMsg") | ||||||
|  |     public void genErrorLog(@RequestBody ErrorMsgRequest errorMsgRequest) { | ||||||
|  |         try { | ||||||
|  |             FileUtils.writeFile(errPath, "库存校验-", errorMsgRequest.getErrMsg()); | ||||||
|  |         } catch (IOException e) { | ||||||
|  |             e.printStackTrace(); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,8 @@ | |||||||
|  | package com.glxp.api.req.inv; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class ErrorMsgRequest { | ||||||
|  |     String errMsg; | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in New Issue