11/26 内部码打印

lh_dev_fifo
wangwei 7 months ago
parent c780a22859
commit d10298d4a1

@ -1,5 +1,9 @@
package com.glxp.api.service.inv.impl;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.util.udi.UdiCalCountUtil;
import org.springframework.beans.BeanUtils;
import cn.hutool.core.collection.CollUtil;
@ -167,10 +171,22 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
@Override
public PageSimpleResponse print(InnerOrderQRCodeTextPDFTemplateRequest innerOrderQRCodeTextPDFTemplateRequest) {
SystemPDFModuleEntity systemPDFModuleEntity = systemPDFModuleService.selectById(6 + "");
if (systemPDFModuleEntity == null) return null;
SysPdfTemplateRelevanceLabelEntity sysPdfTemplateRelevanceLabelEntity = systemPDFModuleService.selectByLabelId(innerOrderQRCodeTextPDFTemplateRequest.getLabelId() + "");
if (sysPdfTemplateRelevanceLabelEntity == null) {
throw new JsonException(500,"未找到单据模板模块设置,请检查");
}
SystemPDFTemplateEntity systemPDFTemplateEntity =
systemPDFTemplateService.selectById(String.valueOf(systemPDFModuleEntity.getTemplateId()));
systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceLabelEntity.getTemplateId()));
if (systemPDFTemplateEntity == null) {
throw new JsonException(500,"模板错误");
}
// SystemPDFModuleEntity systemPDFModuleEntity = systemPDFModuleService.selectById(6 + "");
// if (systemPDFModuleEntity == null) return null;
// SystemPDFTemplateEntity systemPDFTemplateEntity =
// systemPDFTemplateService.selectById(String.valueOf(systemPDFModuleEntity.getTemplateId()));
if (systemPDFTemplateEntity == null) return null;
List<InnerOrderPrintResponse> printEntities = new ArrayList<>();
List<InnerOrderPrintResponse> mStockPrintEntities = new ArrayList<>();

@ -34,7 +34,7 @@ import java.util.Map;
public class JasperUtils {
private static Logger logger = LoggerFactory.getLogger(JasperUtils.class);
public static final String PDF_TYPE = "pdf";
public static final String PDF_TYPE = "pdf/template";
public static final String WORD_TYPE = "word";
public static final String EXCEL_TYPE = "excel";
public static final String HTML_TYPE = "html";
@ -117,7 +117,7 @@ public class JasperUtils {
map.put("JSON_INPUT_STREAM", is); //填充报表数据
map.put(JsonQueryExecuterFactory.JSON_LOCALE, Locale.ENGLISH);
// ClassPathResource resource = new ClassPathResource(jasperResource);
FileInputStream jasperStream = new FileInputStream(new File(jasperResource));
FileInputStream jasperStream = new FileInputStream(new File("D:/udi/udiwms/udiwmsfile/" + PDF_TYPE + "/" + jasperResource));
// InputStream jasperStream = resource.getInputStream();
JasperReport jasperReport = (JasperReport) JRLoader.loadObject(jasperStream);

Loading…
Cancel
Save