|
|
@@ -30,6 +30,7 @@ import com.sckw.product.api.dubbo.GoodsInfoService;
|
|
|
import com.sckw.product.api.model.KwpGoods;
|
|
|
import com.sckw.stream.model.SckwBusSum;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import com.sckw.transport.dao.*;
|
|
|
import com.sckw.transport.model.*;
|
|
|
import com.sckw.transport.model.dto.LogisticsOrderDTO;
|
|
|
@@ -191,8 +192,8 @@ public class LogisticsConsignmentService {
|
|
|
param.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
HttpResult httpResult = tradeOrderInfoService.createOrCancelLogisticsOrder(param);
|
|
|
if (httpResult.getCode() != HttpStatus.SUCCESS_CODE) {
|
|
|
- log.info("{}生成物流托运失败!,返回信息:{}", bo.getTOrderNo(), JSONObject.toJSONString(httpResult));
|
|
|
- throw new BusinessException("{}生成物流托运失败!", bo.getTOrderNo());
|
|
|
+ log.info("{}生成物流托运失败!,返回信息:{}", tradeOrder.getTOrderNo(), JSONObject.toJSONString(httpResult));
|
|
|
+ throw new BusinessException("{"+tradeOrder.getTOrderNo()+"}生成物流托运失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -331,6 +332,11 @@ public class LogisticsConsignmentService {
|
|
|
* @param orderId
|
|
|
*/
|
|
|
private void insertLogisticsOrderUnit(LogisticsConsignmentParam bo, Long orderId) {
|
|
|
+ Map<Long, EntCacheResDto> consignentMap = remoteSystemService.queryEntTreeByIds(Collections.singletonList(Long.parseLong(bo.getConsignCompanyId())));
|
|
|
+ Map<Long, EntCacheResDto> checkentMap = remoteSystemService.queryEntTreeByIds(Collections.singletonList(Long.parseLong(bo.getCheckCompanyId())));
|
|
|
+ if (consignentMap.isEmpty() || checkentMap.isEmpty()) {
|
|
|
+ throw new BusinessException("企业对应一级企业不存在");
|
|
|
+ }
|
|
|
KwtLogisticsOrderUnit checkUnit = new KwtLogisticsOrderUnit()
|
|
|
.setLOrderId(orderId)
|
|
|
.setId(new IdWorker(NumberConstant.ONE).nextId())
|
|
|
@@ -338,6 +344,7 @@ public class LogisticsConsignmentService {
|
|
|
.setFirmName(bo.getCheckCompany())
|
|
|
.setRemark(bo.getRemark())
|
|
|
.setEntId(Long.parseLong(bo.getCheckCompanyId()))
|
|
|
+ .setTopEntId(checkentMap.get(Long.parseLong(bo.getCheckCompanyId())).getId())
|
|
|
.setContacts(bo.getCheckContacts())
|
|
|
.setPhone(bo.getCheckContactPhone())
|
|
|
.setCreateBy(LoginUserHolder.getUserId())
|
|
|
@@ -353,6 +360,7 @@ public class LogisticsConsignmentService {
|
|
|
.setFirmName(bo.getConsignCompany())
|
|
|
.setRemark(bo.getRemark())
|
|
|
.setEntId(Long.parseLong(bo.getConsignCompanyId()))
|
|
|
+ .setTopEntId(consignentMap.get(Long.parseLong(bo.getConsignCompanyId())).getId())
|
|
|
.setContacts(bo.getConsignContacts())
|
|
|
.setPhone(bo.getConsignContactPhone())
|
|
|
.setCreateBy(LoginUserHolder.getUserId())
|
|
|
@@ -427,14 +435,14 @@ public class LogisticsConsignmentService {
|
|
|
order.setPrice(new BigDecimal(bo.getPrice()));
|
|
|
order.setPriceType(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getPriceType()) == null ?
|
|
|
null : Long.parseLong(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getPriceType()).getValue()));
|
|
|
- order.setAmount(tradeOrder.getAmount());
|
|
|
+// order.setAmount(tradeOrder.getAmount());
|
|
|
order.setBillingMode(bo.getBillingMode());
|
|
|
order.setUnit(bo.getCarryingCapacityUnit());
|
|
|
order.setLoss(new BigDecimal(bo.getLoss()));
|
|
|
// order.setLossUnit(bo.getLossUnit());
|
|
|
order.setLossUnit(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.UNIT_TYPE.getType(), bo.getLossUnit()) == null ?
|
|
|
null : remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.UNIT_TYPE.getType(), bo.getLossUnit()).getValue());
|
|
|
- order.setGoodsPrice(new BigDecimal(bo.getGoodsPrice()));
|
|
|
+ order.setGoodsPrice(bo.getGoodsPrice() == null ? null : new BigDecimal(bo.getGoodsPrice()));
|
|
|
order.setGoodsPriceUnit(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getGoodsPriceUnit()) == null ?
|
|
|
null : remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getGoodsPriceUnit()).getValue());
|
|
|
order.setGoodsPriceUnit(bo.getGoodsPriceUnit());
|
|
|
@@ -454,7 +462,7 @@ public class LogisticsConsignmentService {
|
|
|
order.setSubcontractAmount(decimal);
|
|
|
order.setLoadAmount(decimal);
|
|
|
order.setUnloadAmount(decimal);
|
|
|
- order.setIgnoreAmount(decimal);
|
|
|
+ order.setIgnoreAmount(bo.getCarryingCapacity());
|
|
|
order.setDeficitPrice(decimal);
|
|
|
order.setDeficitAmount(decimal);
|
|
|
order.setBindStatus(String.valueOf(NumberConstant.ZERO));
|
|
|
@@ -498,6 +506,9 @@ public class LogisticsConsignmentService {
|
|
|
throw new RuntimeException("dubbp 查询销售订单数据查找失败!");
|
|
|
}
|
|
|
List<AddressInfoDetail> addressInfo = orderDetailRes.getAddressInfo();
|
|
|
+ if (CollectionUtils.isEmpty(addressInfo)) {
|
|
|
+ throw new BusinessException("生成物流托运时,地址信息不存在!");
|
|
|
+ }
|
|
|
if (CollectionUtils.isNotEmpty(addressInfo)) {
|
|
|
for (AddressInfoDetail detail : addressInfo) {
|
|
|
if (String.valueOf(NumberConstant.ONE).equals(detail.getAddressType())) {
|