From 4d99d9cdd66fecbd0d405b61cacd034802fe4f56 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 11 Apr 2022 16:37:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=A2=E6=B2=B9=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighOrderController.java | 48 +++---------------- .../java/com/hai/dao/HighOrderMapperExt.java | 25 ++++++++-- 2 files changed, 27 insertions(+), 46 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index 6c851141..3db7ae49 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -842,57 +842,23 @@ public class HighOrderController { UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); Map map = new HashMap<>(); - Map mapSam = new HashMap<>(); - Map mapOrg = new HashMap<>(); - StringBuilder salesmanIds = new StringBuilder(); - if (object.getInteger("organizationId") != null) { - // 设置为空 - salesmanIds.setLength(0); - // 查询代理商 - mapOrg.put("orgId" , object.getInteger("organizationId")); - List highTyAgentList = highTyAgentService.getAgentList(mapOrg); - - for (HighTyAgent tyAgent : highTyAgentList) { - // 查询业务员 - mapSam.put("tyAgentId" , tyAgent.getId()); - List salesmanList = highTySalesmanService.getSalesmanList(mapSam); - for (HighTySalesman salesman: salesmanList) { - salesmanIds.append(salesman.getId()).append(","); - } - } + if (userInfoModel.getBsCompany() != null && userInfoModel.getSecUser().getAdminFlag().equals(1)) { + map.put("companyId", userInfoModel.getBsCompany().getId()); + } + if (object.getInteger("organizationId") != null) { + map.put("orgId" , object.getInteger("organizationId")); } if (object.getInteger("agentId") != null) { - // 设置为空 - salesmanIds.setLength(0); - // 查询业务员 - mapOrg.put("tyAgentId" , object.getInteger("agentId")); - List salesmanList = highTySalesmanService.getSalesmanList(mapOrg); - for (HighTySalesman salesman: salesmanList) { - salesmanIds.append(salesman.getId()).append(","); - } + map.put("agentId" , object.getInteger("agentId")); } if (object.getInteger("gasSalesmanId") != null) { - // 设置为空 - salesmanIds.setLength(0); - salesmanIds.append(object.getInteger("gasSalesmanId")); - - // 判断当前账号有无业务员 并且不是公司主账号 - } else if (!(userInfoModel.getSecRole().getRoleType() == 5 && userInfoModel.getSecUser().getAdminFlag() ==1) && salesmanIds.length() == 0){ - salesmanIds.append(0); + map.put("gasSalesmanId" , object.getInteger("gasSalesmanId")); } - if (salesmanIds.length() == 0) { - map.put("gasSalesmanId" , null); - } else if (salesmanIds.length() == 1){ - map.put("gasSalesmanId" , salesmanIds.toString()); - } else { - salesmanIds.deleteCharAt(salesmanIds.length() - 1); - map.put("gasSalesmanId" , salesmanIds.toString()); - } map.put("payType" , object.getInteger("payType")); map.put("gasOilNo" , object.getString("gasOilNo")); diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index 47d22d0c..2d9d11c5 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -963,7 +963,10 @@ public interface HighOrderMapperExt { " and hco.goods_id = #{map.goodsId} " , " = #{map.createTimeS} ]]> " + " " + - " and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) " , + " AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) " + + " and hco.gas_salesman_id = #{map.gasSalesmanId} " , + " and hco.gas_org_id = #{map.orgId} " , + " and hco.gas_agent_id = #{map.agentId} ) " , ") as hh; " , "" }) @@ -986,7 +989,10 @@ public interface HighOrderMapperExt { " and hco.goods_id = #{map.goodsId} " , " = #{map.createTimeS} ]]> " + " " + - " and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) " , + " AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) " + + " and hco.gas_salesman_id = #{map.gasSalesmanId} " , + " and hco.gas_org_id = #{map.orgId} " , + " and hco.gas_agent_id = #{map.agentId} ) " , ") as hh; " , "" }) @@ -1006,7 +1012,10 @@ public interface HighOrderMapperExt { " " , " = #{map.createTimeS} ]]> " , " " , - " and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) " , + " AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) " + + " and hco.gas_salesman_id = #{map.gasSalesmanId} " , + " and hco.gas_org_id = #{map.orgId} " , + " and hco.gas_agent_id = #{map.agentId} ) " , ") as hh; " , "" }) @@ -1020,10 +1029,13 @@ public interface HighOrderMapperExt { "from high_order ho join high_child_order hco on ho.id = hco.order_id ", "where hco.goods_type = 3 and ho.order_status in (2, 3) ", " and ho.pay_type = #{map.payType} " , + " AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) " + " and hco.gas_oil_no = #{map.gasOilNo} " , " and hco.gas_oil_type = #{map.gasOilType} " , " and hco.goods_id = #{map.goodsId} " , - " and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) " , + " and hco.gas_salesman_id = #{map.gasSalesmanId} " , + " and hco.gas_org_id = #{map.orgId} " , + " and hco.gas_agent_id = #{map.agentId} ) " , " = #{map.createTimeS} ]]> " , " " , "group by pay_type " , @@ -1043,7 +1055,10 @@ public interface HighOrderMapperExt { " and hco.gas_oil_no = #{map.gasOilNo} " , " and hco.gas_oil_type = #{map.gasOilType} " , " and hco.goods_id = #{map.goodsId} " , - " and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) " , + " AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) " + + " and hco.gas_salesman_id = #{map.gasSalesmanId} " , + " and hco.gas_org_id = #{map.orgId} " , + " and hco.gas_agent_id = #{map.agentId} ) " , " = #{map.createTimeS} ]]> " , " " , "group by hco.gas_oil_no " ,