Commit 579c56d3 authored by liuzeheng's avatar liuzeheng

颜色标识

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