|
|
@@ -137,6 +137,7 @@ import java.nio.charset.StandardCharsets;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -154,6 +155,7 @@ import static cn.start.tz.framework.common.exception.util.ServiceExceptionUtil.e
|
|
|
import static cn.start.tz.framework.common.util.servlet.ServletUtils.getClientIP;
|
|
|
import static cn.start.tz.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
|
import static cn.start.tz.module.grape.city.enums.ApiConstants.TEMPLATE_NON_TAX;
|
|
|
+import static cn.start.tz.module.infra.api.sign.dto.SignValuesDTO.SIGN_GZ_INS_SEAL2;
|
|
|
import static cn.start.tz.module.pressure2.enums.ErrorCodeConstants.*;
|
|
|
|
|
|
/**
|
|
|
@@ -2048,7 +2050,7 @@ public class BoilerTaskOrderIssueReportServiceImpl extends ServiceImpl<BoilerTas
|
|
|
item.setRemainingDays(10);
|
|
|
}else{
|
|
|
LocalDate targetDate = item.getEndCheckDate().plusDays(10);
|
|
|
- long remainingDays = java.time.temporal.ChronoUnit.DAYS.between(java.time.LocalDate.now(), targetDate);
|
|
|
+ long remainingDays = ChronoUnit.DAYS.between(LocalDate.now(), targetDate);
|
|
|
item.setRemainingDays((int) remainingDays);
|
|
|
}
|
|
|
});
|
|
|
@@ -2847,17 +2849,49 @@ public class BoilerTaskOrderIssueReportServiceImpl extends ServiceImpl<BoilerTas
|
|
|
private ReportUrlInfo generateReportUrl(BoilerTaskOrderItemDO taskOrderItemDO) {
|
|
|
String reportUrl = "";
|
|
|
String fileUrl = "";
|
|
|
-
|
|
|
+ byte[] pdfByte = null;
|
|
|
if (StringUtils.isNotEmpty(taskOrderItemDO.getIssueUrl())) {
|
|
|
fileUrl = taskOrderItemDO.getIssueUrl();
|
|
|
} else {
|
|
|
- byte[] pdfByte = taskOrderService.getReportOutputStreamMerge(taskOrderItemDO.getId());
|
|
|
+ pdfByte = taskOrderService.getReportOutputStreamMerge(taskOrderItemDO.getId());
|
|
|
if (pdfByte != null){
|
|
|
fileUrl = fileApi.createFile(pdfByte);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (EnvEnum.PROD.getEnvName().equals(env)) {
|
|
|
+ if (pdfByte != null) {
|
|
|
+ try {
|
|
|
+ String id = taskOrderItemDO.getId();
|
|
|
+ List<SignValuesDTO> valuesDTOList = new ArrayList<>();
|
|
|
+ SignValuesDTO valuesDTO1 = new SignValuesDTO();
|
|
|
+ valuesDTO1.setSealType("JYZ");
|
|
|
+ valuesDTO1.setTextonce(0);
|
|
|
+ valuesDTO1.setText("机构公章或");
|
|
|
+ valuesDTOList.add(valuesDTO1);
|
|
|
+ SignValuesDTO valuesDTO2 = new SignValuesDTO();
|
|
|
+ valuesDTO2.setSealType(SIGN_GZ_INS_SEAL2);
|
|
|
+ valuesDTO2.setQfzdistance(400);
|
|
|
+ valuesDTO2.setQfznumber(32);
|
|
|
+ valuesDTO2.setQfzstart(1);
|
|
|
+ valuesDTO2.setQfzmode(1);
|
|
|
+ valuesDTOList.add(valuesDTO2);
|
|
|
+
|
|
|
+ String qrcode = String.format(boilerQrCodeUrl, id);
|
|
|
+ QrCodeValuesDTO qrCodeValuesDTO = new QrCodeValuesDTO();
|
|
|
+ qrCodeValuesDTO.setMetaname("特检院相关二维码");
|
|
|
+ qrCodeValuesDTO.setTextval(qrcode);
|
|
|
+ qrCodeValuesDTO.setPageno("1");
|
|
|
+ qrCodeValuesDTO.setWidth(95);
|
|
|
+ qrCodeValuesDTO.setHeight(95);
|
|
|
+ qrCodeValuesDTO.setX("515");
|
|
|
+ qrCodeValuesDTO.setY("700");
|
|
|
+ pdfByte = this.sign(pdfByte, valuesDTOList, qrCodeValuesDTO);
|
|
|
+ fileUrl = fileApi.createFile(pdfByte);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("盖章失败 {}",taskOrderItemDO.getEquipCode(),e);
|
|
|
+ }
|
|
|
+ }
|
|
|
reportUrl = minioHostouter + fileUrl;
|
|
|
} else {
|
|
|
reportUrl = minioHost + fileUrl;
|