提交 8f0d9201 authored 作者: huyufan's avatar huyufan

货单编辑

上级 126cff61
......@@ -21,7 +21,7 @@ public class RedisConstants {
public static final String ORDER_GOODS_STATUS_LAZY_LAST_ORDER_TIME = "clx:order:goods:status:lazy:lastOrderTime";
public static final String ORDER_GOODS_STATUS_LAZY_LAST_ARRIVE_SEND_TIME = "clx:order:goods:status:lazy:lastOrderTime";
public static final String ORDER_GOODS_STATUS_LAZY_LAST_ARRIVE_SEND_TIME = "clx:order:goods:status:lazy:lastArriveSendTime";
public static final String ORDER_GOODS_TRUCK_RECORD = "clx:order:goods:truck:record:";
......
......@@ -252,9 +252,37 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
@Override
@Transactional(rollbackFor = Exception.class)
public void updateEditOrderGoods(UpdateEditOrderGoodsParam param) {
OrderGoodsEditParams orderGoodsParams = param.getOrderGoodsParams();
OrderGoods oldOrderGoods = orderGoodsDao.getByOrderGoodsNo(orderGoodsParams.getOrderGoodsNo()).get();
FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(param.getOrderNo());
if (orderGoodsParams.getExtractWeight().compareTo(oldOrderGoods.getAlreadyTransportWeight()) < 0) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "当前货单提取吨数不能小于货单已拉运吨数");
}
BigDecimal answer = orderGoodsParams.getExtractWeight().subtract(oldOrderGoods.getExtractWeight());
int flag = answer.compareTo(BigDecimal.ZERO);
if (flag >= 0) {
orderGoodsParams.setResidueTransportWeight(oldOrderGoods.getResidueTransportWeight().add(answer));
}else {
orderGoodsParams.setResidueTransportWeight(orderGoodsParams.getExtractWeight().subtract(oldOrderGoods.getAlreadyTransportWeight()));
//归还吨数
RollbackOrderWeightParam rollbackOrderWeightParam = new RollbackOrderWeightParam();
rollbackOrderWeightParam.setOrderNo(param.getOrderNo());
if (oldOrderGoods.getTruckDemand().equals(TruckDemandEnum.TruckType.PLATFORM_CAR.getCode())) {
rollbackOrderWeightParam.setResidueWeight(answer.negate());
rollbackOrderWeightParam.setOwnResidueCarryWeight(BigDecimal.ZERO);
rollbackOrderWeightParam.setPlatformResidueCarryWeight(answer.negate());
}else if (oldOrderGoods.getTruckDemand().equals(TruckDemandEnum.TruckType.OWNER_CAR.getCode())) {
rollbackOrderWeightParam.setResidueWeight(answer.negate());
rollbackOrderWeightParam.setOwnResidueCarryWeight(answer.negate());
rollbackOrderWeightParam.setPlatformResidueCarryWeight(BigDecimal.ZERO);
}
orderFeign.rollbackOrderWeight(rollbackOrderWeightParam);
}
if (new BigDecimal(orderInfoFeign.getResidueWeight()).compareTo(orderGoodsParams.getExtractWeight()) < 0) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "当前货单提取吨数已超订单可提取吨数");
}
String orderGoodsNo = orderGoodsParams.getOrderGoodsNo();
List<OrderChild> orderChildList = orderChildDao.getOrderChildInfoByOrderGoodsNo(orderGoodsNo).get();
......@@ -341,6 +369,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
/**
* 货单取消
*
* @param goodsCancelParam
*/
@Override
......
......@@ -661,6 +661,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
while (true) {
Integer flag = 0;
List<OwnerAccount> accountList = ownerAccountDao.accountInfo(userNo);
if (accountList.isEmpty()) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "当前货主没有保证金账户");
}
for (OwnerAccount ownerAccount : accountList) {
OwnerAccount entity = new OwnerAccount();
mobile = ownerAccount.getMobile();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论