Commit 579c56d3 authored by liuzeheng's avatar liuzeheng

颜色标识

parent 44b45a50
...@@ -273,7 +273,7 @@ public class ShipmentLoadExcelExportListener { ...@@ -273,7 +273,7 @@ public class ShipmentLoadExcelExportListener {
List<Integer> mergeCountList = new ArrayList(); List<Integer> mergeCountList = new ArrayList();
List<Integer> colorRowList = new ArrayList<>(); List<Integer> colorRowList = new ArrayList<>();
AtomicInteger colorRowNum = new AtomicInteger(6); AtomicInteger colorRowNum = new AtomicInteger(8);
Map<String,Integer> colorMap = new HashMap<>(); Map<String,Integer> colorMap = new HashMap<>();
Map<String,Integer> mergePkgCountMap = new LinkedHashMap<>(); Map<String,Integer> mergePkgCountMap = new LinkedHashMap<>();
int colorIndex = 0; int colorIndex = 0;
...@@ -288,14 +288,12 @@ public class ShipmentLoadExcelExportListener { ...@@ -288,14 +288,12 @@ public class ShipmentLoadExcelExportListener {
for (Map.Entry<Long, List<BoxPreloadGoodsBackVO>> entry : orderMap.entrySet()) { for (Map.Entry<Long, List<BoxPreloadGoodsBackVO>> entry : orderMap.entrySet()) {
Long orderId = entry.getKey(); Long orderId = entry.getKey();
Long pkgId = entry.getValue().get(0).getPkgId();
//OrderBackInfoDto orderInfo = orderQueryService.info(orderId);
//OrderDO orderDO = orderService.selectOne(OrderDO::getOrderId, orderId);
List<OrderWarehouseInBackItemVO> orderWarehouseInBackItemVOS = List<OrderWarehouseInBackItemVO> orderWarehouseInBackItemVOS =
orderWarehouseInService.getOrderWarehouseInListOrderByInTime(orderId); orderWarehouseInService.getOrderWarehouseInListOrderByInTime(orderId);
for (OrderWarehouseInBackItemVO item : orderWarehouseInBackItemVOS) { for (OrderWarehouseInBackItemVO item : orderWarehouseInBackItemVOS) {
int andIncrement = colorRowNum.getAndIncrement(); int andIncrement = colorRowNum.getAndIncrement();
if (StringUtils.isNotBlank(item.getOrderWarehouseInDetails())) { if (StringUtils.isNotBlank(item.getOrderWarehouseInDetails())) {
JSONArray jsonArray = JSONArray.parseArray(item.getOrderWarehouseInDetails()); JSONArray jsonArray = JSONArray.parseArray(item.getOrderWarehouseInDetails());
if (jsonArray.size() > 0) { if (jsonArray.size() > 0) {
...@@ -303,37 +301,37 @@ public class ShipmentLoadExcelExportListener { ...@@ -303,37 +301,37 @@ public class ShipmentLoadExcelExportListener {
colorRowList.add(andIncrement);//这里加1是为了设置颜色时过滤掉入仓记录那条 colorRowList.add(andIncrement);//这里加1是为了设置颜色时过滤掉入仓记录那条
} }
} }
int mergeCount = 1; // int mergeCount = 1;
if (StringUtils.isNotBlank(item.getOrderWarehouseInDetails())) { // if (StringUtils.isNotBlank(item.getOrderWarehouseInDetails())) {
item.setOrderWarehouseInDetailsVOList(JsonUtils.parseArray(item.getOrderWarehouseInDetails(), OrderWarehouseInDetailsVO.class)); // item.setOrderWarehouseInDetailsVOList(JsonUtils.parseArray(item.getOrderWarehouseInDetails(), OrderWarehouseInDetailsVO.class));
} // }
if (CollectionUtil.isNotEmpty(item.getOrderWarehouseInDetailsVOList())) { // if (CollectionUtil.isNotEmpty(item.getOrderWarehouseInDetailsVOList())) {
mergeCount = mergeCount + item.getOrderWarehouseInDetailsVOList().size(); // mergeCount = mergeCount + item.getOrderWarehouseInDetailsVOList().size();
List<OrderWarehouseInDetailsVO> orderWarehouseInDetailsVOList = // List<OrderWarehouseInDetailsVO> orderWarehouseInDetailsVOList =
item.getOrderWarehouseInDetailsVOList(); // item.getOrderWarehouseInDetailsVOList();
for (int j = 0; j < orderWarehouseInDetailsVOList.size(); j++) { // for (int j = 0; j < orderWarehouseInDetailsVOList.size(); j++) {
int andIncrement1 = colorRowNum.getAndIncrement(); // int andIncrement1 = colorRowNum.getAndIncrement();
colorMap.put(String.valueOf(andIncrement1),colorList.get(colorIndex)); // colorMap.put(String.valueOf(andIncrement1),colorList.get(colorIndex));
colorRowList.add(andIncrement1); // colorRowList.add(andIncrement1);
} // }
} // }
mergeCountList.add(mergeCount); // mergeCountList.add(mergeCount);
if (colorIndex == 7) { if (colorIndex == 7) {
colorIndex = 0; colorIndex = 0;
} else { } else {
colorIndex ++; colorIndex ++;
} }
//合包那几个列合并单元格计算 //合包那几个列合并单元格计算
if (pkgId.longValue() != 0L) { // if (pkgId.longValue() != 0L) {
if (mergePkgCountMap.get(String.valueOf(pkgId)) == null) { // if (mergePkgCountMap.get(String.valueOf(pkgId)) == null) {
mergePkgCountMap.put(String.valueOf(pkgId),mergeCount); // mergePkgCountMap.put(String.valueOf(pkgId),mergeCount);
} else { // } else {
Integer sumMergePkgCount = mergePkgCountMap.get(String.valueOf(pkgId)) + mergeCount; // Integer sumMergePkgCount = mergePkgCountMap.get(String.valueOf(pkgId)) + mergeCount;
mergePkgCountMap.put(String.valueOf(pkgId),sumMergePkgCount); // mergePkgCountMap.put(String.valueOf(pkgId),sumMergePkgCount);
} // }
} else { // } else {
mergePkgCountMap.put(String.valueOf(item.getId()),mergeCount); // mergePkgCountMap.put(String.valueOf(item.getId()),mergeCount);
} // }
} }
} }
......
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