Compare commits

...

2 Commits

4 changed files with 45 additions and 15 deletions

View File

@ -1,5 +1,6 @@
package com.njzscloud.dispose.cst.order.pojo.param;
import com.njzscloud.dispose.cst.order.constant.CheckStatus;
import com.njzscloud.dispose.cst.order.constant.OrderStatus;
import com.njzscloud.dispose.cst.order.constant.TransStatus;
import lombok.Getter;
@ -64,5 +65,10 @@ public class OrderTransQueryParam {
*/
private TransStatus transStatus;
/**
* check_statusWu-->YiKanLiao-->WeiKanLiao-->
*/
private CheckStatus checkStatus;
}

View File

@ -325,12 +325,13 @@ public class OrderService extends ServiceImpl<OrderMapper, OrderEntity> {
// 根据订单类型区分毛重皮重
if (OrderCategory.HuiShouYuYue.equals(result.getOrderCategory())) {
transEntity.setTareWeight(weight);
transEntity.setSettleWeight(result.getRoughWeight() - transEntity.getTareWeight());
// 更新车辆皮重
this.updateTruckHisTareWeight(result.getTruckId(), weight);
} else if (OrderCategory.XiaoShouYuYue.equals(result.getOrderCategory())) {
transEntity.setRoughWeight(weight);
transEntity.setSettleWeight(transEntity.getRoughWeight() - result.getTareWeight());
}
transEntity.setSettleWeight(transEntity.getRoughWeight() - transEntity.getTareWeight());
transEntity.setOutFrontPhoto(leavingParam.getFrontPhoto());
transEntity.setOutBodyPhoto(leavingParam.getBodyPhoto());
transEntity.setOutTime(LocalDateTime.now());

View File

@ -69,11 +69,20 @@ public class OrderTransService extends ServiceImpl<OrderTransMapper, OrderTransE
.eq(param.getTrainNum() != null, "cot.train_num", param.getTrainNum())
.like(StrUtil.isNotBlank(param.getStationName()), "co.station_name", param.getStationName())
.eq(param.getOrderStatus() != null, "co.order_status", param.getOrderStatus())
.eq(param.getTransStatus() != null, "cot.trans_status", param.getTransStatus());
.eq(param.getTransStatus() != null, "cot.trans_status", param.getTransStatus())
.eq(param.getCheckStatus() != null, "cot.check_status", param.getCheckStatus());
}
// 管理员查看全部,非管理员按身份过滤
if (!SecurityUtil.isAdmin()) {
MyResult userDetail = SecurityUtil.loginUser();
if (userDetail.isKanLiao()) {
Long userId = userDetail.getUserId();
if (userId != null) {
ew.eq("cot.checker_id", userId);
} else {
throw Exceptions.clierr("当前登录人无用户ID");
}
} else {
Long currentCustomerId = userDetail.getCurrentCustomerId();
if (currentCustomerId != null) {
CustomerEntity customer = customerService.getById(currentCustomerId);
@ -92,6 +101,7 @@ public class OrderTransService extends ServiceImpl<OrderTransMapper, OrderTransE
throw Exceptions.clierr("当前登录人无客户信息");
}
}
}
return PageResult.of(baseMapper.paging(pageParam.toPage(), ew));
}

View File

@ -17,6 +17,9 @@ import java.util.Optional;
@Setter
@Accessors(chain = true)
public class MyResult extends UserDetail {
public static final String ROLE_KANLIAO = "ROLE_KANLIAO";
/**
*
*/
@ -66,4 +69,14 @@ public class MyResult extends UserDetail {
// noinspection OptionalGetWithoutIsPresent
return identityInfo.get();
}
/**
*
*
* @return true/false
*/
public boolean isKanLiao() {
return this.getRoles().contains(ROLE_KANLIAO);
}
}