提交 05f7b42f authored 作者: aiqingguo's avatar aiqingguo

货单数量修改

上级 ef9244a1
...@@ -49,4 +49,7 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int ...@@ -49,4 +49,7 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int
Optional<List<OrderChild>> getOrderChildInfoByOrderGoodsNo(String childNo); Optional<List<OrderChild>> getOrderChildInfoByOrderGoodsNo(String childNo);
OrderChild getGoingLatestOrderChild(Long driverUserNo); OrderChild getGoingLatestOrderChild(Long driverUserNo);
int countValidByOrderGoodsNo(String orderGoodsNo);
} }
...@@ -33,7 +33,7 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int ...@@ -33,7 +33,7 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int
IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param); IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param);
void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight); void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight, Integer orderGoodsStatus);
IPage<OrderGoodsAPPVO> openOrderPageGoodsList(OrderGoodsListPageParam orderGoodsListPageParam); IPage<OrderGoodsAPPVO> openOrderPageGoodsList(OrderGoodsListPageParam orderGoodsListPageParam);
......
...@@ -173,4 +173,10 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild, ...@@ -173,4 +173,10 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
.orderByDesc(OrderChild::getId) .orderByDesc(OrderChild::getId)
.last("limit 1")); .last("limit 1"));
} }
@Override
public int countValidByOrderGoodsNo(String orderGoodsNo) {
return baseMapper.countValidByOrderGoodsNo(orderGoodsNo);
}
} }
...@@ -70,8 +70,8 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, ...@@ -70,8 +70,8 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
} }
@Override @Override
public void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight) { public void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight, Integer orderGoodsStatus) {
baseMapper.updateOrderGoodsWeightAndStatus(id, orderChildWeight, OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode()); baseMapper.updateOrderGoodsWeightAndStatus(id, orderChildWeight, orderGoodsStatus);
} }
@Override @Override
......
...@@ -14,6 +14,7 @@ import com.clx.performance.vo.pc.PageCarrierOrderChildVO; ...@@ -14,6 +14,7 @@ import com.clx.performance.vo.pc.PageCarrierOrderChildVO;
import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO; import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider; import org.apache.ibatis.annotations.SelectProvider;
...@@ -42,4 +43,7 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> { ...@@ -42,4 +43,7 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> {
@SelectProvider(type = OrderChildSqlProvider.class, method = "pageCarrierOrderChildList") @SelectProvider(type = OrderChildSqlProvider.class, method = "pageCarrierOrderChildList")
IPage<PageCarrierOrderChildVO> pageCarrierOrderChildList(@Param("page") Page<PageCarrierOrderChildVO> page, @Param("param") PageCarrierOrderChildParam param); IPage<PageCarrierOrderChildVO> pageCarrierOrderChildList(@Param("page") Page<PageCarrierOrderChildVO> page, @Param("param") PageCarrierOrderChildParam param);
@Select("select count(1) from order_child where order_goods_no = #{orderGoodsNo} and status < 110")
int countValidByOrderGoodsNo(String orderGoodsNo);
} }
\ No newline at end of file
...@@ -34,9 +34,9 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> { ...@@ -34,9 +34,9 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
IPage<OrderGoodsVO> pageOrderGoodsList(Page<OrderGoodsVO> page, PageOrderGoodsListParam param); IPage<OrderGoodsVO> pageOrderGoodsList(Page<OrderGoodsVO> page, PageOrderGoodsListParam param);
@Update(" update order_goods set " + @Update(" update order_goods set " +
" residue_transport_weight = residue_transport_weight-#{weight}," + " residue_transport_weight = if (residue_transport_weight>#{weight}, residue_transport_weight-#{weight}, 0)," +
" already_transport_weight = already_transport_weight+#{weight}," + " already_transport_weight = already_transport_weight+#{weight}," +
"order_goods_status = #{orderGoodsStatus}" + "order_goods_status = if (residue_transport_weight>#{weight}, #{orderGoodsStatus}, 40) " +
" where id = #{id}") " where id = #{id}")
void updateOrderGoodsWeightAndStatus(@Param("id") Integer id, @Param("weight") BigDecimal orderChildWeight, @Param("orderGoodsStatus") Integer orderGoodsStatus); void updateOrderGoodsWeightAndStatus(@Param("id") Integer id, @Param("weight") BigDecimal orderChildWeight, @Param("orderGoodsStatus") Integer orderGoodsStatus);
......
...@@ -21,7 +21,7 @@ public interface OrderGoodsService { ...@@ -21,7 +21,7 @@ public interface OrderGoodsService {
IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param); IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param);
void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight); void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight, Integer orderGoodsStatus);
IPage<OrderGoodsAPPVO> indexOrderGoodsList(OrderGoodsListPageParam orderGoodsListParam); IPage<OrderGoodsAPPVO> indexOrderGoodsList(OrderGoodsListPageParam orderGoodsListParam);
} }
...@@ -909,21 +909,51 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -909,21 +909,51 @@ public class OrderChildServiceImpl implements OrderChildService {
* 更新货单数据 * 更新货单数据
*/ */
private void updateOrderGoodsAmount(OrderGoods orderGoods, BigDecimal weight){ private void updateOrderGoodsAmount(OrderGoods orderGoods, BigDecimal weight){
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), weight); int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo())-1;
Integer status = orderGoods.getOrderGoodsStatus();
if (count == 0){
status = OrderGoodsStatusEnum.Status.PAYING.getCode();
}
else {
status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
}
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), weight, status);
} }
/** /**
* 取消返吨数 * 取消返吨数
*/ */
private void updateOrderGoodsAmountReturn(OrderChild orderChild, OrderGoods orderGoods){ private void updateOrderGoodsAmountReturn(OrderChild orderChild, OrderGoods orderGoods){
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), orderChild.getWeight().negate()); int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo())-1;
Integer status = orderGoods.getOrderGoodsStatus();
if (count == 0){
status = OrderGoodsStatusEnum.Status.PAYING.getCode();
}
else {
status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
}
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), orderChild.getWeight().negate(), status);
} }
/** /**
* 装车补偿 * 装车补偿
*/ */
private void updateOrderGoodsAmountLoad(OrderGoods orderGoods, BigDecimal dif){ private void updateOrderGoodsAmountLoad(OrderGoods orderGoods, BigDecimal dif){
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), dif); int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo())-1;
Integer status = orderGoods.getOrderGoodsStatus();
if (count == 0){
status = OrderGoodsStatusEnum.Status.PAYING.getCode();
}
else {
status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
}
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), dif, status);
} }
/** /**
......
...@@ -75,8 +75,8 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -75,8 +75,8 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
} }
@Override @Override
public void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight) { public void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight, Integer orderGoodsStatus) {
orderGoodsDao.updateOrderGoodsReduceWeightAndStatus(id, orderChildWeight); orderGoodsDao.updateOrderGoodsReduceWeightAndStatus(id, orderChildWeight, orderGoodsStatus);
} }
@Override @Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论