提交 a6bf27f0 authored 作者: 刘海泉's avatar 刘海泉

Merge remote-tracking branch 'origin/v20.8_add_sub_weight_20240805' into dev

......@@ -11,6 +11,7 @@ import com.clx.performance.param.pc.owner.ThawAccountParam;
import com.clx.performance.param.pc.owner.UpdateStatusParam;
import com.clx.performance.vo.app.collect.AppCollectTruckVO;
import com.clx.performance.vo.feign.FreightEstimateVO;
import com.clx.performance.vo.feign.OrderExtractWeightVO;
import com.clx.performance.vo.feign.OrderGoodsFeignVO;
import com.clx.performance.vo.feign.PlatformServiceFeeConfigFeignVO;
import com.clx.performance.vo.pc.OwnerAccountAllVO;
......@@ -158,7 +159,7 @@ public interface PerformanceFeign {
@GetMapping(value = {"clx-performance/feign/order/weight/getOrderResidueWeight"})
Result<BigDecimal> getOrderResidueWeight(@RequestParam("orderNo") String orderNo);
Result<OrderExtractWeightVO> getOrderResidueWeight(@RequestParam("orderNo") String orderNo);
......
......@@ -16,7 +16,6 @@ import com.clx.performance.vo.app.OrderGoodsAPPVO;
import com.clx.performance.vo.pc.OrderGoodsVO;
import com.msl.common.base.Optional;
import com.msl.common.dao.BaseDao;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.time.LocalDateTime;
......@@ -28,7 +27,6 @@ import java.util.List;
* Time 16:45
*/
public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Integer> {
boolean updateWeight(@Param("orderId")Integer orderId, @Param("weight") BigDecimal weight);
String getMaxOrderGoodsId();
......
......@@ -20,7 +20,6 @@ import com.clx.performance.vo.app.OrderGoodsAPPVO;
import com.clx.performance.vo.pc.OrderGoodsVO;
import com.msl.common.base.Optional;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
......@@ -35,11 +34,6 @@ import java.util.List;
@Repository
public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, Integer> implements OrderGoodsDao {
@Override
public boolean updateWeight(@Param("orderId") Integer orderId, @Param("weight") BigDecimal weight) {
return baseMapper.updateWeight(orderId, weight) > 0;
}
@Override
public String getMaxOrderGoodsId() {
return baseMapper.getMaxOrderGoodsId();
......
......@@ -26,11 +26,6 @@ import java.util.List;
*/
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@Update(" update order_goods set " +
" residue_transport_weight = residue_transport_weight-#{weight} " +
" where id = #{orderId}")
int updateWeight(@Param("orderId") Integer orderId, @Param("weight") BigDecimal weight);
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "getMaxOrderGoodsId")
String getMaxOrderGoodsId();
......@@ -38,14 +33,12 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
IPage<OrderGoodsVO> pageOrderGoodsList(@Param("page") Page<OrderGoodsVO> page, @Param("param") PageOrderGoodsListParam param);
@Update(" update order_goods set " +
" residue_transport_weight = residue_transport_weight-#{weight}," +
" already_transport_weight = already_transport_weight+#{weight}," +
"order_goods_status = #{orderGoodsStatus} " +
" where id = #{id}")
void updateOrderGoodsWeightAndStatus(@Param("id") Integer id, @Param("weight") BigDecimal orderChildWeight, @Param("orderGoodsStatus") Integer orderGoodsStatus);
@Update(" update order_goods set " +
" residue_transport_weight = residue_transport_weight-#{residueTransportWeight}," +
" already_transport_weight = already_transport_weight+#{alreadyTransportWeight}," +
"order_goods_status = #{orderGoodsStatus} " +
" where id = #{id}")
......
......@@ -118,7 +118,7 @@ public class OrderGoodsSqlProvider {
}
WHERE("a.last_arrive_send_time >= now()");
WHERE("a.order_goods_status IN ( "+OrderGoodsStatusEnum.Status.PAYING.getCode()+","+OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode()+")");
WHERE("a.residue_transport_weight > 0");
WHERE("IFNULL(a.extract_weight,0) - IFNULL(a.already_transport_weight,0) > 0");
ORDER_BY("a.pending_order_time desc");
}}.toString();
return sql;
......@@ -134,7 +134,7 @@ public class OrderGoodsSqlProvider {
WHERE(" a.pending_order_way = " + PendingOrderWayStatusEnum.Status.FLEET_GK.getCode());
WHERE("a.last_arrive_send_time >= now()");
WHERE("a.order_goods_status IN ( "+OrderGoodsStatusEnum.Status.PAYING.getCode()+","+OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode()+")");
WHERE("a.residue_transport_weight > 0");
WHERE("IFNULL(a.extract_weight,0) - IFNULL(a.already_transport_weight,0) > 0");
WHERE("b.id is not null");
}}.toString();
return sql;
......@@ -161,7 +161,7 @@ public class OrderGoodsSqlProvider {
"a.pending_order_freight,a.user_no,a.user_name from order_goods a " +
"where a.stop_flag = "+ OrderGoodsStopEnum.Status.NO.getCode()+" and a.last_arrive_send_time >= now() and (a.order_goods_status = "+OrderGoodsStatusEnum.Status.PAYING.getCode()+
" or a.order_goods_status = "+OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode()+")" +
"and a.residue_transport_weight > 0" +
"and IFNULL(a.extract_weight,0) - IFNULL(a.already_transport_weight,0) > 0" +
" and a.pending_order_way in ( "+ PendingOrderWayStatusEnum.Status.DX.getCode()+","+
PendingOrderWayStatusEnum.Status.FLEET_DX.getCode()+") and a.order_goods_no in (");
......@@ -226,7 +226,6 @@ public class OrderGoodsSqlProvider {
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}");
......@@ -266,7 +265,6 @@ public class OrderGoodsSqlProvider {
UPDATE("order_goods")
.SET("vehicle_usage = #{params.vehicleUsage}")
.SET("extract_weight = #{params.extractWeight}")
.SET("residue_transport_weight = #{params.residueTransportWeight}")
.SET("pending_order_way = #{params.pendingOrderWay}")
.SET("last_order_time = #{params.lastOrderTime}")
.SET("last_arrive_send_time = #{params.lastArriveSendTime}")
......@@ -287,7 +285,6 @@ public class OrderGoodsSqlProvider {
public String updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(@Param(value ="residueWeight") BigDecimal residueWeight, @Param(value = "alreadyWeight") BigDecimal alreadyWeight,@Param(value ="status") Integer status,@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}")
.SET("order_goods_status = #{status}")
......@@ -354,7 +351,7 @@ public class OrderGoodsSqlProvider {
WHERE("a.stop_flag = "+ OrderGoodsStopEnum.Status.NO.getCode());
WHERE("a.last_arrive_send_time >= now()");
WHERE("(a.order_goods_status = "+OrderGoodsStatusEnum.Status.PAYING.getCode()+" or a.order_goods_status = "+OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode()+")");
WHERE("a.residue_transport_weight >=35");
WHERE("IFNULL(a.extract_weight,0) - IFNULL(a.already_transport_weight,0) > 0");
if (ObjectUtil.isNotNull(param.getSearchType())) {
if (1 == param.getSearchType()) {
WHERE("a.send_address_shorter like '%"+ param.getSearchName() +"%'");
......@@ -371,8 +368,7 @@ public class OrderGoodsSqlProvider {
public String batchCancelOrderGoods(List<CancelOrderGoodsWeightDTO> cancelOrderGoodsWeight){
StringJoiner sj = new StringJoiner("; ");
for(CancelOrderGoodsWeightDTO item : cancelOrderGoodsWeight){
sj.add("update order_goods set residue_transport_weight = residue_transport_weight +" + item.getCancelWeight() +
", already_transport_weight = already_transport_weight -" + item.getCancelWeight() +
sj.add("update order_goods set already_transport_weight = already_transport_weight -" + item.getCancelWeight() +
" where order_goods_no = '"+item.getOrderGoodsNo() + "'") ;
}
return sj.toString();
......@@ -400,7 +396,6 @@ public class OrderGoodsSqlProvider {
for(OrderGoodsCancelWeightDTO dto : list){
sj.add("update order_goods " +
"set " +
"residue_transport_weight = residue_transport_weight + " + dto.getWeight() + "," +
"already_transport_weight = already_transport_weight - " + dto.getWeight() + " " +
"where order_goods_no = '"+dto.getOrderGoodsNo()+"'"
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论