Browse Source

高新复审统计开发

anderx 4 years ago
parent
commit
882b917862

+ 4 - 4
src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java

@@ -3,10 +3,7 @@ package com.goafanti.common.dao;
 import com.goafanti.common.bo.OrderOperator;
 import com.goafanti.common.bo.UserOrderTask;
 import com.goafanti.common.model.TOrderTask;
-import com.goafanti.order.bo.OutHighNewRetrialStatistics;
-import com.goafanti.order.bo.TOrderTaskBo;
-import com.goafanti.order.bo.TOrderTaskDetailBo;
-import com.goafanti.order.bo.TOrderTaskListBo;
+import com.goafanti.order.bo.*;
 import com.goafanti.organization.bo.ProjectTypePuls;
 
 import java.math.BigDecimal;
@@ -95,4 +92,7 @@ public interface TOrderTaskMapper {
     List<OutHighNewRetrialStatistics> highNewRetrialStatistics(@Param("depId") String depId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
     int getHighNewRetrial(String orderNo);
+
+	List<OutHighNewRetrialList> highNewRetrialList(@Param("province") String province, @Param("depId") String depId, @Param("aid") String aid,
+												   @Param("sort") Integer sort, @Param("startDate") String startDate, @Param("endDate") String endDate);
 }

+ 32 - 0
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -2183,4 +2183,36 @@ inner join department de on x.department_id=de.id left join business_category bc
     left join t_order_task c on b.order_no =c.order_no left join business_project d on c.commodity_id =d.id
     where a.order_no =#{orderNo} and b.create_time &lt; a.create_time and d.`type` =5
   </select>
+  <select id="highNewRetrialList" resultType="com.goafanti.order.bo.OutHighNewRetrialList">
+    select t1.province,dg.name provinceName,t1.salesman_id aid,t1.name name,t1.quantity,t1.pass,t1.notPass,t1.signBacks
+    from (SELECT e.province,c.salesman_id,d.name ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,
+     sum(if(a.project_status != 10,1,0))notPass, sum(ttm.high_new_retrial)signBacks
+    from t_order_task a left join business_project b on a.commodity_id =b.id left join t_task_mid ttm on a.id=ttm.tid
+    left join t_order_new c on a.order_no =c.order_no  left join admin d on c.salesman_id =d.id
+    left join department e on d.department_id =e.id where b.`type` =5  and c.process_status >4
+    <if test="province!=null">
+      and e.province= #{province}
+    </if>
+    <if test="depId!=null">
+      and e.id= #{depId}
+    </if>
+    <if test="startDate!=null and endDate!=null">
+      and c.sign_time  between #{startDate} and #{endDate}
+    </if>
+    <if test="aid !=null">
+      and c.salesman_id = #{aid}
+    </if>
+    <if test="depId !=null">
+      and d.department_id = #{depId}
+    </if>
+    group by e.province ,c.salesman_id ,d.name )t1 left join district_glossory dg on t1.province=dg.id
+    order by
+    <if test="sort==0">
+      t1.pass
+    </if>
+    <if test="sort==1">
+      t1.notPass
+    </if>
+    desc
+  </select>
 </mapper>

+ 86 - 0
src/main/java/com/goafanti/order/bo/OutHighNewRetrialList.java

@@ -0,0 +1,86 @@
+package com.goafanti.order.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+public class OutHighNewRetrialList {
+
+
+    private Integer province;
+    @Excel(name = "省份")
+    private String provinceName;
+    @Excel(name = "高新总数")
+    private Integer quantity;
+    @Excel(name = "已通过高新数")
+    private Integer pass;
+    private String aid;
+    @Excel(name = "跟进人")
+    private String name;
+    @Excel(name = "已回签")
+    private Integer signBacks;
+    @Excel(name = "未通过高新数")
+    private Integer notPass;
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public String getProvinceName() {
+        return provinceName;
+    }
+
+    public void setProvinceName(String provinceName) {
+        this.provinceName = provinceName;
+    }
+
+    public Integer getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(Integer quantity) {
+        this.quantity = quantity;
+    }
+
+    public Integer getPass() {
+        return pass;
+    }
+
+    public void setPass(Integer pass) {
+        this.pass = pass;
+    }
+
+    public Integer getSignBacks() {
+        return signBacks;
+    }
+
+    public void setSignBacks(Integer signBacks) {
+        this.signBacks = signBacks;
+    }
+
+    public Integer getNotPass() {
+        return notPass;
+    }
+
+    public void setNotPass(Integer notPass) {
+        this.notPass = notPass;
+    }
+}

+ 29 - 1
src/main/java/com/goafanti/order/controller/OrderProjectApiController.java

@@ -443,7 +443,6 @@ public class OrderProjectApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/highNewRetrialStatistics/export",method = RequestMethod.GET)
 	public Result highNewRetrialStatisticsExport(String depId,String startDate,String endDate,String depName) {
-		Result res =new Result();
 		List<OutHighNewRetrialStatistics>  list=orderProjectService.highNewRetrialStatistics(depId,startDate,endDate);
 		NewExcelUtil<OutHighNewRetrialStatistics> newExcelUtil=new NewExcelUtil<>(OutHighNewRetrialStatistics.class);
 		StringBuffer str=new StringBuffer("搜索条件=》");
@@ -451,6 +450,35 @@ public class OrderProjectApiController extends CertifyApiController {
 		if (startDate!=null&&endDate!=null)str=str.append("时间:").append(startDate).append("~").append(endDate).append(",");
 		return newExcelUtil.exportExcel(list,"高新复审统计",uploadPath,str.substring(0,str.toString().length()-1));
 	}
+
+	/**
+	 * 高新复审详情列表
+	 */
+	@RequestMapping(value = "/highNewRetrialList",method = RequestMethod.GET)
+	public Result highNewRetrialList(String province,String depId,String startDate,String endDate,String aid,Integer sort) {
+		Result res =new Result();
+		res.data(orderProjectService.highNewRetrialList(province,depId,aid,sort,startDate,endDate));
+		return res;
+	}
+
+	@RequestMapping(value = "/highNewRetrialList/export",method = RequestMethod.GET)
+	public Result highNewRetrialListExport(String province,String provinceName,String depId,String depName,String startDate,String endDate,String aid,
+										   String aName,Integer sort) {
+
+		List<OutHighNewRetrialList>  list=orderProjectService.highNewRetrialList(province,depId,aid,sort,startDate,endDate);
+		NewExcelUtil<OutHighNewRetrialList> newExcelUtil=new NewExcelUtil<>(OutHighNewRetrialList.class);
+		StringBuffer str=new StringBuffer("搜索条件=》");
+		if (provinceName!=null)str=str.append("省份:").append(provinceName).append(",");
+		if (depName!=null)str=str.append("部门:").append(depName).append(",");
+		if (aName!=null)str=str.append("跟进人:").append(aName).append(",");
+		if (startDate!=null&&endDate!=null)str=str.append("时间:").append(startDate).append("~").append(endDate).append(",");
+		if(sort!=null){
+			str=str.append("排序:");
+			if(sort==0)str=str.append("按签通过高新排序");
+			else if(sort==1)str=str.append("按未通过高新排序");
+		}
+		return newExcelUtil.exportExcel(list,"高新复审详情",uploadPath,str.substring(0,str.toString().length()-1));
+	}
 	
 	
 	

+ 2 - 0
src/main/java/com/goafanti/order/service/OrderProjectService.java

@@ -79,4 +79,6 @@ public interface OrderProjectService {
 
 
     List<OutHighNewRetrialStatistics> highNewRetrialStatistics(String depId, String startDate, String endDate);
+
+	List<OutHighNewRetrialList> highNewRetrialList(String province, String depId, String aid, Integer sort, String startDate, String endDate);
 }

+ 7 - 0
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -1018,4 +1018,11 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		return tOrderTaskMapper.highNewRetrialStatistics(depId,startDate,endDate);
 	}
 
+	@Override
+	public List<OutHighNewRetrialList> highNewRetrialList(String province, String depId, String aid, Integer sort, String startDate, String endDate) {
+		endDate=endDate+" 23:59:59";
+		if (sort==null)sort=0;
+		return tOrderTaskMapper.highNewRetrialList( province,  depId,  aid,  sort,  startDate,  endDate);
+	}
+
 }