|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.api.controller.inv;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.api.annotation.Log;
|
|
|
|
@ -12,6 +13,7 @@ import com.glxp.api.entity.inv.InnerOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvInnerOrderPdfTempEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvInnerOrderPrintEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
|
|
|
|
|
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
|
|
|
|
|
import com.glxp.api.req.inv.*;
|
|
|
|
@ -186,34 +188,34 @@ public class InvInnerOrderPrintController {
|
|
|
|
|
} else {
|
|
|
|
|
Map<String, Object> data = new HashMap<String, Object>();
|
|
|
|
|
data.put("data", printEntities);
|
|
|
|
|
JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf");
|
|
|
|
|
JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
String orderId="";
|
|
|
|
|
String orderId = "";
|
|
|
|
|
for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) {
|
|
|
|
|
InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity();
|
|
|
|
|
innerOrderPrintEntity.setStatus(1);
|
|
|
|
|
innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId());
|
|
|
|
|
invInnerOrderPrintService.updateOrder(innerOrderPrintEntity);
|
|
|
|
|
orderId=InnerOrderPrintResponse.getId()+"";
|
|
|
|
|
orderId = InnerOrderPrintResponse.getId() + "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询订单id
|
|
|
|
|
InvInnerOrderPrintEntity innerOrderPrintEntity=invInnerOrderPrintService.selectById(orderId);
|
|
|
|
|
InvInnerOrderPrintEntity innerOrderPrintEntity = invInnerOrderPrintService.selectById(orderId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新内部码状态
|
|
|
|
|
|
|
|
|
|
InnerOrderEntity innerOrderEntity=innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk());
|
|
|
|
|
if(innerOrderEntity!=null){
|
|
|
|
|
InnerOrderEntity innerOrderEntity = innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk());
|
|
|
|
|
if (innerOrderEntity != null) {
|
|
|
|
|
innerOrderEntity.setGenStatus(2);
|
|
|
|
|
innerOrderEntity.setId(innerOrderEntity.getId());
|
|
|
|
|
innerOrderService.update(innerOrderEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IoOrderEntity ioOrderEntity=new IoOrderEntity();
|
|
|
|
|
IoOrderEntity ioOrderEntity = new IoOrderEntity();
|
|
|
|
|
ioOrderEntity.setInCodeStatus(1);
|
|
|
|
|
ioOrderEntity.setBillNo(innerOrderPrintEntity.getOrderIdFk());
|
|
|
|
|
ioOrderService.updateByBillNo(ioOrderEntity);
|
|
|
|
@ -221,6 +223,95 @@ public class InvInnerOrderPrintController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------打印码
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/pdf/template/inspection/stock/qrcode/text/statement/file")
|
|
|
|
|
public BaseResponse inspectionStockQRCodeTextPDFFromTemplateStatementFile(
|
|
|
|
|
@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception {
|
|
|
|
|
|
|
|
|
|
//查询模板文件是否存在
|
|
|
|
|
SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getLabelId()+"");
|
|
|
|
|
if (null == sysPdfTemplateRelevanceStatemenEntity) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()));
|
|
|
|
|
if (null == systemPDFTemplateEntity) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/pdf/template/stock/qrcode/text/statement/file")
|
|
|
|
|
public BaseResponse stockQRCodeTextPDFFromTemplateStatementFile(
|
|
|
|
|
@RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest,
|
|
|
|
|
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
|
|
|
|
|
|
|
SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(stockQRCodeTextPDFTemplateRequest.getLabelId()+"");
|
|
|
|
|
if (sysPdfTemplateRelevanceStatemenEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查");
|
|
|
|
|
|
|
|
|
|
SystemPDFTemplateEntity systemPDFTemplateEntity =
|
|
|
|
|
systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()));
|
|
|
|
|
if (systemPDFTemplateEntity == null) return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
|
|
|
|
|
|
|
|
|
|
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<InnerOrderPrintResponse> stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterinnerOrderprintRequest);
|
|
|
|
|
if (stockPrintEntities != null && stockPrintEntities.size() > 0) {
|
|
|
|
|
mStockPrintEntities.addAll(stockPrintEntities);
|
|
|
|
|
}
|
|
|
|
|
for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) {
|
|
|
|
|
PdfPrintCountEntity pdfPrintCount = getCount(stockQRCodeTextPDFTemplateRequest.getCountList(), InnerOrderPrintResponse);
|
|
|
|
|
if (pdfPrintCount != null && pdfPrintCount.getRowCount() > 0) {
|
|
|
|
|
for (int i = 0; i < pdfPrintCount.getRowCount(); i++) {
|
|
|
|
|
InnerOrderPrintResponse clone = new InnerOrderPrintResponse();
|
|
|
|
|
BeanUtils.copyProperties(InnerOrderPrintResponse, clone);
|
|
|
|
|
printEntities.add(clone);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
printEntities.add(InnerOrderPrintResponse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String param = JSON.toJSONString(printEntities);
|
|
|
|
|
JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
|
|
|
|
|
|
|
|
|
|
String orderId = "";
|
|
|
|
|
for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) {
|
|
|
|
|
InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity();
|
|
|
|
|
innerOrderPrintEntity.setStatus(1);
|
|
|
|
|
innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId());
|
|
|
|
|
invInnerOrderPrintService.updateOrder(innerOrderPrintEntity);
|
|
|
|
|
orderId = InnerOrderPrintResponse.getId() + "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询订单id
|
|
|
|
|
InvInnerOrderPrintEntity innerOrderPrintEntity = invInnerOrderPrintService.selectById(orderId);
|
|
|
|
|
//更新内部码状态
|
|
|
|
|
InnerOrderEntity innerOrderEntity = innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk());
|
|
|
|
|
if (innerOrderEntity != null) {
|
|
|
|
|
innerOrderEntity.setGenStatus(2);
|
|
|
|
|
innerOrderEntity.setId(innerOrderEntity.getId());
|
|
|
|
|
innerOrderService.update(innerOrderEntity);
|
|
|
|
|
}
|
|
|
|
|
IoOrderEntity ioOrderEntity = new IoOrderEntity();
|
|
|
|
|
ioOrderEntity.setInCodeStatus(1);
|
|
|
|
|
ioOrderEntity.setBillNo(innerOrderPrintEntity.getOrderIdFk());
|
|
|
|
|
ioOrderService.updateByBillNo(ioOrderEntity);
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PdfPrintCountEntity getCount(List<PdfPrintCountEntity> countList, InnerOrderPrintResponse InnerOrderPrintResponse) {
|
|
|
|
|
for (PdfPrintCountEntity pdfPrintCount : countList) {
|
|
|
|
|
if (pdfPrintCount.getQueryId().equals(InnerOrderPrintResponse.getId() + "")) {
|
|
|
|
|