提交 45699e84 authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/v4.9_create_goods_child_20230918' into test

......@@ -18,7 +18,7 @@ public enum OrderGoodsTruckBindEnum {
SUCCESS(1, "正常"),
CANCEL(2, "取消"),
GET(3, "已单"),
GET(3, "已单"),
;
......
......@@ -192,7 +192,10 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
@Override
public Integer getOrderChildTotalByUserNo(Long userNo) {
return baseMapper.getOrderChildTotalByUserNo(userNo);
LambdaQueryWrapper<OrderChild> query = new LambdaQueryWrapper();
query.eq(OrderChild :: getUserNo,userNo);
query.in(OrderChild :: getStatus,OrderChildEnum.Status.UNSETTLE.getCode(),OrderChildEnum.Status.COMPLETE.getCode());
return baseMapper.selectCount(query).intValue();
}
@Override
......
......@@ -19,10 +19,11 @@ import java.util.List;
public class OrderChildLogDaoImpl extends BaseDaoImpl<OrderChildLogMapper, OrderChildLog, Integer> implements OrderChildLogDao {
@Override
public List<OrderChildLog> getOrderChildNodeLog(String childNo) {
return list(lQrWrapper().eq(OrderChildLog::getChildNo,childNo).notIn(OrderChildLog::getType, OrderChildLogEnum.Type.PAY.getCode()
, OrderChildLogEnum.Type.RELOAD.getCode(), OrderChildLogEnum.Type.REUNLOAD.getCode()
, OrderChildLogEnum.Type.SETTLEMENT.getCode(), OrderChildLogEnum.Type.POUND_AUDIT.getCode()
, OrderChildLogEnum.Type.POUND_AUDIT_REJECT.getCode(), OrderChildLogEnum.Type.COMPLETE.getCode()
, OrderChildLogEnum.Type.RELOAD_AND_REUNLOAD.getCode()).groupBy(OrderChildLog::getType));
return list(lQrWrapper().eq(OrderChildLog::getChildNo,childNo).in(OrderChildLog::getType, OrderChildLogEnum.Type.CREATED.getCode()
, OrderChildLogEnum.Type.GO_TO_SEND.getCode(), OrderChildLogEnum.Type.ARRIVE_SEND.getCode()
, OrderChildLogEnum.Type.GO_TO_RECEIVE.getCode(), OrderChildLogEnum.Type.ARRIVE_RECEIVE.getCode()
, OrderChildLogEnum.Type.LOAD.getCode(), OrderChildLogEnum.Type.UNLOAD.getCode()
, OrderChildLogEnum.Type.DRIVER_CANCEL.getCode(), OrderChildLogEnum.Type.PLATFORM_CANCEL.getCode()
, OrderChildLogEnum.Type.OWNER_CANCEL.getCode(), OrderChildLogEnum.Type.DRIVER_CONFIRM.getCode()).groupBy(OrderChildLog::getType));
}
}
......@@ -70,7 +70,7 @@ public class OrderGoodsTruckBindDaoImpl extends BaseDaoImpl<OrderGoodsTruckBindM
@Override
public Optional<List<OrderGoodsTruckBind>> selectListByTruckNo(List<String> truckList) {
return Optional.ofNullable(baseMapper.selectList(new QueryWrapper<OrderGoodsTruckBind>().lambda()
.ne(OrderGoodsTruckBind::getStatus, OrderGoodsTruckBindEnum.Status.CANCEL.getCode())
.ne(OrderGoodsTruckBind::getStatus, OrderGoodsTruckBindEnum.Status.GET.getCode())
.in(OrderGoodsTruckBind::getTruckNo,truckList).select(OrderGoodsTruckBind::getOrderGoodsNo)));
}
}
......@@ -3,6 +3,7 @@ package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.enums.OrderChildEnum;
import com.clx.performance.model.OrderChild;
import com.clx.performance.param.app.PageOrderChildOfDriverParam;
import com.clx.performance.param.app.PageOrderChildOfDriverSearchParam;
......@@ -45,7 +46,4 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> {
@Select("select count(1) from order_child where order_goods_no = #{orderGoodsNo} and status < 110")
int countValidByOrderGoodsNo(String orderGoodsNo);
@Select("select count(1) from order_child where user_no = #{userNo} and status = 100")
Integer getOrderChildTotalByUserNo(Long userNo);
}
\ No newline at end of file
......@@ -35,7 +35,7 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
IPage<OrderGoodsVO> pageOrderGoodsList(Page<OrderGoodsVO> page, PageOrderGoodsListParam param);
@Update(" update order_goods set " +
" residue_transport_weight = if (residue_transport_weight>#{weight}, residue_transport_weight-#{weight}, 0)," +
" residue_transport_weight = residue_transport_weight-#{weight}," +
" already_transport_weight = already_transport_weight+#{weight}," +
"order_goods_status = #{orderGoodsStatus} " +
" where id = #{id}")
......
......@@ -926,15 +926,9 @@ public class OrderChildServiceImpl implements OrderChildService {
* 更新货单数据
*/
private void updateOrderGoodsAmount(OrderGoods orderGoods, BigDecimal weight){
int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo())-1;
int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo());
Integer status = orderGoods.getOrderGoodsStatus();
if (count == 0){
status = OrderGoodsStatusEnum.Status.PAYING.getCode();
}
else {
status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
}
Integer status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), weight, status);
}
......@@ -962,15 +956,9 @@ public class OrderChildServiceImpl implements OrderChildService {
private void updateOrderGoodsAmountLoad(OrderGoods orderGoods, BigDecimal dif){
if (dif.compareTo(BigDecimal.ZERO) == 0){return;}
int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo())-1;
int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo());
Integer status = orderGoods.getOrderGoodsStatus();
if (count == 0){
status = OrderGoodsStatusEnum.Status.PAYING.getCode();
}
else {
status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
}
Integer status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), dif, status);
}
......@@ -1010,7 +998,7 @@ public class OrderChildServiceImpl implements OrderChildService {
if (count > 1) {return;}
if (orderGoods.getResidueTransportWeight().compareTo(BigDecimal.ZERO) <= 0){
orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoods.getOrderGoodsNo(), OrderGoodsStatusEnum.Status.COMPLETED.getCode());
orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoods.getOrderGoodsNo(), OrderGoodsStatusEnum.Status.SUCCESS.getCode());
}
}
......
......@@ -23,7 +23,7 @@ public class OrderGoodsSqlProvider {
String sql = new SQL() {{
SELECT("a.id, a.order_no," +
" a.order_goods_no, a.order_goods_status, a.extract_weight, " +
" a.residue_transport_weight,a.already_transport_weight, a.send_address_id, a.send_address_shorter,a.send_longitude," +
" if(a.residue_transport_weight < 0, '0', a.residue_transport_weight) as residue_transport_weight ,a.already_transport_weight, a.send_address_id, a.send_address_shorter,a.send_longitude," +
" a.send_latitude,a.receive_address_id, a.receive_address_shorter,a.receive_longitude,a.receive_latitude," +
"a.goods_id, a.goods_name, a.pending_order_way," +
" date_format(a.directional_expire_time, '%Y-%m-%d %H:%i:%s') as directional_expire_time ," +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论