|
@@ -10,10 +10,16 @@ import java.util.*;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.servlet.http.HttpServletResponseWrapper;
|
|
import javax.servlet.http.HttpServletResponseWrapper;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.goafanti.admin.service.DepartmentService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.utils.excel.NewExcelUtil;
|
|
import com.goafanti.common.utils.excel.NewExcelUtil;
|
|
|
import com.goafanti.order.bo.*;
|
|
import com.goafanti.order.bo.*;
|
|
|
import com.goafanti.order.bo.outStatistics.*;
|
|
import com.goafanti.order.bo.outStatistics.*;
|
|
|
|
|
+import com.google.gson.JsonArray;
|
|
|
|
|
+import com.google.gson.JsonObject;
|
|
|
import groovy.util.logging.Log4j;
|
|
import groovy.util.logging.Log4j;
|
|
|
import org.apache.commons.collections4.map.HashedMap;
|
|
import org.apache.commons.collections4.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -23,6 +29,7 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -41,6 +48,8 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
|
|
|
|
|
|
|
|
@Value("${upload.path}")
|
|
@Value("${upload.path}")
|
|
|
private String downloadPath;
|
|
private String downloadPath;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DepartmentService departmentService;
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
@@ -50,8 +59,8 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
|
|
|
Integer pageNo=1,pageSize=10;
|
|
Integer pageNo=1,pageSize=10;
|
|
|
if(ps.getStartDate()!=null)params.put("startDate", ps.getStartDate());
|
|
if(ps.getStartDate()!=null)params.put("startDate", ps.getStartDate());
|
|
|
if(ps.getEndDate()!=null)params.put("endDate", ps.getEndDate()+" 23:59:59");
|
|
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.getProjectStatus()!=null)params.put("projectStatus", ps.getProjectStatus());
|
|
|
if(ps.getProjectType()!=null)params.put("projectType", ps.getProjectType());
|
|
if(ps.getProjectType()!=null)params.put("projectType", ps.getProjectType());
|
|
|
if(ps.getOrderNo()!=null)params.put("orderNo", ps.getOrderNo());
|
|
if(ps.getOrderNo()!=null)params.put("orderNo", ps.getOrderNo());
|
|
@@ -78,8 +87,6 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
|
|
|
params.put("amountEnd", e);
|
|
params.put("amountEnd", e);
|
|
|
}
|
|
}
|
|
|
params.put("status",ps.getStatus()==null?0:ps.getStatus());
|
|
params.put("status",ps.getStatus()==null?0:ps.getStatus());
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
if(ps.getProvince()!=null) params.put("province", ps.getProvince());
|
|
if(ps.getProvince()!=null) params.put("province", ps.getProvince());
|
|
|
if(ps.getProjectId()!=null) params.put("projectId", ps.getProjectId());
|
|
if(ps.getProjectId()!=null) params.put("projectId", ps.getProjectId());
|
|
|
if(ps.getScreen()!=null) params.put("screen", ps.getScreen());
|
|
if(ps.getScreen()!=null) params.put("screen", ps.getScreen());
|
|
@@ -151,11 +158,32 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
|
|
|
}
|
|
}
|
|
|
NewExcelUtil<OutProjectStatisticsPatent> excelUtil=new NewExcelUtil<>(OutProjectStatisticsPatent.class);
|
|
NewExcelUtil<OutProjectStatisticsPatent> excelUtil=new NewExcelUtil<>(OutProjectStatisticsPatent.class);
|
|
|
res=excelUtil.exportExcel(tl,"项目汇总表(专利)",downloadPath);
|
|
res=excelUtil.exportExcel(tl,"项目汇总表(专利)",downloadPath);
|
|
|
|
|
+ }else if (ib.getStatus()==5){//会员
|
|
|
|
|
+ List<OutProjectStatisticsMember> tl=new ArrayList<>();
|
|
|
|
|
+ for (OutProjectStatistics o : list) {
|
|
|
|
|
+ OutProjectStatisticsMember member = new OutProjectStatisticsMember();
|
|
|
|
|
+ BeanUtils.copyProperties(o,member);
|
|
|
|
|
+ if (member.getServiceLife()!=null){
|
|
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(member.getServiceLife());
|
|
|
|
|
+ Object[] object=jsonArray.stream().toArray();
|
|
|
|
|
+ member.setServiceLife(StringUtils.join(object,","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (member.getContractTerm()!=null){
|
|
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(member.getContractTerm());
|
|
|
|
|
+ Object[] object=jsonArray.stream().toArray();
|
|
|
|
|
+ member.setContractTerm(StringUtils.join(object,"~"));
|
|
|
|
|
+ }
|
|
|
|
|
+ tl.add(member);
|
|
|
|
|
+ }
|
|
|
|
|
+ NewExcelUtil<OutProjectStatisticsMember> excelUtil=new NewExcelUtil<>(OutProjectStatisticsMember.class);
|
|
|
|
|
+ res=excelUtil.exportExcel(tl,"项目汇总表(会员)",downloadPath);
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 处理搜索条件
|
|
* 处理搜索条件
|
|
|
* @param ib
|
|
* @param ib
|
|
@@ -187,8 +215,8 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
|
|
|
str=StringUtils.join(str,i++,"-筛选分类:",screenName," ");
|
|
str=StringUtils.join(str,i++,"-筛选分类:",screenName," ");
|
|
|
}
|
|
}
|
|
|
if(ib.getProvinceName()!=null)str=StringUtils.join(str,i++,"-省份:",ib.getProvinceName()," ");
|
|
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.getProjectStatus()!=null)str=StringUtils.join(str,i++,"-项目别类:",ib.getProjectStatusName()," ");
|
|
|
if(ib.getProjectType()!=null)str=StringUtils.join(str,i++,"-项目分类:",ib.getProjectTypeName()," ");
|
|
if(ib.getProjectType()!=null)str=StringUtils.join(str,i++,"-项目分类:",ib.getProjectTypeName()," ");
|
|
|
if(ib.getOrderNo()!=null)str=StringUtils.join(str,i++,"-订单编号:",ib.getOrderNo()," ");
|
|
if(ib.getOrderNo()!=null)str=StringUtils.join(str,i++,"-订单编号:",ib.getOrderNo()," ");
|
|
@@ -234,7 +262,7 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
|
|
|
Integer pageNo=1,pageSize=10;
|
|
Integer pageNo=1,pageSize=10;
|
|
|
if(is.getStartDate()!=null)params.put("startDate", is.getStartDate());
|
|
if(is.getStartDate()!=null)params.put("startDate", is.getStartDate());
|
|
|
if(is.getEndDate()!=null)params.put("endDate", is.getEndDate()+" 23:59:59");
|
|
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.getProjectStatus()!=null)params.put("projectStatus", is.getProjectStatus());
|
|
|
if(is.getProjectType()!=null)params.put("projectType", is.getProjectType());
|
|
if(is.getProjectType()!=null)params.put("projectType", is.getProjectType());
|
|
|
if(is.getProvince()!=null)params.put("province", is.getProvince());
|
|
if(is.getProvince()!=null)params.put("province", is.getProvince());
|
|
@@ -372,7 +400,7 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
|
|
|
if(ib.getStartDate()!=null) str=StringUtils.join(str,i++,"-开始时间:",ib.getStartDate()," ");
|
|
if(ib.getStartDate()!=null) str=StringUtils.join(str,i++,"-开始时间:",ib.getStartDate()," ");
|
|
|
if(ib.getEndDate()!=null)str=StringUtils.join(str,i++,"-结束时间:",ib.getEndDate()," ");
|
|
if(ib.getEndDate()!=null)str=StringUtils.join(str,i++,"-结束时间:",ib.getEndDate()," ");
|
|
|
if(ib.getProvince()!=null)str=StringUtils.join(str,i++,"-省份:",ib.getProvinceName()," ");
|
|
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.getProjectStatus()!=null)str=StringUtils.join(str,i++,"-项目别类:",ib.getProjectStatusName()," ");
|
|
|
if(ib.getProjectType()!=null)str=StringUtils.join(str,i++,"-项目分类:",ib.getProjectTypeName()," ");
|
|
if(ib.getProjectType()!=null)str=StringUtils.join(str,i++,"-项目分类:",ib.getProjectTypeName()," ");
|
|
|
if(ib.getProjectId()!=null)str=StringUtils.join(str,i++,"-项目名称:",ib.getProjectName()," ");
|
|
if(ib.getProjectId()!=null)str=StringUtils.join(str,i++,"-项目名称:",ib.getProjectName()," ");
|