|
|
|
@ -3,13 +3,21 @@ package com.glxp.api.admin.controller.inventory;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.api.admin.entity.info.SystemPDFModuleEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.info.SystemPDFTemplateEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.InvCountOrder;
|
|
|
|
|
import com.glxp.api.admin.req.info.SystemPDFModuleRequest;
|
|
|
|
|
import com.glxp.api.admin.req.inout.DeleteRequest;
|
|
|
|
|
import com.glxp.api.admin.req.inventory.FilterInvCountOrderRequest;
|
|
|
|
|
import com.glxp.api.admin.req.inventory.FilterInvCountOrderSaveRequest;
|
|
|
|
|
import com.glxp.api.admin.req.inventory.InvCountOrderPrintRequest;
|
|
|
|
|
import com.glxp.api.admin.req.itextpdf.InspectionPDFTemplateRequest;
|
|
|
|
|
import com.glxp.api.admin.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.admin.res.inventory.InvCountOrderResponse;
|
|
|
|
|
import com.glxp.api.admin.service.info.SystemPDFModuleService;
|
|
|
|
|
import com.glxp.api.admin.service.info.SystemPDFTemplateService;
|
|
|
|
|
import com.glxp.api.admin.service.inventory.InvCountOrderService;
|
|
|
|
|
import com.glxp.api.admin.util.JasperUtils;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
@ -20,8 +28,12 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 盘点单接口
|
|
|
|
@ -31,6 +43,10 @@ public class InvCountOrderController {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private InvCountOrderService invCountOrderService;
|
|
|
|
|
@Resource
|
|
|
|
|
private SystemPDFTemplateService systemPDFTemplateService;
|
|
|
|
|
@Resource
|
|
|
|
|
private SystemPDFModuleService systemPDFModuleService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询盘点单列表
|
|
|
|
@ -38,6 +54,7 @@ public class InvCountOrderController {
|
|
|
|
|
* @param filterInvCountOrderRequest
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/invCount/order/filter")
|
|
|
|
|
public BaseResponse filterList(FilterInvCountOrderRequest filterInvCountOrderRequest) {
|
|
|
|
|
List<InvCountOrderResponse> list = invCountOrderService.filterList(filterInvCountOrderRequest);
|
|
|
|
@ -54,6 +71,7 @@ public class InvCountOrderController {
|
|
|
|
|
* @param deleteRequest
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/invCount/order/delete")
|
|
|
|
|
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
|
|
|
|
invCountOrderService.deleteOrder(deleteRequest.getId());
|
|
|
|
@ -65,6 +83,7 @@ public class InvCountOrderController {
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/invCount/order/saveCountOrder")
|
|
|
|
|
public BaseResponse saveCountOrder(@RequestBody InvCountOrder invCountOrder, BindingResult bindingResult) {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
@ -83,6 +102,7 @@ public class InvCountOrderController {
|
|
|
|
|
* @param id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/invCount/order/submitAudit")
|
|
|
|
|
public BaseResponse submitAudit(String id) {
|
|
|
|
|
if (StrUtil.isBlank(id)) {
|
|
|
|
@ -97,6 +117,7 @@ public class InvCountOrderController {
|
|
|
|
|
* @param filterInvCountOrderRequest
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/invCount/order/updateCountOrderStatus")
|
|
|
|
|
public BaseResponse updateCountOrderStatus(@RequestBody FilterInvCountOrderRequest filterInvCountOrderRequest) {
|
|
|
|
|
if (null == filterInvCountOrderRequest || StrUtil.isBlank(filterInvCountOrderRequest.getId()) || null == filterInvCountOrderRequest.getStatus()) {
|
|
|
|
@ -105,6 +126,50 @@ public class InvCountOrderController {
|
|
|
|
|
return invCountOrderService.updateCountOrderStatus(filterInvCountOrderRequest.getId(), filterInvCountOrderRequest.getStatus());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 校验模板文件
|
|
|
|
|
*
|
|
|
|
|
* @param inspectionPDFTemplateRequest
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/invCount/order/verifyTemplateFile")
|
|
|
|
|
public BaseResponse verifyTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) {
|
|
|
|
|
if (null == inspectionPDFTemplateRequest) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
|
|
|
|
|
}
|
|
|
|
|
//查询模板文件是否存在
|
|
|
|
|
SystemPDFModuleRequest systemPDFModuleRequest = new SystemPDFModuleRequest();
|
|
|
|
|
systemPDFModuleRequest.setId(inspectionPDFTemplateRequest.getModuleId());
|
|
|
|
|
SystemPDFModuleEntity systemPDFModule = systemPDFModuleService.findSystemPDFModule(systemPDFModuleRequest);
|
|
|
|
|
if (null == systemPDFModule) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(systemPDFModule.getTemplateId()));
|
|
|
|
|
if (null == systemPDFTemplateEntity) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success(systemPDFModule.getTemplateId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 打印模板单号标签
|
|
|
|
|
*
|
|
|
|
|
* @param invCountOrderPrintRequest
|
|
|
|
|
* @param request
|
|
|
|
|
* @param response
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/invCount/order/printOrder")
|
|
|
|
|
public void printOrder(@RequestBody InvCountOrderPrintRequest invCountOrderPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
|
|
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(invCountOrderPrintRequest.getTemplateId());
|
|
|
|
|
//打印单号标签
|
|
|
|
|
Map<String, Object> data = new HashMap<>(1);
|
|
|
|
|
data.put("orderId", invCountOrderPrintRequest.getOrderId());
|
|
|
|
|
JasperUtils.jasperReport(request, response, data, systemPDFTemplateEntity.getPath(), "pdf");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------手持终端接口---------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|