|
@@ -1062,8 +1062,7 @@ public class TqQuotationServiceImpl extends ServiceImpl<TqQuotationMapper, TqQuo
|
|
|
});
|
|
|
|
|
|
data.put("id", item.getId());
|
|
|
- data.put("noFix", "E" + StringUtils.padl(String.valueOf(index++), 2, '0'));
|
|
|
- data.put("no", data.get("noFix"));
|
|
|
+ data.put("no", StringUtils.padl(String.valueOf(index++), 2, '0'));
|
|
|
|
|
|
data.put("specification", item.getSpecification());
|
|
|
data.put("qty", format.format(item.getElevatorNumber()));
|
|
@@ -1079,6 +1078,7 @@ public class TqQuotationServiceImpl extends ServiceImpl<TqQuotationMapper, TqQuo
|
|
|
totalFreight = totalFreight.add(nonNull(item.getSeaShipFees()) ? item.getSeaShipFees() : BigDecimal.ZERO);
|
|
|
freightRemarks.add(item.getFreightRemark());
|
|
|
|
|
|
+ data.put("elevatorCode", item.getElevatorCode());
|
|
|
data.put("productType", item.getElevatorModel());
|
|
|
String loadCapacity = data.getString(RATED_LOAD_CAPACITY);
|
|
|
String persons = isNotBlank(loadCapacity) ? String.valueOf(Integer.parseInt(loadCapacity) / 75) : EMPTY;
|
|
@@ -1293,6 +1293,17 @@ public class TqQuotationServiceImpl extends ServiceImpl<TqQuotationMapper, TqQuo
|
|
|
map.put("date", DateUtils.parseDateToStr("yyyy-MM-dd", tqQuotation.getCreateTime()));
|
|
|
// 2.2 规格信息
|
|
|
map.put("specifications", specifications);
|
|
|
+ // 材质描述部分需要去重处理
|
|
|
+
|
|
|
+ map.put("carbinWallFinishesList", extractMaterialList(specifications, Lists.newArrayList("carType", "carDetail", "carDetail1", "carDetail2", "carDetail3", "carDetail4", "carDetail5", "carDetail6")));
|
|
|
+ map.put("doorFinishesList", extractMaterialList(specifications, Lists.newArrayList("typeOfDoor", "carDoor", "landingDoor", "landingDoor1", "landingDoor2", "landingDoor3", "landingDoor4")));
|
|
|
+ map.put("handrialTypeList", extractMaterialList(specifications, Lists.newArrayList("handrailDetail", "handrailDetail1", "handrailDetail2", "handrailDetail3")));
|
|
|
+ map.put("ceilingTypeList", extractMaterialList(specifications, Lists.newArrayList("ceiling", "ceilingType")));
|
|
|
+ map.put("flooringTypeList", extractMaterialList(specifications, Lists.newArrayList("flooringType")));
|
|
|
+ map.put("copTypeList", extractMaterialList(specifications, Lists.newArrayList("copDetail", "copDetail1", "copDetail2", "copDetail3", "copDetail4", "copDetail5")));
|
|
|
+ map.put("lopTypeList", extractMaterialList(specifications, Lists.newArrayList("lopDetail", "lopDetail1", "lopDetail2", "lopDetail3", "lopDetail4", "lopDetail5", "lopDetail6", "lopDetail7", "lopDetail8", "lopDetail9", "lopDetail10", "lopDetail11", "lopDetail12", "lopDetail13", "lopDetail14")));
|
|
|
+ map.put("mirrorTypeList", extractMaterialList(specifications, Lists.newArrayList("mirrorDetail", "mirrorDetail1", "mirrorDetail2")));
|
|
|
+
|
|
|
// 2.3 规格统计信息
|
|
|
String targetPort = "";
|
|
|
if (isNotBlank(tqQuotation.getTargetPort())){
|
|
@@ -1348,17 +1359,26 @@ public class TqQuotationServiceImpl extends ServiceImpl<TqQuotationMapper, TqQuo
|
|
|
.download();
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- // 2.1 基础信息
|
|
|
- Map<String, Object> map = Maps.newHashMap();
|
|
|
- map.put("buyers","陈杰");
|
|
|
- // 3. 填充模板并返回
|
|
|
- new CommonDocUtils()
|
|
|
- .loadFromClasspath("/wordTemplate/国际部销售合同模版2024test.docx")
|
|
|
- .replaceData(map)
|
|
|
- .download();
|
|
|
- }
|
|
|
+ private List<JSONObject> extractMaterialList(List<JSONObject> specifications, ArrayList<String> keys) {
|
|
|
+ List<JSONObject> result = Lists.newArrayList();
|
|
|
+ Map<String, Object> resultMap = Maps.newHashMap();
|
|
|
+ specifications.forEach(item -> {
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ keys.forEach(key -> data.put(key, item.get(key)));
|
|
|
+ String key = JSONObject.toJSONString(data);
|
|
|
+ JSONObject exist = (JSONObject)resultMap.get(key);
|
|
|
+ String elevatorCode = item.getString("elevatorCode");
|
|
|
+ if (Objects.nonNull(exist)){
|
|
|
+ exist.put("elevatorCode", exist.getString("elevatorCode") + "," + elevatorCode);
|
|
|
+ } else {
|
|
|
+ data.put("elevatorCode", elevatorCode);
|
|
|
+ resultMap.put(key, data);
|
|
|
+ result.add(data);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public List<QuotationVO> selectTqQuotationListAll(QuotationQueryBO queryBO) {
|