|
@@ -17,6 +17,7 @@ import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
|
|
|
import com.sckw.contract.api.model.vo.GoodsInfoDto;
|
|
import com.sckw.contract.api.model.vo.GoodsInfoDto;
|
|
|
import com.sckw.contract.api.model.vo.TradeContractResDto;
|
|
import com.sckw.contract.api.model.vo.TradeContractResDto;
|
|
|
import com.sckw.contract.api.model.vo.TradeContractUnitDto;
|
|
import com.sckw.contract.api.model.vo.TradeContractUnitDto;
|
|
|
|
|
+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;
|
|
@@ -1564,22 +1565,20 @@ public class KwoTradeOrderService {
|
|
|
Map<Long, UserCacheResDto> userMap = remoteSystemService.queryUserCacheMapByIds(createByIds);
|
|
Map<Long, UserCacheResDto> userMap = remoteSystemService.queryUserCacheMapByIds(createByIds);
|
|
|
Map<Long, KwpGoods> goodsMap = goodsInfoService.getGoodsByIds(goodIdList);
|
|
Map<Long, KwpGoods> goodsMap = goodsInfoService.getGoodsByIds(goodIdList);
|
|
|
Map<Long, ContractCommonInfoResDto> contractMap = remoteContractService.queryContractBaseInfo(contracIdList);
|
|
Map<Long, ContractCommonInfoResDto> contractMap = remoteContractService.queryContractBaseInfo(contracIdList);
|
|
|
- Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.TORDER_STATUS.getType(), DictTypeEnum.TRADE_TYPE.getType(), DictTypeEnum.LOAD_UNLOAD_WAY.getType(), DictTypeEnum.SETTLEMENT_WAY.getType(), DictTypeEnum.CONSIGNMENT_WAY.getType(), DictTypeEnum.TORDER_SOURCE.getType()));
|
|
|
|
|
|
|
+ Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.TORDER_STATUS.getType(), DictTypeEnum.TRADE_TYPE.getType(), DictTypeEnum.SETTLEMENT_WAY.getType(), DictTypeEnum.CONSIGNMENT_WAY.getType(), DictTypeEnum.TORDER_SOURCE.getType()));
|
|
|
Map<String, SysDictResDto> unitType = remoteSystemService.queryDictMapByType(DictTypeEnum.UNIT_TYPE.getType());
|
|
Map<String, SysDictResDto> unitType = remoteSystemService.queryDictMapByType(DictTypeEnum.UNIT_TYPE.getType());
|
|
|
- Map<String, String> tradeMap, deliveryMap, pickupMap, sourceMap, unloadMap;
|
|
|
|
|
|
|
+ Map<String, String> tradeMap, deliveryMap, pickupMap, sourceMap;
|
|
|
if (CollUtil.isNotEmpty(dict)) {
|
|
if (CollUtil.isNotEmpty(dict)) {
|
|
|
tradeMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.TRADE_TYPE.getType())) ? dict.get(DictTypeEnum.TRADE_TYPE.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
tradeMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.TRADE_TYPE.getType())) ? dict.get(DictTypeEnum.TRADE_TYPE.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
deliveryMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.SETTLEMENT_WAY.getType())) ? dict.get(DictTypeEnum.SETTLEMENT_WAY.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
deliveryMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.SETTLEMENT_WAY.getType())) ? dict.get(DictTypeEnum.SETTLEMENT_WAY.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
pickupMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.CONSIGNMENT_WAY.getType())) ? dict.get(DictTypeEnum.CONSIGNMENT_WAY.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
pickupMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.CONSIGNMENT_WAY.getType())) ? dict.get(DictTypeEnum.CONSIGNMENT_WAY.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
sourceMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.TORDER_SOURCE.getType())) ? dict.get(DictTypeEnum.TORDER_SOURCE.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
sourceMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.TORDER_SOURCE.getType())) ? dict.get(DictTypeEnum.TORDER_SOURCE.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
- unloadMap = CollUtil.isNotEmpty(dict.get(DictTypeEnum.LOAD_UNLOAD_WAY.getType())) ? dict.get(DictTypeEnum.LOAD_UNLOAD_WAY.getType()) : new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
tradeMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
tradeMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
deliveryMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
deliveryMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
pickupMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
pickupMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
sourceMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
sourceMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
- unloadMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
|
|
}
|
|
}
|
|
|
list.forEach(e -> {
|
|
list.forEach(e -> {
|
|
|
//装货地址
|
|
//装货地址
|
|
@@ -1597,8 +1596,8 @@ public class KwoTradeOrderService {
|
|
|
UserCacheResDto userCache = userMap.get(e.getCreateBy());
|
|
UserCacheResDto userCache = userMap.get(e.getCreateBy());
|
|
|
|
|
|
|
|
OrderListResVO vo = BeanUtil.copyProperties(e, OrderListResVO.class);
|
|
OrderListResVO vo = BeanUtil.copyProperties(e, OrderListResVO.class);
|
|
|
- vo.setStatusLabel(TradeOrderStatusEnum.getMsg(e.getStatus())).setTradingLabel(tradeMap.get(e.getTrading())).setTrading(tradeMap.get(e.getTrading())).setDeliveryTypeLabel(deliveryMap.get(e.getDeliveryType())).setDeliveryType(deliveryMap.get(e.getDeliveryType())).setPickupTypeLabel(pickupMap.get(e.getPickupType())).setSourceLabel(sourceMap.get(e.getSource())).setSource(sourceMap.get(e.getSource())).setContractName(Objects.isNull(contract) ? null : contract.getContactName()).setContractSigningWay(Objects.isNull(contract) ? null : contract.getSigningWayName()).setGoodsName(Objects.isNull(goods) ? null : goods.getName()).setGoodsSpec(Objects.isNull(goods) ? null : goods.getSpec()).setGoodsTaxRate(Objects.isNull(goods) ? null : goods.getTaxRate()).setGoodsThumb(Objects.isNull(goods) ? null : goods.getThumb()).setWaitEntrustAmount(setScale(getWaitEntrustAmount(e.getAmount(), e.getEntrustAmount()))).setActualPrice(actualAmount.multiply(unitPrice).setScale(2, RoundingMode.HALF_UP)).setUnitPrice(setScale(e.getUnitPrice())).setPrice(setScale(e.getPrice())).setUnit(e.getUnit()).setUnitLabel(unitType == null ? e.getUnit() : (unitType.get(e.getUnit()) == null ? e.getUnit() : unitType.get(e.getUnit()).getLabel())).setAmount(setScale(vo.getAmount())).setEntrustAmount(setScale(e.getEntrustAmount())).setActualAmount(setScale(e.getActualAmount())).setCreateByName(Objects.isNull(userCache) ? null : userCache.getName());
|
|
|
|
|
- vo.setDeliveryTypeLabel(unloadMap.getOrDefault(String.valueOf(e.getChargeType()), "-"));
|
|
|
|
|
|
|
+ vo.setStatusLabel(TradeOrderStatusEnum.getMsg(e.getStatus())).setTradingLabel(tradeMap.get(e.getTrading())).setTrading(tradeMap.get(e.getTrading())).setDeliveryType(deliveryMap.get(e.getDeliveryType())).setPickupTypeLabel(pickupMap.get(e.getPickupType())).setSourceLabel(sourceMap.get(e.getSource())).setSource(sourceMap.get(e.getSource())).setContractName(Objects.isNull(contract) ? null : contract.getContactName()).setContractSigningWay(Objects.isNull(contract) ? null : contract.getSigningWayName()).setGoodsName(Objects.isNull(goods) ? null : goods.getName()).setGoodsSpec(Objects.isNull(goods) ? null : goods.getSpec()).setGoodsTaxRate(Objects.isNull(goods) ? null : goods.getTaxRate()).setGoodsThumb(Objects.isNull(goods) ? null : goods.getThumb()).setWaitEntrustAmount(setScale(getWaitEntrustAmount(e.getAmount(), e.getEntrustAmount()))).setActualPrice(actualAmount.multiply(unitPrice).setScale(2, RoundingMode.HALF_UP)).setUnitPrice(setScale(e.getUnitPrice())).setPrice(setScale(e.getPrice())).setUnit(e.getUnit()).setUnitLabel(unitType == null ? e.getUnit() : (unitType.get(e.getUnit()) == null ? e.getUnit() : unitType.get(e.getUnit()).getLabel())).setAmount(setScale(vo.getAmount())).setEntrustAmount(setScale(e.getEntrustAmount())).setActualAmount(setScale(e.getActualAmount())).setCreateByName(Objects.isNull(userCache) ? null : userCache.getName());
|
|
|
|
|
+ vo.setDeliveryTypeLabel(DictEnum.getLabel(DictTypeEnum.LOAD_UNLOAD_WAY.getType(), String.valueOf(e.getChargeType())));
|
|
|
loadAddress.ifPresent(d -> {
|
|
loadAddress.ifPresent(d -> {
|
|
|
vo.setLoadName(d.getName());
|
|
vo.setLoadName(d.getName());
|
|
|
vo.setLoadAddress(d.getCityName() + " " + d.getDetailAddress());
|
|
vo.setLoadAddress(d.getCityName() + " " + d.getDetailAddress());
|