parent
							
								
									b1e8a79f85
								
							
						
					
					
						commit
						8ddd7b05d0
					
				| @ -0,0 +1,58 @@ | ||||
| package com.glxp.api.admin.controller.business; | ||||
| 
 | ||||
| import cn.hutool.core.bean.BeanUtil; | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import com.github.pagehelper.PageInfo; | ||||
| import com.glxp.api.admin.entity.business.StockOrderEntity; | ||||
| import com.glxp.api.admin.req.business.StockOrderUploadRequest; | ||||
| import com.glxp.api.admin.res.PageSimpleResponse; | ||||
| import com.glxp.api.admin.res.inout.StockOrderResponse; | ||||
| import com.glxp.api.admin.service.business.StockOrderService; | ||||
| import com.glxp.api.admin.service.inout.OrderService; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 业务单据上传相关接口 | ||||
|  */ | ||||
| @RestController | ||||
| public class StockOrderUploadController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private StockOrderService stockOrderService; | ||||
|     @Resource | ||||
|     private OrderService orderService; | ||||
| 
 | ||||
|     /** | ||||
|      * 查询业务单据上传列表 | ||||
|      * | ||||
|      * @param request | ||||
|      * @return | ||||
|      */ | ||||
|     @GetMapping("/udiwms/stock/order/upload/filter") | ||||
|     public BaseResponse filter(StockOrderUploadRequest request) { | ||||
|         List<StockOrderEntity> list = stockOrderService.filter(request); | ||||
|         PageInfo<StockOrderEntity> pageInfo = new PageInfo<>(list); | ||||
|         List<StockOrderResponse> responses = new ArrayList<>(); | ||||
|         if (CollUtil.isNotEmpty(list)) { | ||||
|             for (StockOrderEntity stockOrderEntity : list) { | ||||
|                 StockOrderResponse stockOrderResponse = new StockOrderResponse(); | ||||
|                 BeanUtil.copyProperties(stockOrderEntity, stockOrderResponse); | ||||
|                 responses.add(stockOrderResponse); | ||||
|             } | ||||
|         } | ||||
|         orderService.checkSubmitOrder(responses); | ||||
|         PageSimpleResponse pageSimpleResponse = new PageSimpleResponse(); | ||||
|         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||
|         pageSimpleResponse.setList(responses); | ||||
|         return ResultVOUtils.success(pageSimpleResponse); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,57 @@ | ||||
| package com.glxp.api.admin.controller.business; | ||||
| 
 | ||||
| import com.github.pagehelper.PageInfo; | ||||
| import com.glxp.api.admin.entity.business.StockOrderUploadLogEntity; | ||||
| import com.glxp.api.admin.req.business.StockOrderUploadLogRequest; | ||||
| import com.glxp.api.admin.res.PageSimpleResponse; | ||||
| import com.glxp.api.admin.service.business.StockOrderUploadLogService; | ||||
| import com.glxp.api.common.enums.ResultEnum; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 单据上传日志接口 | ||||
|  */ | ||||
| @RestController | ||||
| public class StockOrderUploadLogController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private StockOrderUploadLogService stockOrderUploadLogService; | ||||
| 
 | ||||
|     /** | ||||
|      * 查询日志列表 | ||||
|      * | ||||
|      * @param request | ||||
|      * @return | ||||
|      */ | ||||
|     @GetMapping("/udiwms/stock/order/uploadLog/filter") | ||||
|     public BaseResponse filter(StockOrderUploadLogRequest request) { | ||||
|         List<StockOrderUploadLogEntity> list = stockOrderUploadLogService.filter(request); | ||||
|         PageInfo<StockOrderUploadLogEntity> pageInfo = new PageInfo<>(list); | ||||
|         PageSimpleResponse pageSimpleResponse = new PageSimpleResponse(); | ||||
|         pageSimpleResponse.setList(list); | ||||
|         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||
|         return ResultVOUtils.success(pageSimpleResponse); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 删除日志 | ||||
|      * | ||||
|      * @param id | ||||
|      * @return | ||||
|      */ | ||||
|     @GetMapping("/udiwms/stock/order/uploadLog/delete") | ||||
|     public BaseResponse delete(Integer id) { | ||||
|         if (null == id) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); | ||||
|         } | ||||
|         stockOrderUploadLogService.deleteByPrimaryKey(id); | ||||
|         return ResultVOUtils.success(""); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,50 @@ | ||||
| package com.glxp.api.admin.entity.business; | ||||
| 
 | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| /** | ||||
|  * 业务单据上传日志 | ||||
|  */ | ||||
| @Data | ||||
| public class StockOrderUploadLogEntity { | ||||
| 
 | ||||
|     private Long id; | ||||
| 
 | ||||
|     /** | ||||
|      * 单据号 | ||||
|      */ | ||||
|     private String billNo; | ||||
| 
 | ||||
|     /** | ||||
|      * 单据日期 | ||||
|      */ | ||||
|     private Date billDate; | ||||
| 
 | ||||
|     /** | ||||
|      * 单据类型 | ||||
|      */ | ||||
|     private String billType; | ||||
| 
 | ||||
|     /** | ||||
|      * 第三方单据号 | ||||
|      */ | ||||
|     private String thrBillNo; | ||||
| 
 | ||||
|     /** | ||||
|      * 提交时间 | ||||
|      */ | ||||
|     private Date submitTime; | ||||
| 
 | ||||
|     /** | ||||
|      * 提交状态 0.未提交 1.正在处理 2.已提交 3.提交失败 | ||||
|      */ | ||||
|     private Integer status; | ||||
| 
 | ||||
|     /** | ||||
|      * 结果信息 | ||||
|      */ | ||||
|     private String result; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,34 @@ | ||||
| package com.glxp.api.admin.req.business; | ||||
| 
 | ||||
| import com.glxp.api.admin.req.ListPageRequest; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| /** | ||||
|  * 业务单据上传日志查询参数 | ||||
|  */ | ||||
| @Data | ||||
| public class StockOrderUploadLogRequest extends ListPageRequest { | ||||
| 
 | ||||
|     /** | ||||
|      * 业务单据号 | ||||
|      */ | ||||
|     private String billNo; | ||||
| 
 | ||||
|     /** | ||||
|      * 第三方单据号 | ||||
|      */ | ||||
|     private String thirdBillNo; | ||||
| 
 | ||||
|     /** | ||||
|      * 提交时间 | ||||
|      */ | ||||
|     private Date submitTime; | ||||
| 
 | ||||
|     /** | ||||
|      * 提交状态 | ||||
|      */ | ||||
|     private Integer status; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,25 @@ | ||||
| package com.glxp.api.admin.service.business; | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.business.StockOrderUploadLogEntity; | ||||
| import com.glxp.api.admin.req.business.StockOrderUploadLogRequest; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public interface StockOrderUploadLogService { | ||||
| 
 | ||||
|     int deleteByPrimaryKey(Integer id); | ||||
| 
 | ||||
| 
 | ||||
|     int insert(StockOrderUploadLogEntity stockOrderUploadLogEntity); | ||||
| 
 | ||||
|     StockOrderUploadLogEntity selectByPrimaryKey(Integer id); | ||||
| 
 | ||||
|     int updateByPrimaryKey(StockOrderUploadLogEntity stockOrderUploadLogEntity); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询业务单据上传日志 | ||||
|      * @param request | ||||
|      * @return | ||||
|      */ | ||||
|     List<StockOrderUploadLogEntity> filter(StockOrderUploadLogRequest request); | ||||
| } | ||||
| @ -0,0 +1,68 @@ | ||||
| package com.glxp.api.admin.service.business.impl; | ||||
| 
 | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.admin.dao.business.StockOrderUploadLogDao; | ||||
| import com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity; | ||||
| import com.glxp.api.admin.entity.business.StockOrderUploadLogEntity; | ||||
| import com.glxp.api.admin.req.business.StockOrderUploadLogRequest; | ||||
| import com.glxp.api.admin.service.basic.BussinessLocalTypeService; | ||||
| import com.glxp.api.admin.service.business.StockOrderUploadLogService; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Slf4j | ||||
| @Service | ||||
| public class StockOrderUploadLogServiceImpl implements StockOrderUploadLogService { | ||||
| 
 | ||||
|     @Resource | ||||
|     private StockOrderUploadLogDao stockOrderUploadLogMapper; | ||||
|     @Resource | ||||
|     private BussinessLocalTypeService bussinessLocalTypeService; | ||||
| 
 | ||||
|     @Override | ||||
|     public int deleteByPrimaryKey(Integer id) { | ||||
|         return stockOrderUploadLogMapper.deleteByPrimaryKey(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int insert(StockOrderUploadLogEntity stockOrderUploadLogEntity) { | ||||
|         return stockOrderUploadLogMapper.insert(stockOrderUploadLogEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public StockOrderUploadLogEntity selectByPrimaryKey(Integer id) { | ||||
|         return stockOrderUploadLogMapper.selectByPrimaryKey(id); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public int updateByPrimaryKey(StockOrderUploadLogEntity stockOrderUploadLogEntity) { | ||||
|         return stockOrderUploadLogMapper.updateByPrimaryKey(stockOrderUploadLogEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<StockOrderUploadLogEntity> filter(StockOrderUploadLogRequest request) { | ||||
|         if (null == request) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
| 
 | ||||
|         if (request.getPage() != null) { | ||||
|             int offset = (request.getPage() - 1) * request.getLimit(); | ||||
|             PageHelper.offsetPage(offset, request.getLimit()); | ||||
|         } | ||||
|         List<StockOrderUploadLogEntity> list = stockOrderUploadLogMapper.selectList(request); | ||||
|         if (CollUtil.isNotEmpty(list)) { | ||||
|             for (StockOrderUploadLogEntity uploadLog : list) { | ||||
|                 BussinessLocalTypeEntity localTypeEntity = bussinessLocalTypeService.findBTByAction(uploadLog.getBillType()); | ||||
|                 uploadLog.setBillType(localTypeEntity.getName()); | ||||
|             } | ||||
|         } | ||||
|         return list; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue