优化PI分页
This commit is contained in:
parent
3c550c6f50
commit
f56ec80d51
|
|
@ -69,6 +69,7 @@ import cn.hangtag.module.system.service.mail.MailSendService;
|
|||
import cn.hangtag.module.system.service.user.AdminUserService;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
|
|
@ -719,34 +720,37 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
SaleContractSaveReqVO saleContractVO = toSaleContractVO(saleOrder, entrys);
|
||||
SaleContractDO saleContract = BeanUtils.toBean(saleContractVO, SaleContractDO.class);
|
||||
List<SaleContractEntryDO> saleContractEntrys = BeanUtils.toBean(saleContractVO.getSaleContractEntrys(), SaleContractEntryDO.class);
|
||||
String htmlContent = generateHtmlContent(saleContract, saleContractEntrys);
|
||||
|
||||
List<List<SaleContractEntryDO>> split = ListUtil.split(saleContractEntrys, 6);
|
||||
int i = 1;
|
||||
for (List<SaleContractEntryDO> saleContractEntryDOS : split) {
|
||||
String htmlContent = generateHtmlContent(saleContract, saleContractEntryDOS);
|
||||
|
||||
//docker生成路径
|
||||
String pathUrl = System.getProperty("user.dir") + "/pdffile";
|
||||
String fileName = StrUtil.format(pathUrl + "/SaleContract_{}", saleOrder.getBillno());
|
||||
//主宿机生成路径
|
||||
String fileName2 = StrUtil.format(pdfPath + "/SaleContract_{}", saleOrder.getBillno());
|
||||
//docker生成路径
|
||||
String pathUrl = System.getProperty("user.dir") + "/pdffile";
|
||||
String fileName = StrUtil.format(pathUrl + "/SaleContract_{}", saleOrder.getBillno()+"_"+i);
|
||||
//主宿机生成路径
|
||||
String fileName2 = StrUtil.format(pdfPath + "/SaleContract_{}", saleOrder.getBillno()+"_"+i);
|
||||
|
||||
String templatePath = fileName + ".html";
|
||||
String pdfPath = fileName + ".pdf";
|
||||
String templatePath2 = fileName2 + ".html";
|
||||
String pdfPath2 = fileName2 + ".pdf";
|
||||
FileUtil.writeString(htmlContent, templatePath, "UTF-8");
|
||||
|
||||
log.info("已生成HTML文件:" + templatePath);
|
||||
//请求wkapp
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("input_html_path", "file://" + templatePath2);
|
||||
params.put("output_pdf_path", pdfPath2);
|
||||
log.info("请求wkapp接口url:" + wkappUrl + "/exehtmltopdf");
|
||||
String result = HttpUtil.post(wkappUrl + "/exehtmltopdf", params, 5 * 60 * 1000);
|
||||
log.info("请求wkapp接口返回结果:" + result);
|
||||
//WKHtmlToPdfUtil.convert(templatePath, pdfPath);
|
||||
File file = FileUtil.file(pdfPath);
|
||||
files.add(file);
|
||||
delFiles.add(pdfPath);
|
||||
delFiles.add(templatePath);
|
||||
String templatePath = fileName + ".html";
|
||||
String pdfPath = fileName + ".pdf";
|
||||
String templatePath2 = fileName2 + ".html";
|
||||
String pdfPath2 = fileName2 + ".pdf";
|
||||
FileUtil.writeString(htmlContent, templatePath, "UTF-8");
|
||||
log.info("已生成HTML文件:" + templatePath);
|
||||
//请求wkapp
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("input_html_path", "file://" + templatePath2);
|
||||
params.put("output_pdf_path", pdfPath2);
|
||||
log.info("请求wkapp接口url:" + wkappUrl + "/exehtmltopdf");
|
||||
String result = HttpUtil.post(wkappUrl + "/exehtmltopdf", params, 5 * 60 * 1000);
|
||||
log.info("请求wkapp接口返回结果:" + result);
|
||||
//WKHtmlToPdfUtil.convert(templatePath, pdfPath);
|
||||
File file = FileUtil.file(pdfPath);
|
||||
files.add(file);
|
||||
delFiles.add(pdfPath);
|
||||
delFiles.add(templatePath);
|
||||
}
|
||||
}
|
||||
String pathUrl = System.getProperty("user.dir") + "/pdffile";
|
||||
String zipFileName = StrUtil.format(pathUrl + "/SaleContract_{}", new Date().getTime());
|
||||
|
|
|
|||
|
|
@ -240,6 +240,29 @@
|
|||
<td></td>
|
||||
<td scope="row" colspan="6" th:text="${explain53}">跨越多列的标题</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td th:text="${item6}">1</td>
|
||||
<td th:text="${explain6}">Doe</td>
|
||||
<td style="text-align: center; " th:text="${qty6}">12344</td>
|
||||
<td style="text-align: center; " th:text="${price6}">Doe</td>
|
||||
<td style="text-align: center; " th:text="${discount6}">Doe</td>
|
||||
<td style="text-align: center; " th:text="${amount6}">Doe</td>
|
||||
<td style="text-align: center; " th:text="${deliverydate6}">2024-01-12</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td scope="row" colspan="6" th:text="${explain61}">跨越多列的标题</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td scope="row" colspan="6" th:text="${explain62}">跨越多列的标题</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td scope="row" colspan="6" th:text="${explain63}">跨越多列的标题</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue