提交 511944ea authored 作者: huyufan's avatar huyufan

修改BUG

上级 5e557239
...@@ -59,6 +59,10 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -59,6 +59,10 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
log.info("货单已完结定时器查询redis条数为null"); log.info("货单已完结定时器查询redis条数为null");
return; return;
} }
if (orderGoodsIds.isEmpty()) {
log.info("货单已完结定时器查询redis条数为空");
return;
}
if (!CollectionUtil.isEmpty(orderGoodsIds)) { if (!CollectionUtil.isEmpty(orderGoodsIds)) {
log.info("货单已完结定时器查询redis条数:{}", orderGoodsIds.size()); log.info("货单已完结定时器查询redis条数:{}", orderGoodsIds.size());
......
...@@ -17,8 +17,10 @@ import com.clx.performance.struct.OrderGoodsStruct; ...@@ -17,8 +17,10 @@ import com.clx.performance.struct.OrderGoodsStruct;
import com.clx.performance.vo.app.OrderGoodsAPPVO; import com.clx.performance.vo.app.OrderGoodsAPPVO;
import com.clx.performance.vo.feign.OrderGoodsFeignVO; import com.clx.performance.vo.feign.OrderGoodsFeignVO;
import com.clx.performance.vo.pc.OrderGoodsVO; import com.clx.performance.vo.pc.OrderGoodsVO;
import com.clx.user.feign.UserClxFeign;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
import com.msl.common.exception.ServiceSystemException; import com.msl.common.exception.ServiceSystemException;
import com.msl.common.result.Result;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -52,6 +54,9 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -52,6 +54,9 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
@Autowired @Autowired
private OrderGoodsDriverTruckDao orderGoodsDriverTruckDao; private OrderGoodsDriverTruckDao orderGoodsDriverTruckDao;
@Autowired
private UserClxFeign userClxFeign;
@Override @Override
public OrderGoodsVO getOrderGoodsInfoByOrderGoodsNoForPC(String orderGoodsNo) { public OrderGoodsVO getOrderGoodsInfoByOrderGoodsNoForPC(String orderGoodsNo) {
OrderGoodsVO orderGoodsVO = orderGoodsDao.getOrderGoodsInfoByOrderGoodsNoForPC(orderGoodsNo).map(orderGoodsStruct::convert).get(); OrderGoodsVO orderGoodsVO = orderGoodsDao.getOrderGoodsInfoByOrderGoodsNoForPC(orderGoodsNo).map(orderGoodsStruct::convert).get();
...@@ -84,16 +89,26 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -84,16 +89,26 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
@Override @Override
public IPage<OrderGoodsAPPVO> indexOrderGoodsList(OrderGoodsListPageParam orderGoodsListParam) { public IPage<OrderGoodsAPPVO> indexOrderGoodsList(OrderGoodsListPageParam orderGoodsListParam) {
if (StringUtils.equals(orderGoodsListParam.getOrderGoodsType(),"1")){ if (StringUtils.equals(orderGoodsListParam.getOrderGoodsType(), "1")) {
return orderGoodsDao.openOrderPageGoodsList(orderGoodsListParam); return orderGoodsDao.openOrderPageGoodsList(orderGoodsListParam);
}else { } else {
List<OrderGoodsDriverTruck> truckList = orderGoodsDriverTruckDao. List<OrderGoodsDriverTruck> truckList = orderGoodsDriverTruckDao.
selectListByDriverUserNo(orderGoodsListParam.getDriverUserNo()) selectListByDriverUserNo(orderGoodsListParam.getDriverUserNo())
.orElseThrow(PerformanceResultEnum.DATA_NOT_FIND, "当前用户未绑定车辆"); .orElseThrow(PerformanceResultEnum.DATA_NOT_FIND, "当前用户未绑定车辆");
List<String> truckNoList = null;
if (truckList.isEmpty()) { if (truckList.isEmpty()) {
//查询当前用户是否是货主
Long driverUserNo = orderGoodsListParam.getDriverUserNo();
Result<List<String>> ownTruckByUserNo = userClxFeign.getOwnTruckByUserNo(driverUserNo);
if (ownTruckByUserNo.getCode() == 200) {
if (ownTruckByUserNo.getData().isEmpty()) {
throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND, "当前用户未绑定车辆"); throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND, "当前用户未绑定车辆");
} }
List<String> truckNoList = truckList.stream().map(OrderGoodsDriverTruck::getTruckNo).collect(Collectors.toList()); truckNoList = ownTruckByUserNo.getData();
}
} else {
truckNoList = truckList.stream().map(OrderGoodsDriverTruck::getTruckNo).collect(Collectors.toList());
}
List<OrderGoodsTruckBind> orderGoodsDriverTrucks = orderGoodsTruckBindDao.selectListByTruckNo(truckNoList) List<OrderGoodsTruckBind> orderGoodsDriverTrucks = orderGoodsTruckBindDao.selectListByTruckNo(truckNoList)
.orElseThrow(PerformanceResultEnum.DATA_NOT_FIND, "当前用户没有专属单"); .orElseThrow(PerformanceResultEnum.DATA_NOT_FIND, "当前用户没有专属单");
if (orderGoodsDriverTrucks.isEmpty()) { if (orderGoodsDriverTrucks.isEmpty()) {
...@@ -101,7 +116,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -101,7 +116,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
} }
List<String> orderGoodsNoList = orderGoodsDriverTrucks.stream().map(OrderGoodsTruckBind::getOrderGoodsNo).collect(Collectors.toList()); List<String> orderGoodsNoList = orderGoodsDriverTrucks.stream().map(OrderGoodsTruckBind::getOrderGoodsNo).collect(Collectors.toList());
return orderGoodsDao.exclusiveOrderPageGoodsList(orderGoodsListParam,orderGoodsNoList); return orderGoodsDao.exclusiveOrderPageGoodsList(orderGoodsListParam, orderGoodsNoList);
} }
} }
......
...@@ -162,7 +162,7 @@ public class TwoGoodsOrderStrategy implements GoodsOrderStrategy, InitializingBe ...@@ -162,7 +162,7 @@ public class TwoGoodsOrderStrategy implements GoodsOrderStrategy, InitializingBe
orderGoodsTruckBindDao.saveBatchEntity(orderNo, OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId, child.getTruckList(), now); orderGoodsTruckBindDao.saveBatchEntity(orderNo, OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId, child.getTruckList(), now);
} }
mqMap.put(OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId, postedTime); mqMap.put(OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId, postedTime);
orderGoodsStatusLazyComponent.expireProduce(orderGoods.getLastArriveSendTime(),OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId); orderGoodsStatusLazyComponent.expireProduce(orderGoods.getLastArriveSendTime(), OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId);
beginOrderGoodsId = beginOrderGoodsId + 1; beginOrderGoodsId = beginOrderGoodsId + 1;
orderGoodsList.add(orderGoods); orderGoodsList.add(orderGoods);
...@@ -170,26 +170,33 @@ public class TwoGoodsOrderStrategy implements GoodsOrderStrategy, InitializingBe ...@@ -170,26 +170,33 @@ public class TwoGoodsOrderStrategy implements GoodsOrderStrategy, InitializingBe
orderGoodsDao.saveBatchEntity(orderGoodsList); orderGoodsDao.saveBatchEntity(orderGoodsList);
BigDecimal residueWeight = new BigDecimal(orderInfo.getResidueWeight()); BigDecimal residueWeight = new BigDecimal(orderInfo.getResidueWeight());
if (platSum.compareTo(BigDecimal.ZERO) != 0 && ownSum.compareTo(BigDecimal.ZERO) != 0) { if (platSum.compareTo(BigDecimal.ZERO) != 0 && ownSum.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal residuePlatSum = new BigDecimal(orderInfo.getPlatformResidueCarryWeight());
BigDecimal residueOwnSum = new BigDecimal(orderInfo.getOwnResidueCarryWeight());
UpdateOrderInfoResidueWeightParam param = new UpdateOrderInfoResidueWeightParam(); UpdateOrderInfoResidueWeightParam param = new UpdateOrderInfoResidueWeightParam();
param.setOrderId(orderInfo.getId()); param.setOrderId(orderInfo.getId());
param.setUpdateType("4"); param.setUpdateType("4");
param.setResidueWeight(residueWeight.subtract(platSum).subtract(ownSum)); param.setResidueWeight(residueWeight.subtract(platSum).subtract(ownSum));
param.setOwnWeight(ownSum); param.setOwnWeight(residueOwnSum.subtract(ownSum));
param.setPlatWeight(platSum); param.setPlatWeight(residuePlatSum.subtract(platSum));
orderFeign.updateOrderInfoResidueWeight(param); orderFeign.updateOrderInfoResidueWeight(param);
} else if (platSum.compareTo(BigDecimal.ZERO) != 0 && ownSum.compareTo(BigDecimal.ZERO) == 0) { } else if (platSum.compareTo(BigDecimal.ZERO) != 0 && ownSum.compareTo(BigDecimal.ZERO) == 0) {
BigDecimal residuePlatSum = new BigDecimal(orderInfo.getPlatformResidueCarryWeight());
UpdateOrderInfoResidueWeightParam param = new UpdateOrderInfoResidueWeightParam(); UpdateOrderInfoResidueWeightParam param = new UpdateOrderInfoResidueWeightParam();
param.setOrderId(orderInfo.getId()); param.setOrderId(orderInfo.getId());
param.setUpdateType("2"); param.setUpdateType("2");
param.setResidueWeight(residueWeight.subtract(platSum)); param.setResidueWeight(residueWeight.subtract(platSum));
param.setPlatWeight(platSum); param.setPlatWeight(residuePlatSum.subtract(platSum));
orderFeign.updateOrderInfoResidueWeight(param); orderFeign.updateOrderInfoResidueWeight(param);
} else if (platSum.compareTo(BigDecimal.ZERO) == 0 && ownSum.compareTo(BigDecimal.ZERO) != 0) { } else if (platSum.compareTo(BigDecimal.ZERO) == 0 && ownSum.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal residueOwnSum = new BigDecimal(orderInfo.getOwnResidueCarryWeight());
UpdateOrderInfoResidueWeightParam param = new UpdateOrderInfoResidueWeightParam(); UpdateOrderInfoResidueWeightParam param = new UpdateOrderInfoResidueWeightParam();
param.setOrderId(orderInfo.getId()); param.setOrderId(orderInfo.getId());
param.setUpdateType("3"); param.setUpdateType("3");
param.setResidueWeight(residueWeight.subtract(ownSum)); param.setResidueWeight(residueWeight.subtract(ownSum));
param.setOwnWeight(ownSum); param.setOwnWeight(residueOwnSum.subtract(ownSum));
orderFeign.updateOrderInfoResidueWeight(param); orderFeign.updateOrderInfoResidueWeight(param);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论