Compare commits

..

No commits in common. "50630eae2287c4f31f1f67720af3b9e832981f3e" and "6519c24135db2b6b76fb9409718635daf9cf099e" have entirely different histories.

4 changed files with 3 additions and 118 deletions

5
.idea/.gitignore vendored
View File

@ -1,5 +0,0 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

View File

@ -138,12 +138,6 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</dependency>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-core</artifactId>
<version>1.39.0</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.ortools/ortools-java -->

View File

@ -1453,17 +1453,12 @@ public class ProcessOrderProController extends BaseController {
}
if (!kingdeeBomRows.isEmpty()) {
List<Map<String, Object>> bomDataList2 = convertKingdeeBomToMapList(kingdeeBomRows);
// 合并到 RouteBomData 中统一按物料分组导出方案A
dynamicDataMappingList.addAll(DynamicDataMapping.createOneDataList("KingdeeBomData", bomDataList2));
}
// 添加伊特产品数据
if (!routeList.isEmpty()) {
// 合并到 RouteBomData 中统一按物料分组导出方案A
}
// 方案A合并工艺与BOM为单一数据集并按物料分组
if (!routeList.isEmpty() || !kingdeeBomRows.isEmpty()) {
List<Map<String, Object>> routeBomDataList = convertRouteBomToMapList(routeList, kingdeeBomRows);
dynamicDataMappingList.addAll(DynamicDataMapping.createOneDataList("RouteBomData", routeBomDataList));
List<Map<String, Object>> evoRouteDataList = convertRouteDataToMapList(routeList);
dynamicDataMappingList.addAll(DynamicDataMapping.createOneDataList("ProcessRouteExcelDTO", evoRouteDataList));
}
// 使用模板导出Excel
@ -1498,105 +1493,6 @@ public class ProcessOrderProController extends BaseController {
}
}
/**
* 合并工艺路线与金蝶BOM行按物料编码分组生成统一的 RouteBomData 列表
* 每条记录包含两类rowType=route工艺行 rowType=bomBOM行以便模板在同一块中连续展示
*/
private List<Map<String, Object>> convertRouteBomToMapList(List<ProcessRoute> routeDataList,
List<Map<String, Object>> kingdeeBomRows) {
Map<String, List<Map<String, Object>>> grouped = new LinkedHashMap<>();
// 先按工艺数据建立分组与顺序
for (ProcessRoute item : routeDataList) {
String mcode = item.getMaterialCode();
if (mcode == null) mcode = "";
grouped.computeIfAbsent(mcode, k -> new ArrayList<>());
Map<String, Object> map = new HashMap<>();
map.put("rowType", "route");
map.put("routeDescription", item.getRouteDescription());
map.put("materialCode", item.getMaterialCode());
map.put("materialName", item.getMaterialName());
map.put("material", item.getMaterial());
map.put("discWeight", item.getDiscWeight());
map.put("processNo", item.getProcessNo());
map.put("workCenter", item.getWorkCenter());
map.put("processName", item.getProcessName());
map.put("processDescription", item.getProcessDescription());
map.put("processControl", item.getProcessControl());
map.put("activityDuration", item.getActivityDuration());
map.put("activityUnit", item.getActivityUnit());
map.put("unitQuantity", item.getUnitQuantity());
map.put("batchQuantity", item.getBatchQuantity());
map.put("firstBatchQuantity", item.getFirstBatchQuantity());
map.put("planStartTime", formatDate(item.getPlanStartTime()));
map.put("planEndTime", formatDate(item.getPlanEndTime()));
map.put("xuStartTime", formatDate(item.getXuStartTime()));
map.put("xuEndTime", formatDate(item.getXuEndTime()));
// BOM占位当前行类型为工艺BOM字段置空
map.put("rawMaterialCode", "");
map.put("rawMaterialName", "");
map.put("bomMaterial", "");
map.put("bomDanZhong", "");
map.put("discUsage", "");
map.put("bomUnit", "");
grouped.get(mcode).add(map);
}
// 追加BOM数据到对应物料分组若该物料此前未出现则在最后新增一个分组
for (Map<String, Object> row : kingdeeBomRows) {
String mcode = Objects.toString(row.get("materialCode"), "");
grouped.computeIfAbsent(mcode, k -> new ArrayList<>());
Map<String, Object> map = new HashMap<>();
map.put("rowType", "bom");
map.put("routeDescription", row.get("routeDescription"));
map.put("materialCode", row.get("materialCode"));
map.put("materialName", row.get("materialName"));
map.put("material", row.get("material"));
map.put("discWeight", row.get("discWeight"));
// 工艺占位当前行类型为BOM工艺字段置空
map.put("processNo", "");
map.put("workCenter", "");
map.put("processName", "");
map.put("processDescription", "");
map.put("processControl", "");
map.put("activityDuration", "");
map.put("activityUnit", "");
map.put("unitQuantity", "");
map.put("batchQuantity", "");
map.put("firstBatchQuantity", "");
map.put("planStartTime", "");
map.put("planEndTime", "");
map.put("xuStartTime", "");
map.put("xuEndTime", "");
// BOM具体字段
map.put("rawMaterialCode", row.get("rawMaterialCode"));
map.put("rawMaterialName", row.get("rawMaterialName"));
map.put("bomMaterial", row.get("bomMaterial"));
map.put("bomDanZhong", row.get("bomDanZhong"));
map.put("discUsage", row.get("discUsage"));
map.put("bomUnit", row.get("bomUnit"));
grouped.get(mcode).add(map);
}
// 展平为顺序列表并补齐序号
List<Map<String, Object>> result = new ArrayList<>();
int index = 1;
for (Map.Entry<String, List<Map<String, Object>>> entry : grouped.entrySet()) {
for (Map<String, Object> m : entry.getValue()) {
m.put("index", index++);
result.add(m);
}
}
return result;
}
private List<Map<String, Object>> convertKingdeeBomToMapList(List<Map<String, Object>> kingdeeBomRows) {
List<Map<String, Object>> mapList = new ArrayList<>();
int index = 1;