问题修复

localizer
lzq 2025-09-23 11:56:35 +08:00
parent 9a6782b02b
commit d314a20ea9
12 changed files with 46 additions and 11 deletions

View File

@ -51,6 +51,7 @@ public class BizDriverEntity {
*
*/
private String phone;
private Boolean busy;
/**
* ;

View File

@ -72,6 +72,7 @@ public class BizTruckEntity {
*/
private AuditStatus auditStatus;
private Boolean busy;
/**
*
*/

View File

@ -23,7 +23,10 @@ public class ModifyBizCompanyParam {
* Id
*/
private Long id;
/**
*
*/
private String stationName;
/**
* ; biz_company.uscc

View File

@ -8,6 +8,7 @@ import lombok.ToString;
import lombok.experimental.Accessors;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
*
@ -136,5 +137,7 @@ public class SearchCompanyResult {
private String auditMemo;
private BizObj bizObj;
private LocalDateTime createTime;
private LocalDateTime modifyTime;
}

View File

@ -86,8 +86,14 @@ public class BizCompanyService extends ServiceImpl<BizCompanyMapper, BizCompanyE
/* if (oldData.getAuditStatus() != AuditStatus.YiCheXiao) {
throw Exceptions.create(CompanyExceptionMsg.COMPANY_MODIFY_ERROR, "当前状态不能修改");
} */
AppProperties.DefaultPlace defaultPlace = appProperties.getDefaultPlace();
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);
}

View File

@ -131,8 +131,9 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
SearchCompanyResult searchCompanyResult = baseMapper.selectCompanyByUserId(userDetail.getUserId());
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::getAuditStatus, AuditStatus.TongGuo)
.and(StrUtil.isNotBlank(keywords), it ->
it.like(BizDriverEntity::getDriverName, keywords)
.or().like(BizDriverEntity::getPhone, keywords))

View File

@ -112,6 +112,7 @@ public class BizProjectService extends ServiceImpl<BizProjectMapper, BizProjectE
Long userId = userDetail.getUserId();
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.<BizProjectEntity>query()
.eq("a.deleted", 0)
.eq("a.audit_status", AuditStatus.TongGuo.getVal())
.eq("b.user_id", userId)
.like(StrUtil.isNotBlank(bizProjectEntity.getProjectName()), "a.project_name", bizProjectEntity.getProjectName())
));

View File

@ -113,7 +113,7 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
SearchCompanyResult searchCompanyResult = baseMapper.selectCompanyByUserId(userDetail.getUserId());
Assert.notNull(searchCompanyResult, () -> Exceptions.exception("未查询到公司信息"));
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::getCompanyId, searchCompanyResult.getId())
.and(StrUtil.isNotBlank(keywords), it ->

View File

@ -23,4 +23,8 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
OrderPagingResult obtainWeighBill(@Param("orderId") Long orderId);
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);
}

View File

@ -251,7 +251,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
}
if (BizObj.isTrans(bizObjStr)) {
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)
;
return;
@ -259,10 +259,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
if (BizObj.isDriver(bizObjStr)) {
ew
.eq("f.user_id", userId)
.and(it ->
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))
)
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
;
return;
}
@ -513,6 +510,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
);
}
@Transactional(rollbackFor = Exception.class)
public void assignment(AssignmentOrderParam assignmentOrderParam) {
OrderInfoEntity oldOrder = this.getById(assignmentOrderParam.getOrderId());
Assert.notNull(oldOrder, () -> Exceptions.clierr("订单不存在"));
@ -529,6 +527,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
Assert.isNull(orderInfo.getDriverId(), () -> Exceptions.clierr("当前订单已分配司机,无需重复分配"));
Assert.isTrue(orderInfo.getOrderStatus() == OrderStatus.DaiPaiDan, () -> Exceptions.clierr("当前订单状态,无法分配司机"));
baseMapper.busyDriver(driverId, Boolean.TRUE);
this.updateById(new OrderInfoEntity()
.setId(orderInfo.getId())
.setDriverId(driverId)
@ -550,6 +550,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
return true;
}
@Transactional(rollbackFor = Exception.class)
public void confirm(Long orderId, Long truckId) {
OrderInfoEntity orderInfo = this.getById(orderId);
Assert.notNull(orderInfo, () -> Exceptions.clierr("订单不存在"));
@ -558,6 +559,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
long userId = SecurityUtil.currentUserId();
Long driverId_ = baseMapper.getDriverId(userId);
Assert.isTrue(driverId_ != null && driverId == driverId_, () -> Exceptions.clierr("您没有权限确认此单"));
baseMapper.busyTruck(truckId, Boolean.TRUE);
this.updateById(new OrderInfoEntity()
.setId(orderInfo.getId())
.setTruckId(truckId)
@ -651,6 +654,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
Assert.notNull(orderInfoEntity, () -> Exceptions.clierr("订单不存在"));
OrderStatus orderStatus = orderInfoEntity.getOrderStatus();
Assert.isTrue(orderStatus == OrderStatus.YiJinChang, () -> Exceptions.clierr("当前订单状态,无法出场"));
baseMapper.busyDriver(orderInfoEntity.getDriverId(), Boolean.FALSE);
baseMapper.busyTruck(orderInfoEntity.getTruckId(), Boolean.FALSE);
this.updateById(new OrderInfoEntity()
.setId(orderInfoEntity.getId())
.setOrderStatus(OrderStatus.YiWanCheng)

View File

@ -39,8 +39,8 @@
d.nickname,
e.nickname other_nickname
FROM biz_project a
INNER JOIN biz_company b ON b.id = a.other_company_id AND b.deleted = 0
INNER JOIN biz_company c ON c.user_id = a.user_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 AND c.audit_status = 'TongGuo'
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
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">

View File

@ -143,6 +143,16 @@
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
</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">
<result property="cargoPhoto" column="cargo_photo" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>