提交 e87b4934 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
...@@ -78,11 +78,11 @@ public enum OrderChildEnum { ...@@ -78,11 +78,11 @@ public enum OrderChildEnum {
; ;
private final int code; private final Integer code;
private final String name; private final String name;
public static Optional<Status> getByCode(int code) { public static Optional<Status> getByCode(Integer code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst(); return Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
} }
} }
...@@ -126,7 +126,8 @@ public enum OrderChildEnum { ...@@ -126,7 +126,8 @@ public enum OrderChildEnum {
public static final List<Integer> CANCEL_lIST = Arrays.asList( public static final List<Integer> CANCEL_lIST = Arrays.asList(
Status.DRIVER_CANCEL.getCode(), Status.DRIVER_CANCEL.getCode(),
Status.PLATFORM_CANCEL.getCode(), Status.PLATFORM_CANCEL.getCode(),
Status.OWNER_CANCEL.getCode() Status.OWNER_CANCEL.getCode(),
Status.ARTIFICIAL_CANCEL.getCode()
); );
......
...@@ -84,8 +84,8 @@ public enum PerformanceResultEnum implements ResultEnum { ...@@ -84,8 +84,8 @@ public enum PerformanceResultEnum implements ResultEnum {
SETTLEMENT_NO_FOUND(1401, "结算单不存在"), SETTLEMENT_NO_FOUND(1401, "结算单不存在"),
MONEY_NO_SAME(1501, "货主提现金额和平台支付金额不一致"), MONEY_NO_SAME(1501, "货主提现金额和平台支付金额不一致"),
ORDER_GOODS_WEIGHT_NOT_HAVE(1601, "货单可拉运吨数不足") ORDER_GOODS_WEIGHT_NOT_HAVE(1601, "货单可拉运吨数不足"),
ORDER_GOODS_STATUS_NOT_GET(1602, "当前货单已关闭不可继续提取")
; ;
private final int code; private final int code;
private final String msg; private final String msg;
......
...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
...@@ -20,6 +21,7 @@ public class PageTruckListParam extends PageParam { ...@@ -20,6 +21,7 @@ public class PageTruckListParam extends PageParam {
@NotNull(message = "需要车数不能为空") @NotNull(message = "需要车数不能为空")
@ApiModelProperty(value = "需要车辆数量", example = "5") @ApiModelProperty(value = "需要车辆数量", example = "5")
@Min(value = 1,message = "需要车数最小为1")
private Integer needTruckNum; private Integer needTruckNum;
@ApiModelProperty(value = "空重车状态 1:空车 2:运单-空车 3:运单-重车", example = "1") @ApiModelProperty(value = "空重车状态 1:空车 2:运单-空车 3:运单-重车", example = "1")
private Integer truckUserStatus; private Integer truckUserStatus;
......
...@@ -164,4 +164,10 @@ public class OrderChildVO { ...@@ -164,4 +164,10 @@ public class OrderChildVO {
return freightPrice.multiply(weight).setScale(2, RoundingMode.HALF_UP); return freightPrice.multiply(weight).setScale(2, RoundingMode.HALF_UP);
} }
@ApiModelProperty("状态MSG")
public String statusMsg;
public String getStatusMsg() {
return OrderChildEnum.Status.getByCode(status).get().getName();
}
} }
\ No newline at end of file
...@@ -127,7 +127,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -127,7 +127,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoodsNo, OrderGoodsStatusEnum.Status.COMPLETED.getCode()); orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoodsNo, OrderGoodsStatusEnum.Status.COMPLETED.getCode());
} else { } else {
//更新货单已完成 //更新货单已完成
log.info("当前货单虽然可拉运吨数为0,未存在未拉运完成的运单,所以更新为已完成,货单编号{}", orderGoodsNo); log.info("当前货单可拉运吨数为0,未存在未拉运完成的运单,所以更新为已完成,货单编号{}", orderGoodsNo);
orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoodsNo, OrderGoodsStatusEnum.Status.SUCCESS.getCode()); orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoodsNo, OrderGoodsStatusEnum.Status.SUCCESS.getCode());
} }
...@@ -215,9 +215,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -215,9 +215,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
orderChild.setCancelTime(DateUtils.parseDateTime(now).get()); orderChild.setCancelTime(DateUtils.parseDateTime(now).get());
orderChild.setFinishTime(DateUtils.parseDateTime(now).get()); orderChild.setFinishTime(DateUtils.parseDateTime(now).get());
breakContractDriverRecordService.saveDriverRecordOfOrderChildCancel(orderChild, 0L, "系统"); breakContractDriverRecordService.saveDriverRecordOfOrderChildCancel(orderChild, 0L, "系统");
//保存运单日志数据 //保存运单日志数据
// 日志
orderChildLogService.saveDriverOrderChildLog(orderChild.getChildNo(), OrderChildLogEnum.Type.PLATFORM_CANCEL.getCode(), orderChildLogService.saveDriverOrderChildLog(orderChild.getChildNo(), OrderChildLogEnum.Type.PLATFORM_CANCEL.getCode(),
OrderChildLogEnum.Type.PLATFORM_CANCEL.getMsg(), 0L, "系统"); OrderChildLogEnum.Type.PLATFORM_CANCEL.getMsg(), 0L, "系统");
...@@ -227,14 +225,15 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -227,14 +225,15 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
orderChildDao.batchUpdateOrderChildStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), "系统取消", now, now, childNoList); orderChildDao.batchUpdateOrderChildStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), "系统取消", now, now, childNoList);
} }
RollbackOrderWeightParam param = new RollbackOrderWeightParam();
param.setOrderNo(orderGoods.getOrderNo());
param.setResidueWeight(orderGoods.getResidueTransportWeight());
//当前货单已经到了最晚接单时间,所有相关状态均已经处理完毕,此刻单独处理运单的数据 //当前货单已经到了最晚接单时间,所有相关状态均已经处理完毕,此刻单独处理运单的数据
if (OrderGoodsStatusEnum.Status.SUCCESS.getCode().equals(orderGoods.getOrderGoodsStatus()) if (OrderGoodsStatusEnum.Status.SUCCESS.getCode().equals(orderGoods.getOrderGoodsStatus())
|| OrderGoodsStatusEnum.Status.COMPLETED.getCode().equals(orderGoods.getOrderGoodsStatus()) || OrderGoodsStatusEnum.Status.COMPLETED.getCode().equals(orderGoods.getOrderGoodsStatus())
) { ) {
RollbackOrderWeightParam param = new RollbackOrderWeightParam();
param.setOrderNo(orderGoods.getOrderNo());
param.setResidueWeight(childSum);
//当前情况需要回填订单的余量 //当前情况需要回填订单的余量
if (orderGoods.getTruckDemand().equals(1) || orderGoods.getTruckDemand().equals(3)) { if (orderGoods.getTruckDemand().equals(1) || orderGoods.getTruckDemand().equals(3)) {
param.setOwnResidueCarryWeight(BigDecimal.ZERO); param.setOwnResidueCarryWeight(BigDecimal.ZERO);
...@@ -249,7 +248,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -249,7 +248,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
} }
} }
//只更新货单已拉运吨数 //只更新货单已拉运吨数
orderGoodsDao.updateOrderGoodsSetAlreadyWeight(childSum, orderGoods.getId()); orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeight(childSum, childSum, orderGoods.getId());
orderFeign.rollbackOrderWeight(param); orderFeign.rollbackOrderWeight(param);
} else { } else {
//只更新货单未拉运吨数,已拉运吨数 //只更新货单未拉运吨数,已拉运吨数
......
package com.clx.performance.controller.pc; package com.clx.performance.controller.pc;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.OrderCancelParam; import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.param.pc.PageOrderGoodsListParam;
import com.clx.performance.service.OrderCancelService; import com.clx.performance.service.OrderCancelService;
import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.OrderGoodsVO;
import com.msl.common.base.PageData;
import com.msl.common.base.PageParam;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result; import com.msl.common.result.Result;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -11,6 +18,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -11,6 +18,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping(value="/pc/order/") @RequestMapping(value="/pc/order/")
...@@ -34,4 +43,27 @@ public class OrderCancelController { ...@@ -34,4 +43,27 @@ public class OrderCancelController {
orderCancelService.ownerCancelOrderPre(param); orderCancelService.ownerCancelOrderPre(param);
return Result.ok(); return Result.ok();
} }
@ApiOperation(value = "客服取消运单查询", notes = "<br>By:胡宇帆")
@GetMapping("/findArtificialCancelOrder")
public Result<OrderChildVO> findArtificialCancelOrder(@RequestParam String orderChildNo) {
OrderChildVO vo = orderCancelService.findArtificialCancelOrder(orderChildNo);
return Result.ok(vo);
}
@ApiOperation(value = "客服取消运单", notes = "<br>By:胡宇帆")
@GetMapping("/artificialCancelOrder")
public Result<Object> artificialCancelOrder(@RequestParam(value = "orderChildNo") String orderChildNo, @RequestParam(value = "remark") String remark) {
orderCancelService.artificialCancelOrder(orderChildNo, remark);
return Result.ok();
}
@ApiOperation(value = "取消运单记录", notes = "<br>By:胡宇帆")
@PostMapping("/orderChildCancelRecord")
public Result<PageData<OrderChildVO>> orderChildCancelRecord() {
PageParam pageParam = new PageParam();
IPage<OrderChildVO> page = orderCancelService.orderChildCancelRecord(pageParam);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
} }
...@@ -13,6 +13,7 @@ import com.clx.performance.vo.app.OrderChildVO; ...@@ -13,6 +13,7 @@ import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.PageCarrierOrderChildVO; import com.clx.performance.vo.pc.PageCarrierOrderChildVO;
import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO; import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
import com.msl.common.base.PageParam;
import com.msl.common.dao.BaseDao; import com.msl.common.dao.BaseDao;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -125,4 +126,12 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int ...@@ -125,4 +126,12 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int
*/ */
List<OrderChild> selectInTransitOrderChildByOrderGoodsNo(String orderGoodsNo); List<OrderChild> selectInTransitOrderChildByOrderGoodsNo(String orderGoodsNo);
/**
* 客服查询可以取消的运单
* @param orderChildNo
* @return
*/
OrderChildVO findArtificialCancelOrder(String orderChildNo);
IPage<OrderChildVO> orderChildCancelRecord(PageParam pageParam);
} }
...@@ -15,9 +15,11 @@ import com.clx.performance.param.pc.PageCarrierOrderChildParam; ...@@ -15,9 +15,11 @@ import com.clx.performance.param.pc.PageCarrierOrderChildParam;
import com.clx.performance.param.pc.PageMonitorOrderChildQCParam; import com.clx.performance.param.pc.PageMonitorOrderChildQCParam;
import com.clx.performance.param.pc.PagePoundAuditParam; import com.clx.performance.param.pc.PagePoundAuditParam;
import com.clx.performance.vo.app.OrderChildVO; import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.OrderGoodsVO;
import com.clx.performance.vo.pc.PageCarrierOrderChildVO; import com.clx.performance.vo.pc.PageCarrierOrderChildVO;
import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO; import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
import com.msl.common.base.PageParam;
import com.msl.common.dao.impl.BaseDaoImpl; import com.msl.common.dao.impl.BaseDaoImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -381,4 +383,15 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild, ...@@ -381,4 +383,15 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
return baseMapper.selectList(lQrWrapper().eq(OrderChild::getOrderGoodsNo, orderGoodsNo) return baseMapper.selectList(lQrWrapper().eq(OrderChild::getOrderGoodsNo, orderGoodsNo)
.lt(OrderChild::getStatus, OrderChildEnum.Status.UNLOAD.getCode()) .lt(OrderChild::getStatus, OrderChildEnum.Status.UNLOAD.getCode())
); } ); }
@Override
public OrderChildVO findArtificialCancelOrder(String orderChildNo) {
return baseMapper.findArtificialCancelOrder(orderChildNo);
}
@Override
public IPage<OrderChildVO> orderChildCancelRecord(PageParam param) {
Page<OrderGoodsVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.orderChildCancelRecord(page);
}
} }
...@@ -12,6 +12,7 @@ import com.clx.performance.param.pc.PagePoundAuditParam; ...@@ -12,6 +12,7 @@ import com.clx.performance.param.pc.PagePoundAuditParam;
import com.clx.performance.sqlProvider.OrderChildSqlProvider; import com.clx.performance.sqlProvider.OrderChildSqlProvider;
import com.clx.performance.sqlProvider.OrderGoodsSqlProvider; import com.clx.performance.sqlProvider.OrderGoodsSqlProvider;
import com.clx.performance.vo.app.OrderChildVO; import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.OrderGoodsVO;
import com.clx.performance.vo.pc.PageCarrierOrderChildVO; 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.*; import org.apache.ibatis.annotations.*;
...@@ -51,4 +52,11 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> { ...@@ -51,4 +52,11 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> {
Integer updateOrderGoodsSetResidueWeight(@Param(value = "status") Integer status, @Param(value = "remark") String remark, Integer updateOrderGoodsSetResidueWeight(@Param(value = "status") Integer status, @Param(value = "remark") String remark,
@Param(value = "cancelTime") String cancelTime, @Param(value = "finishTime") String finishTime, @Param(value = "cancelTime") String cancelTime, @Param(value = "finishTime") String finishTime,
@Param(value = "childNoList") List<String> childNoList); @Param(value = "childNoList") List<String> childNoList);
@SelectProvider(type = OrderChildSqlProvider.class, method = "findArtificialCancelOrder")
OrderChildVO findArtificialCancelOrder(@Param("orderChildNo") String orderChildNo);
@SelectProvider(type = OrderChildSqlProvider.class, method = "orderChildCancelRecord")
IPage<OrderChildVO> orderChildCancelRecord(@Param("page")Page<OrderGoodsVO> page);
} }
\ No newline at end of file
package com.clx.performance.service; package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.OrderCancelParam; import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.vo.app.OrderChildVO;
import com.msl.common.base.PageParam;
import java.util.List;
public interface OrderCancelService { public interface OrderCancelService {
...@@ -34,6 +39,14 @@ public interface OrderCancelService { ...@@ -34,6 +39,14 @@ public interface OrderCancelService {
* 客服取消 * 客服取消
* @param orderChildNo * @param orderChildNo
*/ */
void artificialCancelOrder(String orderChildNo); void artificialCancelOrder(String orderChildNo, String remark);
/**
* 客服取消运单查询
* @param orderChildNo
* @return
*/
OrderChildVO findArtificialCancelOrder(String orderChildNo);
IPage<OrderChildVO> orderChildCancelRecord(PageParam pageParam);
} }
...@@ -2,6 +2,7 @@ package com.clx.performance.service.impl; ...@@ -2,6 +2,7 @@ package com.clx.performance.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.order.enums.OrderEnum; import com.clx.order.enums.OrderEnum;
import com.clx.order.feign.OrderFeign; import com.clx.order.feign.OrderFeign;
import com.clx.order.param.feign.OrderCancelReasonParam; import com.clx.order.param.feign.OrderCancelReasonParam;
...@@ -23,7 +24,9 @@ import com.clx.performance.service.OrderCancelService; ...@@ -23,7 +24,9 @@ import com.clx.performance.service.OrderCancelService;
import com.clx.performance.service.OrderGoodsTruckBindService; import com.clx.performance.service.OrderGoodsTruckBindService;
import com.clx.performance.service.OwnerAccountService; import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.breakcontract.BreakContractSettlementOwnerService; import com.clx.performance.service.breakcontract.BreakContractSettlementOwnerService;
import com.clx.performance.vo.app.OrderChildVO;
import com.clx.user.enums.driver.DriverInfoEnum; import com.clx.user.enums.driver.DriverInfoEnum;
import com.msl.common.base.PageParam;
import com.msl.common.enums.ResultEnum; import com.msl.common.enums.ResultEnum;
import com.msl.common.exception.ServiceSystemException; import com.msl.common.exception.ServiceSystemException;
import com.msl.common.result.Result; import com.msl.common.result.Result;
...@@ -678,16 +681,29 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -678,16 +681,29 @@ public class OrderCancelServiceImpl implements OrderCancelService {
} }
@Override @Override
public void artificialCancelOrder(String orderChildNo) { public void artificialCancelOrder(String orderChildNo, String remark) {
LocalDateTime now = LocalDateTime.now();
OrderChild orderChild = orderChildDao.getByChildNo(orderChildNo).orElseThrow(PerformanceResultEnum.ORDER_CHILD_NO_FOUND); OrderChild orderChild = orderChildDao.getByChildNo(orderChildNo).orElseThrow(PerformanceResultEnum.ORDER_CHILD_NO_FOUND);
OrderChild update = new OrderChild(); OrderChild update = new OrderChild();
update.setId(orderChild.getId()); update.setId(orderChild.getId());
update.setStatus(OrderChildEnum.Status.ARTIFICIAL_CANCEL.getCode()); update.setStatus(OrderChildEnum.Status.ARTIFICIAL_CANCEL.getCode());
update.setCancelRemark(OrderChildEnum.Status.ARTIFICIAL_CANCEL.getName()); update.setCancelRemark(remark);
update.setCancelTime(now);
update.setFinishTime(now);
orderChildDao.updateEntityByKey(update); orderChildDao.updateEntityByKey(update);
orderCancelComponent.backFillTonnageForArtificial(orderChild.getOrderGoodsNo(), orderChild.getWeight()); orderCancelComponent.backFillTonnageForArtificial(orderChild.getOrderGoodsNo(), orderChild.getWeight());
} }
@Override
public OrderChildVO findArtificialCancelOrder(String orderChildNo) {
return orderChildDao.findArtificialCancelOrder(orderChildNo);
}
@Override
public IPage<OrderChildVO> orderChildCancelRecord(PageParam pageParam) {
return orderChildDao.orderChildCancelRecord(pageParam);
}
} }
\ No newline at end of file
...@@ -143,6 +143,13 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer ...@@ -143,6 +143,13 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
if (i == 0){ if (i == 0){
return; return;
} else if (i > 0) { } else if (i > 0) {
if (orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.CANCEL.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.COMPLETED.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.SUCCESS.getCode())
) {
throw new ServiceSystemException(PerformanceResultEnum.ORDER_GOODS_STATUS_NOT_GET);
}
if (orderGoods.getResidueTransportWeight().compareTo(dif) < 0) { if (orderGoods.getResidueTransportWeight().compareTo(dif) < 0) {
throw new ServiceSystemException(PerformanceResultEnum.ORDER_GOODS_WEIGHT_NOT_HAVE); throw new ServiceSystemException(PerformanceResultEnum.ORDER_GOODS_WEIGHT_NOT_HAVE);
} }
......
...@@ -1396,6 +1396,13 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -1396,6 +1396,13 @@ public class OrderChildServiceImpl implements OrderChildService {
if (i == 0){ if (i == 0){
return; return;
} else if (i > 0) { } else if (i > 0) {
if (orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.CANCEL.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.COMPLETED.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.SUCCESS.getCode())
) {
throw new ServiceSystemException(PerformanceResultEnum.ORDER_GOODS_STATUS_NOT_GET);
}
if (orderGoods.getResidueTransportWeight().compareTo(dif) < 0) { if (orderGoods.getResidueTransportWeight().compareTo(dif) < 0) {
throw new ServiceSystemException(PerformanceResultEnum.ORDER_GOODS_WEIGHT_NOT_HAVE); throw new ServiceSystemException(PerformanceResultEnum.ORDER_GOODS_WEIGHT_NOT_HAVE);
} }
......
...@@ -136,6 +136,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -136,6 +136,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
public void updateOrderGoodsReduceWeightAndStatusAmountLoad(OrderGoods orderGoods, BigDecimal orderChildWeight, Integer orderGoodsStatus) { public void updateOrderGoodsReduceWeightAndStatusAmountLoad(OrderGoods orderGoods, BigDecimal orderChildWeight, Integer orderGoodsStatus) {
if (orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.CANCEL.getCode()) if (orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.CANCEL.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.COMPLETED.getCode()) || orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.COMPLETED.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.SUCCESS.getCode())
) { ) {
if (orderChildWeight.compareTo(BigDecimal.ZERO) < 0) { if (orderChildWeight.compareTo(BigDecimal.ZERO) < 0) {
orderChildWeight = orderChildWeight.negate(); orderChildWeight = orderChildWeight.negate();
......
...@@ -146,4 +146,49 @@ public class OrderChildSqlProvider { ...@@ -146,4 +146,49 @@ public class OrderChildSqlProvider {
sqlList.append(")"); sqlList.append(")");
return sqlList.toString(); return sqlList.toString();
} }
public String findArtificialCancelOrder(@Param("orderChildNo") String orderChildNo) {
return new SQL(){{
SELECT("child_no,goods_name,freight_price," +
"send_address,receive_address,good_type_code,good_type_name" +
"driver_user_no, driver_name,driver_mobile," +
"truck_no," +
"unload_pound_no,weight," +
"cancel_remark," +
"pound_status,status," +
"date_format(load_deadline, '%Y-%m-%d %H:%i:%s') as loadDeadline," +
"date_format(create_time, '%Y-%m-%d %H:%i:%s') as createTime," +
"date_format(unload_time, '%Y-%m-%d %H:%i:%s') as unloadTime "
);
FROM("order_child");
WHERE("(child_no = #{orderChildNo}");
WHERE("(status >=" + OrderChildEnum.Status.LOAD.getCode());
WHERE("(status <=" + OrderChildEnum.Status.COMPLETE.getCode());
LIMIT("1");
}}.toString();
}
public String orderChildCancelRecord(@Param("page") Page<OrderChildVO> page) {
return new SQL(){{
SELECT("child_no,goods_name,freight_price," +
"send_address,receive_address," +
"driver_user_no, driver_name,driver_mobile," +
"truck_no," +
"unload_pound_no,weight," +
"cancel_remark," +
"pound_status,status," +
"date_format(load_deadline, '%Y-%m-%d %H:%i:%s') as loadDeadline," +
"date_format(load_deadline, '%Y-%m-%d %H:%i:%s') as loadDeadline," +
"date_format(cancel_time, '%Y-%m-%d %H:%i:%s') as cancelTime "
);
FROM("order_child ");
WHERE("status in (" + StringUtils.join(OrderChildEnum.CANCEL_lIST, ",")+")");
ORDER_BY("create_time desc");
}}.toString();
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论