问题修复
parent
9a6782b02b
commit
d314a20ea9
|
|
@ -51,6 +51,7 @@ public class BizDriverEntity {
|
||||||
* 联系电话
|
* 联系电话
|
||||||
*/
|
*/
|
||||||
private String phone;
|
private String phone;
|
||||||
|
private Boolean busy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驾驶证; 图片
|
* 驾驶证; 图片
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ public class BizTruckEntity {
|
||||||
*/
|
*/
|
||||||
private AuditStatus auditStatus;
|
private AuditStatus auditStatus;
|
||||||
|
|
||||||
|
private Boolean busy;
|
||||||
/**
|
/**
|
||||||
* 审核备注
|
* 审核备注
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,10 @@ public class ModifyBizCompanyParam {
|
||||||
* Id
|
* Id
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 站点名称
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一社会信用代码; biz_company.uscc
|
* 统一社会信用代码; biz_company.uscc
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息
|
* 企业信息
|
||||||
|
|
@ -136,5 +137,7 @@ public class SearchCompanyResult {
|
||||||
private String auditMemo;
|
private String auditMemo;
|
||||||
|
|
||||||
private BizObj bizObj;
|
private BizObj bizObj;
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,14 @@ public class BizCompanyService extends ServiceImpl<BizCompanyMapper, BizCompanyE
|
||||||
/* if (oldData.getAuditStatus() != AuditStatus.YiCheXiao) {
|
/* if (oldData.getAuditStatus() != AuditStatus.YiCheXiao) {
|
||||||
throw Exceptions.create(CompanyExceptionMsg.COMPANY_MODIFY_ERROR, "当前状态不能修改");
|
throw Exceptions.create(CompanyExceptionMsg.COMPANY_MODIFY_ERROR, "当前状态不能修改");
|
||||||
} */
|
} */
|
||||||
|
AppProperties.DefaultPlace defaultPlace = appProperties.getDefaultPlace();
|
||||||
|
|
||||||
BizCompanyEntity bizCompanyEntity = BeanUtil.copyProperties(modifyBizCompanyParam, BizCompanyEntity.class)
|
BizCompanyEntity bizCompanyEntity = BeanUtil.copyProperties(modifyBizCompanyParam, BizCompanyEntity.class)
|
||||||
.setAuditStatus(AuditStatus.DaiShenHe);
|
.setAuditStatus(AuditStatus.DaiShenHe)
|
||||||
|
.setProvince(defaultPlace.getProvince())
|
||||||
|
.setCity(defaultPlace.getCity())
|
||||||
|
.setProvinceName(defaultPlace.getProvinceName())
|
||||||
|
.setCityName(defaultPlace.getCityName());
|
||||||
this.updateById(bizCompanyEntity);
|
this.updateById(bizCompanyEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,9 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
|
||||||
SearchCompanyResult searchCompanyResult = baseMapper.selectCompanyByUserId(userDetail.getUserId());
|
SearchCompanyResult searchCompanyResult = baseMapper.selectCompanyByUserId(userDetail.getUserId());
|
||||||
|
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BizDriverEntity>lambdaQuery()
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BizDriverEntity>lambdaQuery()
|
||||||
// .eq(BizDriverEntity::getBusy, false)
|
.eq(BizDriverEntity::getBusy, false)
|
||||||
.eq(BizDriverEntity::getCompanyId, searchCompanyResult.getId())
|
.eq(BizDriverEntity::getCompanyId, searchCompanyResult.getId())
|
||||||
|
.eq(BizDriverEntity::getAuditStatus, AuditStatus.TongGuo)
|
||||||
.and(StrUtil.isNotBlank(keywords), it ->
|
.and(StrUtil.isNotBlank(keywords), it ->
|
||||||
it.like(BizDriverEntity::getDriverName, keywords)
|
it.like(BizDriverEntity::getDriverName, keywords)
|
||||||
.or().like(BizDriverEntity::getPhone, keywords))
|
.or().like(BizDriverEntity::getPhone, keywords))
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ public class BizProjectService extends ServiceImpl<BizProjectMapper, BizProjectE
|
||||||
Long userId = userDetail.getUserId();
|
Long userId = userDetail.getUserId();
|
||||||
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.<BizProjectEntity>query()
|
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.<BizProjectEntity>query()
|
||||||
.eq("a.deleted", 0)
|
.eq("a.deleted", 0)
|
||||||
|
.eq("a.audit_status", AuditStatus.TongGuo.getVal())
|
||||||
.eq("b.user_id", userId)
|
.eq("b.user_id", userId)
|
||||||
.like(StrUtil.isNotBlank(bizProjectEntity.getProjectName()), "a.project_name", bizProjectEntity.getProjectName())
|
.like(StrUtil.isNotBlank(bizProjectEntity.getProjectName()), "a.project_name", bizProjectEntity.getProjectName())
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
||||||
SearchCompanyResult searchCompanyResult = baseMapper.selectCompanyByUserId(userDetail.getUserId());
|
SearchCompanyResult searchCompanyResult = baseMapper.selectCompanyByUserId(userDetail.getUserId());
|
||||||
Assert.notNull(searchCompanyResult, () -> Exceptions.exception("未查询到公司信息"));
|
Assert.notNull(searchCompanyResult, () -> Exceptions.exception("未查询到公司信息"));
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BizTruckEntity>lambdaQuery()
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BizTruckEntity>lambdaQuery()
|
||||||
// .eq(BizTruckEntity::getBusy, false)
|
.eq(BizTruckEntity::getBusy, false)
|
||||||
.eq(BizTruckEntity::getAuditStatus, AuditStatus.TongGuo)
|
.eq(BizTruckEntity::getAuditStatus, AuditStatus.TongGuo)
|
||||||
.eq(BizTruckEntity::getCompanyId, searchCompanyResult.getId())
|
.eq(BizTruckEntity::getCompanyId, searchCompanyResult.getId())
|
||||||
.and(StrUtil.isNotBlank(keywords), it ->
|
.and(StrUtil.isNotBlank(keywords), it ->
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,8 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
||||||
OrderPagingResult obtainWeighBill(@Param("orderId") Long orderId);
|
OrderPagingResult obtainWeighBill(@Param("orderId") Long orderId);
|
||||||
|
|
||||||
Long getDriverId(@Param("userId") Long userId);
|
Long getDriverId(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
void busyDriver(@Param("driverId") Long driverId, @Param("busy") Boolean busy);
|
||||||
|
|
||||||
|
void busyTruck(@Param("truckId") Long truckId, @Param("busy") Boolean busy);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
}
|
}
|
||||||
if (BizObj.isTrans(bizObjStr)) {
|
if (BizObj.isTrans(bizObjStr)) {
|
||||||
ew
|
ew
|
||||||
.in("a.order_status", OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
|
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
|
||||||
.eq("g.user_id", userId)
|
.eq("g.user_id", userId)
|
||||||
;
|
;
|
||||||
return;
|
return;
|
||||||
|
|
@ -259,10 +259,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
if (BizObj.isDriver(bizObjStr)) {
|
if (BizObj.isDriver(bizObjStr)) {
|
||||||
ew
|
ew
|
||||||
.eq("f.user_id", userId)
|
.eq("f.user_id", userId)
|
||||||
.and(it ->
|
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
|
||||||
it.in("a.order_status", OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
|
|
||||||
.or(it_ -> it_.eq("a.order_status", OrderStatus.YiJieDan).eq("a.audit_status", AuditStatus.TongGuo))
|
|
||||||
)
|
|
||||||
;
|
;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -513,6 +510,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void assignment(AssignmentOrderParam assignmentOrderParam) {
|
public void assignment(AssignmentOrderParam assignmentOrderParam) {
|
||||||
OrderInfoEntity oldOrder = this.getById(assignmentOrderParam.getOrderId());
|
OrderInfoEntity oldOrder = this.getById(assignmentOrderParam.getOrderId());
|
||||||
Assert.notNull(oldOrder, () -> Exceptions.clierr("订单不存在"));
|
Assert.notNull(oldOrder, () -> Exceptions.clierr("订单不存在"));
|
||||||
|
|
@ -529,6 +527,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Assert.isNull(orderInfo.getDriverId(), () -> Exceptions.clierr("当前订单已分配司机,无需重复分配"));
|
Assert.isNull(orderInfo.getDriverId(), () -> Exceptions.clierr("当前订单已分配司机,无需重复分配"));
|
||||||
Assert.isTrue(orderInfo.getOrderStatus() == OrderStatus.DaiPaiDan, () -> Exceptions.clierr("当前订单状态,无法分配司机"));
|
Assert.isTrue(orderInfo.getOrderStatus() == OrderStatus.DaiPaiDan, () -> Exceptions.clierr("当前订单状态,无法分配司机"));
|
||||||
|
|
||||||
|
baseMapper.busyDriver(driverId, Boolean.TRUE);
|
||||||
|
|
||||||
this.updateById(new OrderInfoEntity()
|
this.updateById(new OrderInfoEntity()
|
||||||
.setId(orderInfo.getId())
|
.setId(orderInfo.getId())
|
||||||
.setDriverId(driverId)
|
.setDriverId(driverId)
|
||||||
|
|
@ -550,6 +550,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void confirm(Long orderId, Long truckId) {
|
public void confirm(Long orderId, Long truckId) {
|
||||||
OrderInfoEntity orderInfo = this.getById(orderId);
|
OrderInfoEntity orderInfo = this.getById(orderId);
|
||||||
Assert.notNull(orderInfo, () -> Exceptions.clierr("订单不存在"));
|
Assert.notNull(orderInfo, () -> Exceptions.clierr("订单不存在"));
|
||||||
|
|
@ -558,6 +559,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
long userId = SecurityUtil.currentUserId();
|
long userId = SecurityUtil.currentUserId();
|
||||||
Long driverId_ = baseMapper.getDriverId(userId);
|
Long driverId_ = baseMapper.getDriverId(userId);
|
||||||
Assert.isTrue(driverId_ != null && driverId == driverId_, () -> Exceptions.clierr("您没有权限确认此单"));
|
Assert.isTrue(driverId_ != null && driverId == driverId_, () -> Exceptions.clierr("您没有权限确认此单"));
|
||||||
|
baseMapper.busyTruck(truckId, Boolean.TRUE);
|
||||||
|
|
||||||
this.updateById(new OrderInfoEntity()
|
this.updateById(new OrderInfoEntity()
|
||||||
.setId(orderInfo.getId())
|
.setId(orderInfo.getId())
|
||||||
.setTruckId(truckId)
|
.setTruckId(truckId)
|
||||||
|
|
@ -651,6 +654,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Assert.notNull(orderInfoEntity, () -> Exceptions.clierr("订单不存在"));
|
Assert.notNull(orderInfoEntity, () -> Exceptions.clierr("订单不存在"));
|
||||||
OrderStatus orderStatus = orderInfoEntity.getOrderStatus();
|
OrderStatus orderStatus = orderInfoEntity.getOrderStatus();
|
||||||
Assert.isTrue(orderStatus == OrderStatus.YiJinChang, () -> Exceptions.clierr("当前订单状态,无法出场"));
|
Assert.isTrue(orderStatus == OrderStatus.YiJinChang, () -> Exceptions.clierr("当前订单状态,无法出场"));
|
||||||
|
baseMapper.busyDriver(orderInfoEntity.getDriverId(), Boolean.FALSE);
|
||||||
|
baseMapper.busyTruck(orderInfoEntity.getTruckId(), Boolean.FALSE);
|
||||||
this.updateById(new OrderInfoEntity()
|
this.updateById(new OrderInfoEntity()
|
||||||
.setId(orderInfoEntity.getId())
|
.setId(orderInfoEntity.getId())
|
||||||
.setOrderStatus(OrderStatus.YiWanCheng)
|
.setOrderStatus(OrderStatus.YiWanCheng)
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@
|
||||||
d.nickname,
|
d.nickname,
|
||||||
e.nickname other_nickname
|
e.nickname other_nickname
|
||||||
FROM biz_project a
|
FROM biz_project a
|
||||||
INNER JOIN biz_company b ON b.id = a.other_company_id AND b.deleted = 0
|
INNER JOIN biz_company b ON b.id = a.other_company_id AND b.deleted = 0 AND b.audit_status = 'TongGuo'
|
||||||
INNER JOIN biz_company c ON c.user_id = a.user_id AND b.deleted = 0
|
INNER JOIN biz_company c ON c.user_id = a.user_id AND b.deleted = 0 AND c.audit_status = 'TongGuo'
|
||||||
INNER JOIN sys_user d ON a.user_id = d.id AND b.deleted = 0
|
INNER JOIN sys_user d ON a.user_id = d.id AND b.deleted = 0
|
||||||
INNER JOIN sys_user e ON a.other_user_id = e.id AND b.deleted = 0
|
INNER JOIN sys_user e ON a.other_user_id = e.id AND b.deleted = 0
|
||||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,16 @@
|
||||||
LEFT JOIN sys_user n ON n.id = a.qu_audit_user_id
|
LEFT JOIN sys_user n ON n.id = a.qu_audit_user_id
|
||||||
LEFT JOIN sys_user o ON o.id = a.shi_audit_user_id
|
LEFT JOIN sys_user o ON o.id = a.shi_audit_user_id
|
||||||
</sql>
|
</sql>
|
||||||
|
<update id="busyDriver">
|
||||||
|
UPDATE biz_driver
|
||||||
|
SET busy = #{busy}
|
||||||
|
WHERE id = #{driverId}
|
||||||
|
</update>
|
||||||
|
<update id="busyTruck">
|
||||||
|
UPDATE biz_truck
|
||||||
|
SET busy = #{busy}
|
||||||
|
WHERE id = #{truckId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<resultMap id="OrderPagingResultMap" autoMapping="true" type="com.njzscloud.supervisory.order.pojo.result.OrderPagingResult">
|
<resultMap id="OrderPagingResultMap" autoMapping="true" type="com.njzscloud.supervisory.order.pojo.result.OrderPagingResult">
|
||||||
<result property="cargoPhoto" column="cargo_photo" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
|
<result property="cargoPhoto" column="cargo_photo" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue