|
|
|
@ -1,13 +1,10 @@
|
|
|
|
|
package com.glxp.api.controller.inv;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
|
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.dao.inv.InvInnerOrderPdfTempDao;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvInnerOrderPrintEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvInnerOrderPdfTempEntity;
|
|
|
|
@ -16,11 +13,8 @@ import com.glxp.api.entity.system.SystemPDFTemplateEntity;
|
|
|
|
|
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
|
|
|
|
|
import com.glxp.api.req.inv.*;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.inv.innerOrderPrintRequest;
|
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.service.basic.UdiProductService;
|
|
|
|
|
import com.glxp.api.res.inv.InnerOrderPrintResponse;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
|
import com.glxp.api.service.inv.InnerOrderDetailService;
|
|
|
|
|
import com.glxp.api.service.inv.InvInnerOrderPdfTempService;
|
|
|
|
|
import com.glxp.api.service.inv.InvInnerOrderPrintService;
|
|
|
|
|
import com.glxp.api.service.inv.JaspaperService;
|
|
|
|
@ -31,7 +25,6 @@ import com.glxp.api.util.FileUtils;
|
|
|
|
|
import com.glxp.api.util.JasperUtils;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
@ -66,9 +59,9 @@ public class InvInnerOrderPrintController {
|
|
|
|
|
|
|
|
|
|
@GetMapping("/udiwms/innerOrderPrint/filter")
|
|
|
|
|
public BaseResponse filterList(FilterinnerOrderprintRequest filterinnerOrderprintRequest) {
|
|
|
|
|
List<InvInnerOrderPrintEntity> list = invInnerOrderPrintService.filterOrderPrintList(filterinnerOrderprintRequest);
|
|
|
|
|
PageInfo<InvInnerOrderPrintEntity> pageInfo = new PageInfo<>(list);
|
|
|
|
|
PageSimpleResponse<InvInnerOrderPrintEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
List<InnerOrderPrintResponse> list = invInnerOrderPrintService.filterJoinInnerPrint(filterinnerOrderprintRequest);
|
|
|
|
|
PageInfo<InnerOrderPrintResponse> pageInfo = new PageInfo<>(list);
|
|
|
|
|
PageSimpleResponse<InnerOrderPrintResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
|
pageSimpleResponse.setList(pageInfo.getList());
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
@ -117,28 +110,28 @@ public class InvInnerOrderPrintController {
|
|
|
|
|
SystemPDFTemplateEntity systemPDFTemplateEntity =
|
|
|
|
|
systemPDFTemplateService.selectById(String.valueOf(systemPDFModuleEntity.getTemplateId()));
|
|
|
|
|
if (systemPDFTemplateEntity == null) return null;
|
|
|
|
|
List<innerOrderPrintRequest> printEntities = new ArrayList<>();
|
|
|
|
|
List<innerOrderPrintRequest> mStockPrintEntities = new ArrayList<>();
|
|
|
|
|
List<InnerOrderPrintResponse> printEntities = new ArrayList<>();
|
|
|
|
|
List<InnerOrderPrintResponse> mStockPrintEntities = new ArrayList<>();
|
|
|
|
|
FilterinnerOrderprintRequest filterinnerOrderprintRequest = new FilterinnerOrderprintRequest();
|
|
|
|
|
if (stockQRCodeTextPDFTemplateRequest.getOrderId() != null) {
|
|
|
|
|
filterinnerOrderprintRequest.setSOrderId(stockQRCodeTextPDFTemplateRequest.getOrderId());
|
|
|
|
|
} else {
|
|
|
|
|
filterinnerOrderprintRequest.setId(stockQRCodeTextPDFTemplateRequest.getQueryId());
|
|
|
|
|
}
|
|
|
|
|
List<innerOrderPrintRequest> stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterinnerOrderprintRequest);
|
|
|
|
|
List<InnerOrderPrintResponse> stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterinnerOrderprintRequest);
|
|
|
|
|
if (stockPrintEntities != null && stockPrintEntities.size() > 0) {
|
|
|
|
|
mStockPrintEntities.addAll(stockPrintEntities);
|
|
|
|
|
}
|
|
|
|
|
for (innerOrderPrintRequest innerOrderPrintRequest : mStockPrintEntities) {
|
|
|
|
|
PdfPrintCountEntity pdfPrintCount = getCount(stockQRCodeTextPDFTemplateRequest.getCountList(), innerOrderPrintRequest);
|
|
|
|
|
for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) {
|
|
|
|
|
PdfPrintCountEntity pdfPrintCount = getCount(stockQRCodeTextPDFTemplateRequest.getCountList(), InnerOrderPrintResponse);
|
|
|
|
|
if (pdfPrintCount != null && pdfPrintCount.getRowCount() > 0) {
|
|
|
|
|
for (int i = 0; i < pdfPrintCount.getRowCount(); i++) {
|
|
|
|
|
innerOrderPrintRequest clone = new innerOrderPrintRequest();
|
|
|
|
|
BeanUtils.copyProperties(innerOrderPrintRequest, clone);
|
|
|
|
|
InnerOrderPrintResponse clone = new InnerOrderPrintResponse();
|
|
|
|
|
BeanUtils.copyProperties(InnerOrderPrintResponse, clone);
|
|
|
|
|
printEntities.add(clone);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
printEntities.add(innerOrderPrintRequest);
|
|
|
|
|
printEntities.add(InnerOrderPrintResponse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -146,7 +139,7 @@ public class InvInnerOrderPrintController {
|
|
|
|
|
if (!FileUtils.isFileExist(dirPath + "/pdfprint")) {
|
|
|
|
|
new File(dirPath + "/pdfprint").mkdirs();
|
|
|
|
|
}
|
|
|
|
|
List<List<innerOrderPrintRequest>> splits = CustomUtil.splitList(printEntities, 100);
|
|
|
|
|
List<List<InnerOrderPrintResponse>> splits = CustomUtil.splitList(printEntities, 100);
|
|
|
|
|
int index = 0;
|
|
|
|
|
List<InvInnerOrderPdfTempEntity> stockPrintTempEntities = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < splits.size(); i++) {
|
|
|
|
@ -185,10 +178,10 @@ public class InvInnerOrderPrintController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
for (innerOrderPrintRequest innerOrderPrintRequest : mStockPrintEntities) {
|
|
|
|
|
for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) {
|
|
|
|
|
InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity();
|
|
|
|
|
innerOrderPrintEntity.setStatus(1);
|
|
|
|
|
innerOrderPrintEntity.setId(innerOrderPrintRequest.getId());
|
|
|
|
|
innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId());
|
|
|
|
|
invInnerOrderPrintService.updateOrder(innerOrderPrintEntity);
|
|
|
|
|
}
|
|
|
|
|
IoOrderEntity ioOrderEntity=new IoOrderEntity();
|
|
|
|
@ -198,9 +191,9 @@ public class InvInnerOrderPrintController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PdfPrintCountEntity getCount(List<PdfPrintCountEntity> countList, innerOrderPrintRequest innerOrderPrintRequest) {
|
|
|
|
|
public PdfPrintCountEntity getCount(List<PdfPrintCountEntity> countList, InnerOrderPrintResponse InnerOrderPrintResponse) {
|
|
|
|
|
for (PdfPrintCountEntity pdfPrintCount : countList) {
|
|
|
|
|
if (pdfPrintCount.getQueryId().equals(innerOrderPrintRequest.getId() + "")) {
|
|
|
|
|
if (pdfPrintCount.getQueryId().equals(InnerOrderPrintResponse.getId() + "")) {
|
|
|
|
|
return pdfPrintCount;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|