|
@@ -1238,8 +1238,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
membRowData.add("");
|
|
|
membRowData.add("");
|
|
|
}
|
|
|
- membRowData.add((String)membMap.get("name"));
|
|
|
- membRowData.add((String)membMap.get("departmentName"));
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ membRowData.add((String)("$userName="+membMap.get("corpwxUserId")+"$"));
|
|
|
+ if(membMap.get("departmentName").equals("未分配")){
|
|
|
+ membRowData.add("未分配");
|
|
|
+ }else {
|
|
|
+ membRowData.add((String)("$departmentName="+membMap.get("corpwxDeptId")+"$"));
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ membRowData.add((String)membMap.get("name"));
|
|
|
+ membRowData.add((String)membMap.get("departmentName"));
|
|
|
+ }
|
|
|
if(functionTimeList.size()>0){
|
|
|
membRowData.add(((Double)membMap.get("cost")).toString());
|
|
|
}
|
|
@@ -1697,7 +1706,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
Optional<User> first = userList.stream().filter(u -> u.getId().equals(project.getInchargerId())).findFirst();
|
|
|
if (first.isPresent()) {
|
|
|
User incharger = first.get();
|
|
|
- data.add(incharger.getName());
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ data.add("$userName="+incharger.getCorpwxUserid()+"$");
|
|
|
+ }else {
|
|
|
+ data.add(incharger.getName());
|
|
|
+ }
|
|
|
} else {
|
|
|
data.add("");
|
|
|
}
|
|
@@ -1712,7 +1725,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
//String fileName = "项目报表_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.projectReport")+System.currentTimeMillis();
|
|
|
- ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
httpRespMsg.data = pathPrefix + fileName+".xls";
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -1756,6 +1773,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
Integer companyId = user.getCompanyId();
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
QueryWrapper<Project> queryWrapper = new QueryWrapper<Project>().eq("company_id", companyId);
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
List<Project> projectAllList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
|
|
@@ -1790,7 +1808,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
data.add(task.get("project_code") == null?"":task.get("project_code").toString());
|
|
|
data.add(task.get("project_name") == null?"":task.get("project_name").toString());
|
|
|
data.add(task.get("name") != null?task.get("name").toString():"");
|
|
|
- data.add(task.get("executor_name") != null?task.get("executor_name").toString():"");
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ if(task.get("executor_id")!=null){
|
|
|
+ User us = userList.stream().filter(ul -> ul.getId().equals(task.get("executor_id"))).findFirst().get();
|
|
|
+ data.add(us.getCorpwxUserid() == null?"":us.getCorpwxUserid());
|
|
|
+ }else {
|
|
|
+ data.add("");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ data.add(task.get("executor_name") != null?task.get("executor_name").toString():"");
|
|
|
+ }
|
|
|
data.add(task.get("plan_hours") != null?task.get("plan_hours").toString():"");
|
|
|
data.add(task.get("real_hours").toString());
|
|
|
data.add(task.get("task_status")==null?"":statusNames[Integer.parseInt(task.get("task_status").toString())]);
|
|
@@ -1800,7 +1827,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
//String fileName = "项目任务报表_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.projectTaskReport")+System.currentTimeMillis();
|
|
|
- ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
httpRespMsg.data = pathPrefix + fileName+".xls";
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -1888,7 +1919,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
//String fileName = "项目成本报表_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.projectCostReport")+System.currentTimeMillis();
|
|
|
- ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
httpRespMsg.data = pathPrefix + fileName+".xls";
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -2005,7 +2040,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
//String fileName = "项目收支平衡报表(利润表)_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.profitSta")+System.currentTimeMillis();
|
|
|
- ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
httpRespMsg.data = pathPrefix + fileName+".xls";
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -2074,7 +2113,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
//String fileName = "客户项目利润报表_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.cusPro")+System.currentTimeMillis();
|
|
|
- ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
httpRespMsg.data = pathPrefix + fileName+".xls";
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -2601,7 +2644,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
//String fileName = "项目阶段工时报表_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.ProPeriodWork")+System.currentTimeMillis();
|
|
|
- ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, dataList, path);
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, dataList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
httpRespMsg.data = pathPrefix + fileName+".xls";
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -4178,6 +4225,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<String> nameList= (List<String>) resultMap.get("nameList");
|
|
|
Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", company.getId()));
|
|
|
List<String> headList = new ArrayList<String>();
|
|
|
// headList.add("项目编号");
|
|
|
// headList.add("项目分类");
|
|
@@ -4272,14 +4320,31 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//rowData.add(("1".equals(projectVO.getIsPublic())?"是":"否"));
|
|
|
rowData.add(("1".equals(projectVO.getIsPublic())?MessageUtils.message("excel.yes"):MessageUtils.message("excel.no")));
|
|
|
rowData.add(projectVO.getProjectName());
|
|
|
- rowData.add(projectVO.getInchargerName());
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ if(projectVO.getInchargerId()!=null){
|
|
|
+ User us = userList.stream().filter(ul -> ul.getId().equals(projectVO.getInchargerId())).findFirst().get();
|
|
|
+ rowData.add("$userName="+us.getCorpwxUserid()+"$");
|
|
|
+ }else {
|
|
|
+ rowData.add("");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ rowData.add(projectVO.getInchargerName());
|
|
|
+ }
|
|
|
List<Map<String, Object>> participator = projectVO.getParticipator();
|
|
|
String names="";
|
|
|
for (int i = 0; i < participator.size(); i++) {
|
|
|
- if(i==participator.size()-1){
|
|
|
- names+=participator.get(i).get("name");
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ if(i==participator.size()-1){
|
|
|
+ names+="$userName="+(participator.get(i).get("corpwxUserId"))+"$";
|
|
|
+ }else {
|
|
|
+ names+="$userName="+(participator.get(i).get("corpwxUserId"))+"$"+",";
|
|
|
+ }
|
|
|
}else {
|
|
|
- names+=participator.get(i).get("name")+",";
|
|
|
+ if(i==participator.size()-1){
|
|
|
+ names+=participator.get(i).get("name");
|
|
|
+ }else {
|
|
|
+ names+=participator.get(i).get("name")+",";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
rowData.add(names);
|
|
@@ -4287,7 +4352,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
rowData.add(start==null?"":sdf.format(start));
|
|
|
LocalDate end = projectVO.getPlanEndDate();
|
|
|
rowData.add(end==null?"":sdf.format(end));
|
|
|
- rowData.add(projectVO.getCreatorName());
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ rowData.add("$userName="+projectVO.getCreatorId()+"$");
|
|
|
+ }else {
|
|
|
+ rowData.add(projectVO.getCreatorName());
|
|
|
+ }
|
|
|
LocalDate createDate = projectVO.getCreateDate();
|
|
|
rowData.add(createDate==null?"":sdf.format(createDate));
|
|
|
|
|
@@ -4312,7 +4381,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(timeType.getProjectWithDept()==1){
|
|
|
Optional<Department> first = departmentList.stream().filter(dl -> dl.getDepartmentId().equals(projectVO.getDeptId())).findFirst();
|
|
|
if(first.isPresent()){
|
|
|
- rowData.add(first.get().getDepartmentName());
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ rowData.add("$departmentName="+first.get().getCorpwxDeptid()+"$");
|
|
|
+ }else {
|
|
|
+ rowData.add(first.get().getDepartmentName());
|
|
|
+ }
|
|
|
}else {
|
|
|
rowData.add("");
|
|
|
}
|
|
@@ -4393,11 +4466,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//生成excel文件导出
|
|
|
//String fileName = "项目导出_"+company.getCompanyName()+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.proExport")+company.getCompanyName()+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,allList,path);
|
|
|
- HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
- httpRespMsg.data = resp;
|
|
|
-
|
|
|
- return httpRespMsg;
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,allList,path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return new HttpRespMsg();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -4424,15 +4498,33 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
item.add((String) map.get("projectCode")==null?"":(String)map.get("projectCode"));
|
|
|
item.add((String) map.get("projectName")==null?"":(String)map.get("projectName"));
|
|
|
item.add((String) map.get("groupName")==null?"":(String)map.get("groupName"));
|
|
|
- item.add((String) map.get("inchargerName")==null?"":(String)map.get("inchargerName"));
|
|
|
- item.add((String) map.get("participators")==null?"":(String)map.get("participators"));
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ item.add((String) map.get("corpwxUserId")==null?"":("$userName="+(String)map.get("corpwxUserId")+"$"));
|
|
|
+ if(!map.get("participatorsCorp").equals("")){
|
|
|
+ String participatorsCorp = (String) map.get("participatorsCorp");
|
|
|
+ List<String> asList = Arrays.asList(participatorsCorp.split(","));
|
|
|
+ List<String> thisList=new ArrayList<>();
|
|
|
+ asList.forEach(al->{
|
|
|
+ thisList.add("$userName="+al+"$");
|
|
|
+ });
|
|
|
+ item.add(thisList.toString().replaceAll("\\[","").replaceAll("]",""));
|
|
|
+ }else {
|
|
|
+ item.add("");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ item.add((String) map.get("inchargerName")==null?"":(String)map.get("inchargerName"));
|
|
|
+ item.add((String) map.get("participators")==null?"":(String)map.get("participators"));
|
|
|
+ }
|
|
|
allList.add(item);
|
|
|
}
|
|
|
//String fileName = "项目分组_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.proGroup")+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
- httpRespMsg.data = resp;
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
@@ -4474,6 +4566,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
try {
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
List<String> headList = new ArrayList<String>();
|
|
|
// headList.add("序号");
|
|
@@ -4512,8 +4605,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
for (Map<String, Object> membMap : membList) {
|
|
|
List<String> membRowData = new ArrayList<String>();
|
|
|
membRowData.add(String.valueOf(seq));
|
|
|
- membRowData.add((String)membMap.get("name"));
|
|
|
- membRowData.add((String)membMap.get("departmentName"));
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(membMap.get("creatorId"))).findFirst();
|
|
|
+ if(first.isPresent()){
|
|
|
+ membRowData.add("$userName="+first.get().getCorpwxUserid()+"$");
|
|
|
+ }else {
|
|
|
+ membRowData.add("");
|
|
|
+ }
|
|
|
+ membRowData.add(String.valueOf(membMap.get("corpwxDeptId")==null?"":membMap.get("corpwxDeptId")));
|
|
|
+ }else {
|
|
|
+ membRowData.add((String)membMap.get("name"));
|
|
|
+ membRowData.add((String)membMap.get("departmentName"));
|
|
|
+ }
|
|
|
membRowData.add("");
|
|
|
membRowData.add("");
|
|
|
membRowData.add("");
|
|
@@ -4552,9 +4655,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//生成excel文件导出
|
|
|
//String fileName = timeType.getCustomDataName() + "统计_"+System.currentTimeMillis();
|
|
|
String fileName = timeType.getCustomDataName() + MessageUtils.message("Statistics.tj")+"_"+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
|
|
|
-
|
|
|
- httpRespMsg.data = resp;
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
//httpRespMsg.setError("验证失败");
|
|
@@ -4937,7 +5042,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
//String fileName = "工时成本预警表_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.hourCostAlert")+System.currentTimeMillis();
|
|
|
- ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
httpRespMsg.data = pathPrefix + fileName+".xls";
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -5316,7 +5425,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
double costTime = 0;
|
|
|
List<Map<String, Object>> mapList = membList.stream().filter(mb -> mb.get("creatorId").equals(user.getId())).collect(Collectors.toList());
|
|
|
List<String> membRowData=new ArrayList<>();
|
|
|
- membRowData.add(user.getName());
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ membRowData.add("$userName"+(user.getCorpwxUserid()==null?"":user.getCorpwxUserid())+"$");
|
|
|
+ }else {
|
|
|
+ membRowData.add(user.getName());
|
|
|
+ }
|
|
|
for(Object i:projectCategorys){
|
|
|
List<Map<String, Object>> resultList = mapList.stream().filter(mp -> mp.get("category").equals(i)).collect(Collectors.toList());
|
|
|
if(resultList.size()>0){
|
|
@@ -5351,8 +5464,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//生成excel文件导出
|
|
|
//String fileName = "项目分类工时成本统计_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.proClassLaborCost")+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
|
|
|
- httpRespMsg.data = resp;
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
//httpRespMsg.setError("验证失败");
|
|
@@ -5450,7 +5566,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
BigDecimal bdIsPublic=new BigDecimal(isPublic);
|
|
|
BigDecimal divide = bdIsPublic.divide(BigDecimal.valueOf(workingTime),2,BigDecimal.ROUND_HALF_UP);
|
|
|
NumberFormat nf = NumberFormat.getPercentInstance();
|
|
|
- subList.add(String.valueOf(item.get("username")));
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ subList.add("$userName="+(item.get("corpwxUserId")==null?"":item.get("corpwxUserId"))+"$");
|
|
|
+ }else {
|
|
|
+ subList.add(String.valueOf(item.get("username")));
|
|
|
+ }
|
|
|
subList.add(String.valueOf(StringUtils.isEmpty(item.get("jobNumber"))?"":item.get("jobNumber")));
|
|
|
subList.add(String.valueOf(item.get("unPublic")));
|
|
|
subList.add(String.valueOf(item.get("isPublic")));
|
|
@@ -5461,8 +5581,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//生成excel文件导出
|
|
|
//String fileName = "人员工时分配统计_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.perHoursAllSta")+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
- msg.data = resp;
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -5690,7 +5813,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
dataList.add(titleString);
|
|
|
for (TimelinessRateVO timelinessRateVO : list) {
|
|
|
List<String> item=new ArrayList<>();
|
|
|
- item.add(timelinessRateVO.getUserName());
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ item.add(timelinessRateVO.getCorpwxUserId()==null?"":timelinessRateVO.getCorpwxUserId());
|
|
|
+ }else {
|
|
|
+ item.add(timelinessRateVO.getUserName());
|
|
|
+ }
|
|
|
item.add(timelinessRateVO.getJobNumber());
|
|
|
item.add(timelinessRateVO.getDepartmentName());
|
|
|
item.add(timelinessRateVO.getTimelinessRate());
|
|
@@ -5699,8 +5826,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//生成excel文件导出
|
|
|
//String fileName = "人员填报及时率统计_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.timePerFill")+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
- httpRespMsg.data = resp;
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
@@ -5754,15 +5884,22 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
dataList.add(Arrays.asList(s));
|
|
|
for (Map<String, Object> map : list) {
|
|
|
List<String> item=new ArrayList<>();
|
|
|
- item.add(String.valueOf(map.get("userName")));
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ item.add("$userName="+(map.get("corpwxUserId"))+"$");
|
|
|
+ }else {
|
|
|
+ item.add(String.valueOf(map.get("userName")));
|
|
|
+ }
|
|
|
item.add(String.valueOf(map.get("num")));
|
|
|
dataList.add(item);
|
|
|
}
|
|
|
//生成excel文件导出
|
|
|
//String fileName = "人员待审核统计_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.perReviewed")+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
- msg.data = resp;
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -5899,9 +6036,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
dataList.add(titleList);
|
|
|
for (Map<String, Object> map : resultList) {
|
|
|
List<String> item=new ArrayList<>();
|
|
|
- item.add((String) map.get("name"));
|
|
|
- item.add(String.valueOf(StringUtils.isEmpty(map.get("jobNumber"))?"":map.get("jobNumber")));
|
|
|
- item.add((String) map.get("departmentName")==null?"":(String) map.get("departmentName"));
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ item.add("$userName="+(map.get("corwxUserId")==null?"":map.get("corwxUserId"))+"$");
|
|
|
+ item.add(String.valueOf(StringUtils.isEmpty(map.get("jobNumber"))?"":map.get("jobNumber")));
|
|
|
+ item.add("$deprtmentName="+(map.get("corpwxDeptId")==null?"":map.get("corpwxDeptId"))+"$");
|
|
|
+ }else {
|
|
|
+ item.add((String) map.get("name"));
|
|
|
+ item.add(String.valueOf(StringUtils.isEmpty(map.get("jobNumber"))?"":map.get("jobNumber")));
|
|
|
+ item.add((String) map.get("departmentName")==null?"":(String) map.get("departmentName"));
|
|
|
+ }
|
|
|
item.add(String.valueOf(map.get("planHours")).equals("null")?"":String.valueOf(map.get("planHours")));
|
|
|
item.add(String.valueOf(map.get("workingTime")).equals("null")?"":String.valueOf(map.get("workingTime")));
|
|
|
item.add(String.valueOf(map.get("proportion")).equals("null")?"":String.valueOf(map.get("proportion")));
|
|
@@ -5910,8 +6053,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//生成excel文件导出
|
|
|
//String fileName = "人员工时统计_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("fileName.perHoursSta")+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
- msg.data = resp;
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -6355,8 +6501,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//生成excel文件导出
|
|
|
//String fileName = "项目成本基线表_"+System.currentTimeMillis();
|
|
|
String fileName = MessageUtils.message("Statistics.ProjectCostBase")+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
- httpRespMsg.data = resp;
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
@@ -6457,9 +6606,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//生成excel文件导出
|
|
|
//String fileName = userCustom.getName()+"工时成本统计_"+System.currentTimeMillis();
|
|
|
String fileName = userCustom.getName()+MessageUtils.message("fileName.hourCost")+System.currentTimeMillis();
|
|
|
- String resp = ExcelUtil.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
- httpRespMsg.data = resp;
|
|
|
-
|
|
|
+ try {
|
|
|
+ return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
@@ -6845,7 +6996,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
List<Integer> idList = inertProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
idList.add(-1);
|
|
|
- List<ProjectSeparate> projectSeparateList = projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", idList));
|
|
|
for (Project project : inertProjectList) {
|
|
|
List<TaskGroup> taskGroupList = project.getTaskGroupList();
|
|
|
if(taskGroupList!=null){
|
|
@@ -6853,8 +7003,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
taskGroupService.saveBatch(taskGroupList);
|
|
|
}
|
|
|
ProjectSeparate projectSeparate = project.getProjectSeparate();
|
|
|
- projectSeparate.setId(project.getId());
|
|
|
- projectSeparateService.saveOrUpdate(projectSeparate);
|
|
|
+ if(projectSeparate!=null){
|
|
|
+ projectSeparate.setId(project.getId());
|
|
|
+ projectSeparateService.saveOrUpdate(projectSeparate);
|
|
|
+ }
|
|
|
+ //项目负责人要加到参与人中
|
|
|
+ Participation participation=new Participation();
|
|
|
+ if(project.getInchargerId()!=null){
|
|
|
+ participation.setUserId(project.getInchargerId());
|
|
|
+ participation.setProjectId(project.getId());
|
|
|
+ participationMapper.insert(participation);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}else if(changeType.equals("update_project")){
|
|
@@ -6879,7 +7038,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Integer> idList = changeProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
idList.add(-1);
|
|
|
List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", idList));
|
|
|
- List<ProjectSeparate> projectSeparateList = projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", idList));
|
|
|
for (Project project : changeProjectList) {
|
|
|
List<TaskGroup> taskGroupList = project.getTaskGroupList();
|
|
|
if(taskGroupList!=null){
|
|
@@ -6895,9 +7053,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
taskGroupService.saveOrUpdateBatch(taskGroupList);
|
|
|
}
|
|
|
ProjectSeparate projectSeparate = project.getProjectSeparate();
|
|
|
- projectSeparate.setId(project.getId());
|
|
|
- projectSeparateService.saveOrUpdate(projectSeparate);
|
|
|
- projectSeparateService.saveOrUpdate(projectSeparate);
|
|
|
+ if(projectSeparate!=null){
|
|
|
+ projectSeparate.setId(project.getId());
|
|
|
+ projectSeparateService.saveOrUpdate(projectSeparate);
|
|
|
+ }
|
|
|
+ //项目负责人要加到参与人中
|
|
|
+ Participation participation=new Participation();
|
|
|
+ if(project.getInchargerId()!=null){
|
|
|
+ participationMapper.delete(new QueryWrapper<Participation>().eq("project_id",project.getId()).eq("user_id",project.getId()));
|
|
|
+ participation.setUserId(project.getInchargerId());
|
|
|
+ participation.setProjectId(project.getId());
|
|
|
+ participationMapper.insert(participation);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}else if(changeType.equals("delete_project")){
|