You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			89 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Java
		
	
		
		
			
		
	
	
			89 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Java
		
	
| 
								 
											3 years ago
										 
									 | 
							
								package com.glxp.api.controller.inv;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import cn.hutool.core.util.StrUtil;
							 | 
						||
| 
								 | 
							
								import com.github.pagehelper.PageInfo;
							 | 
						||
| 
								 | 
							
								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.entity.inv.InvCountCodesEntity;
							 | 
						||
| 
								 | 
							
								import com.glxp.api.req.inv.FilterInvCountCodesRequest;
							 | 
						||
| 
								 | 
							
								import com.glxp.api.res.PageSimpleResponse;
							 | 
						||
| 
								 | 
							
								import com.glxp.api.service.inv.InvCountCodesService;
							 | 
						||
| 
								 | 
							
								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.util.List;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * 盘点单据码表
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								@RestController
							 | 
						||
| 
								 | 
							
								public class InvCountCodesController {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    @Resource
							 | 
						||
| 
								 | 
							
								    private InvCountCodesService invCountCodesService;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * 查询码表
							 | 
						||
| 
								 | 
							
								     *
							 | 
						||
| 
								 | 
							
								     * @param codesRequest
							 | 
						||
| 
								 | 
							
								     * @return
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    @GetMapping("/inv/count/codes/filter")
							 | 
						||
| 
								 | 
							
								    public BaseResponse filterList(FilterInvCountCodesRequest codesRequest) {
							 | 
						||
| 
								 | 
							
								        List<InvCountCodesEntity> list = invCountCodesService.filterList(codesRequest);
							 | 
						||
| 
								 | 
							
								        PageInfo<InvCountCodesEntity> pageInfo = new PageInfo<>(list);
							 | 
						||
| 
								 | 
							
								        PageSimpleResponse<InvCountCodesEntity> pageSimpleResponse = new PageSimpleResponse<>();
							 | 
						||
| 
								 | 
							
								        pageSimpleResponse.setTotal(pageInfo.getTotal());
							 | 
						||
| 
								 | 
							
								        pageSimpleResponse.setList(list);
							 | 
						||
| 
								 | 
							
								        return ResultVOUtils.success(pageSimpleResponse);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * 移除条码
							 | 
						||
| 
								 | 
							
								     *
							 | 
						||
| 
								 | 
							
								     * @param codesRequest
							 | 
						||
| 
								 | 
							
								     * @return
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    @PostMapping("/inv/count/codes/deleteCode")
							 | 
						||
| 
								 | 
							
								    public BaseResponse deleteCode(@RequestBody FilterInvCountCodesRequest codesRequest) {
							 | 
						||
| 
								 | 
							
								        if (null == codesRequest || StrUtil.isBlank(codesRequest.getOrderIdFk()) || StrUtil.isBlank(codesRequest.getRelId()) || StrUtil.isBlank(codesRequest.getCode())) {
							 | 
						||
| 
								 | 
							
								            return ResultVOUtils.success(ResultEnum.PARAM_VERIFY_FALL);
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								        return invCountCodesService.deleteCode(codesRequest);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * 添加条码
							 | 
						||
| 
								 | 
							
								     *
							 | 
						||
| 
								 | 
							
								     * @param invCountCodes
							 | 
						||
| 
								 | 
							
								     * @return
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    @PostMapping("/inv/count/codes/addCode")
							 | 
						||
| 
								 | 
							
								    public BaseResponse addCode(@RequestBody InvCountCodesEntity invCountCodes) {
							 | 
						||
| 
								 | 
							
								        if (null == invCountCodes || StrUtil.isBlank(invCountCodes.getCode())) {
							 | 
						||
| 
								 | 
							
								            return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								        return invCountCodesService.addCode(invCountCodes);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * 根据此盘点单据号统计条码数量
							 | 
						||
| 
								 | 
							
								     *
							 | 
						||
| 
								 | 
							
								     * @param orderIdFk
							 | 
						||
| 
								 | 
							
								     * @return
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    @GetMapping("/inv/count/codes/getCountOrderCodesNum")
							 | 
						||
| 
								 | 
							
								    public BaseResponse getCountOrderCodesNum(String orderIdFk) {
							 | 
						||
| 
								 | 
							
								        if (StrUtil.isBlank(orderIdFk)) {
							 | 
						||
| 
								 | 
							
								            return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								        Long codesNum = invCountCodesService.getCountOrderCodesNum(orderIdFk);
							 | 
						||
| 
								 | 
							
								        return ResultVOUtils.success(codesNum);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								}
							 |