|
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.sckw.contract.api.RemoteContractService;
|
|
import com.sckw.contract.api.RemoteContractService;
|
|
|
import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
|
|
import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
|
|
|
-import com.sckw.core.common.enums.enums.DictEnum;
|
|
|
|
|
import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.exception.CustomPromptException;
|
|
import com.sckw.core.exception.CustomPromptException;
|
|
@@ -24,6 +23,7 @@ import com.sckw.manage.api.model.dto.res.FindEntCooperateResVo;
|
|
|
import com.sckw.mongo.model.SckwTradeOrder;
|
|
import com.sckw.mongo.model.SckwTradeOrder;
|
|
|
import com.sckw.order.api.model.TradeOrderCountStatisticsDTO;
|
|
import com.sckw.order.api.model.TradeOrderCountStatisticsDTO;
|
|
|
import com.sckw.order.dao.KwoTradeOrderMapper;
|
|
import com.sckw.order.dao.KwoTradeOrderMapper;
|
|
|
|
|
+import com.sckw.order.enums.*;
|
|
|
import com.sckw.order.model.*;
|
|
import com.sckw.order.model.*;
|
|
|
import com.sckw.order.model.dto.OrderCheckDTO;
|
|
import com.sckw.order.model.dto.OrderCheckDTO;
|
|
|
import com.sckw.order.model.dto.WbTOrderExcelStsReqDTO;
|
|
import com.sckw.order.model.dto.WbTOrderExcelStsReqDTO;
|
|
@@ -120,7 +120,7 @@ public class KwoTradeOrderService {
|
|
|
KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
|
|
KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
|
|
|
order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
|
|
order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
|
|
|
.setUnit(Objects.nonNull(param.getGoodsInfo()) ? param.getGoodsInfo().getUnit() : null)
|
|
.setUnit(Objects.nonNull(param.getGoodsInfo()) ? param.getGoodsInfo().getUnit() : null)
|
|
|
- .setSource(DictEnum.TORDER_SOURCE_1.getValue()).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_0.getValue()));
|
|
|
|
|
|
|
+ .setSource(OrderSourceEnum.PURCHASE.getType()).setStatus(OrderStatusEnum.SAVED.getCode());
|
|
|
kwoTradeOrderMapper.insert(order);
|
|
kwoTradeOrderMapper.insert(order);
|
|
|
addOtherOrderInfo(order, BeanUtils.copyProperties(param, ValetOrderParam.class), false);
|
|
addOtherOrderInfo(order, BeanUtils.copyProperties(param, ValetOrderParam.class), false);
|
|
|
}
|
|
}
|
|
@@ -183,7 +183,7 @@ public class KwoTradeOrderService {
|
|
|
KwoTradeOrderUnit unit = BeanUtils.copyProperties(e, KwoTradeOrderUnit.class);
|
|
KwoTradeOrderUnit unit = BeanUtils.copyProperties(e, KwoTradeOrderUnit.class);
|
|
|
unit.setTOrderId(id).setTOrderNo(tOrderNo).setTopEntId(ent.getId());
|
|
unit.setTOrderId(id).setTOrderNo(tOrderNo).setTopEntId(ent.getId());
|
|
|
list.add(unit);
|
|
list.add(unit);
|
|
|
- if (Objects.equals(e.getUnitType(), DictEnum.TORDER_UNIT_TYPE_1.getValue())) {
|
|
|
|
|
|
|
+ if (Objects.equals(e.getUnitType(), OrderUnitTypeEnum.PURCHASE.getType())) {
|
|
|
order.setProcureEntId(e.getEntId()).setProcureTopEntId(unit.getTopEntId()).setProcureFirmName(e.getFirmName())
|
|
order.setProcureEntId(e.getEntId()).setProcureTopEntId(unit.getTopEntId()).setProcureFirmName(e.getFirmName())
|
|
|
.setProcureContacts(e.getContacts()).setProcurePhone(e.getPhone()).setProcureContactsId(e.getContactsId());
|
|
.setProcureContacts(e.getContacts()).setProcurePhone(e.getPhone()).setProcureContactsId(e.getContactsId());
|
|
|
} else {
|
|
} else {
|
|
@@ -202,7 +202,7 @@ public class KwoTradeOrderService {
|
|
|
KwoTradeOrderAddress address = BeanUtils.copyProperties(e, KwoTradeOrderAddress.class);
|
|
KwoTradeOrderAddress address = BeanUtils.copyProperties(e, KwoTradeOrderAddress.class);
|
|
|
address.setTOrderId(id).setTOrderNo(tOrderNo);
|
|
address.setTOrderId(id).setTOrderNo(tOrderNo);
|
|
|
list.add(address);
|
|
list.add(address);
|
|
|
- if (Objects.equals(e.getAddressType(), DictEnum.TORDER_ADDRESS_TYPE_1.getValue())) {
|
|
|
|
|
|
|
+ if (Objects.equals(e.getAddressType(), OrderAddressTypeEnum.LOAD.getType())) {
|
|
|
order.setLoadName(e.getName()).setLoadType(e.getType()).setLoadContacts(e.getContacts())
|
|
order.setLoadName(e.getName()).setLoadType(e.getType()).setLoadContacts(e.getContacts())
|
|
|
.setLoadPhone(e.getPhone()).setLoadCityCode(String.valueOf(e.getCityCode())).setLoadCityName(e.getCityName())
|
|
.setLoadPhone(e.getPhone()).setLoadCityCode(String.valueOf(e.getCityCode())).setLoadCityName(e.getCityName())
|
|
|
.setLoadDetailAddress(e.getDetailAddress()).setLoadLat(e.getLat()).setLoadLng(e.getLng());
|
|
.setLoadDetailAddress(e.getDetailAddress()).setLoadLat(e.getLat()).setLoadLng(e.getLng());
|
|
@@ -224,7 +224,7 @@ public class KwoTradeOrderService {
|
|
|
BeanUtils.copyProperties(contractInfo, order);
|
|
BeanUtils.copyProperties(contractInfo, order);
|
|
|
}
|
|
}
|
|
|
//状态信息(草稿更新不加状态记录)
|
|
//状态信息(草稿更新不加状态记录)
|
|
|
- if (!isUpdate || !Objects.equals(DictEnum.TORDER_STATUS_0.getValue(), String.valueOf(tradeOrder.getStatus()))) {
|
|
|
|
|
|
|
+ if (!isUpdate || !Objects.equals(OrderStatusEnum.SAVED.getCode(), tradeOrder.getStatus())) {
|
|
|
KwoTradeOrderTrack track = new KwoTradeOrderTrack();
|
|
KwoTradeOrderTrack track = new KwoTradeOrderTrack();
|
|
|
track.setTOrderId(id).setTOrderNo(tOrderNo).setStatus(tradeOrder.getStatus()).setRemark(tradeOrder.getRemark());
|
|
track.setTOrderId(id).setTOrderNo(tOrderNo).setStatus(tradeOrder.getStatus()).setRemark(tradeOrder.getRemark());
|
|
|
kwoTradeOrderTrackService.insert(track);
|
|
kwoTradeOrderTrackService.insert(track);
|
|
@@ -262,7 +262,7 @@ public class KwoTradeOrderService {
|
|
|
KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
|
|
KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
|
|
|
order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
|
|
order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
|
|
|
.setUnit(Objects.nonNull(param.getGoodsInfo()) ? param.getGoodsInfo().getUnit() : null)
|
|
.setUnit(Objects.nonNull(param.getGoodsInfo()) ? param.getGoodsInfo().getUnit() : null)
|
|
|
- .setSource(DictEnum.TORDER_SOURCE_2.getValue()).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_0.getValue()));
|
|
|
|
|
|
|
+ .setSource(OrderSourceEnum.SALE.getType()).setStatus(OrderStatusEnum.SAVED.getCode());
|
|
|
kwoTradeOrderMapper.insert(order);
|
|
kwoTradeOrderMapper.insert(order);
|
|
|
addOtherOrderInfo(order, BeanUtils.copyProperties(param, ValetOrderParam.class), false);
|
|
addOtherOrderInfo(order, BeanUtils.copyProperties(param, ValetOrderParam.class), false);
|
|
|
}
|
|
}
|
|
@@ -282,12 +282,13 @@ public class KwoTradeOrderService {
|
|
|
OrderCheckDTO orderCheck = BeanUtils.copyProperties(param, OrderCheckDTO.class);
|
|
OrderCheckDTO orderCheck = BeanUtils.copyProperties(param, OrderCheckDTO.class);
|
|
|
getTopEnt(orderCheck, param.getUnitInfo());
|
|
getTopEnt(orderCheck, param.getUnitInfo());
|
|
|
orderCheck.setGoodsId(goodsInfo.getGoodsId()).setUnitPrice(goodsInfo.getUnitPrice())
|
|
orderCheck.setGoodsId(goodsInfo.getGoodsId()).setUnitPrice(goodsInfo.getUnitPrice())
|
|
|
- .setOrderSource(DictEnum.TORDER_SOURCE_1.getValue());
|
|
|
|
|
|
|
+ .setOrderSource(OrderSourceEnum.PURCHASE.getType());
|
|
|
orderCheck(orderCheck, false);
|
|
orderCheck(orderCheck, false);
|
|
|
KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
|
|
KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
|
|
|
order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
|
|
order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
|
|
|
- .setUnit(param.getGoodsInfo().getUnit()).setSource(DictEnum.TORDER_SOURCE_1.getValue())
|
|
|
|
|
- .setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_1.getValue()));
|
|
|
|
|
|
|
+ .setUnit(param.getGoodsInfo().getUnit())
|
|
|
|
|
+ .setSource(OrderSourceEnum.PURCHASE.getType())
|
|
|
|
|
+ .setStatus(OrderStatusEnum.WAIT_ACCEPTED.getCode());
|
|
|
kwoTradeOrderMapper.insert(order);
|
|
kwoTradeOrderMapper.insert(order);
|
|
|
//扣减库存
|
|
//扣减库存
|
|
|
HttpResult updateResult = goodsInfoService.updateGoodsAmount(param.getGoodsInfo().getGoodsId(), param.getAmount());
|
|
HttpResult updateResult = goodsInfoService.updateGoodsAmount(param.getGoodsInfo().getGoodsId(), param.getAmount());
|
|
@@ -316,7 +317,7 @@ public class KwoTradeOrderService {
|
|
|
UserInfo createUser = new UserInfo();
|
|
UserInfo createUser = new UserInfo();
|
|
|
createUser.setUserId(LoginUserHolder.getUserId()).setEntId(LoginUserHolder.getEntId());
|
|
createUser.setUserId(LoginUserHolder.getUserId()).setEntId(LoginUserHolder.getEntId());
|
|
|
userInfos.add(createUser);
|
|
userInfos.add(createUser);
|
|
|
- boolean flag = Objects.equals(orderCheck.getOrderSource(), DictEnum.TORDER_SOURCE_1.getValue());
|
|
|
|
|
|
|
+ boolean flag = Objects.equals(orderCheck.getOrderSource(), OrderSourceEnum.PURCHASE.getType());
|
|
|
UserInfo procureUser = orderCheck.getProcureUser();
|
|
UserInfo procureUser = orderCheck.getProcureUser();
|
|
|
String procureFireName = orderCheck.getProcureFireName();
|
|
String procureFireName = orderCheck.getProcureFireName();
|
|
|
UserInfo supplyUser = orderCheck.getSupplyUser();
|
|
UserInfo supplyUser = orderCheck.getSupplyUser();
|
|
@@ -388,7 +389,7 @@ public class KwoTradeOrderService {
|
|
|
log.error("企业:{}找不到对应一级企业信息", entId);
|
|
log.error("企业:{}找不到对应一级企业信息", entId);
|
|
|
throw new BusinessException("一级企业信息不存在!");
|
|
throw new BusinessException("一级企业信息不存在!");
|
|
|
}
|
|
}
|
|
|
- if (Objects.equals(e.getUnitType(), DictEnum.TORDER_UNIT_TYPE_1.getValue())) {
|
|
|
|
|
|
|
+ if (Objects.equals(e.getUnitType(), OrderUnitTypeEnum.PURCHASE.getType())) {
|
|
|
UserInfo procureUser = new UserInfo();
|
|
UserInfo procureUser = new UserInfo();
|
|
|
orderCheck.setProcureTopEntId(ent.getId());
|
|
orderCheck.setProcureTopEntId(ent.getId());
|
|
|
orderCheck.setProcureEntId(entId);
|
|
orderCheck.setProcureEntId(entId);
|
|
@@ -423,7 +424,7 @@ public class KwoTradeOrderService {
|
|
|
throw new BusinessException("订单总金额不等于商品单价*订单总量!");
|
|
throw new BusinessException("订单总金额不等于商品单价*订单总量!");
|
|
|
}
|
|
}
|
|
|
List<FindEntCooperateResVo> entCooperate;
|
|
List<FindEntCooperateResVo> entCooperate;
|
|
|
- if (DictEnum.TORDER_SOURCE_1.getValue().equals(param.getOrderSource())) {
|
|
|
|
|
|
|
+ if (OrderSourceEnum.PURCHASE.getType().equals(param.getOrderSource())) {
|
|
|
entCooperate = remoteManageService.findEntCooperate(param.getProcureEntId()
|
|
entCooperate = remoteManageService.findEntCooperate(param.getProcureEntId()
|
|
|
, param.getSupplyEntId(), CooperateTypeEnum.SUPPLIER.getCode());
|
|
, param.getSupplyEntId(), CooperateTypeEnum.SUPPLIER.getCode());
|
|
|
} else {
|
|
} else {
|
|
@@ -445,7 +446,7 @@ public class KwoTradeOrderService {
|
|
|
if (trading.startsWith("1")) {
|
|
if (trading.startsWith("1")) {
|
|
|
BigDecimal advancePrice = goods.getAdvancePrice().multiply(new BigDecimal("10000"));
|
|
BigDecimal advancePrice = goods.getAdvancePrice().multiply(new BigDecimal("10000"));
|
|
|
//直接采购下单才校验预付款限额
|
|
//直接采购下单才校验预付款限额
|
|
|
- if (Objects.equals(param.getOrderSource(), DictEnum.TORDER_SOURCE_1.getValue()) && price.compareTo(advancePrice) < 0) {
|
|
|
|
|
|
|
+ if (Objects.equals(param.getOrderSource(), OrderSourceEnum.PURCHASE.getType()) && price.compareTo(advancePrice) < 0) {
|
|
|
throw new BusinessException("您的订单总额未达到预付限额,请确认");
|
|
throw new BusinessException("您的订单总额未达到预付限额,请确认");
|
|
|
}
|
|
}
|
|
|
R<List<WalletDto>> wallet = payCenterDubboService.wallet(param.getProcureTopEntId(), ChannelEnum.getByCode(trading), param.getSupplyTopEntId());
|
|
R<List<WalletDto>> wallet = payCenterDubboService.wallet(param.getProcureTopEntId(), ChannelEnum.getByCode(trading), param.getSupplyTopEntId());
|
|
@@ -474,19 +475,19 @@ public class KwoTradeOrderService {
|
|
|
OrderCheckDTO orderCheck = BeanUtils.copyProperties(param, OrderCheckDTO.class);
|
|
OrderCheckDTO orderCheck = BeanUtils.copyProperties(param, OrderCheckDTO.class);
|
|
|
getTopEnt(orderCheck, param.getUnitInfo());
|
|
getTopEnt(orderCheck, param.getUnitInfo());
|
|
|
orderCheck.setGoodsId(param.getGoodsInfo().getGoodsId()).setUnitPrice(param.getGoodsInfo().getUnitPrice())
|
|
orderCheck.setGoodsId(param.getGoodsInfo().getGoodsId()).setUnitPrice(param.getGoodsInfo().getUnitPrice())
|
|
|
- .setOrderSource(DictEnum.TORDER_SOURCE_2.getValue());
|
|
|
|
|
|
|
+ .setOrderSource(OrderSourceEnum.SALE.getType());
|
|
|
orderCheck(orderCheck, false);
|
|
orderCheck(orderCheck, false);
|
|
|
ContractInfo contract = param.getContractInfo();
|
|
ContractInfo contract = param.getContractInfo();
|
|
|
contractCheck(contract);
|
|
contractCheck(contract);
|
|
|
param.setContractInfo(contract);
|
|
param.setContractInfo(contract);
|
|
|
KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
|
|
KwoTradeOrder order = BeanUtils.copyProperties(param, KwoTradeOrder.class);
|
|
|
order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
|
|
order.setEntId(LoginUserHolder.getEntId()).setTOrderNo(getOrderNo())
|
|
|
- .setUnit(param.getGoodsInfo().getUnit()).setSource(DictEnum.TORDER_SOURCE_2.getValue());
|
|
|
|
|
|
|
+ .setUnit(param.getGoodsInfo().getUnit()).setSource(OrderSourceEnum.SALE.getType());
|
|
|
String contractStatus = contract.getContractStatus();
|
|
String contractStatus = contract.getContractStatus();
|
|
|
- if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_0.getValue())) {
|
|
|
|
|
- order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()));
|
|
|
|
|
- } else if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_1.getValue())) {
|
|
|
|
|
- order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()));
|
|
|
|
|
|
|
+ if (Objects.equals(contractStatus, ContractStatusEnum.WAIT_SIGNED.getCode())) {
|
|
|
|
|
+ order.setStatus(OrderStatusEnum.WAIT_SIGNED.getCode());
|
|
|
|
|
+ } else if (Objects.equals(contractStatus, ContractStatusEnum.SIGNED.getCode())) {
|
|
|
|
|
+ order.setStatus(OrderStatusEnum.EXECUTING.getCode());
|
|
|
} else {
|
|
} else {
|
|
|
throw new BusinessException("Invalid contract status");
|
|
throw new BusinessException("Invalid contract status");
|
|
|
}
|
|
}
|
|
@@ -578,7 +579,7 @@ public class KwoTradeOrderService {
|
|
|
process.setRoleName(String.join(",", roleNames));
|
|
process.setRoleName(String.join(",", roleNames));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- process.setStatusLabel(DictEnum.getLabel(DictTypeEnum.TORDER_STATUS.getType(), String.valueOf(process.getStatus())));
|
|
|
|
|
|
|
+ process.setStatusLabel(OrderStatusEnum.getMsg(process.getStatus()));
|
|
|
orderProcesses.add(process);
|
|
orderProcesses.add(process);
|
|
|
});
|
|
});
|
|
|
detail.setOrderProcess(orderProcesses);
|
|
detail.setOrderProcess(orderProcesses);
|
|
@@ -597,17 +598,48 @@ public class KwoTradeOrderService {
|
|
|
if (Objects.isNull(order)) {
|
|
if (Objects.isNull(order)) {
|
|
|
throw new BusinessException("不存在该订单!");
|
|
throw new BusinessException("不存在该订单!");
|
|
|
}
|
|
}
|
|
|
|
|
+ Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(
|
|
|
|
|
+ List.of(DictTypeEnum.TRADE_TYPE.getType(), DictTypeEnum.PICKUP_TYPE.getType(),
|
|
|
|
|
+ DictTypeEnum.DELIVERY_TYPE.getType(), DictTypeEnum.TORDER_SOURCE.getType(), DictTypeEnum.TORDER_STATUS.getType(),
|
|
|
|
|
+ DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.UNIT_TYPE.getType(), DictTypeEnum.TAX_RATE.getType(),
|
|
|
|
|
+ DictTypeEnum.TORDER_UNIT_TYPE.getType(), DictTypeEnum.TORDER_ADDRESS_TYPE.getType(), DictTypeEnum.ADDRESS_TYPE.getType()));
|
|
|
|
|
+ Map<String, String> tradeMap = new HashMap<>();
|
|
|
|
|
+ Map<String, String> pickupMap = new HashMap<>();
|
|
|
|
|
+ Map<String, String> deleveryMap = new HashMap<>();
|
|
|
|
|
+ Map<String, String> sourceMap = new HashMap<>();
|
|
|
|
|
+ Map<String, String> statusMap = new HashMap<>();
|
|
|
|
|
+ Map<String, String> prodcutNameMap = new HashMap<>();
|
|
|
|
|
+ Map<String, String> unitMap = new HashMap<>();
|
|
|
|
|
+ Map<String, String> taxRateMap = new HashMap<>();
|
|
|
|
|
+ Map<String, String> orderUnitMap, orderAddressMap, addressMap;
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dict)) {
|
|
|
|
|
+ tradeMap = dict.get(DictTypeEnum.TRADE_TYPE.getType());
|
|
|
|
|
+ pickupMap = dict.get(DictTypeEnum.PICKUP_TYPE.getType());
|
|
|
|
|
+ deleveryMap = dict.get(DictTypeEnum.DELIVERY_TYPE.getType());
|
|
|
|
|
+ sourceMap = dict.get(DictTypeEnum.TORDER_SOURCE.getType());
|
|
|
|
|
+ statusMap = dict.get(DictTypeEnum.TORDER_STATUS.getType());
|
|
|
|
|
+ prodcutNameMap = dict.get(DictTypeEnum.PRODUCT_NAME_TYPE.getType());
|
|
|
|
|
+ unitMap = dict.get(DictTypeEnum.UNIT_TYPE.getType());
|
|
|
|
|
+ taxRateMap = dict.get(DictTypeEnum.TAX_RATE.getType());
|
|
|
|
|
+ orderUnitMap = dict.get(DictTypeEnum.TORDER_UNIT_TYPE.getType());
|
|
|
|
|
+ orderAddressMap = dict.get(DictTypeEnum.TORDER_ADDRESS_TYPE.getType());
|
|
|
|
|
+ addressMap = dict.get(DictTypeEnum.ADDRESS_TYPE.getType());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ orderUnitMap = new HashMap<>();
|
|
|
|
|
+ orderAddressMap = new HashMap<>();
|
|
|
|
|
+ addressMap = new HashMap<>();
|
|
|
|
|
+ }
|
|
|
//订单基本信息
|
|
//订单基本信息
|
|
|
OrderDetailRes detail = BeanUtils.copyProperties(order, OrderDetailRes.class);
|
|
OrderDetailRes detail = BeanUtils.copyProperties(order, OrderDetailRes.class);
|
|
|
UserCacheResDto createUser = remoteSystemService.queryUserCacheById(detail.getCreateBy());
|
|
UserCacheResDto createUser = remoteSystemService.queryUserCacheById(detail.getCreateBy());
|
|
|
EntCacheResDto ent = remoteSystemService.queryEntCacheById(detail.getEntId());
|
|
EntCacheResDto ent = remoteSystemService.queryEntCacheById(detail.getEntId());
|
|
|
detail.setFirmName(Objects.isNull(ent) ? null : ent.getFirmName())
|
|
detail.setFirmName(Objects.isNull(ent) ? null : ent.getFirmName())
|
|
|
.setCreateByName(Objects.isNull(createUser) ? null : createUser.getName())
|
|
.setCreateByName(Objects.isNull(createUser) ? null : createUser.getName())
|
|
|
- .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), detail.getTrading()))
|
|
|
|
|
- .setPickupTypeLabel(DictEnum.getLabel(DictTypeEnum.PICKUP_TYPE.getType(), detail.getPickupType()))
|
|
|
|
|
- .setDeliveryTypeLabel(DictEnum.getLabel(DictTypeEnum.DELIVERY_TYPE.getType(), detail.getDeliveryType()))
|
|
|
|
|
- .setSourceLabel(DictEnum.getLabel(DictTypeEnum.TORDER_SOURCE.getType(), detail.getSource()))
|
|
|
|
|
- .setStatusLabel(DictEnum.getLabel(DictTypeEnum.TORDER_STATUS.getType(), String.valueOf(detail.getStatus())));
|
|
|
|
|
|
|
+ .setTradingLabel(CollectionUtils.isNotEmpty(tradeMap) ? tradeMap.get(detail.getTrading()) : null)
|
|
|
|
|
+ .setPickupTypeLabel(CollectionUtils.isNotEmpty(pickupMap) ? pickupMap.get(detail.getPickupType()) : null)
|
|
|
|
|
+ .setDeliveryTypeLabel(CollectionUtils.isNotEmpty(deleveryMap) ? deleveryMap.get(detail.getDeliveryType()) : null)
|
|
|
|
|
+ .setSourceLabel(CollectionUtils.isNotEmpty(sourceMap) ? sourceMap.get(detail.getSource()) : null)
|
|
|
|
|
+ .setStatusLabel(CollectionUtils.isNotEmpty(statusMap) ? statusMap.get(String.valueOf(detail.getStatus())) : null);
|
|
|
//商品信息
|
|
//商品信息
|
|
|
KwoTradeOrderGoods orderGoods = kwoTradeOrderGoodsService.getByOrderId(id);
|
|
KwoTradeOrderGoods orderGoods = kwoTradeOrderGoodsService.getByOrderId(id);
|
|
|
if (Objects.nonNull(orderGoods)) {
|
|
if (Objects.nonNull(orderGoods)) {
|
|
@@ -615,13 +647,15 @@ public class KwoTradeOrderService {
|
|
|
if (Objects.nonNull(goods)) {
|
|
if (Objects.nonNull(goods)) {
|
|
|
EntCacheResDto entCache = remoteSystemService.queryEntCacheById(goods.getEntId());
|
|
EntCacheResDto entCache = remoteSystemService.queryEntCacheById(goods.getEntId());
|
|
|
GoodsInfoDetailRes goodsDetail = new GoodsInfoDetailRes();
|
|
GoodsInfoDetailRes goodsDetail = new GoodsInfoDetailRes();
|
|
|
- goodsDetail.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), goods.getGoodsType()))
|
|
|
|
|
- .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), goods.getUnit())).setGoodsAmount(goods.getAmount())
|
|
|
|
|
- .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), goods.getTaxRate()))
|
|
|
|
|
|
|
+ goodsDetail.setGoodsTypeLabel(CollectionUtils.isNotEmpty(prodcutNameMap) ? prodcutNameMap.get(goods.getGoodsType()) : null)
|
|
|
|
|
+ .setUnitLabel(CollectionUtils.isNotEmpty(unitMap) ? unitMap.get(goods.getUnit()) : null)
|
|
|
|
|
+ .setTaxRateLabel(CollectionUtils.isNotEmpty(taxRateMap) ? taxRateMap.get(goods.getTaxRate()) : null)
|
|
|
|
|
+ .setGoodsAmount(goods.getAmount())
|
|
|
.setGoodsId(goods.getId()).setCode(goods.getCode()).setName(goods.getName())
|
|
.setGoodsId(goods.getId()).setCode(goods.getCode()).setName(goods.getName())
|
|
|
.setGoodsType(goods.getGoodsType()).setTaxRate(goods.getTaxRate()).setSpec(goods.getSpec())
|
|
.setGoodsType(goods.getGoodsType()).setTaxRate(goods.getTaxRate()).setSpec(goods.getSpec())
|
|
|
.setUnit(goods.getUnit()).setPriceRangeId(orderGoods.getPriceRangeId()).setUnitPrice(orderGoods.getUnitPrice())
|
|
.setUnit(goods.getUnit()).setPriceRangeId(orderGoods.getPriceRangeId()).setUnitPrice(orderGoods.getUnitPrice())
|
|
|
.setSkuId(orderGoods.getSkuId()).setCollectionUnitId(goods.getEntId()).setGoodsThumb(goods.getThumb())
|
|
.setSkuId(orderGoods.getSkuId()).setCollectionUnitId(goods.getEntId()).setGoodsThumb(goods.getThumb())
|
|
|
|
|
+ .setPrepaidLimit(goods.getPrepaidLimit()).setAdvancePrice(goods.getAdvancePrice())
|
|
|
.setCollectionUnit(Objects.isNull(entCache) ? null : entCache.getFirmName());
|
|
.setCollectionUnit(Objects.isNull(entCache) ? null : entCache.getFirmName());
|
|
|
detail.setGoodsInfo(goodsDetail);
|
|
detail.setGoodsInfo(goodsDetail);
|
|
|
}
|
|
}
|
|
@@ -633,7 +667,7 @@ public class KwoTradeOrderService {
|
|
|
List<UnitInfoDetailRes> unitInfos = new ArrayList<>(units.size());
|
|
List<UnitInfoDetailRes> unitInfos = new ArrayList<>(units.size());
|
|
|
units.forEach(e -> {
|
|
units.forEach(e -> {
|
|
|
UnitInfoDetailRes unit = BeanUtils.copyProperties(e, UnitInfoDetailRes.class);
|
|
UnitInfoDetailRes unit = BeanUtils.copyProperties(e, UnitInfoDetailRes.class);
|
|
|
- unit.setUnitTypeLabel(DictEnum.getLabel(DictTypeEnum.TORDER_UNIT_TYPE.getType(), unit.getUnitType()));
|
|
|
|
|
|
|
+ unit.setUnitTypeLabel(CollectionUtils.isNotEmpty(orderUnitMap) ? orderUnitMap.get(unit.getUnitType()) : null);
|
|
|
unitInfos.add(unit);
|
|
unitInfos.add(unit);
|
|
|
});
|
|
});
|
|
|
detail.setUnitInfo(unitInfos);
|
|
detail.setUnitInfo(unitInfos);
|
|
@@ -644,8 +678,8 @@ public class KwoTradeOrderService {
|
|
|
List<AddressInfoDetailRes> addressInfoDetails = new ArrayList<>(addressList.size());
|
|
List<AddressInfoDetailRes> addressInfoDetails = new ArrayList<>(addressList.size());
|
|
|
addressList.forEach(e -> {
|
|
addressList.forEach(e -> {
|
|
|
AddressInfoDetailRes address = BeanUtils.copyProperties(e, AddressInfoDetailRes.class);
|
|
AddressInfoDetailRes address = BeanUtils.copyProperties(e, AddressInfoDetailRes.class);
|
|
|
- address.setAddressTypeLabel(DictEnum.getLabel(DictTypeEnum.TORDER_ADDRESS_TYPE.getType(), address.getAddressType()));
|
|
|
|
|
- address.setTypeLabel(DictEnum.getLabel(DictTypeEnum.ADDRESS_TYPE.getType(), address.getType()));
|
|
|
|
|
|
|
+ address.setAddressTypeLabel(CollectionUtils.isNotEmpty(orderAddressMap) ? orderAddressMap.get(address.getAddressType()) : null);
|
|
|
|
|
+ address.setTypeLabel(CollectionUtils.isNotEmpty(addressMap) ? addressMap.get(address.getType()) : null);
|
|
|
addressInfoDetails.add(address);
|
|
addressInfoDetails.add(address);
|
|
|
});
|
|
});
|
|
|
detail.setAddressInfo(addressInfoDetails);
|
|
detail.setAddressInfo(addressInfoDetails);
|
|
@@ -679,12 +713,12 @@ public class KwoTradeOrderService {
|
|
|
throw new BusinessException("Order not found");
|
|
throw new BusinessException("Order not found");
|
|
|
}
|
|
}
|
|
|
String source = order.getSource();
|
|
String source = order.getSource();
|
|
|
- String status = String.valueOf(order.getStatus());
|
|
|
|
|
- if ((!Objects.equals(status, DictEnum.TORDER_STATUS_0.getValue()) && !Objects.equals(status, DictEnum.TORDER_STATUS_2.getValue()))
|
|
|
|
|
- && Objects.equals(source, DictEnum.TORDER_SOURCE_1.getValue())) {
|
|
|
|
|
|
|
+ Integer status = order.getStatus();
|
|
|
|
|
+ if ((!Objects.equals(status, OrderStatusEnum.SAVED.getCode()) && !Objects.equals(status, OrderStatusEnum.RETURNED.getCode()))
|
|
|
|
|
+ && Objects.equals(source, OrderSourceEnum.PURCHASE.getType())) {
|
|
|
throw new BusinessException("采购下单只能修改已保存及已退回状态的订单!");
|
|
throw new BusinessException("采购下单只能修改已保存及已退回状态的订单!");
|
|
|
}
|
|
}
|
|
|
- if (Objects.equals(source, DictEnum.TORDER_SOURCE_2.getValue()) && !Objects.equals(status, DictEnum.TORDER_STATUS_0.getValue())) {
|
|
|
|
|
|
|
+ if (Objects.equals(source, OrderSourceEnum.SALE.getType()) && !Objects.equals(status, OrderStatusEnum.SAVED.getCode())) {
|
|
|
throw new BusinessException("代客下单只能修改已保存状态的订单!");
|
|
throw new BusinessException("代客下单只能修改已保存状态的订单!");
|
|
|
}
|
|
}
|
|
|
if (!Objects.equals(0, order.getStatus())
|
|
if (!Objects.equals(0, order.getStatus())
|
|
@@ -694,17 +728,17 @@ public class KwoTradeOrderService {
|
|
|
OrderCheckDTO orderCheck = new OrderCheckDTO();
|
|
OrderCheckDTO orderCheck = new OrderCheckDTO();
|
|
|
if (Objects.equals(param.getOperateType(), 1)) {
|
|
if (Objects.equals(param.getOperateType(), 1)) {
|
|
|
checkParams(param, source);
|
|
checkParams(param, source);
|
|
|
- if (Objects.equals(source, DictEnum.TORDER_SOURCE_1.getValue())) {
|
|
|
|
|
- order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_1.getValue()));
|
|
|
|
|
|
|
+ if (Objects.equals(source, OrderSourceEnum.PURCHASE.getType())) {
|
|
|
|
|
+ order.setStatus(OrderStatusEnum.WAIT_ACCEPTED.getCode());
|
|
|
} else {
|
|
} else {
|
|
|
ContractInfo contract = param.getContractInfo();
|
|
ContractInfo contract = param.getContractInfo();
|
|
|
contractCheck(contract);
|
|
contractCheck(contract);
|
|
|
param.setContractInfo(contract);
|
|
param.setContractInfo(contract);
|
|
|
String contractStatus = contract.getContractStatus();
|
|
String contractStatus = contract.getContractStatus();
|
|
|
- if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_0.getValue())) {
|
|
|
|
|
- order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()));
|
|
|
|
|
- } else if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_1.getValue())) {
|
|
|
|
|
- order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()));
|
|
|
|
|
|
|
+ if (Objects.equals(contractStatus, ContractStatusEnum.WAIT_SIGNED.getCode())) {
|
|
|
|
|
+ order.setStatus(OrderStatusEnum.WAIT_SIGNED.getCode());
|
|
|
|
|
+ } else if (Objects.equals(contractStatus, ContractStatusEnum.SIGNED.getCode())) {
|
|
|
|
|
+ order.setStatus(OrderStatusEnum.EXECUTING.getCode());
|
|
|
} else {
|
|
} else {
|
|
|
throw new BusinessException("Invalid contract status");
|
|
throw new BusinessException("Invalid contract status");
|
|
|
}
|
|
}
|
|
@@ -755,7 +789,7 @@ public class KwoTradeOrderService {
|
|
|
throw new BusinessException("结束时间不能为空!");
|
|
throw new BusinessException("结束时间不能为空!");
|
|
|
}
|
|
}
|
|
|
ContractInfo contractInfo = param.getContractInfo();
|
|
ContractInfo contractInfo = param.getContractInfo();
|
|
|
- if (Objects.equals(source, DictEnum.TORDER_SOURCE_2.getValue())) {
|
|
|
|
|
|
|
+ if (Objects.equals(source, OrderSourceEnum.SALE.getType())) {
|
|
|
if (StringUtils.isBlank(param.getDeliveryType())) {
|
|
if (StringUtils.isBlank(param.getDeliveryType())) {
|
|
|
throw new BusinessException("交付类型不能为空!");
|
|
throw new BusinessException("交付类型不能为空!");
|
|
|
}
|
|
}
|
|
@@ -776,7 +810,7 @@ public class KwoTradeOrderService {
|
|
|
if (StringUtils.isBlank(goodsInfo.getUnit())) {
|
|
if (StringUtils.isBlank(goodsInfo.getUnit())) {
|
|
|
throw new BusinessException("商品单位不能为空!");
|
|
throw new BusinessException("商品单位不能为空!");
|
|
|
}
|
|
}
|
|
|
- if (Objects.isNull(goodsInfo.getPriceRangeId()) && Objects.equals(source, DictEnum.TORDER_SOURCE_1.getValue())) {
|
|
|
|
|
|
|
+ if (Objects.isNull(goodsInfo.getPriceRangeId()) && Objects.equals(source, OrderSourceEnum.PURCHASE.getType())) {
|
|
|
throw new BusinessException("价格段id不能为空!");
|
|
throw new BusinessException("价格段id不能为空!");
|
|
|
}
|
|
}
|
|
|
if (Objects.isNull(goodsInfo.getUnitPrice()) || goodsInfo.getUnitPrice().compareTo(BigDecimal.ZERO) <= 0) {
|
|
if (Objects.isNull(goodsInfo.getUnitPrice()) || goodsInfo.getUnitPrice().compareTo(BigDecimal.ZERO) <= 0) {
|
|
@@ -861,10 +895,10 @@ public class KwoTradeOrderService {
|
|
|
if (Objects.isNull(order)) {
|
|
if (Objects.isNull(order)) {
|
|
|
throw new BusinessException("Order not found");
|
|
throw new BusinessException("Order not found");
|
|
|
}
|
|
}
|
|
|
- if (!Objects.equals(DictEnum.TORDER_STATUS_1.getValue(), String.valueOf(order.getStatus()))) {
|
|
|
|
|
|
|
+ if (!Objects.equals(OrderStatusEnum.WAIT_ACCEPTED.getCode(), order.getStatus())) {
|
|
|
throw new BusinessException("订单状态不为待受理!");
|
|
throw new BusinessException("订单状态不为待受理!");
|
|
|
}
|
|
}
|
|
|
- if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), DictEnum.TORDER_UNIT_TYPE_2.getValue())) {
|
|
|
|
|
|
|
+ if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), OrderUnitTypeEnum.SALE.getType())) {
|
|
|
throw new BusinessException("无订单操作权限!");
|
|
throw new BusinessException("无订单操作权限!");
|
|
|
}
|
|
}
|
|
|
KwoTradeOrderGoods goods = kwoTradeOrderGoodsService.getByOrderId(order.getId());
|
|
KwoTradeOrderGoods goods = kwoTradeOrderGoodsService.getByOrderId(order.getId());
|
|
@@ -887,10 +921,10 @@ public class KwoTradeOrderService {
|
|
|
ContractInfo contractInfo = param.getContractInfo();
|
|
ContractInfo contractInfo = param.getContractInfo();
|
|
|
contractCheck(contractInfo);
|
|
contractCheck(contractInfo);
|
|
|
String contractStatus = contractInfo.getContractStatus();
|
|
String contractStatus = contractInfo.getContractStatus();
|
|
|
- if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_0.getValue())) {
|
|
|
|
|
- order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()));
|
|
|
|
|
- } else if (Objects.equals(contractStatus, DictEnum.CONTRACT_STATUS_1.getValue())) {
|
|
|
|
|
- order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()));
|
|
|
|
|
|
|
+ if (Objects.equals(contractStatus, ContractStatusEnum.WAIT_SIGNED.getCode())) {
|
|
|
|
|
+ order.setStatus(OrderStatusEnum.WAIT_SIGNED.getCode());
|
|
|
|
|
+ } else if (Objects.equals(contractStatus, ContractStatusEnum.SIGNED.getCode())) {
|
|
|
|
|
+ order.setStatus(OrderStatusEnum.EXECUTING.getCode());
|
|
|
} else {
|
|
} else {
|
|
|
throw new BusinessException("Invalid contract status");
|
|
throw new BusinessException("Invalid contract status");
|
|
|
}
|
|
}
|
|
@@ -942,13 +976,13 @@ public class KwoTradeOrderService {
|
|
|
if (Objects.isNull(order)) {
|
|
if (Objects.isNull(order)) {
|
|
|
throw new BusinessException("Order not found");
|
|
throw new BusinessException("Order not found");
|
|
|
}
|
|
}
|
|
|
- if (!Objects.equals(DictEnum.TORDER_STATUS_1.getValue(), String.valueOf(order.getStatus()))) {
|
|
|
|
|
|
|
+ if (!Objects.equals(OrderStatusEnum.WAIT_ACCEPTED.getCode(), order.getStatus())) {
|
|
|
throw new BusinessException("订单状态不为待受理!");
|
|
throw new BusinessException("订单状态不为待受理!");
|
|
|
}
|
|
}
|
|
|
- if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), DictEnum.TORDER_UNIT_TYPE_2.getValue())) {
|
|
|
|
|
|
|
+ if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), OrderUnitTypeEnum.SALE.getType())) {
|
|
|
throw new BusinessException("无订单操作权限!");
|
|
throw new BusinessException("无订单操作权限!");
|
|
|
}
|
|
}
|
|
|
- order.setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_2.getValue()));
|
|
|
|
|
|
|
+ order.setStatus(OrderStatusEnum.RETURNED.getCode());
|
|
|
kwoTradeOrderMapper.updateById(order);
|
|
kwoTradeOrderMapper.updateById(order);
|
|
|
//订单状态记录
|
|
//订单状态记录
|
|
|
KwoTradeOrderTrack track = new KwoTradeOrderTrack();
|
|
KwoTradeOrderTrack track = new KwoTradeOrderTrack();
|
|
@@ -983,8 +1017,8 @@ public class KwoTradeOrderService {
|
|
|
map.put("orderNo", order.getTOrderNo());
|
|
map.put("orderNo", order.getTOrderNo());
|
|
|
Map<String, KwoTradeOrderUnit> unitMap = units.stream().collect
|
|
Map<String, KwoTradeOrderUnit> unitMap = units.stream().collect
|
|
|
(Collectors.toMap(KwoTradeOrderUnit::getUnitType, Function.identity()));
|
|
(Collectors.toMap(KwoTradeOrderUnit::getUnitType, Function.identity()));
|
|
|
- KwoTradeOrderUnit purchase = unitMap.get(DictEnum.TORDER_UNIT_TYPE_1.getValue());
|
|
|
|
|
- KwoTradeOrderUnit supply = unitMap.get(DictEnum.TORDER_UNIT_TYPE_2.getValue());
|
|
|
|
|
|
|
+ KwoTradeOrderUnit purchase = unitMap.get(OrderUnitTypeEnum.PURCHASE.getType());
|
|
|
|
|
+ KwoTradeOrderUnit supply = unitMap.get(OrderUnitTypeEnum.SALE.getType());
|
|
|
//给供应企业联系人发消息
|
|
//给供应企业联系人发消息
|
|
|
map.put("firmName", purchase.getFirmName());
|
|
map.put("firmName", purchase.getFirmName());
|
|
|
UserInfo supplyUser = new UserInfo();
|
|
UserInfo supplyUser = new UserInfo();
|
|
@@ -1019,7 +1053,7 @@ public class KwoTradeOrderService {
|
|
|
if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), null)) {
|
|
if (kwoTradeOrderUnitService.entMatch(order.getId(), LoginUserHolder.getEntId(), null)) {
|
|
|
throw new BusinessException("无订单操作权限!");
|
|
throw new BusinessException("无订单操作权限!");
|
|
|
}
|
|
}
|
|
|
- KwoTradeOrderTrack track = kwoTradeOrderTrackService.getByOrderId(id, Integer.valueOf(DictEnum.TORDER_STATUS_2.getValue()));
|
|
|
|
|
|
|
+ KwoTradeOrderTrack track = kwoTradeOrderTrackService.getByOrderId(id, OrderStatusEnum.RETURNED.getCode());
|
|
|
|
|
|
|
|
return Objects.isNull(track) ? null : track.getRemark();
|
|
return Objects.isNull(track) ? null : track.getRemark();
|
|
|
}
|
|
}
|
|
@@ -1038,10 +1072,10 @@ public class KwoTradeOrderService {
|
|
|
if (Objects.isNull(order)) {
|
|
if (Objects.isNull(order)) {
|
|
|
throw new BusinessException("Order not found");
|
|
throw new BusinessException("Order not found");
|
|
|
}
|
|
}
|
|
|
- if (!Objects.equals(String.valueOf(order.getStatus()), DictEnum.TORDER_STATUS_4.getValue())) {
|
|
|
|
|
|
|
+ if (!Objects.equals(order.getStatus(), OrderStatusEnum.EXECUTING.getCode())) {
|
|
|
throw new BusinessException("执行中的订单才能完结订单!");
|
|
throw new BusinessException("执行中的订单才能完结订单!");
|
|
|
}
|
|
}
|
|
|
- if (kwoTradeOrderUnitService.entMatch(param.getId(), LoginUserHolder.getEntId(), DictEnum.TORDER_UNIT_TYPE_2.getValue())) {
|
|
|
|
|
|
|
+ if (kwoTradeOrderUnitService.entMatch(param.getId(), LoginUserHolder.getEntId(), OrderUnitTypeEnum.SALE.getType())) {
|
|
|
throw new BusinessException("无订单操作权限!");
|
|
throw new BusinessException("无订单操作权限!");
|
|
|
}
|
|
}
|
|
|
if (transportDubboService.checkLogisticsOrderByTradeOrderId(tOrderId)) {
|
|
if (transportDubboService.checkLogisticsOrderByTradeOrderId(tOrderId)) {
|
|
@@ -1052,7 +1086,7 @@ public class KwoTradeOrderService {
|
|
|
throw new BusinessException("业务繁忙,请稍后再试!");
|
|
throw new BusinessException("业务繁忙,请稍后再试!");
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
- order.setActualAmount(actualAmount).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_5.getValue()));
|
|
|
|
|
|
|
+ order.setActualAmount(actualAmount).setStatus(OrderStatusEnum.FINISHED.getCode());
|
|
|
kwoTradeOrderMapper.updateById(order);
|
|
kwoTradeOrderMapper.updateById(order);
|
|
|
//订单状态记录
|
|
//订单状态记录
|
|
|
KwoTradeOrderTrack track = new KwoTradeOrderTrack();
|
|
KwoTradeOrderTrack track = new KwoTradeOrderTrack();
|
|
@@ -1160,7 +1194,7 @@ public class KwoTradeOrderService {
|
|
|
*/
|
|
*/
|
|
|
public List<KwoTradeOrder> getWaitSignByIds(List<Long> tOrderIds) {
|
|
public List<KwoTradeOrder> getWaitSignByIds(List<Long> tOrderIds) {
|
|
|
LambdaQueryWrapper<KwoTradeOrder> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<KwoTradeOrder> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(KwoTradeOrder::getStatus, Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()))
|
|
|
|
|
|
|
+ wrapper.eq(KwoTradeOrder::getStatus, OrderStatusEnum.WAIT_SIGNED.getCode())
|
|
|
.in(KwoTradeOrder::getId, tOrderIds).eq(KwoTradeOrder::getDelFlag, Global.NO);
|
|
.in(KwoTradeOrder::getId, tOrderIds).eq(KwoTradeOrder::getDelFlag, Global.NO);
|
|
|
List<KwoTradeOrder> list = kwoTradeOrderMapper.selectList(wrapper);
|
|
List<KwoTradeOrder> list = kwoTradeOrderMapper.selectList(wrapper);
|
|
|
return CollectionUtils.emptyIfNull(list);
|
|
return CollectionUtils.emptyIfNull(list);
|
|
@@ -1176,9 +1210,9 @@ public class KwoTradeOrderService {
|
|
|
*/
|
|
*/
|
|
|
public void contractCompletedUpdate(List<Long> tOrderIds, Long updateBy) {
|
|
public void contractCompletedUpdate(List<Long> tOrderIds, Long updateBy) {
|
|
|
LambdaUpdateWrapper<KwoTradeOrder> wrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<KwoTradeOrder> wrapper = new LambdaUpdateWrapper<>();
|
|
|
- wrapper.in(KwoTradeOrder::getId, tOrderIds).eq(KwoTradeOrder::getStatus, Integer.valueOf(DictEnum.TORDER_STATUS_3.getValue()))
|
|
|
|
|
|
|
+ wrapper.in(KwoTradeOrder::getId, tOrderIds).eq(KwoTradeOrder::getStatus, OrderStatusEnum.WAIT_SIGNED.getCode())
|
|
|
.eq(KwoTradeOrder::getDelFlag, Global.NO).set(KwoTradeOrder::getUpdateBy, updateBy)
|
|
.eq(KwoTradeOrder::getDelFlag, Global.NO).set(KwoTradeOrder::getUpdateBy, updateBy)
|
|
|
- .set(KwoTradeOrder::getStatus, Integer.valueOf(DictEnum.TORDER_STATUS_4.getValue()));
|
|
|
|
|
|
|
+ .set(KwoTradeOrder::getStatus, OrderStatusEnum.EXECUTING.getCode());
|
|
|
kwoTradeOrderMapper.update(null, wrapper);
|
|
kwoTradeOrderMapper.update(null, wrapper);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1206,9 +1240,9 @@ public class KwoTradeOrderService {
|
|
|
Map<String, List<Integer>> map = addressList.stream().collect(Collectors.
|
|
Map<String, List<Integer>> map = addressList.stream().collect(Collectors.
|
|
|
groupingBy(KwoTradeOrderAddress::getAddressType, Collectors.mapping(KwoTradeOrderAddress::getCityCode, Collectors.toList())));
|
|
groupingBy(KwoTradeOrderAddress::getAddressType, Collectors.mapping(KwoTradeOrderAddress::getCityCode, Collectors.toList())));
|
|
|
//装货地址下拉列表树
|
|
//装货地址下拉列表树
|
|
|
- List<AreaTreeFrontResDto> loadTree = remoteSystemService.queryAreaTreeFrontByCodeList(map.get(DictEnum.TORDER_ADDRESS_TYPE_1.getValue()));
|
|
|
|
|
|
|
+ List<AreaTreeFrontResDto> loadTree = remoteSystemService.queryAreaTreeFrontByCodeList(map.get(OrderAddressTypeEnum.LOAD.getType()));
|
|
|
//卸货地址下拉列表树
|
|
//卸货地址下拉列表树
|
|
|
- List<AreaTreeFrontResDto> unloadTree = remoteSystemService.queryAreaTreeFrontByCodeList(map.get(DictEnum.TORDER_ADDRESS_TYPE_2.getValue()));
|
|
|
|
|
|
|
+ List<AreaTreeFrontResDto> unloadTree = remoteSystemService.queryAreaTreeFrontByCodeList(map.get(OrderAddressTypeEnum.UNLOAD.getType()));
|
|
|
res.setLoadAddressList(loadTree).setUnloadAddressList(unloadTree);
|
|
res.setLoadAddressList(loadTree).setUnloadAddressList(unloadTree);
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|