Browse Source

接口部门搜索

anderx 3 years ago
parent
commit
844fa80e28

+ 31 - 13
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1317,11 +1317,17 @@
     <if test="projectId !=null">
       and a.commodity_id = #{projectId}
     </if>
-    <if test="depId !=null">
-      and b.order_dep = #{depId}
+    <if test="deps != null">
+      and b.order_dep in
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
+      </foreach>
     </if>
-    <if test="thchDepId !=null">
-      and td.id= #{thchDepId}
+    <if test="thchDeps != null">
+      and td.id in
+      <foreach close=")" collection="thchDep" item="thchDeps" open="(" separator=",">
+        #{thchDep}
+      </foreach>
     </if>
     <if test="projectStatus !=null">
       and bp.cid= #{projectStatus}
@@ -1367,7 +1373,7 @@
     <if test="projectStatus !=null or projectType !=null">
       left join business_project bp on a.commodity_id =bp.id
     </if>
-    <if test="thchDepId !=null">
+    <if test="thchDeps !=null">
       left join admin ta on a.task_receiver =ta.id
       left join department td on ta.department_id =td.id
     </if>
@@ -1422,11 +1428,17 @@
     <if test="projectId !=null">
       and a.commodity_id = #{projectId}
     </if>
-    <if test="depId !=null">
-      and b.order_dep = #{depId}
+    <if test="deps != null">
+      and b.order_dep in
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
+      </foreach>
     </if>
-    <if test="thchDepId !=null">
-      and td.id= #{thchDepId}
+    <if test="thchDeps != null">
+      and td.id in
+      <foreach close=")" collection="thchDep" item="thchDeps" open="(" separator=",">
+        #{thchDep}
+      </foreach>
     </if>
     <if test="projectStatus !=null">
       and bp.cid= #{projectStatus}
@@ -1482,8 +1494,11 @@
     <if test="province !=null">
     and b.dispatch_province = #{province}
     </if>
-    <if test="thchDepId !=null">
-    and b.duty_dep = #{thchDepId}
+    <if test="thchDeps !=null">
+    and b.duty_dep in
+      <foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
     </if>
     <if test="projectType !=null">
     and bp.`type` = #{projectType}
@@ -1521,8 +1536,11 @@
     <if test="province !=null">
       and b.dispatch_province = #{province}
     </if>
-    <if test="thchDepId !=null">
-      and b.duty_dep = #{thchDepId}
+    <if test="thchDeps !=null">
+      and b.duty_dep in
+      <foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
     </if>
     <if test="projectType !=null">
       and bp.`type` = #{projectType}

+ 15 - 10
src/main/java/com/goafanti/order/bo/InputProjectStatistics.java

@@ -4,8 +4,8 @@ public class InputProjectStatistics {
 
 	private String startDate;
 	private String endDate;
-	private String depId;
-	private String thchDepId;
+	private String deps;
+	private String thchDeps;
 	private String projectStatus;
 	private Integer projectType;
 	private String orderNo;
@@ -69,18 +69,23 @@ public class InputProjectStatistics {
 	public void setEndDate(String endDate) {
 		this.endDate = endDate;
 	}
-	public String getDepId() {
-		return depId;
+
+	public String getDeps() {
+		return deps;
 	}
-	public void setDepId(String depId) {
-		this.depId = depId;
+
+	public void setDeps(String deps) {
+		this.deps = deps;
 	}
-	public String getThchDepId() {
-		return thchDepId;
+
+	public String getThchDeps() {
+		return thchDeps;
 	}
-	public void setThchDepId(String thchDepId) {
-		this.thchDepId = thchDepId;
+
+	public void setThchDeps(String thchDeps) {
+		this.thchDeps = thchDeps;
 	}
+
 	public String getProjectStatus() {
 		return projectStatus;
 	}

+ 23 - 23
src/main/java/com/goafanti/order/bo/InputProvincialStatistics.java

@@ -3,37 +3,37 @@ package com.goafanti.order.bo;
 public class InputProvincialStatistics {
 
 	private String startDate;
-	
+
 	private String endDate;
-	
+
 	private Integer province;
-	
-	private String thchDepId;
-	
+
+	private String thchDeps;
+
 	private String projectStatus;
-	
+
 	private Integer projectType;
-	
+
 	private String projectId;
-	
+
 	private Integer pageSize;
-	
+
 	private Integer pageNo;
-	
+
 	private String provinceName;
 
 	private String thchDepName;
-	
+
 	private String projectStatusName;
-	
+
 	private String projectTypeName;
-	
+
 	private String projectName;
-	
+
 	private Integer status;
-	
-	
-	
+
+
+
 
 	public String getThchDepName() {
 		return thchDepName;
@@ -75,12 +75,12 @@ public class InputProvincialStatistics {
 		this.province = province;
 	}
 
-	public String getThchDepId() {
-		return thchDepId;
+	public String getThchDeps() {
+		return thchDeps;
 	}
 
-	public void setThchDepId(String thchDepId) {
-		this.thchDepId = thchDepId;
+	public void setThchDeps(String thchDeps) {
+		this.thchDeps = thchDeps;
 	}
 
 	public String getProjectStatus() {
@@ -154,6 +154,6 @@ public class InputProvincialStatistics {
 	public void setProvinceName(String provinceName) {
 		this.provinceName = provinceName;
 	}
-	
-	
+
+
 }

+ 10 - 6
src/main/java/com/goafanti/order/service/impl/ProjectStatisticsServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.*;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponseWrapper;
 
+import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.*;
@@ -23,6 +24,7 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -41,6 +43,8 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 
 	@Value("${upload.path}")
 	private String downloadPath;
+	@Autowired
+	private DepartmentService departmentService;
 
 
 	@SuppressWarnings("unchecked")
@@ -50,8 +54,8 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 		Integer pageNo=1,pageSize=10;
 		if(ps.getStartDate()!=null)params.put("startDate", ps.getStartDate());
 		if(ps.getEndDate()!=null)params.put("endDate", ps.getEndDate()+" 23:59:59");
-		if(ps.getDepId()!=null)params.put("depId", ps.getDepId());
-		if(ps.getThchDepId()!=null)params.put("thchDepId", ps.getThchDepId());
+		if(ps.getDeps()!=null)params.put("deps", departmentService.parseArray(ps.getDeps()));
+		if(ps.getThchDeps()!=null)params.put("thchDeps", departmentService.parseArray(ps.getThchDeps()));
 		if(ps.getProjectStatus()!=null)params.put("projectStatus", ps.getProjectStatus());
 		if(ps.getProjectType()!=null)params.put("projectType", ps.getProjectType());
 		if(ps.getOrderNo()!=null)params.put("orderNo", ps.getOrderNo());
@@ -187,8 +191,8 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 			str=StringUtils.join(str,i++,"-筛选分类:",screenName,"   ");
 		}
 		if(ib.getProvinceName()!=null)str=StringUtils.join(str,i++,"-省份:",ib.getProvinceName(),"   ");
-		if(ib.getDepId()!=null)str=StringUtils.join(str,i++,"-订单部门:",ib.getDepName(),"   ");
-		if(ib.getThchDepId()!=null)str=StringUtils.join(str,i++,"-责任部门:",ib.getThchDepName(),"   ");
+		if(ib.getDeps()!=null)str=StringUtils.join(str,i++,"-订单部门:",ib.getDepName(),"   ");
+		if(ib.getThchDeps()!=null)str=StringUtils.join(str,i++,"-责任部门:",ib.getThchDepName(),"   ");
 		if(ib.getProjectStatus()!=null)str=StringUtils.join(str,i++,"-项目别类:",ib.getProjectStatusName(),"   ");
 		if(ib.getProjectType()!=null)str=StringUtils.join(str,i++,"-项目分类:",ib.getProjectTypeName(),"   ");
 		if(ib.getOrderNo()!=null)str=StringUtils.join(str,i++,"-订单编号:",ib.getOrderNo(),"   ");
@@ -234,7 +238,7 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 		Integer pageNo=1,pageSize=10;
 		if(is.getStartDate()!=null)params.put("startDate", is.getStartDate());
 		if(is.getEndDate()!=null)params.put("endDate", is.getEndDate()+" 23:59:59");
-		if(is.getThchDepId()!=null)params.put("thchDepId", is.getThchDepId());
+		if(is.getThchDeps()!=null)params.put("thchDeps", departmentService.parseArray(is.getThchDeps()));
 		if(is.getProjectStatus()!=null)params.put("projectStatus", is.getProjectStatus());
 		if(is.getProjectType()!=null)params.put("projectType", is.getProjectType());
 		if(is.getProvince()!=null)params.put("province", is.getProvince());
@@ -372,7 +376,7 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 		if(ib.getStartDate()!=null) str=StringUtils.join(str,i++,"-开始时间:",ib.getStartDate(),"   ");
 		if(ib.getEndDate()!=null)str=StringUtils.join(str,i++,"-结束时间:",ib.getEndDate(),"   ");
 		if(ib.getProvince()!=null)str=StringUtils.join(str,i++,"-省份:",ib.getProvinceName(),"   ");
-		if(ib.getThchDepId()!=null)str=StringUtils.join(str,i++,"-责任部门:",ib.getThchDepName(),"   ");
+		if(ib.getThchDeps()!=null)str=StringUtils.join(str,i++,"-责任部门:",ib.getThchDepName(),"   ");
 		if(ib.getProjectStatus()!=null)str=StringUtils.join(str,i++,"-项目别类:",ib.getProjectStatusName(),"   ");
 		if(ib.getProjectType()!=null)str=StringUtils.join(str,i++,"-项目分类:",ib.getProjectTypeName(),"   ");
 		if(ib.getProjectId()!=null)str=StringUtils.join(str,i++,"-项目名称:",ib.getProjectName(),"   ");