审核列表
parent
586b828b96
commit
67e3d7ffee
|
|
@ -470,9 +470,13 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.isNull(BizAuditConfigEntity::getAreaRole).isNull(BizAuditConfigEntity::getCityRole))
|
.isNull(BizAuditConfigEntity::getAreaRole).isNull(BizAuditConfigEntity::getCityRole))
|
||||||
.stream().map(BizAuditConfigEntity::getArea).distinct().collect(Collectors.toList());
|
.stream().map(BizAuditConfigEntity::getArea).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (CollUtil.isEmpty(areaList) && CollUtil.isEmpty(cityList) && CollUtil.isEmpty(cityAreaList)) {
|
||||||
|
return PageResult.of(pageParam.toPage());
|
||||||
|
}
|
||||||
|
|
||||||
Page<OrderPagingResult> page = pageParam.toPage();
|
Page<OrderPagingResult> page = pageParam.toPage();
|
||||||
page.addOrder(OrderItem.desc("a.create_time"));
|
page.addOrder(OrderItem.desc("a.create_time"));
|
||||||
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query();
|
QueryWrapper<OrderPagingResult> ew = Wrappers.query();
|
||||||
AuditStatus auditStatus = orderPagingSearchParam.getAuditStatus();
|
AuditStatus auditStatus = orderPagingSearchParam.getAuditStatus();
|
||||||
if (Boolean.TRUE.equals(orderPagingSearchParam.getIsCertificatePaging())) {
|
if (Boolean.TRUE.equals(orderPagingSearchParam.getIsCertificatePaging())) {
|
||||||
ew.isNotNull("a.certificate_sn");
|
ew.isNotNull("a.certificate_sn");
|
||||||
|
|
@ -498,7 +502,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
ew
|
ew
|
||||||
.eq("a.order_status", OrderStatus.YiJieDan)
|
.eq("a.order_status", OrderStatus.YiJieDan)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.in(CollUtil.isNotEmpty(areaList), "b.area", areaList).eq("a.audit_status", AuditStatus.QuDaiShenHe)
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).eq("a.audit_status", AuditStatus.QuDaiShenHe))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
||||||
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.DaiShenHe))
|
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.DaiShenHe))
|
||||||
)
|
)
|
||||||
|
|
@ -507,7 +511,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
ew
|
ew
|
||||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.in(CollUtil.isNotEmpty(areaList), "b.area", areaList).eq("a.audit_status", AuditStatus.ShiDaiShenHe)
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.TongGuo))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.TongGuo))
|
||||||
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.TongGuo))
|
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.TongGuo))
|
||||||
);
|
);
|
||||||
|
|
@ -515,25 +519,26 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
ew
|
ew
|
||||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.in(CollUtil.isNotEmpty(areaList), "b.area", areaList).eq("a.audit_status", AuditStatus.BoHui)
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).eq("a.audit_status", AuditStatus.BoHui))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.BoHui))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.BoHui))
|
||||||
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.BoHui))
|
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.BoHui))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String auditType = orderPagingSearchParam.getAuditType();
|
String auditType = orderPagingSearchParam.getAuditType();
|
||||||
|
// 1-->待审核
|
||||||
if ("1".equals(auditType)) {
|
if ("1".equals(auditType)) {
|
||||||
ew.eq("a.order_status", OrderStatus.YiJieDan)
|
ew.eq("a.order_status", OrderStatus.YiJieDan)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.in(CollUtil.isNotEmpty(areaList), "b.area", areaList).in("a.audit_status", AuditStatus.QuDaiShenHe, AuditStatus.ShiDaiShenHe)
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).in("a.audit_status", AuditStatus.QuDaiShenHe, AuditStatus.ShiDaiShenHe))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
||||||
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.DaiShenHe))
|
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.DaiShenHe))
|
||||||
);
|
);
|
||||||
} else if ("2".equals(auditType)) {
|
} else if ("2".equals(auditType)) { // 2-->已审核
|
||||||
ew
|
ew
|
||||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.in(CollUtil.isNotEmpty(areaList), "b.area", areaList).eq("a.audit_status", AuditStatus.ShiDaiShenHe)
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).in("a.audit_status", AuditStatus.TongGuo, AuditStatus.BoHui))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).in("a.audit_status", AuditStatus.TongGuo, AuditStatus.BoHui))
|
||||||
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).in("a.audit_status", AuditStatus.TongGuo, AuditStatus.BoHui))
|
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).in("a.audit_status", AuditStatus.TongGuo, AuditStatus.BoHui))
|
||||||
);
|
);
|
||||||
|
|
@ -541,7 +546,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
ew
|
ew
|
||||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.in(CollUtil.isNotEmpty(areaList), "b.area", areaList)
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList))
|
||||||
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList)))
|
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList)))
|
||||||
;
|
;
|
||||||
|
|
@ -567,6 +572,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Set<String> roles = SecurityUtil.loginUser().getRoles();
|
Set<String> roles = SecurityUtil.loginUser().getRoles();
|
||||||
BizAuditConfigEntity config = bizAuditConfigService.getOne(Wrappers.<BizAuditConfigEntity>query()
|
BizAuditConfigEntity config = bizAuditConfigService.getOne(Wrappers.<BizAuditConfigEntity>query()
|
||||||
.eq("area", detail.getArea()));
|
.eq("area", detail.getArea()));
|
||||||
|
Assert.notNull(config, () -> Exceptions.exception("您没有权限审核该订单"));
|
||||||
String areaRole = config.getAreaRole();
|
String areaRole = config.getAreaRole();
|
||||||
String cityRole = config.getCityRole();
|
String cityRole = config.getCityRole();
|
||||||
if (!roles.contains(areaRole) && !roles.contains(cityRole)) {
|
if (!roles.contains(areaRole) && !roles.contains(cityRole)) {
|
||||||
|
|
@ -1271,8 +1277,9 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算付费项的优惠金额
|
* 计算付费项的优惠金额
|
||||||
|
*
|
||||||
* @param companyId 清运公司id
|
* @param companyId 清运公司id
|
||||||
* @param item 付费项实体
|
* @param item 付费项实体
|
||||||
* @return 总金额
|
* @return 总金额
|
||||||
*/
|
*/
|
||||||
private BigDecimal calculateItemDiscountMoney(Long companyId, OrderExpenseItemsEntity item) {
|
private BigDecimal calculateItemDiscountMoney(Long companyId, OrderExpenseItemsEntity item) {
|
||||||
|
|
@ -1285,7 +1292,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
return discountMoney;
|
return discountMoney;
|
||||||
}
|
}
|
||||||
goodsId = entity.getOriginGoodsId();
|
goodsId = entity.getOriginGoodsId();
|
||||||
} else if (ExpenseItemCategory.QingYunFuWuFei.getVal().equals(item.getExpenseItemCategory())){
|
} else if (ExpenseItemCategory.QingYunFuWuFei.getVal().equals(item.getExpenseItemCategory())) {
|
||||||
itemId = item.getOriginExpenseItemId();
|
itemId = item.getOriginExpenseItemId();
|
||||||
}
|
}
|
||||||
List<DiscountManageEntity> discountList = discountManageService.list(Wrappers.lambdaQuery(DiscountManageEntity.class)
|
List<DiscountManageEntity> discountList = discountManageService.list(Wrappers.lambdaQuery(DiscountManageEntity.class)
|
||||||
|
|
@ -1294,7 +1301,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.eq(null != itemId, DiscountManageEntity::getExpenseId, itemId)
|
.eq(null != itemId, DiscountManageEntity::getExpenseId, itemId)
|
||||||
.eq(DiscountManageEntity::getDeleted, Boolean.FALSE));
|
.eq(DiscountManageEntity::getDeleted, Boolean.FALSE));
|
||||||
if (null != discountList && discountList.size() > 0) {
|
if (null != discountList && discountList.size() > 0) {
|
||||||
for (DiscountManageEntity discount: discountList) {
|
for (DiscountManageEntity discount : discountList) {
|
||||||
if (DiscountType.DISCOUNT.getVal().equals(discount.getType())) {
|
if (DiscountType.DISCOUNT.getVal().equals(discount.getType())) {
|
||||||
discountMoney = discountMoney.subtract(discount.getMoney());
|
discountMoney = discountMoney.subtract(discount.getMoney());
|
||||||
} else if (DiscountType.RAISE.getVal().equals(discount.getType())) {
|
} else if (DiscountType.RAISE.getVal().equals(discount.getType())) {
|
||||||
|
|
@ -1649,7 +1656,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.equals(result.getId())).collect(Collectors.toList());
|
.equals(result.getId())).collect(Collectors.toList());
|
||||||
List<String> detailList = new ArrayList<>();
|
List<String> detailList = new ArrayList<>();
|
||||||
if (details.size() > 0) {
|
if (details.size() > 0) {
|
||||||
for (OrderExportDetailResult detailResult: details) {
|
for (OrderExportDetailResult detailResult : details) {
|
||||||
detailList.add(detailResult.getExpenseItemName() + detailResult.getSettleMoney() + "元");
|
detailList.add(detailResult.getExpenseItemName() + detailResult.getSettleMoney() + "元");
|
||||||
}
|
}
|
||||||
map.put("明细", JSONObject.toJSONString(detailList));
|
map.put("明细", JSONObject.toJSONString(detailList));
|
||||||
|
|
@ -1861,7 +1868,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
List<String> companyIds = cfg.getCompanyIds();
|
List<String> companyIds = cfg.getCompanyIds();
|
||||||
List<String> goodsIds = cfg.getGoodsIds();
|
List<String> goodsIds = cfg.getGoodsIds();
|
||||||
List<String> stationsIds = cfg.getStationIds();
|
List<String> stationsIds = cfg.getStationIds();
|
||||||
|
|
||||||
// 判断客户范围
|
// 判断客户范围
|
||||||
boolean isComTrue;
|
boolean isComTrue;
|
||||||
if (scope == Scope.ALL) {
|
if (scope == Scope.ALL) {
|
||||||
|
|
@ -1869,7 +1876,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
} else {
|
} else {
|
||||||
isComTrue = companyIds != null && transCompanyId != null && companyIds.contains(String.valueOf(transCompanyId));
|
isComTrue = companyIds != null && transCompanyId != null && companyIds.contains(String.valueOf(transCompanyId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断产品范围
|
// 判断产品范围
|
||||||
boolean isGoodsTrue;
|
boolean isGoodsTrue;
|
||||||
if (goodsScope == GoodsScope.ALL) {
|
if (goodsScope == GoodsScope.ALL) {
|
||||||
|
|
@ -1877,7 +1884,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
} else {
|
} else {
|
||||||
isGoodsTrue = goodsIds != null && goodsId != null && goodsIds.contains(String.valueOf(goodsId));
|
isGoodsTrue = goodsIds != null && goodsId != null && goodsIds.contains(String.valueOf(goodsId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断站点范围
|
// 判断站点范围
|
||||||
boolean isStationsTrue;
|
boolean isStationsTrue;
|
||||||
if (stationsScope == StationsScope.ALL) {
|
if (stationsScope == StationsScope.ALL) {
|
||||||
|
|
@ -1885,7 +1892,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
} else {
|
} else {
|
||||||
isStationsTrue = stationsIds != null && stationId != null && stationsIds.contains(String.valueOf(stationId));
|
isStationsTrue = stationsIds != null && stationId != null && stationsIds.contains(String.valueOf(stationId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 只有当三个条件都为true时,才返回true
|
// 只有当三个条件都为true时,才返回true
|
||||||
return isComTrue && isGoodsTrue && isStationsTrue;
|
return isComTrue && isGoodsTrue && isStationsTrue;
|
||||||
})
|
})
|
||||||
|
|
@ -1950,7 +1957,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
if (null != param.getServiceFeeList() && param.getServiceFeeList().size() > 0) {
|
if (null != param.getServiceFeeList() && param.getServiceFeeList().size() > 0) {
|
||||||
List<OrderItemsParams> params = param.getServiceFeeList();
|
List<OrderItemsParams> params = param.getServiceFeeList();
|
||||||
for (OrderItemsParams itemsParam : params) {
|
for (OrderItemsParams itemsParam : params) {
|
||||||
OrderExpenseItemsEntity expenseItemsEntity = orderExpenseItemsService.getById(itemsParam.getId());
|
OrderExpenseItemsEntity expenseItemsEntity = orderExpenseItemsService.getById(itemsParam.getId());
|
||||||
if (null == expenseItemsEntity) {
|
if (null == expenseItemsEntity) {
|
||||||
throw Exceptions.clierr("服务费不存在,请检查参数");
|
throw Exceptions.clierr("服务费不存在,请检查参数");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue