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.
udi-spms-java/src/main/java/com/glxp/api/controller/inout/IoCodeController.java

85 lines
2.7 KiB
Java

package com.glxp.api.controller.inout;
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.controller.BaseController;
import com.glxp.api.entity.inout.IoCodeEntity;
import com.glxp.api.req.inout.FilterCodeRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inout.IoCodeResponse;
import com.glxp.api.service.inout.IoCodeService;
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 IoCodeController extends BaseController {
@Resource
private IoCodeService ioCodeService;
/**
* 查询单据正式码表数据
*
* @param filterCodeRequest
* @return
*/
@GetMapping("/udiwms/inout/code/filterList")
public BaseResponse filterList(FilterCodeRequest filterCodeRequest) {
List<IoCodeResponse> list = ioCodeService.filterList(filterCodeRequest);
PageInfo<IoCodeResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
/**
* 根据单据号查询正式码表数据
*
* @return
*/
@GetMapping("/udiwms/inout/code/findByOrderId")
public BaseResponse findAllByOrderId(FilterCodeRequest filterCodeRequest) {
List<IoCodeResponse> list = ioCodeService.filterList(filterCodeRequest);
PageInfo<IoCodeResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.success(pageInfo);
}
/**
* 单据复核,获取单据对应条码
*/
@AuthRuleAnnotation("")
@GetMapping("spms/inout/dlcode/findByOrderId")
public BaseResponse downloadCodesByOrderId(String orderId) {
List<IoCodeEntity> codeEntityList = ioCodeService.findByOrderId(orderId);
PageInfo<IoCodeEntity> pageInfo;
pageInfo = new PageInfo<>(codeEntityList);
PageSimpleResponse<IoCodeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(codeEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
* 单据编辑,+
*
* @param filterCodeRequest
* @return
*/
@GetMapping("/udiwms/inout/code/getCodeListForEdit")
public BaseResponse getCodeListForEdit(FilterCodeRequest filterCodeRequest) {
List<IoCodeResponse> list = ioCodeService.getCodeListForEdit(filterCodeRequest);
PageInfo<IoCodeResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
}