From 5a28d8beb970357d72f6f6de679c246e0b1c432b Mon Sep 17 00:00:00 2001 From: mzr <1562242162@qq.com> Date: Thu, 31 Oct 2024 14:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=BA=93=E5=AD=98=E7=9B=98?= =?UTF-8?q?=E7=82=B9=E6=98=8E=E7=BB=86-=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/stock/StockReportController.java | 10 +- .../stock/ClientStockReportMapper.xml | 91 +++++++++++++++++++ 2 files changed, 99 insertions(+), 2 deletions(-) diff --git a/crm-admin/src/main/java/com/yb/lb/webapp/stock/StockReportController.java b/crm-admin/src/main/java/com/yb/lb/webapp/stock/StockReportController.java index 390bced..5208231 100644 --- a/crm-admin/src/main/java/com/yb/lb/webapp/stock/StockReportController.java +++ b/crm-admin/src/main/java/com/yb/lb/webapp/stock/StockReportController.java @@ -135,6 +135,8 @@ public class StockReportController extends BaseController { @ApiParam(required = true, value = "开始日期") @RequestParam(required = true) String startDate, @ApiParam(required = true, value = "结束日期") @RequestParam(required = true) String endDate, @ApiParam(required = false, value = "客户id") @RequestParam(required = false) String clientId, + @ApiParam(required = false, value = "客户编码U8") @RequestParam(required = false) String uecode, + @ApiParam(required = false, value = "客户名称") @RequestParam(required = false) String clientName, @ApiParam(required = false, value = "业务员名称") @RequestParam(required = false) String staffName, @ApiParam(required = false, value = "部门名称") @RequestParam(required = false) String areaName, @ApiParam(required = true, value = "页码", defaultValue = "1") @RequestParam(value = "page") Integer pageNum, @@ -146,11 +148,15 @@ public class StockReportController extends BaseController { if (!redisService.isKey(token)) { return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录"); } - Map tokenMap = redisService.hmget(token); - params.put("companyId", tokenMap.get("companyId")); + params = roleDateUtils.roleUtiles(token, "", "", ""); + if ("0".equals(params.get("code"))) { + return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看"); + } params.put("startDate", startDate); params.put("endDate", endDate); params.put("clientId", clientId); + params.put("uecode", uecode); + params.put("clientName", clientName); params.put("staffName", staffName); params.put("areaName", areaName); params.put("page", pageNum); diff --git a/crm-common/src/main/resources/mapper/mapper_oracle/stock/ClientStockReportMapper.xml b/crm-common/src/main/resources/mapper/mapper_oracle/stock/ClientStockReportMapper.xml index c0e9866..dbf9fee 100644 --- a/crm-common/src/main/resources/mapper/mapper_oracle/stock/ClientStockReportMapper.xml +++ b/crm-common/src/main/resources/mapper/mapper_oracle/stock/ClientStockReportMapper.xml @@ -70,12 +70,103 @@ AND t0.id = #{clientId} + + AND t0.uecode = #{uecode} + + + AND t0.distributor_name = #{clientName} + AND csui.name = #{staffName} AND cmai.area_name = #{areaName} + + + + + and (t0.ancestors LIKE '%' || #{areaId1} || '%' + or + t0.marketing_area_id = #{areaId1} + ) + + + and t0.marketing_area_id = #{areaId2} + + + and t0.marketing_area_id in + + #{item} + + + + + + + and (t0.ancestors LIKE '%' || #{areaId1} || '%' + or + t0.marketing_area_id = #{areaId1} + + or t0.marketing_area_id in + + #{item} + + + ) + + + + + + and (t0.marketing_area_id = #{areaId2} + + or t0.marketing_area_id in + + #{item} + + + ) + + + + + and ( + t0.region in + + #{item} + + + or t0.marketing_area_id in + + #{item} + + + ) + + + + + and t0.region = #{region} + + + and t0.region in + + #{item} + + + + and t0.marketing_area_id = #{areaId} + + + + + AND ( + t0.id LIKE '%' || #{userId} || '%' + OR + t0.service_id LIKE '%' || #{userId} || '%' + ) + \ No newline at end of file