内部码打印问题

pro
anthonywj 2 years ago
parent c2c7b0b339
commit 7c6b5b1da3

@ -186,34 +186,34 @@ public class InvInnerOrderPrintController {
} else { } else {
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("data", printEntities); data.put("data", printEntities);
JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/" + FileUtils.getLastFileName(systemPDFTemplateEntity.getPath()), "pdf");
} }
String orderId=""; String orderId = "";
for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) {
InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity(); InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity();
innerOrderPrintEntity.setStatus(1); innerOrderPrintEntity.setStatus(1);
innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId()); innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId());
invInnerOrderPrintService.updateOrder(innerOrderPrintEntity); invInnerOrderPrintService.updateOrder(innerOrderPrintEntity);
orderId=InnerOrderPrintResponse.getId()+""; orderId = InnerOrderPrintResponse.getId() + "";
} }
//查询订单id //查询订单id
InvInnerOrderPrintEntity innerOrderPrintEntity=invInnerOrderPrintService.selectById(orderId); InvInnerOrderPrintEntity innerOrderPrintEntity = invInnerOrderPrintService.selectById(orderId);
//更新内部码状态 //更新内部码状态
InnerOrderEntity innerOrderEntity=innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk()); InnerOrderEntity innerOrderEntity = innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk());
if(innerOrderEntity!=null){ if (innerOrderEntity != null) {
innerOrderEntity.setGenStatus(2); innerOrderEntity.setGenStatus(2);
innerOrderEntity.setId(innerOrderEntity.getId()); innerOrderEntity.setId(innerOrderEntity.getId());
innerOrderService.update(innerOrderEntity); innerOrderService.update(innerOrderEntity);
} }
IoOrderEntity ioOrderEntity=new IoOrderEntity(); IoOrderEntity ioOrderEntity = new IoOrderEntity();
ioOrderEntity.setInCodeStatus(1); ioOrderEntity.setInCodeStatus(1);
ioOrderEntity.setBillNo(innerOrderPrintEntity.getOrderIdFk()); ioOrderEntity.setBillNo(innerOrderPrintEntity.getOrderIdFk());
ioOrderService.updateByBillNo(ioOrderEntity); ioOrderService.updateByBillNo(ioOrderEntity);
@ -229,7 +229,7 @@ public class InvInnerOrderPrintController {
@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception { @RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception {
//查询模板文件是否存在 //查询模板文件是否存在
SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getLabelId()+""); SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getLabelId() + "");
if (null == sysPdfTemplateRelevanceStatemenEntity) { if (null == sysPdfTemplateRelevanceStatemenEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
} }
@ -247,7 +247,7 @@ public class InvInnerOrderPrintController {
@RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest, @RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest,
HttpServletRequest request, HttpServletResponse response) throws Exception { HttpServletRequest request, HttpServletResponse response) throws Exception {
SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(stockQRCodeTextPDFTemplateRequest.getLabelId()+""); SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(stockQRCodeTextPDFTemplateRequest.getLabelId() + "");
if (sysPdfTemplateRelevanceStatemenEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查"); if (sysPdfTemplateRelevanceStatemenEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查");
SystemPDFTemplateEntity systemPDFTemplateEntity = SystemPDFTemplateEntity systemPDFTemplateEntity =

@ -153,6 +153,7 @@ public class IoOrderServiceImpl implements IoOrderService {
orderEntity.setRelKey(UUID.fastUUID().toString(true)); orderEntity.setRelKey(UUID.fastUUID().toString(true));
} }
orderEntity.setExportStatus(0); //上传状态:未上传 orderEntity.setExportStatus(0); //上传状态:未上传
orderEntity.setInCodeStatus(0);
return orderDao.insert(orderEntity); return orderDao.insert(orderEntity);
} }

@ -1,5 +1,7 @@
package com.glxp.api.util; package com.glxp.api.util;
import cn.hutool.core.util.StrUtil;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
@ -529,6 +531,16 @@ public class FileUtils {
} }
} }
public static String getLastFileName(String fileName) {
String fileNameNow = fileName.substring(fileName.lastIndexOf("/") + 1);
if (StrUtil.isEmpty(fileNameNow))
return fileName;
else
return fileNameNow;
}
/** /**
* *
* *
@ -538,6 +550,7 @@ public class FileUtils {
* @return * @return
* @since 1.0 * @since 1.0
*/ */
public static String getSubpath(String pathName, String fileName) { public static String getSubpath(String pathName, String fileName) {
int index = fileName.indexOf(pathName); int index = fileName.indexOf(pathName);
if (index != -1) { if (index != -1) {

Loading…
Cancel
Save