勘料员查看订单列表,分为:待勘料、已勘料、所有订单
parent
8532c96343
commit
511530f95f
|
|
@ -1,5 +1,6 @@
|
||||||
package com.njzscloud.dispose.cst.order.pojo.param;
|
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.OrderStatus;
|
||||||
import com.njzscloud.dispose.cst.order.constant.TransStatus;
|
import com.njzscloud.dispose.cst.order.constant.TransStatus;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
@ -64,5 +65,10 @@ public class OrderTransQueryParam {
|
||||||
*/
|
*/
|
||||||
private TransStatus transStatus;
|
private TransStatus transStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 勘料状态;字典代码:check_status,Wu-->无需勘料、YiKanLiao-->已勘料、WeiKanLiao-->未勘料
|
||||||
|
*/
|
||||||
|
private CheckStatus checkStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -325,12 +325,13 @@ public class OrderService extends ServiceImpl<OrderMapper, OrderEntity> {
|
||||||
// 根据订单类型区分毛重皮重
|
// 根据订单类型区分毛重皮重
|
||||||
if (OrderCategory.HuiShouYuYue.equals(result.getOrderCategory())) {
|
if (OrderCategory.HuiShouYuYue.equals(result.getOrderCategory())) {
|
||||||
transEntity.setTareWeight(weight);
|
transEntity.setTareWeight(weight);
|
||||||
|
transEntity.setSettleWeight(result.getRoughWeight() - transEntity.getTareWeight());
|
||||||
// 更新车辆皮重
|
// 更新车辆皮重
|
||||||
this.updateTruckHisTareWeight(result.getTruckId(), weight);
|
this.updateTruckHisTareWeight(result.getTruckId(), weight);
|
||||||
} else if (OrderCategory.XiaoShouYuYue.equals(result.getOrderCategory())) {
|
} else if (OrderCategory.XiaoShouYuYue.equals(result.getOrderCategory())) {
|
||||||
transEntity.setRoughWeight(weight);
|
transEntity.setRoughWeight(weight);
|
||||||
|
transEntity.setSettleWeight(transEntity.getRoughWeight() - result.getTareWeight());
|
||||||
}
|
}
|
||||||
transEntity.setSettleWeight(transEntity.getRoughWeight() - transEntity.getTareWeight());
|
|
||||||
transEntity.setOutFrontPhoto(leavingParam.getFrontPhoto());
|
transEntity.setOutFrontPhoto(leavingParam.getFrontPhoto());
|
||||||
transEntity.setOutBodyPhoto(leavingParam.getBodyPhoto());
|
transEntity.setOutBodyPhoto(leavingParam.getBodyPhoto());
|
||||||
transEntity.setOutTime(LocalDateTime.now());
|
transEntity.setOutTime(LocalDateTime.now());
|
||||||
|
|
|
||||||
|
|
@ -69,27 +69,37 @@ public class OrderTransService extends ServiceImpl<OrderTransMapper, OrderTransE
|
||||||
.eq(param.getTrainNum() != null, "cot.train_num", param.getTrainNum())
|
.eq(param.getTrainNum() != null, "cot.train_num", param.getTrainNum())
|
||||||
.like(StrUtil.isNotBlank(param.getStationName()), "co.station_name", param.getStationName())
|
.like(StrUtil.isNotBlank(param.getStationName()), "co.station_name", param.getStationName())
|
||||||
.eq(param.getOrderStatus() != null, "co.order_status", param.getOrderStatus())
|
.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()) {
|
if (!SecurityUtil.isAdmin()) {
|
||||||
MyResult userDetail = SecurityUtil.loginUser();
|
MyResult userDetail = SecurityUtil.loginUser();
|
||||||
Long currentCustomerId = userDetail.getCurrentCustomerId();
|
if (userDetail.isKanLiao()) {
|
||||||
if (currentCustomerId != null) {
|
Long userId = userDetail.getUserId();
|
||||||
CustomerEntity customer = customerService.getById(currentCustomerId);
|
if (userId != null) {
|
||||||
if (customer != null && customer.getIdentityCategory() != null) {
|
ew.eq("cot.checker_id", userId);
|
||||||
ew.eq(IdentityCategory.ChanFei.equals(customer.getIdentityCategory())
|
|
||||||
|| IdentityCategory.CaiGou.equals(customer.getIdentityCategory()),
|
|
||||||
"co.customer_id", currentCustomerId);
|
|
||||||
ew.eq(IdentityCategory.YunShu.equals(customer.getIdentityCategory()),
|
|
||||||
"co.trans_customer_id", currentCustomerId);
|
|
||||||
ew.eq(IdentityCategory.SiJi.equals(customer.getIdentityCategory()),
|
|
||||||
"cot.driver_customer_id", currentCustomerId);
|
|
||||||
} else {
|
} else {
|
||||||
throw Exceptions.clierr("客户信息或客户身份类型不存在");
|
throw Exceptions.clierr("当前登录人无用户ID");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw Exceptions.clierr("当前登录人无客户信息");
|
Long currentCustomerId = userDetail.getCurrentCustomerId();
|
||||||
|
if (currentCustomerId != null) {
|
||||||
|
CustomerEntity customer = customerService.getById(currentCustomerId);
|
||||||
|
if (customer != null && customer.getIdentityCategory() != null) {
|
||||||
|
ew.eq(IdentityCategory.ChanFei.equals(customer.getIdentityCategory())
|
||||||
|
|| IdentityCategory.CaiGou.equals(customer.getIdentityCategory()),
|
||||||
|
"co.customer_id", currentCustomerId);
|
||||||
|
ew.eq(IdentityCategory.YunShu.equals(customer.getIdentityCategory()),
|
||||||
|
"co.trans_customer_id", currentCustomerId);
|
||||||
|
ew.eq(IdentityCategory.SiJi.equals(customer.getIdentityCategory()),
|
||||||
|
"cot.driver_customer_id", currentCustomerId);
|
||||||
|
} else {
|
||||||
|
throw Exceptions.clierr("客户信息或客户身份类型不存在");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw Exceptions.clierr("当前登录人无客户信息");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ import java.util.Optional;
|
||||||
@Setter
|
@Setter
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class MyResult extends UserDetail {
|
public class MyResult extends UserDetail {
|
||||||
|
|
||||||
|
public static final String ROLE_KANLIAO = "ROLE_KANLIAO";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单信息
|
* 菜单信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -66,4 +69,14 @@ public class MyResult extends UserDetail {
|
||||||
// noinspection OptionalGetWithoutIsPresent
|
// noinspection OptionalGetWithoutIsPresent
|
||||||
return identityInfo.get();
|
return identityInfo.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是看料员
|
||||||
|
*
|
||||||
|
* @return true/false
|
||||||
|
*/
|
||||||
|
public boolean isKanLiao() {
|
||||||
|
return this.getRoles().contains(ROLE_KANLIAO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue