Commit 4851ca51 authored by lanbaoming's avatar lanbaoming

2024-06-12-3提交发布

parent b1227055
......@@ -178,4 +178,20 @@ public class WarehouseDO extends BaseDO implements Serializable {
*/
private int lockRecipientDays;
/*
落款信息 lanbm 2024-06-10 add
*/
private String lkLeft;
/*
落款信息 lanbm 2024-06-10 add
*/
private String lkRight;
/*
图章名称 lanbm 2024-06-12 add
*/
private String tzName;
}
......@@ -128,4 +128,9 @@ public class WarehouseLineDO extends BaseDO {
*/
private String lkRight;
/*
图章名称 lanbm 2024-06-12 add
*/
private String tzName;
}
......@@ -263,6 +263,13 @@ public class WarehouseServiceImpl implements WarehouseService {
warehouseItem.setTempTitleEn(lineDO.getTempTitleEn());
warehouseItem.setTempTitleZh(lineDO.getTempTitleZh());
//lanbm 2024-06-12 添加配置
warehouseItem.setLkRight(lineDO.getLkRight());
warehouseItem.setLkLeft(lineDO.getLkLeft());
warehouseItem.setTzName(lineDO.getTzName());
//end lanbm 2024-06-12 添加配置
String recipientInfo = lineDO.getRecipientInfo();
if (recipientInfo != null) {
warehouseItem.setRecipientInfo(JSONObject.parseObject(recipientInfo, ContactInfoDTO.class));
......@@ -448,6 +455,7 @@ public class WarehouseServiceImpl implements WarehouseService {
recipientInfo = JSON.toJSONString(reqVO.getRecipientInfo());
}
//lanbm 2024-06-12 添加配置参数项
warehouseLineMapper.update(null,
new LambdaUpdateWrapper<WarehouseLineDO>().eq(WarehouseLineDO::getId, reqVO.getLineId())
.set(WarehouseLineDO::getOtherService, reqVO.getOtherService())
......@@ -462,6 +470,7 @@ public class WarehouseServiceImpl implements WarehouseService {
.set(reqVO.getControlStatus() != null, WarehouseLineDO::getControlStatus, reqVO.getControlStatus())
.set(StringUtils.isNotEmpty(reqVO.getLkLeft()), WarehouseLineDO::getLkLeft, reqVO.getLkLeft())
.set(StringUtils.isNotEmpty(reqVO.getLkRight()), WarehouseLineDO::getLkRight, reqVO.getLkRight())
.set(StringUtils.isNotEmpty(reqVO.getTzName()), WarehouseLineDO::getTzName, reqVO.getTzName())
);
}
......
......@@ -70,4 +70,21 @@ public class WarehouseLineBindRespVO extends WarehouseBaseVO {
*/
private String tempTitleZh;
/*
落款信息 lanbm 2024-06-10 add
*/
private String lkLeft;
/*
落款信息 lanbm 2024-06-10 add
*/
private String lkRight;
/*
图章名称 lanbm 2024-06-12 add
*/
private String tzName;
}
......@@ -58,4 +58,9 @@ public class WarehouseLineServiceReqVO {
落款信息 lanbm 2024-06-10 add
*/
private String lkRight;
/*
图章名称 lanbm 2024-06-12 add
*/
private String tzName;
}
......@@ -225,6 +225,9 @@ public class WarehouseController {
return success(DeptWarehouseConvert.INSTANCE.convertList(entityList));
}
/*
lanbm 2024-06-12 添加配置参数
*/
@PostMapping("/serviceConfig")
@ApiOperation("其他服务配置")
public CommonResult<Boolean> serviceConfig(
......
......@@ -116,6 +116,30 @@ public class ShipmentReceivableExcelExportListener2 {
@Resource
private AdminUserApi adminUserApi;
/*
lanbm 2024-06-12 add
*/
private String getTemplateName(WarehouseLineDO warehouseLineDO) {
String sTemName = "/nrlyReceivable2.xlsx";
if (warehouseLineDO.getTzName() == null ||
warehouseLineDO.getTzName().length() == 0) {
sTemName = "/nrlyReceivable2.xlsx";
} else {
if (warehouseLineDO.getTzName().equals("广州市捷道国际货运代理有限公司")) {
sTemName = "/nrlyReceivable2.xlsx";
}
else if (warehouseLineDO.getTzName().equals("广州市捷佳国际货运代理有限公司")) {
sTemName = "/nrlyReceivable3.xlsx";
}
else if (warehouseLineDO.getTzName().equals("义乌市捷道国际货运代理有限公司")) {
sTemName = "/nrlyReceivable4.xlsx";
} else {
sTemName = "/nrlyReceivable2.xlsx";
}
}
return sTemName;
}
/**
* 订单导出监听
*
......@@ -158,12 +182,7 @@ public class ShipmentReceivableExcelExportListener2 {
JSONObject jsonObject =
JSONObject.parseObject(event.getRequestParams());
Long shipmentId = jsonObject.getLong("shipmentId");
inputStream = getClass().getClassLoader().
getResourceAsStream(ueProperties.getTemplatesUrl()
+ "/nrlyReceivable2.xlsx");
String templateFileName=ueProperties.getTemplatesUrl()
+ "/nrlyReceivable2.xlsx";
BoxDO box = boxService.getBox(shipmentId);
WarehouseDO startWarehouse = warehouseService.getWarehouse(box.getStartWarehouseId());
......@@ -174,6 +193,12 @@ public class ShipmentReceivableExcelExportListener2 {
box.getStartWarehouseId(), box.getDestWarehouseId(),
box.getTransportType());
//lanbm 添加动态模板逻辑
String sTemName = getTemplateName(warehouseLineDO);
inputStream = getClass().getClassLoader().
getResourceAsStream(ueProperties.getTemplatesUrl()
+ sTemName);
if (StringUtils.isNotBlank(warehouseLineDO.getRecipientInfo())) {
recipientInfo = JSONObject.parseObject(warehouseLineDO.getRecipientInfo(), ContactInfoDTO.class);
}
......@@ -210,7 +235,7 @@ public class ShipmentReceivableExcelExportListener2 {
headMap.put("img2", imageData.getUrl());
//end lanbm 2024-06-11 添加图片自动填充功能
if(box.getZgDate()!=null) {
if (box.getZgDate() != null) {
//装柜日期 日期格式化
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String currentDate = sdf.format(box.getZgDate());
......@@ -491,7 +516,7 @@ public class ShipmentReceivableExcelExportListener2 {
setScale(2, RoundingMode.HALF_UP));
headMap.put("BillinTTl",
currencyFuhaoMap.get(qgCurrency)
+sum6.subtract(sum4).subtract(
+ sum6.subtract(sum4).subtract(
sum6.multiply(new BigDecimal(0.2)).setScale(2, RoundingMode.HALF_UP)));
int sumCount = 0;
......@@ -582,97 +607,6 @@ public class ShipmentReceivableExcelExportListener2 {
}
}
/*
@EventListener(ShipmentReceivableExcelExportPushEvent2.class)
public void shipmentReceivableExcelExportPushEvent(
ShipmentReceivableExcelExportPushEvent2 event)
throws MalformedURLException {
String sPath = "D:\\temp";
String fileName2 = sPath + File.separator + "1.xlsx";
ImageData imageData2 = new ImageData();
imageData2.setUrl(new URL(
"https://jiedao-pre-production.oss-cn-shenzhen.aliyuncs.com/2024/06/11/6668347de4b001393be98e24.jpg"));
Map<String, Object> map = new HashMap<>();
map.put("img1", imageData2.getUrl());
String templateFileName2 = "D:\\jd\\jiedao-api-boot-master\\yudao-server\\src\\main\\resources\\templates\\nrlyReceivable2.xlsx";
EasyExcel.write(fileName2).
withTemplate(templateFileName2).
sheet().doFill(map);
return;
/*
if (StringUtils.isNotBlank(event.getRequestParams())) {
try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATA_FORMAT);
String nowTime = formatter.format(LocalDateTime.now());
String dir = ueProperties.getTempDir().concat("/receivable/excel/");
//先不合并单元格,之后合并,把合并的传到服务器 lanbm 2024-05-25 add
String fileName = event.getUserId().toString().
concat(StrUtil.DASHED).concat(event.getUserType().toString()).
concat(StrUtil.DASHED).concat(nowTime).
concat("receivable_notMerge.xlsx");
String fileNameMerge = event.getUserId().toString().
concat(StrUtil.DASHED).concat(event.getUserType().toString()).
concat(StrUtil.DASHED).concat(nowTime).
concat("receivable_Merge.xlsx");
InputStream inputStream = null;
JSONObject jsonObject =
JSONObject.parseObject(event.getRequestParams());
Long shipmentId = jsonObject.getLong("shipmentId");
inputStream = getClass().getClassLoader().
getResourceAsStream(ueProperties.getTemplatesUrl()
+ "/nrlyReceivable2.xlsx");
String templateFileName = ueProperties.getTemplatesUrl()
+ "/nrlyReceivable2.xlsx";
Map headMap = new HashMap();
//lanbm 2024-06-11 添加图片自动填充功能
ImageData imageData = new ImageData();
imageData.setUrl(new URL(
"https://jiedao-pre-production.oss-cn-shenzhen.aliyuncs.com/2024/06/11/6668347de4b001393be98e24.jpg"));
headMap.put("img1", imageData.getUrl());
headMap.put("img2", imageData.getUrl());
//end lanbm 2024-06-11 添加图片自动填充功能
File fileDir = new File(dir);
if (!fileDir.exists()) {
// 不存在则创建一个目录
fileDir.mkdirs();
}
//ExcelWriter excelWriter =
// EasyExcel.write(dir + fileName).
// withTemplate(inputStream).build();
// WriteSheet sheet = EasyExcel.writerSheet(0).build();
// excelWriter.fill(headMap, sheet);//填充非循环数据--表头
// excelWriter.finish();
// inputStream.close();
EasyExcel.write(dir + fileName).
withTemplate(inputStream).
sheet().doFill(headMap);
} catch (Exception e) {
e.printStackTrace();
event.setResult(e.getMessage());
}
} else {
event.setResult("param fail");
}
*/
// }
private BigDecimal changeAmountToDestCurrency(Long fromCurrencyId,
Long toCurrencyId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment