修改团油统计bug

dev-discount
袁野 3 years ago
parent 3964924737
commit 4d99d9cdd6
  1. 46
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 25
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java

@ -842,57 +842,23 @@ public class HighOrderController {
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
Map<String, Object> mapSam = new HashMap<>();
Map<String, Object> mapOrg = new HashMap<>();
StringBuilder salesmanIds = new StringBuilder();
if (object.getInteger("organizationId") != null) { if (userInfoModel.getBsCompany() != null && userInfoModel.getSecUser().getAdminFlag().equals(1)) {
// 设置为空 map.put("companyId", userInfoModel.getBsCompany().getId());
salesmanIds.setLength(0);
// 查询代理商
mapOrg.put("orgId" , object.getInteger("organizationId"));
List<HighTyAgent> highTyAgentList = highTyAgentService.getAgentList(mapOrg);
for (HighTyAgent tyAgent : highTyAgentList) {
// 查询业务员
mapSam.put("tyAgentId" , tyAgent.getId());
List<HighTySalesman> salesmanList = highTySalesmanService.getSalesmanList(mapSam);
for (HighTySalesman salesman: salesmanList) {
salesmanIds.append(salesman.getId()).append(",");
}
} }
if (object.getInteger("organizationId") != null) {
map.put("orgId" , object.getInteger("organizationId"));
} }
if (object.getInteger("agentId") != null) { if (object.getInteger("agentId") != null) {
// 设置为空 map.put("agentId" , object.getInteger("agentId"));
salesmanIds.setLength(0);
// 查询业务员
mapOrg.put("tyAgentId" , object.getInteger("agentId"));
List<HighTySalesman> salesmanList = highTySalesmanService.getSalesmanList(mapOrg);
for (HighTySalesman salesman: salesmanList) {
salesmanIds.append(salesman.getId()).append(",");
}
} }
if (object.getInteger("gasSalesmanId") != null) { if (object.getInteger("gasSalesmanId") != null) {
// 设置为空 map.put("gasSalesmanId" , object.getInteger("gasSalesmanId"));
salesmanIds.setLength(0);
salesmanIds.append(object.getInteger("gasSalesmanId"));
// 判断当前账号有无业务员 并且不是公司主账号
} else if (!(userInfoModel.getSecRole().getRoleType() == 5 && userInfoModel.getSecUser().getAdminFlag() ==1) && salesmanIds.length() == 0){
salesmanIds.append(0);
} }
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("payType" , object.getInteger("payType"));
map.put("gasOilNo" , object.getString("gasOilNo")); map.put("gasOilNo" , object.getString("gasOilNo"));

@ -963,7 +963,10 @@ public interface HighOrderMapperExt {
"<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " , "<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " + "<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " +
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " + "<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " +
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) </if> " , "<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> " +
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> " ,
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> " ,
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} ) </if> " ,
") as hh; " , ") as hh; " ,
"</script>" "</script>"
}) })
@ -986,7 +989,10 @@ public interface HighOrderMapperExt {
"<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " , "<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " + "<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " +
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " + "<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " +
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) </if> " , "<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> " +
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> " ,
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> " ,
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} ) </if> " ,
") as hh; " , ") as hh; " ,
"</script>" "</script>"
}) })
@ -1006,7 +1012,10 @@ public interface HighOrderMapperExt {
"<if test='map.totalPrice != null'> <![CDATA[ and ho.total_price < #{map.totalPrice} ]]> </if> " , "<if test='map.totalPrice != null'> <![CDATA[ and ho.total_price < #{map.totalPrice} ]]> </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " , "<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " ,
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " , "<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " ,
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) </if> " , "<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> " +
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> " ,
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> " ,
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} ) </if> " ,
") as hh; " , ") as hh; " ,
"</script>" "</script>"
}) })
@ -1020,10 +1029,13 @@ public interface HighOrderMapperExt {
"from high_order ho join high_child_order hco on ho.id = hco.order_id ", "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) ", "where hco.goods_type = 3 and ho.order_status in (2, 3) ",
"<if test='map.payType != null'> and ho.pay_type = #{map.payType} </if> " , "<if test='map.payType != null'> and ho.pay_type = #{map.payType} </if> " ,
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> " +
"<if test='map.gasOilNo != null'> and hco.gas_oil_no = #{map.gasOilNo} </if> " , "<if test='map.gasOilNo != null'> and hco.gas_oil_no = #{map.gasOilNo} </if> " ,
"<if test='map.gasOilType != null'> and hco.gas_oil_type = #{map.gasOilType} </if> " , "<if test='map.gasOilType != null'> and hco.gas_oil_type = #{map.gasOilType} </if> " ,
"<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " , "<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " ,
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) </if> " , "<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> " ,
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> " ,
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} ) </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " , "<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " ,
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " , "<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " ,
"group by pay_type " , "group by pay_type " ,
@ -1043,7 +1055,10 @@ public interface HighOrderMapperExt {
"<if test='map.gasOilNo != null'> and hco.gas_oil_no = #{map.gasOilNo} </if> " , "<if test='map.gasOilNo != null'> and hco.gas_oil_no = #{map.gasOilNo} </if> " ,
"<if test='map.gasOilType != null'> and hco.gas_oil_type = #{map.gasOilType} </if> " , "<if test='map.gasOilType != null'> and hco.gas_oil_type = #{map.gasOilType} </if> " ,
"<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " , "<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " ,
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id in ( ${map.gasSalesmanId} ) </if> " , "<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> " +
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> " ,
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> " ,
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} ) </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " , "<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " ,
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " , "<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " ,
"group by hco.gas_oil_no " , "group by hco.gas_oil_no " ,

Loading…
Cancel
Save