Compare commits
2 Commits
2a7743db5a
...
7f1c44c489
| Author | SHA1 | Date |
|---|---|---|
|
|
7f1c44c489 | |
|
|
6f33757bfb |
|
|
@ -13,6 +13,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装/卸货地信息
|
* 装/卸货地信息
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderEntity;
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderEntity;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.param.AssignmentDriverParam;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.param.AssignmentOrgParam;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.CreateOrderParam;
|
import com.njzscloud.dispose.cst.order.pojo.param.CreateOrderParam;
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderService;
|
import com.njzscloud.dispose.cst.order.service.OrderService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -67,6 +69,25 @@ public class OrderController {
|
||||||
public R<PageResult<OrderEntity>> paging(PageParam pageParam, OrderEntity orderEntity) {
|
public R<PageResult<OrderEntity>> paging(PageParam pageParam, OrderEntity orderEntity) {
|
||||||
return R.success(orderService.paging(pageParam, orderEntity));
|
return R.success(orderService.paging(pageParam, orderEntity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派清运公司
|
||||||
|
*/
|
||||||
|
@GetMapping("/assignmentOrg")
|
||||||
|
public R<?> assignmentOrg(@RequestBody AssignmentOrgParam orgParam) {
|
||||||
|
orderService.assignmentOrg(orgParam);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派司机
|
||||||
|
*/
|
||||||
|
@GetMapping("/assignmentDriver")
|
||||||
|
public R<?> assignmentDriver(@RequestBody AssignmentDriverParam driverParam) {
|
||||||
|
orderService.assignmentDriver(driverParam);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 付费项
|
* 付费项
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运输信息
|
* 运输信息
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,19 @@ package com.njzscloud.dispose.cst.order.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.result.OrderTransResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运输信息
|
* 运输信息
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface OrderTransMapper extends BaseMapper<OrderTransEntity> {
|
public interface OrderTransMapper extends BaseMapper<OrderTransEntity> {
|
||||||
|
|
||||||
|
OrderTransResult getById(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 付费项
|
* 付费项
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
@ -77,24 +78,24 @@ public class OrderExpenseItemsEntity extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 适用用户;结构类型:{
|
* 适用用户;结构类型:{
|
||||||
* strategy: None | All | Specify,
|
* strategy: None | All | Specify,
|
||||||
* objs: long[]
|
* objs: long[]
|
||||||
* },Wu-->无、ZhiDing-->指定、SuoYou-->所有
|
* },Wu-->无、ZhiDing-->指定、SuoYou-->所有
|
||||||
*/
|
*/
|
||||||
private String userScope;
|
private String userScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 适用站点;结构类型:{
|
* 适用站点;结构类型:{
|
||||||
* strategy: None | All | Specify,
|
* strategy: None | All | Specify,
|
||||||
* objs: long[]
|
* objs: long[]
|
||||||
* },Wu-->无、ZhiDing-->指定、SuoYou-->所有
|
* },Wu-->无、ZhiDing-->指定、SuoYou-->所有
|
||||||
*/
|
*/
|
||||||
private String stationScope;
|
private String stationScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 适用产品;结构类型:{
|
* 适用产品;结构类型:{
|
||||||
* strategy: None | All | Specify,
|
* strategy: None | All | Specify,
|
||||||
* objs: long[]
|
* objs: long[]
|
||||||
* },Wu-->无、ZhiDing-->指定、SuoYou-->所有
|
* },Wu-->无、ZhiDing-->指定、SuoYou-->所有
|
||||||
*/
|
*/
|
||||||
private String goodsScope;
|
private String goodsScope;
|
||||||
|
|
@ -139,6 +140,21 @@ public class OrderExpenseItemsEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String settlementWay;
|
private String settlementWay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
private Long payerUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款人客户 Id;cst_customer.id
|
||||||
|
*/
|
||||||
|
private Long payerCustomerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款方资金账户 Id
|
||||||
|
*/
|
||||||
|
private Long payerMoneyAccount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,21 @@ public class OrderTransEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String settlementWay;
|
private String settlementWay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
private Long payerUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款人客户 Id;cst_customer.id
|
||||||
|
*/
|
||||||
|
private Long payerCustomerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款方资金账户 Id
|
||||||
|
*/
|
||||||
|
private Long payerMoneyAccount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.njzscloud.dispose.cst.order.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AssignmentDriverParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单运输ID
|
||||||
|
*/
|
||||||
|
private Long orderTransId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机Id
|
||||||
|
*/
|
||||||
|
private Long driverId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.njzscloud.dispose.cst.order.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AssignmentOrgParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单运输ID
|
||||||
|
*/
|
||||||
|
private Long orderTransId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清运公司Id
|
||||||
|
*/
|
||||||
|
private Long transCompanyId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,275 @@
|
||||||
|
package com.njzscloud.dispose.cst.order.pojo.result;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运输信息
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OrderTransResult {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车次
|
||||||
|
*/
|
||||||
|
private Integer trainNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单 Id
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运输状态;字典代码:trans_status,DaiPaiDan-->待派单、DaiJieDan-->待接单、YiJieDan-->已接单、YunShuZhong-->运输中、YiJinChang-->已进场、YiChuChang-->已出场、YiWanCheng-->已完成、YiQuXiao-->已取消
|
||||||
|
*/
|
||||||
|
private String transStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车道名称
|
||||||
|
*/
|
||||||
|
private String lane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派司机时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime assignmentDriverTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机确认接单时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime driverConfirmTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始运输时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime transTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完结时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 看料员 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
private Long checkerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 勘料状态;字典代码:check_status,Wu-->无需勘料、YiKanLiao-->已勘料、WeiKanLiao-->未勘料
|
||||||
|
*/
|
||||||
|
private String checkStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 勘料时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime checkTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 勘料照片
|
||||||
|
*/
|
||||||
|
private String checkPhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 勘料员备注
|
||||||
|
*/
|
||||||
|
private String checkerMemo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机 Id
|
||||||
|
*/
|
||||||
|
private Long driverId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机所属客户 Id;cst_customer.id
|
||||||
|
*/
|
||||||
|
private Long driverCustomerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机所属用户 Id
|
||||||
|
*/
|
||||||
|
private Long driverUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归属客户 Id;cst_customer.id
|
||||||
|
*/
|
||||||
|
private Long truckCustomerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归属组织
|
||||||
|
*/
|
||||||
|
private Long truckOrgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆 Id
|
||||||
|
*/
|
||||||
|
private Long truckId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String truckLicensePlate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史皮重
|
||||||
|
*/
|
||||||
|
private Integer historyTareWeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 毛重;单位:千克
|
||||||
|
*/
|
||||||
|
private Integer roughWeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 皮重;单位:千克
|
||||||
|
*/
|
||||||
|
private Integer tareWeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 净重;单位:千克
|
||||||
|
*/
|
||||||
|
private Integer settleWeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运距;单位:米
|
||||||
|
*/
|
||||||
|
private Integer transDistance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进场车头照片
|
||||||
|
*/
|
||||||
|
private String inFrontPhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进场车斗照片
|
||||||
|
*/
|
||||||
|
private String inBodyPhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出场车头照片
|
||||||
|
*/
|
||||||
|
private String outFrontPhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出场车斗照片
|
||||||
|
*/
|
||||||
|
private String outBodyPhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进场时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime inTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出场时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime outTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付状态,MianFei-->免费、WeiZhiFu-->未支付、YiZhiFu-->已支付、YiTuiKuan-->已退款
|
||||||
|
*/
|
||||||
|
private String paymentStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付时间
|
||||||
|
*/
|
||||||
|
private BigDecimal payTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款时间
|
||||||
|
*/
|
||||||
|
private BigDecimal refundTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总金额;单位:元
|
||||||
|
*/
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 优惠金额;单位:元,有正负
|
||||||
|
*/
|
||||||
|
private BigDecimal discountMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动修正金额;单位:元,有正负
|
||||||
|
*/
|
||||||
|
private BigDecimal reviseMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算金额;单位:元
|
||||||
|
*/
|
||||||
|
private BigDecimal settleMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算方式,YueJie-->月结、YuE-->余额、XianFu-->现付
|
||||||
|
*/
|
||||||
|
private String settlementWay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
private Long payerUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款人客户 Id;cst_customer.id
|
||||||
|
*/
|
||||||
|
private Long payerCustomerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款方资金账户 Id
|
||||||
|
*/
|
||||||
|
private Long payerMoneyAccount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运输组织 Id;cst_org.id
|
||||||
|
*/
|
||||||
|
private Long transOrgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运输方客户 Id
|
||||||
|
*/
|
||||||
|
private Long transCustomerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指派清运公司时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime assignmentTransTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消
|
||||||
|
*/
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,27 +1,50 @@
|
||||||
package com.njzscloud.dispose.cst.order.service;
|
package com.njzscloud.dispose.cst.order.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.cst.order.mapper.OrderCargoPlaceMapper;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderCargoPlaceEntity;
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderCargoPlaceEntity;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装/卸货地信息
|
* 装/卸货地信息
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
public interface OrderCargoPlaceService extends IService<OrderCargoPlaceEntity> {
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class OrderCargoPlaceService extends ServiceImpl<OrderCargoPlaceMapper, OrderCargoPlaceEntity> {
|
||||||
|
|
||||||
void add(OrderCargoPlaceEntity orderCargoPlaceEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void add(OrderCargoPlaceEntity orderCargoPlaceEntity) {
|
||||||
|
this.save(orderCargoPlaceEntity);
|
||||||
|
}
|
||||||
|
|
||||||
void modify(OrderCargoPlaceEntity orderCargoPlaceEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void modify(OrderCargoPlaceEntity orderCargoPlaceEntity) {
|
||||||
|
this.updateById(orderCargoPlaceEntity);
|
||||||
|
}
|
||||||
|
|
||||||
void del(List<Long> ids);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
OrderCargoPlaceEntity detail(Long id);
|
public OrderCargoPlaceEntity detail(Long id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
PageResult<OrderCargoPlaceEntity> paging(PageParam pageParam, OrderCargoPlaceEntity orderCargoPlaceEntity);
|
public PageResult<OrderCargoPlaceEntity> paging(PageParam pageParam, OrderCargoPlaceEntity orderCargoPlaceEntity) {
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(orderCargoPlaceEntity)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,50 @@
|
||||||
package com.njzscloud.dispose.cst.order.service;
|
package com.njzscloud.dispose.cst.order.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.cst.order.mapper.OrderExpenseItemsMapper;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderExpenseItemsEntity;
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderExpenseItemsEntity;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 付费项
|
* 付费项
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
public interface OrderExpenseItemsService extends IService<OrderExpenseItemsEntity> {
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class OrderExpenseItemsService extends ServiceImpl<OrderExpenseItemsMapper, OrderExpenseItemsEntity> {
|
||||||
|
|
||||||
void add(OrderExpenseItemsEntity orderExpenseItemsEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void add(OrderExpenseItemsEntity orderExpenseItemsEntity) {
|
||||||
|
this.save(orderExpenseItemsEntity);
|
||||||
|
}
|
||||||
|
|
||||||
void modify(OrderExpenseItemsEntity orderExpenseItemsEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void modify(OrderExpenseItemsEntity orderExpenseItemsEntity) {
|
||||||
|
this.updateById(orderExpenseItemsEntity);
|
||||||
|
}
|
||||||
|
|
||||||
void del(List<Long> ids);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
OrderExpenseItemsEntity detail(Long id);
|
public OrderExpenseItemsEntity detail(Long id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
PageResult<OrderExpenseItemsEntity> paging(PageParam pageParam, OrderExpenseItemsEntity orderExpenseItemsEntity);
|
public PageResult<OrderExpenseItemsEntity> paging(PageParam pageParam, OrderExpenseItemsEntity orderExpenseItemsEntity) {
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(orderExpenseItemsEntity)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,244 @@
|
||||||
package com.njzscloud.dispose.cst.order.service;
|
package com.njzscloud.dispose.cst.order.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njzscloud.common.core.ex.Exceptions;
|
||||||
|
import com.njzscloud.common.core.fastjson.Fastjson;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.common.security.util.SecurityUtil;
|
||||||
|
import com.njzscloud.common.sn.support.SnUtil;
|
||||||
|
import com.njzscloud.dispose.cst.order.constant.*;
|
||||||
|
import com.njzscloud.dispose.cst.order.mapper.OrderMapper;
|
||||||
|
import com.njzscloud.dispose.cst.order.mapper.OrderTransMapper;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderCargoPlaceEntity;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderEntity;
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderEntity;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderExpenseItemsEntity;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.param.AssignmentDriverParam;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.param.AssignmentOrgParam;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.param.CreateOrderCargoPlaceParam;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.CreateOrderParam;
|
import com.njzscloud.dispose.cst.order.pojo.param.CreateOrderParam;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.result.OrderTransResult;
|
||||||
|
import com.njzscloud.dispose.cst.order.pojo.vo.Scope;
|
||||||
|
import com.njzscloud.dispose.finance.constant.ScopeStrategy;
|
||||||
|
import com.njzscloud.dispose.finance.pojo.entity.ExpenseItemEntity;
|
||||||
|
import com.njzscloud.dispose.finance.service.ExpenseItemService;
|
||||||
|
import com.njzscloud.dispose.sys.auth.pojo.result.MyResult;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收/销订单
|
* 收/销订单
|
||||||
*
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
public interface OrderService extends IService<OrderEntity> {
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class OrderService extends ServiceImpl<OrderMapper, OrderEntity> {
|
||||||
|
|
||||||
void add(CreateOrderParam param);
|
private final OrderCargoPlaceService orderCargoPlaceService;
|
||||||
|
private final OrderTransMapper orderTransMapper;
|
||||||
|
private final ExpenseItemService expenseItemService;
|
||||||
|
private final OrderExpenseItemsService orderExpenseItemsService;
|
||||||
|
|
||||||
void modify(OrderEntity orderEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void add(CreateOrderParam param) {
|
||||||
|
// 订单信息
|
||||||
|
param.setOrderStatus(OrderStatus.YiYuYue.getVal());
|
||||||
|
Long transOrgId = param.getTransOrgId();
|
||||||
|
OrderStatus orderStatus = transOrgId == null ? OrderStatus.YiYuYue : OrderStatus.JinXingZhong;
|
||||||
|
MyResult userDetail = SecurityUtil.loginUser();
|
||||||
|
OrderEntity orderEntity = BeanUtil.copyProperties(param, OrderEntity.class)
|
||||||
|
.setSn(this.generateSn())
|
||||||
|
.setUserId(SecurityUtil.currentUserId())
|
||||||
|
.setCustomerId(userDetail.getCurrentCustomerId())
|
||||||
|
.setOrderTime(LocalDateTime.now())
|
||||||
|
.setOrderStatus(orderStatus.getVal())
|
||||||
|
.setAssignmentTransTime(transOrgId == null ? null : LocalDateTime.now());
|
||||||
|
this.save(orderEntity);
|
||||||
|
|
||||||
void del(List<Long> ids);
|
// 装卸货信息
|
||||||
|
CreateOrderCargoPlaceParam cargoPlace = param.getCargoPlaceParam();
|
||||||
|
OrderCargoPlaceEntity placeEntity = BeanUtil.copyProperties(cargoPlace, OrderCargoPlaceEntity.class)
|
||||||
|
.setOrderId(orderEntity.getId());
|
||||||
|
if (OrderCategory.HuiShouYuYue.getVal().equals(param.getOrderCategory())) {
|
||||||
|
placeEntity.setZx(Zx.ZhuangHuo.getVal());
|
||||||
|
} else if (OrderCategory.XiaoShouYuYue.getVal().equals(param.getOrderCategory())) {
|
||||||
|
placeEntity.setZx(Zx.XieHuo.getVal());
|
||||||
|
}
|
||||||
|
orderCargoPlaceService.add(placeEntity);
|
||||||
|
|
||||||
OrderEntity detail(Long id);
|
// 运输信息
|
||||||
|
int transNum = orderEntity.getEstimatedTrainNum();
|
||||||
|
OrderTransEntity transEntity = new OrderTransEntity();
|
||||||
|
transEntity.setOrderId(orderEntity.getId());
|
||||||
|
for (int i = 1; i <= transNum; i++) {
|
||||||
|
transEntity.setTrainNum(i);
|
||||||
|
transEntity.setTransStatus(transOrgId == null ? null : TransStatus.DaiPaiDan.getVal());
|
||||||
|
transEntity.setTransTime(transOrgId == null ? null : LocalDateTime.now());
|
||||||
|
transEntity.setCheckStatus(CheckStatus.WeiKanLiao.getVal());
|
||||||
|
transEntity.setPaymentStatus(PaymentStatus.WeiZhiFu.getVal());
|
||||||
|
orderTransMapper.insert(transEntity);
|
||||||
|
}
|
||||||
|
// 付费项
|
||||||
|
if (transOrgId != null) {
|
||||||
|
this.createOrderExpenseItems(orderEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PageResult<OrderEntity> paging(PageParam pageParam, OrderEntity orderEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void modify(OrderEntity orderEntity) {
|
||||||
|
this.updateById(orderEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderEntity detail(Long id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageResult<OrderEntity> paging(PageParam pageParam, OrderEntity orderEntity) {
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(orderEntity)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void assignmentOrg(AssignmentOrgParam orgParam) {
|
||||||
|
Assert.notNull(orgParam, () -> Exceptions.clierr("请填写参数"));
|
||||||
|
Assert.notNull(orgParam.getOrderTransId(), () -> Exceptions.clierr("订单运输ID不可为空"));
|
||||||
|
Assert.notNull(orgParam.getTransCompanyId(), () -> Exceptions.clierr("清运公司ID不可为空"));
|
||||||
|
|
||||||
|
OrderTransResult result = orderTransMapper.getById(orgParam.getOrderTransId());
|
||||||
|
Assert.notNull(result, () -> Exceptions.clierr("订单不存在"));
|
||||||
|
Assert.isNull(result.getTransOrgId(), () -> Exceptions.clierr("当前订单已分配清运公司,无需重复分配"));
|
||||||
|
Assert.isTrue(OrderStatus.YiYuYue.getVal().equals(result.getOrderStatus()), () -> Exceptions.clierr("当前订单状态,无法分配清运公司"));
|
||||||
|
|
||||||
|
// 更新订单表 cst_order 的运输公司与状态信息
|
||||||
|
OrderEntity orderEntity = new OrderEntity();
|
||||||
|
orderEntity.setTransOrgId(orgParam.getTransCompanyId())
|
||||||
|
.setTransCustomerId(orgParam.getTransCompanyId())
|
||||||
|
.setAssignmentTransTime(LocalDateTime.now())
|
||||||
|
.setOrderStatus(OrderStatus.JinXingZhong.getVal())
|
||||||
|
.setId(result.getOrderId());
|
||||||
|
this.updateById(orderEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void assignmentDriver(AssignmentDriverParam driverParam) {
|
||||||
|
Assert.notNull(driverParam, () -> Exceptions.clierr("请填写参数"));
|
||||||
|
Assert.notNull(driverParam.getOrderTransId(), () -> Exceptions.clierr("订单运输ID不可为空"));
|
||||||
|
Assert.notNull(driverParam.getDriverId(), () -> Exceptions.clierr("司机Id不可为空"));
|
||||||
|
|
||||||
|
OrderTransResult result = orderTransMapper.getById(driverParam.getOrderTransId());
|
||||||
|
Assert.notNull(result, () -> Exceptions.clierr("订单不存在"));
|
||||||
|
Assert.isNull(result.getDriverId(), () -> Exceptions.clierr("当前订单已分配司机,无需重复分配"));
|
||||||
|
Assert.isTrue(TransStatus.DaiPaiDan.getVal().equals(result.getTransStatus()), () -> Exceptions.clierr("当前订单状态,无法分配司机"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成订单号
|
||||||
|
*
|
||||||
|
* @return sn 订单号
|
||||||
|
*/
|
||||||
|
public String generateSn() {
|
||||||
|
String sn = SnUtil.next("Booking-Order-SN");
|
||||||
|
if (this.exists(Wrappers.<OrderEntity>lambdaQuery().eq(OrderEntity::getSn, sn).eq(OrderEntity::getDeleted, Boolean.FALSE))) {
|
||||||
|
this.generateSn();
|
||||||
|
}
|
||||||
|
return sn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建订单付费项
|
||||||
|
*
|
||||||
|
* @param orderEntity 订单信息
|
||||||
|
*/
|
||||||
|
public void createOrderExpenseItems(OrderEntity orderEntity) {
|
||||||
|
// 读取启用的付费项配置,并按过滤
|
||||||
|
List<ExpenseItemEntity> itemEntityList = expenseItemService.list(Wrappers.<ExpenseItemEntity>lambdaQuery()
|
||||||
|
.eq(ExpenseItemEntity::getCanuse, Boolean.TRUE)
|
||||||
|
.eq(ExpenseItemEntity::getDeleted, Boolean.FALSE));
|
||||||
|
Long transOrgId = orderEntity.getTransOrgId();
|
||||||
|
Long goodsId = orderEntity.getGoodsId();
|
||||||
|
Long stationId = orderEntity.getStationId();
|
||||||
|
List<ExpenseItemEntity> goodsItems = itemEntityList.stream().filter(item ->
|
||||||
|
item.getGoodsId().equals(goodsId)).toList();
|
||||||
|
|
||||||
|
OrderExpenseItemsEntity goodsOrderItem = null;
|
||||||
|
if (!goodsItems.isEmpty()) {
|
||||||
|
goodsOrderItem = BeanUtil.copyProperties(goodsItems.getFirst(), OrderExpenseItemsEntity.class)
|
||||||
|
.setOrderId(orderEntity.getId())
|
||||||
|
.setPaymentStatus(PaymentStatus.WeiZhiFu.getVal());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<OrderExpenseItemsEntity> extraItems = itemEntityList.stream()
|
||||||
|
.filter(cfg -> {
|
||||||
|
Scope userScope = Fastjson.toBean(cfg.getUserScope(), Scope.class);
|
||||||
|
Scope goodsScope = Fastjson.toBean(cfg.getGoodsScope(), Scope.class);
|
||||||
|
Scope stationsScope = Fastjson.toBean(cfg.getStationScope(), Scope.class);
|
||||||
|
List<Long> companyIds = userScope != null ? userScope.getIds() : null;
|
||||||
|
List<Long> goodsIds = goodsScope != null ? goodsScope.getIds() : null;
|
||||||
|
List<Long> stationsIds = stationsScope != null ? stationsScope.getIds() : null;
|
||||||
|
|
||||||
|
// 判断客户范围
|
||||||
|
boolean isComTrue;
|
||||||
|
if (userScope != null && ScopeStrategy.SuoYou.getVal().equals(userScope.getStrategy())) {
|
||||||
|
isComTrue = true; // 所有客户都匹配
|
||||||
|
} else {
|
||||||
|
isComTrue = companyIds != null && transOrgId != null && companyIds.contains(transOrgId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断产品范围
|
||||||
|
boolean isGoodsTrue;
|
||||||
|
if (goodsScope != null && ScopeStrategy.SuoYou.getVal().equals(goodsScope.getStrategy())) {
|
||||||
|
isGoodsTrue = true; // 所有产品都匹配
|
||||||
|
} else {
|
||||||
|
isGoodsTrue = goodsIds != null && goodsId != null && goodsIds.contains(goodsId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断站点范围
|
||||||
|
boolean isStationsTrue;
|
||||||
|
if (stationsScope != null && ScopeStrategy.SuoYou.getVal().equals(stationsScope.getStrategy())) {
|
||||||
|
isStationsTrue = true; // 所有站点都匹配
|
||||||
|
} else {
|
||||||
|
isStationsTrue = stationsIds != null && stationId != null && stationsIds.contains(stationId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只有当三个条件都为true时,才返回true
|
||||||
|
return isComTrue && isGoodsTrue && isStationsTrue;
|
||||||
|
})
|
||||||
|
// 复制配置为订单付费项(数量口径与产品一致:按车=1,否则=settleWeight)
|
||||||
|
.map(cfg -> {
|
||||||
|
OrderExpenseItemsEntity entity = BeanUtil.copyProperties(cfg, OrderExpenseItemsEntity.class);
|
||||||
|
entity.setOrderId(orderEntity.getId());
|
||||||
|
entity.setPaymentStatus(PaymentStatus.WeiZhiFu.getVal());
|
||||||
|
return entity;
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 第三步:合并集合并计算金额,然后批量落库
|
||||||
|
if (goodsOrderItem != null) {
|
||||||
|
extraItems.addFirst(goodsOrderItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extraItems.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量保存付费项
|
||||||
|
orderExpenseItemsService.saveBatch(extraItems);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,50 @@
|
||||||
package com.njzscloud.dispose.cst.order.service;
|
package com.njzscloud.dispose.cst.order.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.cst.order.mapper.OrderTransMapper;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运输信息
|
* 运输信息
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
public interface OrderTransService extends IService<OrderTransEntity> {
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class OrderTransService extends ServiceImpl<OrderTransMapper, OrderTransEntity> {
|
||||||
|
|
||||||
void add(OrderTransEntity orderTransEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void add(OrderTransEntity orderTransEntity) {
|
||||||
|
this.save(orderTransEntity);
|
||||||
|
}
|
||||||
|
|
||||||
void modify(OrderTransEntity orderTransEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void modify(OrderTransEntity orderTransEntity) {
|
||||||
|
this.updateById(orderTransEntity);
|
||||||
|
}
|
||||||
|
|
||||||
void del(List<Long> ids);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void del(List<Long> ids) {
|
||||||
|
this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
OrderTransEntity detail(Long id);
|
public OrderTransEntity detail(Long id) {
|
||||||
|
return this.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
PageResult<OrderTransEntity> paging(PageParam pageParam, OrderTransEntity orderTransEntity);
|
public PageResult<OrderTransEntity> paging(PageParam pageParam, OrderTransEntity orderTransEntity) {
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(orderTransEntity)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
package com.njzscloud.dispose.cst.order.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.dispose.cst.order.mapper.OrderCargoPlaceMapper;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderCargoPlaceEntity;
|
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderCargoPlaceService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装/卸货地信息
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class OrderCargoPlaceServiceImpl extends ServiceImpl<OrderCargoPlaceMapper, OrderCargoPlaceEntity> implements OrderCargoPlaceService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void add(OrderCargoPlaceEntity orderCargoPlaceEntity) {
|
|
||||||
this.save(orderCargoPlaceEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void modify(OrderCargoPlaceEntity orderCargoPlaceEntity) {
|
|
||||||
this.updateById(orderCargoPlaceEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void del(List<Long> ids) {
|
|
||||||
this.removeBatchByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public OrderCargoPlaceEntity detail(Long id) {
|
|
||||||
return this.getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<OrderCargoPlaceEntity> paging(PageParam pageParam, OrderCargoPlaceEntity orderCargoPlaceEntity) {
|
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(orderCargoPlaceEntity)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
package com.njzscloud.dispose.cst.order.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.dispose.cst.order.mapper.OrderExpenseItemsMapper;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderExpenseItemsEntity;
|
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderExpenseItemsService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付费项
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class OrderExpenseItemsServiceImpl extends ServiceImpl<OrderExpenseItemsMapper, OrderExpenseItemsEntity> implements OrderExpenseItemsService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void add(OrderExpenseItemsEntity orderExpenseItemsEntity) {
|
|
||||||
this.save(orderExpenseItemsEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void modify(OrderExpenseItemsEntity orderExpenseItemsEntity) {
|
|
||||||
this.updateById(orderExpenseItemsEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void del(List<Long> ids) {
|
|
||||||
this.removeBatchByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public OrderExpenseItemsEntity detail(Long id) {
|
|
||||||
return this.getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<OrderExpenseItemsEntity> paging(PageParam pageParam, OrderExpenseItemsEntity orderExpenseItemsEntity) {
|
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(orderExpenseItemsEntity)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,216 +0,0 @@
|
||||||
package com.njzscloud.dispose.cst.order.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njzscloud.common.core.fastjson.Fastjson;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.common.security.util.SecurityUtil;
|
|
||||||
import com.njzscloud.common.sn.support.SnUtil;
|
|
||||||
import com.njzscloud.dispose.cst.order.constant.*;
|
|
||||||
import com.njzscloud.dispose.cst.order.mapper.OrderMapper;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderCargoPlaceEntity;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderEntity;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderExpenseItemsEntity;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.CreateOrderCargoPlaceParam;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.CreateOrderParam;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.vo.Scope;
|
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderCargoPlaceService;
|
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderExpenseItemsService;
|
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderService;
|
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderTransService;
|
|
||||||
import com.njzscloud.dispose.finance.constant.ScopeStrategy;
|
|
||||||
import com.njzscloud.dispose.finance.pojo.entity.ExpenseItemEntity;
|
|
||||||
import com.njzscloud.dispose.finance.service.ExpenseItemService;
|
|
||||||
import com.njzscloud.dispose.sys.auth.pojo.result.MyResult;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收/销订单
|
|
||||||
*
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> implements OrderService {
|
|
||||||
|
|
||||||
private final OrderCargoPlaceService orderCargoPlaceService;
|
|
||||||
private final OrderTransService orderTransService;
|
|
||||||
private final ExpenseItemService expenseItemService;
|
|
||||||
private final OrderExpenseItemsService orderExpenseItemsService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void add(CreateOrderParam param) {
|
|
||||||
// 订单信息
|
|
||||||
param.setOrderStatus(OrderStatus.YiYuYue.getVal());
|
|
||||||
Long transOrgId = param.getTransOrgId();
|
|
||||||
OrderStatus orderStatus = transOrgId == null ? OrderStatus.YiYuYue : OrderStatus.JinXingZhong;
|
|
||||||
MyResult userDetail = SecurityUtil.loginUser();
|
|
||||||
OrderEntity orderEntity = BeanUtil.copyProperties(param, OrderEntity.class)
|
|
||||||
.setSn(this.generateSn())
|
|
||||||
.setUserId(SecurityUtil.currentUserId())
|
|
||||||
.setCustomerId(userDetail.getCurrentCustomerId())
|
|
||||||
.setOrderTime(LocalDateTime.now())
|
|
||||||
.setOrderStatus(orderStatus.getVal())
|
|
||||||
.setAssignmentTransTime(transOrgId == null ? null : LocalDateTime.now());
|
|
||||||
this.save(orderEntity);
|
|
||||||
|
|
||||||
// 装卸货信息
|
|
||||||
CreateOrderCargoPlaceParam cargoPlace = param.getCargoPlaceParam();
|
|
||||||
OrderCargoPlaceEntity placeEntity = BeanUtil.copyProperties(cargoPlace, OrderCargoPlaceEntity.class)
|
|
||||||
.setOrderId(orderEntity.getId());
|
|
||||||
if (OrderCategory.HuiShouYuYue.getVal().equals(param.getOrderCategory())) {
|
|
||||||
placeEntity.setZx(Zx.ZhuangHuo.getVal());
|
|
||||||
} else if (OrderCategory.XiaoShouYuYue.getVal().equals(param.getOrderCategory())) {
|
|
||||||
placeEntity.setZx(Zx.XieHuo.getVal());
|
|
||||||
}
|
|
||||||
orderCargoPlaceService.add(placeEntity);
|
|
||||||
|
|
||||||
// 运输信息
|
|
||||||
int transNum = orderEntity.getEstimatedTrainNum();
|
|
||||||
OrderTransEntity transEntity = new OrderTransEntity();
|
|
||||||
transEntity.setOrderId(orderEntity.getId());
|
|
||||||
for (int i = 1; i <= transNum; i++) {
|
|
||||||
transEntity.setTrainNum(i);
|
|
||||||
transEntity.setTransStatus(transOrgId == null ? null : TransStatus.DaiPaiDan.getVal());
|
|
||||||
transEntity.setTransTime(transOrgId == null ? null : LocalDateTime.now());
|
|
||||||
transEntity.setCheckStatus(CheckStatus.WeiKanLiao.getVal());
|
|
||||||
transEntity.setPaymentStatus(PaymentStatus.WeiZhiFu.getVal());
|
|
||||||
orderTransService.add(transEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 付费项
|
|
||||||
if (transOrgId != null) {
|
|
||||||
this.createOrderExpenseItems(orderEntity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void modify(OrderEntity orderEntity) {
|
|
||||||
this.updateById(orderEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void del(List<Long> ids) {
|
|
||||||
this.removeBatchByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public OrderEntity detail(Long id) {
|
|
||||||
return this.getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<OrderEntity> paging(PageParam pageParam, OrderEntity orderEntity) {
|
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(orderEntity)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成订单号
|
|
||||||
*
|
|
||||||
* @return sn 订单号
|
|
||||||
*/
|
|
||||||
public String generateSn() {
|
|
||||||
String sn = SnUtil.next("Booking-Order-SN");
|
|
||||||
if (this.exists(Wrappers.<OrderEntity>lambdaQuery().eq(OrderEntity::getSn, sn).eq(OrderEntity::getDeleted, Boolean.FALSE))) {
|
|
||||||
this.generateSn();
|
|
||||||
}
|
|
||||||
return sn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建订单付费项
|
|
||||||
*
|
|
||||||
* @param orderEntity 订单信息
|
|
||||||
*/
|
|
||||||
public void createOrderExpenseItems(OrderEntity orderEntity) {
|
|
||||||
// 读取启用的付费项配置,并按过滤
|
|
||||||
List<ExpenseItemEntity> itemEntityList = expenseItemService.list(Wrappers.<ExpenseItemEntity>lambdaQuery()
|
|
||||||
.eq(ExpenseItemEntity::getCanuse, Boolean.TRUE)
|
|
||||||
.eq(ExpenseItemEntity::getDeleted, Boolean.FALSE));
|
|
||||||
Long transOrgId = orderEntity.getTransOrgId();
|
|
||||||
Long goodsId = orderEntity.getGoodsId();
|
|
||||||
Long stationId = orderEntity.getStationId();
|
|
||||||
List<ExpenseItemEntity> goodsItems = itemEntityList.stream().filter(item ->
|
|
||||||
item.getGoodsId().equals(goodsId)).toList();
|
|
||||||
|
|
||||||
OrderExpenseItemsEntity goodsOrderItem = null;
|
|
||||||
if (!goodsItems.isEmpty()) {
|
|
||||||
goodsOrderItem = BeanUtil.copyProperties(goodsItems.getFirst(), OrderExpenseItemsEntity.class)
|
|
||||||
.setOrderId(orderEntity.getId())
|
|
||||||
.setPaymentStatus(PaymentStatus.WeiZhiFu.getVal());
|
|
||||||
}
|
|
||||||
|
|
||||||
List<OrderExpenseItemsEntity> extraItems = itemEntityList.stream()
|
|
||||||
.filter(cfg -> {
|
|
||||||
Scope userScope = Fastjson.toBean(cfg.getUserScope(), Scope.class);
|
|
||||||
Scope goodsScope = Fastjson.toBean(cfg.getGoodsScope(), Scope.class);
|
|
||||||
Scope stationsScope = Fastjson.toBean(cfg.getStationScope(), Scope.class);
|
|
||||||
List<Long> companyIds = userScope != null ? userScope.getIds() : null;
|
|
||||||
List<Long> goodsIds = goodsScope != null ? goodsScope.getIds() : null;
|
|
||||||
List<Long> stationsIds = stationsScope != null ? stationsScope.getIds() : null;
|
|
||||||
|
|
||||||
// 判断客户范围
|
|
||||||
boolean isComTrue;
|
|
||||||
if (userScope != null && ScopeStrategy.SuoYou.getVal().equals(userScope.getStrategy())) {
|
|
||||||
isComTrue = true; // 所有客户都匹配
|
|
||||||
} else {
|
|
||||||
isComTrue = companyIds != null && transOrgId != null && companyIds.contains(transOrgId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断产品范围
|
|
||||||
boolean isGoodsTrue;
|
|
||||||
if (goodsScope != null && ScopeStrategy.SuoYou.getVal().equals(goodsScope.getStrategy())) {
|
|
||||||
isGoodsTrue = true; // 所有产品都匹配
|
|
||||||
} else {
|
|
||||||
isGoodsTrue = goodsIds != null && goodsId != null && goodsIds.contains(goodsId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断站点范围
|
|
||||||
boolean isStationsTrue;
|
|
||||||
if (stationsScope != null && ScopeStrategy.SuoYou.getVal().equals(stationsScope.getStrategy())) {
|
|
||||||
isStationsTrue = true; // 所有站点都匹配
|
|
||||||
} else {
|
|
||||||
isStationsTrue = stationsIds != null && stationId != null && stationsIds.contains(stationId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 只有当三个条件都为true时,才返回true
|
|
||||||
return isComTrue && isGoodsTrue && isStationsTrue;
|
|
||||||
})
|
|
||||||
// 复制配置为订单付费项(数量口径与产品一致:按车=1,否则=settleWeight)
|
|
||||||
.map(cfg -> {
|
|
||||||
OrderExpenseItemsEntity entity = BeanUtil.copyProperties(cfg, OrderExpenseItemsEntity.class);
|
|
||||||
entity.setOrderId(orderEntity.getId());
|
|
||||||
entity.setPaymentStatus(PaymentStatus.WeiZhiFu.getVal());
|
|
||||||
return entity;
|
|
||||||
})
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 第三步:合并集合并计算金额,然后批量落库
|
|
||||||
if (goodsOrderItem != null) {
|
|
||||||
extraItems.addFirst(goodsOrderItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (extraItems.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量保存付费项
|
|
||||||
orderExpenseItemsService.saveBatch(extraItems);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
package com.njzscloud.dispose.cst.order.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.dispose.cst.order.mapper.OrderTransMapper;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderTransService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运输信息
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class OrderTransServiceImpl extends ServiceImpl<OrderTransMapper, OrderTransEntity> implements OrderTransService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void add(OrderTransEntity orderTransEntity) {
|
|
||||||
this.save(orderTransEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void modify(OrderTransEntity orderTransEntity) {
|
|
||||||
this.updateById(orderTransEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void del(List<Long> ids) {
|
|
||||||
this.removeBatchByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public OrderTransEntity detail(Long id) {
|
|
||||||
return this.getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<OrderTransEntity> paging(PageParam pageParam, OrderTransEntity orderTransEntity) {
|
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(orderTransEntity)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njzscloud.dispose.cst.order.mapper.OrderTransMapper">
|
<mapper namespace="com.njzscloud.dispose.cst.order.mapper.OrderTransMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njzscloud.dispose.cst.order.pojo.result.OrderTransResult">
|
||||||
<resultMap id="BaseResultMap" type="com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity">
|
|
||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<result column="train_num" property="trainNum"/>
|
<result column="train_num" property="trainNum"/>
|
||||||
<result column="order_id" property="orderId"/>
|
<result column="order_id" property="orderId"/>
|
||||||
<result column="station_id" property="stationId"/>
|
|
||||||
<result column="trans_status" property="transStatus"/>
|
<result column="trans_status" property="transStatus"/>
|
||||||
<result column="lane" property="lane"/>
|
<result column="lane" property="lane"/>
|
||||||
<result column="assignment_driver_time" property="assignmentDriverTime"/>
|
<result column="assignment_driver_time" property="assignmentDriverTime"/>
|
||||||
|
|
@ -36,6 +34,21 @@
|
||||||
<result column="out_body_photo" property="outBodyPhoto"/>
|
<result column="out_body_photo" property="outBodyPhoto"/>
|
||||||
<result column="in_time" property="inTime"/>
|
<result column="in_time" property="inTime"/>
|
||||||
<result column="out_time" property="outTime"/>
|
<result column="out_time" property="outTime"/>
|
||||||
|
<result column="payment_status" property="paymentStatus"/>
|
||||||
|
<result column="pay_time" property="payTime"/>
|
||||||
|
<result column="refund_time" property="refundTime"/>
|
||||||
|
<result column="total_money" property="totalMoney"/>
|
||||||
|
<result column="discount_money" property="discountMoney"/>
|
||||||
|
<result column="revise_money" property="reviseMoney"/>
|
||||||
|
<result column="settle_money" property="settleMoney"/>
|
||||||
|
<result column="settlement_way" property="settlementWay"/>
|
||||||
|
<result column="payerUserId" property="payerUserId"/>
|
||||||
|
<result column="payerCustomerId" property="payerCustomerId"/>
|
||||||
|
<result column="payerMoneyAccount" property="payerMoneyAccount"/>
|
||||||
|
<result column="trans_org_id" property="transOrgId"/>
|
||||||
|
<result column="trans_customer_id" property="transCustomerId"/>
|
||||||
|
<result column="assignment_trans_time" property="assignmentTransTime"/>
|
||||||
|
<result column="order_status" property="orderStatus"/>
|
||||||
<result column="creator_id" property="creatorId"/>
|
<result column="creator_id" property="creatorId"/>
|
||||||
<result column="modifier_id" property="modifierId"/>
|
<result column="modifier_id" property="modifierId"/>
|
||||||
<result column="create_time" property="createTime"/>
|
<result column="create_time" property="createTime"/>
|
||||||
|
|
@ -44,16 +57,59 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, train_num, order_id, station_id, trans_status, lane,
|
cot
|
||||||
assignment_driver_time, driver_confirm_time, trans_time, finish_time,
|
.
|
||||||
checker_id, check_status, check_time, check_photo, checker_memo,
|
id
|
||||||
driver_id, driver_customer_id, driver_user_id, truck_customer_id,
|
AS id,
|
||||||
truck_org_id, truck_id, truck_license_plate, history_tare_weight,
|
cot.train_num AS train_num,
|
||||||
rough_weight, tare_weight, settle_weight, trans_distance,
|
cot.order_id AS order_id,
|
||||||
in_front_photo, in_body_photo, out_front_photo, out_body_photo,
|
cot.trans_status AS trans_status,
|
||||||
in_time, out_time, creator_id, modifier_id, create_time, modify_time, deleted
|
cot.lane AS lane,
|
||||||
|
cot.assignment_driver_time AS assignment_driver_time,
|
||||||
|
cot.driver_confirm_time AS driver_confirm_time,
|
||||||
|
cot.trans_time AS trans_time,
|
||||||
|
cot.finish_time AS finish_time,
|
||||||
|
cot.checker_id AS checker_id,
|
||||||
|
cot.check_status AS check_status,
|
||||||
|
cot.check_time AS check_time,
|
||||||
|
cot.check_photo AS check_photo,
|
||||||
|
cot.checker_memo AS checker_memo,
|
||||||
|
cot.driver_id AS driver_id,
|
||||||
|
cot.driver_customer_id AS driver_customer_id,
|
||||||
|
cot.driver_user_id AS driver_user_id,
|
||||||
|
cot.truck_customer_id AS truck_customer_id,
|
||||||
|
cot.truck_org_id AS truck_org_id,
|
||||||
|
cot.truck_id AS truck_id,
|
||||||
|
cot.truck_license_plate AS truck_license_plate,
|
||||||
|
cot.history_tare_weight AS history_tare_weight,
|
||||||
|
cot.rough_weight AS rough_weight,
|
||||||
|
cot.tare_weight AS tare_weight,
|
||||||
|
cot.settle_weight AS settle_weight,
|
||||||
|
cot.trans_distance AS trans_distance,
|
||||||
|
cot.in_front_photo AS in_front_photo,
|
||||||
|
cot.in_body_photo AS in_body_photo,
|
||||||
|
cot.out_front_photo AS out_front_photo,
|
||||||
|
cot.out_body_photo AS out_body_photo,
|
||||||
|
cot.in_time AS in_time,
|
||||||
|
cot.out_time AS out_time,
|
||||||
|
cot.creator_id AS creator_id,
|
||||||
|
cot.modifier_id AS modifier_id,
|
||||||
|
cot.create_time AS create_time,
|
||||||
|
cot.modify_time AS modify_time,
|
||||||
|
cot.deleted AS deleted,
|
||||||
|
co.trans_org_id AS trans_org_id,
|
||||||
|
co.trans_customer_id AS trans_customer_id,
|
||||||
|
co.assignment_trans_time AS assignment_trans_time,
|
||||||
|
co.order_status
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<select id="getById" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
FROM cst_order_trans cot
|
||||||
|
left join cst_order co on co.id = cot.order_id
|
||||||
|
WHERE cot.id = #{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue