提交 ae59e5dd authored 作者: huyufan's avatar huyufan

修改BUG

上级 c1316b0e
...@@ -208,7 +208,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -208,7 +208,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
} }
log.info("取消运单ID集合:{}", ids); log.info("取消运单ID集合:{}", ids);
if (CollectionUtil.isNotEmpty(ids)) { if (CollectionUtil.isNotEmpty(ids)) {
orderChildDao.batchUpdateOrderChildStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), ids); orderChildDao.batchUpdateOrderChildStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), "系统取消", ids);
} }
RollbackOrderWeightParam param = new RollbackOrderWeightParam(); RollbackOrderWeightParam param = new RollbackOrderWeightParam();
......
...@@ -103,7 +103,7 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int ...@@ -103,7 +103,7 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int
List<OrderChild> selectArriveSendOrderChildGe(String orderGoodsNo); List<OrderChild> selectArriveSendOrderChildGe(String orderGoodsNo);
void batchUpdateOrderChildStatus(Integer status, List<Integer> ids); void batchUpdateOrderChildStatus(Integer status, String remark, List<Integer> ids);
List<OrderChild> selectOrderChildListByOrderGoodsNoAndStatusGE(String orderGoodsNo, Integer status); List<OrderChild> selectOrderChildListByOrderGoodsNoAndStatusGE(String orderGoodsNo, Integer status);
......
...@@ -312,8 +312,8 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild, ...@@ -312,8 +312,8 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
} }
@Override @Override
public void batchUpdateOrderChildStatus(Integer status, List<Integer> ids) { public void batchUpdateOrderChildStatus(Integer status, String remark, List<Integer> ids) {
baseMapper.updateOrderGoodsSetResidueWeight(status, ids); baseMapper.updateOrderGoodsSetResidueWeight(status,remark, ids);
} }
@Override @Override
......
...@@ -47,5 +47,5 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> { ...@@ -47,5 +47,5 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> {
int countValidByOrderGoodsNo(String orderGoodsNo); int countValidByOrderGoodsNo(String orderGoodsNo);
@UpdateProvider(type = OrderChildSqlProvider.class, method = "batchUpdateOrderChildStatus") @UpdateProvider(type = OrderChildSqlProvider.class, method = "batchUpdateOrderChildStatus")
Integer updateOrderGoodsSetResidueWeight(@Param(value = "status") Integer status, @Param(value = "ids") List<Integer> ids); Integer updateOrderGoodsSetResidueWeight(@Param(value = "status") Integer status, @Param(value = "remark") String remark, @Param(value = "ids") List<Integer> ids);
} }
\ No newline at end of file
...@@ -121,7 +121,7 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -121,7 +121,7 @@ public class OrderCancelServiceImpl implements OrderCancelService {
if (CollectionUtil.isNotEmpty(ids)) { if (CollectionUtil.isNotEmpty(ids)) {
orderChildDao.batchUpdateOrderChildStatus( orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.OWNER_CANCEL.getCode(), OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), "系统取消",
ids); ids);
} }
...@@ -192,19 +192,19 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -192,19 +192,19 @@ public class OrderCancelServiceImpl implements OrderCancelService {
if (!TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode().equals(orderInfoFeignVO.getTruckDemand())) { if (!TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode().equals(orderInfoFeignVO.getTruckDemand())) {
if (OrderEnum.Status.COMPLETED.getCode().equals(orderInfoFeignVO.getOrderStatus())) { if (OrderEnum.Status.COMPLETED.getCode().equals(orderInfoFeignVO.getOrderStatus())) {
//已完结 //已完结
List<Integer> ids = new LinkedList<>(); // List<Integer> ids = new LinkedList<>();
List<OrderChild> orderChildrenList = orderChildDao.selectResidueWeight(orderNo, OrderChildEnum.Status.ARRIVE_SEND.getCode()); List<OrderChild> orderChildrenList = orderChildDao.selectResidueWeight(orderNo, OrderChildEnum.Status.ARRIVE_SEND.getCode());
for (OrderChild orderChild : orderChildrenList) { // for (OrderChild orderChild : orderChildrenList) {
//释放车辆 // //释放车辆
driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1); // driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1);
ids.add(orderChild.getId()); // ids.add(orderChild.getId());
} // }
//
if (CollectionUtil.isNotEmpty(ids)) { // if (CollectionUtil.isNotEmpty(ids)) {
orderChildDao.batchUpdateOrderChildStatus( // orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.OWNER_CANCEL.getCode(), // OrderChildEnum.Status.OWNER_CANCEL.getCode(),
ids); // ids);
} // }
Map<String, List<OrderGoods>> orderGoodsMap = orderGoodsList.stream() Map<String, List<OrderGoods>> orderGoodsMap = orderGoodsList.stream()
...@@ -269,18 +269,18 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -269,18 +269,18 @@ public class OrderCancelServiceImpl implements OrderCancelService {
if (OrderEnum.Status.COMPLETED.getCode().equals(orderInfoFeignVO.getOrderStatus())) { if (OrderEnum.Status.COMPLETED.getCode().equals(orderInfoFeignVO.getOrderStatus())) {
//已完结 //已完结
List<OrderChild> orderChildrenList = orderChildDao.selectResidueWeight(orderNo, OrderChildEnum.Status.ARRIVE_SEND.getCode()); List<OrderChild> orderChildrenList = orderChildDao.selectResidueWeight(orderNo, OrderChildEnum.Status.ARRIVE_SEND.getCode());
List<Integer> ids = new LinkedList<>(); // List<Integer> ids = new LinkedList<>();
for (OrderChild orderChild : orderChildrenList) { // for (OrderChild orderChild : orderChildrenList) {
//释放车辆 // //释放车辆
driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1); // driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1);
ids.add(orderChild.getId()); // ids.add(orderChild.getId());
} // }
//
if (CollectionUtil.isNotEmpty(ids)) { // if (CollectionUtil.isNotEmpty(ids)) {
orderChildDao.batchUpdateOrderChildStatus( // orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.OWNER_CANCEL.getCode(), // OrderChildEnum.Status.OWNER_CANCEL.getCode(),
ids); // ids);
} // }
//货单 //货单
Map<String, List<OrderGoods>> orderGoodsMap = orderGoodsList.stream() Map<String, List<OrderGoods>> orderGoodsMap = orderGoodsList.stream()
...@@ -416,7 +416,7 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -416,7 +416,7 @@ public class OrderCancelServiceImpl implements OrderCancelService {
Map<String, List<OrderChild>> orderChildMap = new HashMap<>(); Map<String, List<OrderChild>> orderChildMap = new HashMap<>();
if (CollectionUtil.isNotEmpty(ids)) { if (CollectionUtil.isNotEmpty(ids)) {
orderChildDao.batchUpdateOrderChildStatus( orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.OWNER_CANCEL.getCode(), OrderChildEnum.Status.OWNER_CANCEL.getCode(), "货主取消",
ids); ids);
orderChildMap = orderChildren.stream() orderChildMap = orderChildren.stream()
.collect(Collectors.groupingBy(OrderChild::getOrderGoodsNo)); .collect(Collectors.groupingBy(OrderChild::getOrderGoodsNo));
...@@ -553,7 +553,7 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -553,7 +553,7 @@ public class OrderCancelServiceImpl implements OrderCancelService {
} }
if (CollectionUtil.isNotEmpty(ids)) { if (CollectionUtil.isNotEmpty(ids)) {
orderChildDao.batchUpdateOrderChildStatus( orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.OWNER_CANCEL.getCode(), OrderChildEnum.Status.OWNER_CANCEL.getCode(), "平台取消",
ids); ids);
} }
......
...@@ -1346,6 +1346,7 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -1346,6 +1346,7 @@ public class OrderChildServiceImpl implements OrderChildService {
return; return;
} }
Integer status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode(); Integer status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), dif, status); orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), dif, status);
......
...@@ -125,6 +125,13 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -125,6 +125,13 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
@Override @Override
public void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight, Integer orderGoodsStatus) { public void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight, Integer orderGoodsStatus) {
OrderGoodsVO entity = orderGoodsDao.findOrderGoodsById(id);
if (entity.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.CANCEL.getCode())
|| entity.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.COMPLETED.getCode())
) {
}
orderGoodsDao.updateOrderGoodsReduceWeightAndStatus(id, orderChildWeight, orderGoodsStatus); orderGoodsDao.updateOrderGoodsReduceWeightAndStatus(id, orderChildWeight, orderGoodsStatus);
} }
...@@ -451,7 +458,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -451,7 +458,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
sum = sum.add(orderChild.getWeight()); sum = sum.add(orderChild.getWeight());
} }
orderChildDao.batchUpdateOrderChildStatus( orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), "系统取消",
ids); ids);
} }
...@@ -491,7 +498,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -491,7 +498,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
sum = sum.add(orderChild.getWeight()); sum = sum.add(orderChild.getWeight());
} }
orderChildDao.batchUpdateOrderChildStatus( orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), OrderChildEnum.Status.PLATFORM_CANCEL.getCode(),"系统取消",
ids); ids);
} }
......
...@@ -126,10 +126,10 @@ public class OrderChildSqlProvider { ...@@ -126,10 +126,10 @@ public class OrderChildSqlProvider {
} }
public String batchUpdateOrderChildStatus(@Param(value ="status") Integer status, @Param(value = "ids") List<Integer> ids ){ public String batchUpdateOrderChildStatus(@Param(value ="status") Integer status, @Param(value ="remark") String remark,@Param(value = "ids") List<Integer> ids ){
StringBuffer sqlList = new StringBuffer(); StringBuffer sqlList = new StringBuffer();
sqlList.append("update order_child set status = " + status + " where id in ("); sqlList.append("update order_child set cancel_remark = "+ remark +" status = " + status + " where id in (");
for (int i = 0; i < ids.size(); i++) { for (int i = 0; i < ids.size(); i++) {
Integer id = ids.get(i); Integer id = ids.get(i);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论