|
|
@@ -148,8 +148,19 @@ public class CorpsDescController extends BladeController {
|
|
|
@GetMapping("/page")
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
@ApiOperation(value = "分页", notes = "传入corpsDesc")
|
|
|
- public R<IPage<CorpsDescVO>> page(CorpsDescVO corpsDesc, Query query) {
|
|
|
- IPage<CorpsDescVO> pages = corpsDescService.selectCorpsDescPage(Condition.getPage(query), corpsDesc);
|
|
|
+ public R<IPage<PjCorpsDesc>> page(CorpsDescVO corpsDesc, Query query) {
|
|
|
+ LambdaQueryWrapper<PjCorpsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(PjCorpsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjCorpsDesc::getIsDeleted, 0)
|
|
|
+ .like(PjCorpsDesc::getCname, corpsDesc.getCname())
|
|
|
+ .apply("find_in_set(corp_type,'" + corpsDesc.getCorpType() + "')")
|
|
|
+ .eq(PjCorpsDesc::getSalesCompanyId, AuthUtil.getDeptId());
|
|
|
+ if (!AuthUtil.getUserRole().contains("admin")) {
|
|
|
+ if (AuthUtil.getUserRole().contains("业务员")) {
|
|
|
+ lambdaQueryWrapper.eq(PjCorpsDesc::getSalesmanId,AuthUtil.getUserId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ IPage<PjCorpsDesc> pages = corpsDescService.page(Condition.getPage(query),lambdaQueryWrapper);
|
|
|
return R.data(pages);
|
|
|
}
|
|
|
|
|
|
@@ -640,7 +651,7 @@ public class CorpsDescController extends BladeController {
|
|
|
.eq(PjCorpsDesc::getCorpType, "KH");
|
|
|
//客户总数量
|
|
|
int count = corpsDescService.count(corpsDescQueryWrapper);
|
|
|
- coreCorp = orderService.coreCorp(AuthUtil.getTenantId(),"XS",AuthUtil.getDeptId());
|
|
|
+ coreCorp = orderService.coreCorp(AuthUtil.getTenantId(), "XS", AuthUtil.getDeptId());
|
|
|
unsales = count - coreCorp;
|
|
|
if (unsales > 0) {
|
|
|
lossRate = lossRate.add(new BigDecimal(unsales).divide(new BigDecimal(count), MathContext.DECIMAL32));
|