提交 3b379097 authored 作者: liruixin's avatar liruixin

Merge remote-tracking branch 'origin/v5.7_break_contract_reverse_20231020' into…

Merge remote-tracking branch 'origin/v5.7_break_contract_reverse_20231020' into v5.7_break_contract_reverse_20231020
...@@ -129,4 +129,7 @@ public class OrderGoodsVO { ...@@ -129,4 +129,7 @@ public class OrderGoodsVO {
private Integer stopFlag; private Integer stopFlag;
@ApiModelProperty("结算账期 1拉运完成结 2月结") @ApiModelProperty("结算账期 1拉运完成结 2月结")
private Integer settlementAccountPeriod; private Integer settlementAccountPeriod;
@ApiModelProperty("用车方式 1:平台车辆配货 2:自有车辆配货")
private Integer vehicleUsage;
} }
\ No newline at end of file
...@@ -184,14 +184,12 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -184,14 +184,12 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
BigDecimal childSum = BigDecimal.ZERO; BigDecimal childSum = BigDecimal.ZERO;
List<Integer> ids = new LinkedList<>();
for (OrderChild orderChild : orderChildrenList) { for (OrderChild orderChild : orderChildrenList) {
childSum.add(orderChild.getWeight()); childSum.add(orderChild.getWeight());
OrderChild update = new OrderChild(); ids.add(orderChild.getId());
update.setId(orderChild.getId());
update.setStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode());
//TODO 补充批量更新接口 关闭运单状态
orderChildDao.updateEntityByKey(update);
} }
orderChildDao.batchUpdateOrderChildStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), ids);
RollbackOrderWeightParam param = new RollbackOrderWeightParam(); RollbackOrderWeightParam param = new RollbackOrderWeightParam();
param.setOrderNo(orderGoods.getOrderNo()); param.setOrderNo(orderGoods.getOrderNo());
...@@ -214,10 +212,12 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -214,10 +212,12 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
param.setPlatformResidueCarryWeight(BigDecimal.ZERO); param.setPlatformResidueCarryWeight(BigDecimal.ZERO);
} }
} }
//只更新货单未拉运吨数,已拉运吨数
orderGoodsDao.updateOrderGoodsSetAlreadyWeight(childSum, orderGoods.getId());
orderFeign.rollbackOrderWeight(param); orderFeign.rollbackOrderWeight(param);
} else { } else {
//只更新货单未拉运吨数 //只更新货单未拉运吨数,已拉运吨数
orderGoodsDao.updateOrderGoodsSetResidueWeight(childSum, orderGoods.getId()); orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeight(childSum, childSum, orderGoods.getId());
} }
redisTemplate.opsForZSet().remove(RedisConstants.ORDER_GOODS_STATUS_LAZY_LAST_ARRIVE_SEND_TIME, orderGoodsId.getValue()); redisTemplate.opsForZSet().remove(RedisConstants.ORDER_GOODS_STATUS_LAZY_LAST_ARRIVE_SEND_TIME, orderGoodsId.getValue());
} }
......
...@@ -62,7 +62,10 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int ...@@ -62,7 +62,10 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int
boolean updateOrderGoodsStatusAndRollbackResidueWeightByOrderGoodsNo(Integer orderGoodsId, Integer status); boolean updateOrderGoodsStatusAndRollbackResidueWeightByOrderGoodsNo(Integer orderGoodsId, Integer status);
Integer updateOrderGoodsSetResidueWeight(BigDecimal residueWeight, Integer id); Integer updateOrderGoodsSetAlreadyWeight(BigDecimal alreadyWeight, Integer id);
Integer updateOrderGoodsSetResidueWeightAndAlreadyWeight(BigDecimal residueWeight, BigDecimal alreadyWeight, Integer id);
OrderGoodsVO findOrderGoodsById(Integer id); OrderGoodsVO findOrderGoodsById(Integer id);
......
...@@ -284,9 +284,9 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild, ...@@ -284,9 +284,9 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
@Override @Override
public List<OrderChild> selectInTransitOrderChild(String orderGoodsNo) { public List<OrderChild> selectInTransitOrderChild(String orderGoodsNo) {
//查询小于 100(完成)的运单都属于在途 //查询小于 40 未到达货源地的运单
return baseMapper.selectList(lQrWrapper().eq(OrderChild::getOrderGoodsNo, orderGoodsNo) return baseMapper.selectList(lQrWrapper().eq(OrderChild::getOrderGoodsNo, orderGoodsNo)
.lt(OrderChild::getStatus, OrderChildEnum.Status.COMPLETE.getCode()) .lt(OrderChild::getStatus, OrderChildEnum.Status.ARRIVE_SEND.getCode())
); );
} }
......
...@@ -165,8 +165,13 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, ...@@ -165,8 +165,13 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
} }
@Override @Override
public Integer updateOrderGoodsSetResidueWeight(BigDecimal residueWeight, Integer id) { public Integer updateOrderGoodsSetAlreadyWeight(BigDecimal alreadyWeight, Integer id) {
return baseMapper.updateOrderGoodsSetResidueWeight(residueWeight,id); return baseMapper.updateOrderGoodsSetAlreadyWeight(alreadyWeight,id);
}
@Override
public Integer updateOrderGoodsSetResidueWeightAndAlreadyWeight(BigDecimal residueWeight, BigDecimal alreadyWeight, Integer id) {
return baseMapper.updateOrderGoodsSetResidueWeightAndAlreadyWeight(residueWeight,alreadyWeight,id);
} }
@Override @Override
......
...@@ -56,8 +56,11 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> { ...@@ -56,8 +56,11 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "saveBatchEntity") @SelectProvider(type = OrderGoodsSqlProvider.class, method = "saveBatchEntity")
void saveBatchEntity(List<OrderGoods> orderGoodsList); void saveBatchEntity(List<OrderGoods> orderGoodsList);
@UpdateProvider(type = OrderGoodsSqlProvider.class, method = "updateOrderGoodsSetResidueWeight") @UpdateProvider(type = OrderGoodsSqlProvider.class, method = "updateOrderGoodsSetResidueWeightAndAlreadyWeight")
Integer updateOrderGoodsSetResidueWeight(@Param(value = "residueWeight") BigDecimal residueWeight, @Param(value = "id") Integer id); Integer updateOrderGoodsSetResidueWeightAndAlreadyWeight(@Param(value = "residueWeight") BigDecimal residueWeight, @Param(value = "alreadyWeight") BigDecimal alreadyWeight,@Param(value = "id") Integer id);
@UpdateProvider(type = OrderGoodsSqlProvider.class, method = "updateOrderGoodsSetAlreadyWeight")
Integer updateOrderGoodsSetAlreadyWeight(@Param(value = "alreadyWeight") BigDecimal alreadyWeight,@Param(value = "id") Integer id);
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "findOrderGoodsById") @SelectProvider(type = OrderGoodsSqlProvider.class, method = "findOrderGoodsById")
OrderGoodsVO findOrderGoodsById(Integer id); OrderGoodsVO findOrderGoodsById(Integer id);
......
...@@ -306,7 +306,9 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -306,7 +306,9 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
orderGoodsDao.updateOrderGoods(orderGoodsParams); orderGoodsDao.updateOrderGoods(orderGoodsParams);
//日志提交
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
orderGoodsLogService.saveLog(orderGoodsNo, loginUserInfo.getUserNo(), loginUserInfo.getUserName(), OrderGoodsLogsEnum.Type.EDIT.getName(), "");
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -337,6 +339,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -337,6 +339,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
} }
} }
/**
* 货单取消
* @param goodsCancelParam
*/
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void orderGoodsCancel(OrderGoodsCancelParam goodsCancelParam) { public void orderGoodsCancel(OrderGoodsCancelParam goodsCancelParam) {
...@@ -466,11 +472,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -466,11 +472,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
List<OrderChild> orderChildList = null; List<OrderChild> orderChildList = null;
BigDecimal residueWeight = null; BigDecimal residueWeight = null;
BigDecimal sum = BigDecimal.ZERO; BigDecimal sum = BigDecimal.ZERO;
RollbackOrderWeightParam param = new RollbackOrderWeightParam();
Integer cancelOperateType = goodsCancelParam.getCancelOperateType(); Integer cancelOperateType = goodsCancelParam.getCancelOperateType();
switch (cancelOperateType) { switch (cancelOperateType) {
case 1: case 1:
return orderGoods.getResidueTransportWeight();
case 2: case 2:
orderChildList = orderChildDao.selectResidueWeightByOrderGoodsNo(orderGoods.getOrderGoodsNo(), OrderChildEnum.Status.ARRIVE_SEND.getCode()); orderChildList = orderChildDao.selectResidueWeightByOrderGoodsNo(orderGoods.getOrderGoodsNo(), OrderChildEnum.Status.ARRIVE_SEND.getCode());
if (CollectionUtils.isNotEmpty(orderChildList)) { if (CollectionUtils.isNotEmpty(orderChildList)) {
......
...@@ -174,10 +174,21 @@ public class OrderGoodsSqlProvider { ...@@ -174,10 +174,21 @@ public class OrderGoodsSqlProvider {
return sqlList.toString(); return sqlList.toString();
} }
public String updateOrderGoodsSetResidueWeight(@Param(value ="residueWeight") BigDecimal residueWeight,@Param(value ="id") Integer id){ public String updateOrderGoodsSetAlreadyWeight(@Param(value = "alreadyWeight") BigDecimal alreadyWeight,@Param(value ="id") Integer id){
String sql = new SQL() {{ String sql = new SQL() {{
UPDATE("order_goods") UPDATE("order_goods")
.SET("residue_weight = residue_weight + #{residueWeight}") .SET("already_transport_weight = already_transport_weight + #{residueWeight}")
.WHERE("id = #{id}");
}}.toString();
return sql;
}
public String updateOrderGoodsSetResidueWeightAndAlreadyWeight(@Param(value ="residueWeight") BigDecimal residueWeight, @Param(value = "alreadyWeight") BigDecimal alreadyWeight,@Param(value ="id") Integer id){
String sql = new SQL() {{
UPDATE("order_goods")
.SET("residue_transport_weight = residue_transport_weight + #{residueWeight}")
.SET("already_transport_weight = already_transport_weight + #{alreadyWeight}")
.WHERE("id = #{id}"); .WHERE("id = #{id}");
}}.toString(); }}.toString();
...@@ -197,7 +208,7 @@ public class OrderGoodsSqlProvider { ...@@ -197,7 +208,7 @@ public class OrderGoodsSqlProvider {
" date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time," + " date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time," +
" date_format(a.modified_time, '%Y-%m-%d %H:%i:%s') as modified_time," + " date_format(a.modified_time, '%Y-%m-%d %H:%i:%s') as modified_time," +
"a.extract_way,a.need_truck_num,a.senior_logistics_manager_id,a.senior_logistics_manager_name,a.pending_order_freight," + "a.extract_way,a.need_truck_num,a.senior_logistics_manager_id,a.senior_logistics_manager_name,a.pending_order_freight," +
"a.user_no,a.user_name,batch_number,last_arrive_receive_time,last_load_time,last_order_time"); "a.user_no,a.user_name,a.batch_number,a.last_arrive_receive_time,a.last_load_time,a.last_order_time,a.vehicle_usage");
FROM("order_goods a"); FROM("order_goods a");
if (Objects.nonNull(id)) { if (Objects.nonNull(id)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论