|
|
@@ -123,6 +123,16 @@ public class MineService {
|
|
|
public HttpResult pageList(MineOrderPageListParam param) {
|
|
|
PageHelper.startPage(param.getPage(), param.getPageSize());
|
|
|
List<MineOrderPageListRes> businessTruckPageListRes = mineOrderMapper.mineOrderPageList(param);
|
|
|
+
|
|
|
+ Map<String, Map<String, String>> dict = orderDictService.queryDictByType(new ArrayList<>(
|
|
|
+ Arrays.asList(OrderDictTypeEnum.GOODS_UNIT.getType())));
|
|
|
+ Map<String, String> GoodsUnitMap;
|
|
|
+ if (CollectionUtils.isNotEmpty(dict)) {
|
|
|
+ GoodsUnitMap = CollectionUtils.isNotEmpty(dict.get(OrderDictTypeEnum.GOODS_UNIT.getType())) ? dict.get(OrderDictTypeEnum.GOODS_UNIT.getType()) : new HashMap<>(16);
|
|
|
+ } else {
|
|
|
+ GoodsUnitMap = new HashMap<>(16);
|
|
|
+ }
|
|
|
+
|
|
|
businessTruckPageListRes.forEach(e -> {
|
|
|
if (ObjectUtils.isNotNull(e.getOrderSource())) {
|
|
|
e.setOrderSourceStr(e.getOrderSource() == 1 ? "生产自建" : "销售流转");
|
|
|
@@ -130,6 +140,12 @@ public class MineService {
|
|
|
if (ObjectUtils.isNotNull(e.getStatus())){
|
|
|
e.setStatusStr(getStatusStr(e.getStatus()));
|
|
|
}
|
|
|
+ if (ObjectUtils.isNotNull(e.getUnit())){
|
|
|
+ e.setUnitStr(GoodsUnitMap.get(e.getUnit().toString()));
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(e.getIsTransport())){
|
|
|
+ e.setIsTransportStr(TransportUnderEnum.getNameByCode(e.getIsTransport()));
|
|
|
+ }
|
|
|
});
|
|
|
return HttpResult.ok(new PageRes<>(new PageInfo<>(businessTruckPageListRes)));
|
|
|
}
|
|
|
@@ -295,45 +311,70 @@ public class MineService {
|
|
|
|
|
|
for (int i = 0; i < orderFlowEnums.size(); i++) {
|
|
|
orderFlowEnums.get(i).setColor("gray");
|
|
|
-
|
|
|
+ //orderFlowEnums.get(i).setStatus(Global.NUMERICAL_ZERO);
|
|
|
for (KwBusinessActionTrack track : actionTracks) {
|
|
|
if (orderFlowEnums.get(i).getCode().equals(track.getStatus())) {
|
|
|
orderFlowEnums.get(i).setColor("green");
|
|
|
+ orderFlowEnums.get(i).setTime(track.getCreateTime());
|
|
|
+ orderFlowEnums.get(i).setCreateBy(track.getCreateBy());
|
|
|
+ orderFlowEnums.get(i).setStatus(Global.NUMERICAL_ONE);
|
|
|
cancelIndex = i; // 更新取消前最后一个执行节点的索引
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if (track.getStatus().equals("20") && !cancelFound) {
|
|
|
+ if ("20".equals(track.getStatus()) && !cancelFound) {
|
|
|
cancelFound = true;
|
|
|
if (cancelIndex != -1) { // 确保有一个被执行的节点在前
|
|
|
orderFlowEnums.get(cancelIndex).setColor("orange");
|
|
|
orderFlowEnums.get(cancelIndex).setName(orderFlowEnums.get(cancelIndex).getName() + cancelNameAppend); // 添加取消字样
|
|
|
+ orderFlowEnums.get(i).setTime(track.getCreateTime());
|
|
|
+ orderFlowEnums.get(i).setCreateBy(track.getCreateBy());
|
|
|
+ orderFlowEnums.get(i).setStatus(Global.NUMERICAL_ONE);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (track.getStatus().equals("15") && !rejectFound) {
|
|
|
+ if ("15".equals(track.getStatus()) && !rejectFound) {
|
|
|
rejectFound = true;
|
|
|
if (cancelIndex != -1) { // 确保有一个被执行的节点在前
|
|
|
orderFlowEnums.get(cancelIndex).setColor("orange");
|
|
|
orderFlowEnums.get(cancelIndex).setName(orderFlowEnums.get(cancelIndex).getName() + rejectNameAppend); // 添加驳回字样
|
|
|
+ orderFlowEnums.get(i).setTime(track.getCreateTime());
|
|
|
+ orderFlowEnums.get(i).setCreateBy(track.getCreateBy());
|
|
|
+ orderFlowEnums.get(i).setStatus(Global.NUMERICAL_ONE);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 如果没有执行任何节点就直接取消了,且只有一个取消记录,需要特殊处理
|
|
|
- if (cancelFound && cancelIndex == Global.MINUS_ONE && actionTracks.size() == Global.ADDRESS_LOAD) {
|
|
|
+ if (cancelFound && cancelIndex == Global.MINUS_ONE && actionTracks.size() == Global.NUMERICAL_ONE) {
|
|
|
orderFlowEnums.get(0).setColor("orange");
|
|
|
orderFlowEnums.get(0).setName(orderFlowEnums.get(0).getName() + cancelNameAppend);
|
|
|
+ orderFlowEnums.get(0).setStatus(Global.NUMERICAL_ONE);
|
|
|
+ //orderFlowEnums.get(0).setIsCancel(Global.NUMERICAL_ONE);
|
|
|
}
|
|
|
|
|
|
// 类似的,如果直接驳回且无其他执行记录,也需要处理
|
|
|
- if (rejectFound && cancelIndex == Global.MINUS_ONE && actionTracks.size() == Global.ADDRESS_LOAD) {
|
|
|
+ if (rejectFound && cancelIndex == Global.MINUS_ONE && actionTracks.size() == Global.NUMERICAL_ONE) {
|
|
|
orderFlowEnums.get(0).setColor("orange");
|
|
|
orderFlowEnums.get(0).setName(orderFlowEnums.get(0).getName() + rejectNameAppend);
|
|
|
+ orderFlowEnums.get(0).setStatus(Global.NUMERICAL_ONE);
|
|
|
+ //orderFlowEnums.get(0).setIsCancel(Global.NUMERICAL_ONE);
|
|
|
}
|
|
|
+ for (NodeStatusDTO orderFlowEnum : orderFlowEnums) {
|
|
|
+ if (orderFlowEnum.getColor().equals("green") || orderFlowEnum.getColor().equals("orange")) {
|
|
|
+ if (orderFlowEnum.getColor().equals("orange")){
|
|
|
+ //表示取消或者驳回
|
|
|
+ orderFlowEnum.setIsCancel(Global.NUMERICAL_ONE);
|
|
|
+ }
|
|
|
+ orderFlowEnum.setStatus(Global.NUMERICAL_ONE);
|
|
|
+ }else{
|
|
|
+ orderFlowEnum.setStatus(Global.NUMERICAL_ZERO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return orderFlowEnums;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -351,9 +392,6 @@ public class MineService {
|
|
|
{
|
|
|
throw new RuntimeException("未找到当前订单");
|
|
|
}
|
|
|
- if(kwBusinessMineorder.getIsTransport() != 2){
|
|
|
- throw new RuntimeException("当前订单不是非自有订单");
|
|
|
- }
|
|
|
if (kwBusinessMineorder.getStatus().equals(String.valueOf(MineStatusEnum.TWENTY.getCode()))) {
|
|
|
throw new RuntimeException("当前订单已取消,请勿重复操作");
|
|
|
}
|