|
@@ -4100,11 +4100,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
List<UserCustom> userCustomList = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", companyId));
|
|
List<UserCustom> userCustomList = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", companyId));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
- //准备导出
|
|
|
|
- HSSFWorkbook workbook = new HSSFWorkbook();
|
|
|
|
- //HSSFSheet sheet = workbook.createSheet("工作日报");
|
|
|
|
- HSSFSheet sheet = workbook.createSheet(MessageUtils.message("excel.workReport"));
|
|
|
|
- sheet.createFreezePane(0,1);
|
|
|
|
|
|
+ List<List<String>> dataList=new ArrayList<>();
|
|
List<String> titles = new ArrayList<String>();
|
|
List<String> titles = new ArrayList<String>();
|
|
// titles.add("序号");
|
|
// titles.add("序号");
|
|
// titles.add("工号");
|
|
// titles.add("工号");
|
|
@@ -4190,49 +4186,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
//titles.add("审核流程状态");
|
|
//titles.add("审核流程状态");
|
|
titles.add(MessageUtils.message("excel.reviewProcessStatus"));
|
|
titles.add(MessageUtils.message("excel.reviewProcessStatus"));
|
|
- //创建表头
|
|
|
|
- HSSFRow headRow = sheet.createRow(0);
|
|
|
|
- //设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
|
|
|
|
- for (int i=0;i<titles.size(); i++) {
|
|
|
|
- int width = 10;
|
|
|
|
- if (i == 0) {
|
|
|
|
- width = 10;
|
|
|
|
- } else if (i == 5 && company.getPackageProject() == 1){
|
|
|
|
- width = 60;
|
|
|
|
- } else if (i == titles.size() -1){
|
|
|
|
- //最后一个是工作事项
|
|
|
|
- width = 100;
|
|
|
|
- } else {
|
|
|
|
- width = 20;
|
|
|
|
- }
|
|
|
|
- sheet.setColumnWidth(i, width * 256);
|
|
|
|
- }
|
|
|
|
-//
|
|
|
|
-// sheet.setColumnWidth(1, 10 * 256);
|
|
|
|
-// sheet.setColumnWidth(2, 20 * 256);
|
|
|
|
-// sheet.setColumnWidth(3, 20 * 256);
|
|
|
|
-// sheet.setColumnWidth(4, 60 * 256);
|
|
|
|
-//
|
|
|
|
-// sheet.setColumnWidth(5, 15 * 256);
|
|
|
|
-// sheet.setColumnWidth(6, 15 * 256);
|
|
|
|
-// sheet.setColumnWidth(7, 100 * 256);
|
|
|
|
- //设置为居中加粗
|
|
|
|
- HSSFCellStyle headStyle = workbook.createCellStyle();
|
|
|
|
- HSSFFont font = workbook.createFont();
|
|
|
|
- font.setBold(true);
|
|
|
|
- headStyle.setFont(font);
|
|
|
|
- //表头
|
|
|
|
- HSSFCell headCell;
|
|
|
|
-
|
|
|
|
- for (int i=0;i<titles.size(); i++) {
|
|
|
|
- headCell = headRow.createCell(i);
|
|
|
|
- headCell.setCellValue(titles.get(i));
|
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //设置日期格式
|
|
|
|
- HSSFCellStyle style = workbook.createCellStyle();
|
|
|
|
- style.setDataFormat(HSSFDataFormat.getBuiltinFormat("yy/mm/dd hh:mm"));
|
|
|
|
|
|
+ dataList.add(titles);
|
|
//新增数据行 并且装填数据
|
|
//新增数据行 并且装填数据
|
|
int rowNum = 1;
|
|
int rowNum = 1;
|
|
List<HashMap<String, Object>> allReportByDate = null;
|
|
List<HashMap<String, Object>> allReportByDate = null;
|
|
@@ -4357,9 +4311,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
for (Map<String, Object> map : allReportByDate) {
|
|
for (Map<String, Object> map : allReportByDate) {
|
|
- HSSFRow row = sheet.createRow(rowNum);
|
|
|
|
- row.createCell(0).setCellValue(rowNum);
|
|
|
|
- row.createCell(1).setCellValue((String) map.get("jobNumber"));
|
|
|
|
|
|
+ List<String> item=new ArrayList<>();
|
|
|
|
+ item.add(String.valueOf(rowNum));
|
|
|
|
+ item.add((String) map.get("jobNumber"));
|
|
for (int i = 0; i < userCustomList.size(); i++) {
|
|
for (int i = 0; i < userCustomList.size(); i++) {
|
|
String value="";
|
|
String value="";
|
|
switch (i){
|
|
switch (i){
|
|
@@ -4374,7 +4328,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
case 4:value=String.valueOf(map.get("plate5")==null?"":map.get("plate5"));
|
|
case 4:value=String.valueOf(map.get("plate5")==null?"":map.get("plate5"));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- row.createCell(3+i).setCellValue(value);
|
|
|
|
|
|
+ item.add(value);
|
|
}
|
|
}
|
|
Department dept = null;
|
|
Department dept = null;
|
|
for (Department department : departments) {
|
|
for (Department department : departments) {
|
|
@@ -4384,87 +4338,69 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
- row.createCell(2).setCellValue("$userName="+(map.get("corpwxUserId")==null?"":map.get("corpwxUserId"))+"$");
|
|
|
|
- row.createCell(3+userCustomList.size()).setCellValue(departmentService.exportWxDepartment(dept,departments));
|
|
|
|
|
|
+ item.add("$userName="+(map.get("corpwxUserId")==null?"":map.get("corpwxUserId"))+"$");
|
|
|
|
+ item.add(departmentService.exportWxDepartment(dept,departments));
|
|
}else {
|
|
}else {
|
|
- row.createCell(2).setCellValue((String) map.get("name"));
|
|
|
|
- row.createCell(3+userCustomList.size()).setCellValue(departmentService.getSupDepartment(dept,departments));
|
|
|
|
|
|
+ item.add((String) map.get("name"));
|
|
|
|
+ item.add(departmentService.getSupDepartment(dept,departments));
|
|
}
|
|
}
|
|
- row.createCell(4+userCustomList.size()).setCellValue((String) map.get("projectCode"));
|
|
|
|
- row.createCell(5+userCustomList.size()).setCellValue((String) map.get("project"));
|
|
|
|
- row.createCell(6+userCustomList.size()).setCellValue((String) map.get("categoryName"));
|
|
|
|
|
|
+ item.add((String) map.get("projectCode"));
|
|
|
|
+ item.add((String) map.get("project"));
|
|
|
|
+ item.add((String) map.get("categoryName"));
|
|
if(timeType.getMainProjectState()==1){
|
|
if(timeType.getMainProjectState()==1){
|
|
- row.createCell(7+userCustomList.size()).setCellValue((String) map.get("projectMainName"));
|
|
|
|
|
|
+ item.add((String) map.get("projectMainName"));
|
|
}else {
|
|
}else {
|
|
- row.createCell(7+userCustomList.size()).setCellValue((String) map.get("subProjectName"));
|
|
|
|
|
|
+ item.add((String) map.get("subProjectName"));
|
|
}
|
|
}
|
|
- int index = 8+userCustomList.size();
|
|
|
|
if (company.getPackageProject() == 1) {
|
|
if (company.getPackageProject() == 1) {
|
|
- row.createCell(8+userCustomList.size()).setCellValue((String) map.get("taskName"));
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add((String) map.get("taskName"));
|
|
}
|
|
}
|
|
- HSSFCell cell = row.createCell(index);
|
|
|
|
- cell.setCellValue(new SimpleDateFormat("yyyy-MM-dd")
|
|
|
|
|
|
+ item.add(new SimpleDateFormat("yyyy-MM-dd")
|
|
.format((java.sql.Date) map.get("createDate")));
|
|
.format((java.sql.Date) map.get("createDate")));
|
|
- cell.setCellStyle(style);
|
|
|
|
- index++;
|
|
|
|
- row.createCell(index).setCellValue(map.get("duration").toString());
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add(map.get("duration").toString());
|
|
if (timeType.getMultiWorktime() == 1) {
|
|
if (timeType.getMultiWorktime() == 1) {
|
|
if ((Integer)map.get("multiWorktime") == 1) {
|
|
if ((Integer)map.get("multiWorktime") == 1) {
|
|
- row.createCell(index).setCellValue(map.get("startTime").toString()+"-"+map.get("endTime").toString());
|
|
|
|
|
|
+ item.add(map.get("startTime").toString()+"-"+map.get("endTime").toString());
|
|
} else {
|
|
} else {
|
|
- row.createCell(index).setCellValue("");
|
|
|
|
|
|
+ item.add("");
|
|
}
|
|
}
|
|
- index++;
|
|
|
|
//加班情况
|
|
//加班情况
|
|
int isOverTime = (Integer) map.get("isOvertime");
|
|
int isOverTime = (Integer) map.get("isOvertime");
|
|
- row.createCell(index).setCellValue(isOverTime==1?(df.format((double)map.get("overtimeHours"))):"-");
|
|
|
|
- index++;
|
|
|
|
-
|
|
|
|
|
|
+ item.add(isOverTime==1?(df.format((double)map.get("overtimeHours"))):"-");
|
|
}
|
|
}
|
|
if (timeType.getMultiWorktime() == 0) {
|
|
if (timeType.getMultiWorktime() == 0) {
|
|
int isOverTime = (Integer) map.get("isOvertime");
|
|
int isOverTime = (Integer) map.get("isOvertime");
|
|
- row.createCell(index).setCellValue(isOverTime==1?(df.format((double)map.get("overtimeHours"))):"-");
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add(isOverTime==1?(df.format((double)map.get("overtimeHours"))):"-");
|
|
}
|
|
}
|
|
//是否启用自定义的维度了
|
|
//是否启用自定义的维度了
|
|
if (timeType.getCustomDegreeActive() == 1) {
|
|
if (timeType.getCustomDegreeActive() == 1) {
|
|
- row.createCell(index).setCellValue(map.get("degreeName") != null?map.get("degreeName").toString():"");
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add(map.get("degreeName") != null?map.get("degreeName").toString():"");
|
|
}
|
|
}
|
|
//是否启用了自定义数值
|
|
//是否启用了自定义数值
|
|
if (timeType.getCustomDataActive() == 1) {
|
|
if (timeType.getCustomDataActive() == 1) {
|
|
- row.createCell(index).setCellValue(map.get("customData") != null?map.get("customData").toString():"");
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add(map.get("customData") != null?map.get("customData").toString():"");
|
|
}
|
|
}
|
|
if (timeType.getCustomTextActive() == 1) {
|
|
if (timeType.getCustomTextActive() == 1) {
|
|
- row.createCell(index).setCellValue(map.get("customText") != null?map.get("customText").toString():"");
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add(map.get("customText") != null?map.get("customText").toString():"");
|
|
}
|
|
}
|
|
//项目管理专业版,需要显示任务分组和投入阶段
|
|
//项目管理专业版,需要显示任务分组和投入阶段
|
|
if (company.getPackageProject() == 1) {
|
|
if (company.getPackageProject() == 1) {
|
|
- row.createCell(index).setCellValue(map.get("groupName") != null? map.get("groupName").toString():"");
|
|
|
|
- index++;
|
|
|
|
- row.createCell(index).setCellValue(map.get("stage") != null?map.get("stage").toString():"");
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add(map.get("groupName") != null? map.get("groupName").toString():"");
|
|
|
|
+ item.add(map.get("stage") != null?map.get("stage").toString():"");
|
|
}
|
|
}
|
|
if (timeType.getShowFillauditTime() == 1) {
|
|
if (timeType.getShowFillauditTime() == 1) {
|
|
- row.createCell(index).setCellValue(sdf.format((Date)map.get("time")));
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add(sdf.format((Date)map.get("time")));
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
String projectAuditorName ="$userName="+String.valueOf(map.get("projectAuditorCorpwxUserId"))+"$";
|
|
String projectAuditorName ="$userName="+String.valueOf(map.get("projectAuditorCorpwxUserId"))+"$";
|
|
- row.createCell(index).setCellValue(projectAuditorName);
|
|
|
|
|
|
+ item.add(projectAuditorName);
|
|
}else {
|
|
}else {
|
|
- row.createCell(index).setCellValue((String)map.get("projectAuditorName"));
|
|
|
|
|
|
+ item.add((String)map.get("projectAuditorName"));
|
|
}
|
|
}
|
|
- index++;
|
|
|
|
if (map.get("projectAuditTime") == null) {
|
|
if (map.get("projectAuditTime") == null) {
|
|
- row.createCell(index).setCellValue("");
|
|
|
|
|
|
+ item.add("");
|
|
} else {
|
|
} else {
|
|
- row.createCell(index).setCellValue(sdf.format((Date)map.get("projectAuditTime")));
|
|
|
|
|
|
+ item.add(sdf.format((Date)map.get("projectAuditTime")));
|
|
}
|
|
}
|
|
- index++;
|
|
|
|
//审核流程显示
|
|
//审核流程显示
|
|
List<ReportLogDetail> detailList = logDetails.stream().filter(log -> log.getReportId().equals((Integer) map.get("id"))).collect(Collectors.toList());
|
|
List<ReportLogDetail> detailList = logDetails.stream().filter(log -> log.getReportId().equals((Integer) map.get("id"))).collect(Collectors.toList());
|
|
if (detailList.size() > 0) {
|
|
if (detailList.size() > 0) {
|
|
@@ -4504,25 +4440,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
sb.append(msg);
|
|
sb.append(msg);
|
|
}
|
|
}
|
|
- row.createCell(index).setCellValue(sb.toString());
|
|
|
|
|
|
+ item.add(sb.toString());
|
|
} else {
|
|
} else {
|
|
- row.createCell(index).setCellValue("");
|
|
|
|
|
|
+ item.add("");
|
|
}
|
|
}
|
|
- index++;
|
|
|
|
}
|
|
}
|
|
- row.createCell(index).setCellValue((String) map.get("content"));
|
|
|
|
- index++;
|
|
|
|
|
|
+ item.add((String) map.get("content"));
|
|
if(stateKey==1){
|
|
if(stateKey==1){
|
|
Integer state = (Integer) map.get("state");
|
|
Integer state = (Integer) map.get("state");
|
|
switch (state){
|
|
switch (state){
|
|
//case 0:row.createCell(index).setCellValue("待审核");
|
|
//case 0:row.createCell(index).setCellValue("待审核");
|
|
- case 0:row.createCell(index).setCellValue(MessageUtils.message("stages.reviewed"));
|
|
|
|
|
|
+ case 0:item.add(MessageUtils.message("stages.reviewed"));
|
|
break;
|
|
break;
|
|
//case 1:row.createCell(index).setCellValue("已通过");
|
|
//case 1:row.createCell(index).setCellValue("已通过");
|
|
- case 1:row.createCell(index).setCellValue(MessageUtils.message("stages.passed"));
|
|
|
|
|
|
+ case 1:item.add(MessageUtils.message("stages.passed"));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- index++;
|
|
|
|
}
|
|
}
|
|
if(timeType.getSyncCorpwxTime()==1){
|
|
if(timeType.getSyncCorpwxTime()==1){
|
|
String cellValue = "";
|
|
String cellValue = "";
|
|
@@ -4537,39 +4470,38 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- row.createCell(index).setCellValue(cellValue);
|
|
|
|
- index ++;
|
|
|
|
|
|
+ item.add(cellValue);
|
|
}
|
|
}
|
|
//审核流程状态
|
|
//审核流程状态
|
|
Integer packageEngineering = company.getPackageEngineering();
|
|
Integer packageEngineering = company.getPackageEngineering();
|
|
if (packageEngineering.equals(0)){
|
|
if (packageEngineering.equals(0)){
|
|
if(String.valueOf(map.get("state")).equals("1")){
|
|
if(String.valueOf(map.get("state")).equals("1")){
|
|
- row.createCell(index).setCellValue("——");
|
|
|
|
|
|
+ item.add("——");
|
|
}else if (String.valueOf(map.get("state")).equals("-1")){
|
|
}else if (String.valueOf(map.get("state")).equals("-1")){
|
|
- row.createCell(index).setCellValue("导入待审核");
|
|
|
|
|
|
+ item.add("导入待审核");
|
|
} else {
|
|
} else {
|
|
//部门审核
|
|
//部门审核
|
|
if(String.valueOf(map.get("isDeptAudit")).equals("1")){
|
|
if(String.valueOf(map.get("isDeptAudit")).equals("1")){
|
|
String deptAuditorId = map.get("deptAuditorName")+"";
|
|
String deptAuditorId = map.get("deptAuditorName")+"";
|
|
String departmentName = map.get("departmentName") + "";
|
|
String departmentName = map.get("departmentName") + "";
|
|
- for (User item : userList) {
|
|
|
|
- if (item.getId().equals(deptAuditorId)){
|
|
|
|
|
|
+ for (User userItem : userList) {
|
|
|
|
+ if (userItem.getId().equals(deptAuditorId)){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
- String deptAuditorName ="$userName="+ item.getCorpwxRealUserid() +"$";
|
|
|
|
|
|
+ String deptAuditorName ="$userName="+ userItem.getCorpwxRealUserid() +"$";
|
|
departmentName = "$departmentName=" + departmentName + "$";
|
|
departmentName = "$departmentName=" + departmentName + "$";
|
|
if(timeType.getReportAuditType()==4){
|
|
if(timeType.getReportAuditType()==4){
|
|
departmentName = map.get("buDepartmentName") + "";
|
|
departmentName = map.get("buDepartmentName") + "";
|
|
departmentName = "$departmentName=" + departmentName + "$";
|
|
departmentName = "$departmentName=" + departmentName + "$";
|
|
- row.createCell(index).setCellValue("待项目所属BU[" + departmentName + "](" + deptAuditorName + ")审核");
|
|
|
|
|
|
+ item.add("待项目所属BU[" + departmentName + "](" + deptAuditorName + ")审核");
|
|
}else {
|
|
}else {
|
|
- row.createCell(index).setCellValue("待" + departmentName + "(" + deptAuditorName + ")审核");
|
|
|
|
|
|
+ item.add("待" + departmentName + "(" + deptAuditorName + ")审核");
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
if(timeType.getReportAuditType()==4){
|
|
if(timeType.getReportAuditType()==4){
|
|
departmentName = map.get("buDepartmentName") + "";
|
|
departmentName = map.get("buDepartmentName") + "";
|
|
- row.createCell(index).setCellValue("待项目所属BU[" + departmentName + "](" + item.getName() + ")审核");
|
|
|
|
|
|
+ item.add("待项目所属BU[" + departmentName + "](" + userItem.getName() + ")审核");
|
|
}else {
|
|
}else {
|
|
- row.createCell(index).setCellValue("待" + departmentName + "(" + item.getName() + ")审核");
|
|
|
|
|
|
+ item.add("待" + departmentName + "(" + userItem.getName() + ")审核");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -4583,68 +4515,27 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
String projectAuditorName = map.get("projectAuditorName")+"";
|
|
String projectAuditorName = map.get("projectAuditorName")+"";
|
|
String projectAuditorId = map.get("projectAuditorId")+"";
|
|
String projectAuditorId = map.get("projectAuditorId")+"";
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
- for (User item : userList) {
|
|
|
|
- if (item.getId().equals(projectAuditorId)){
|
|
|
|
- projectAuditorName ="$userName="+ item.getCorpwxUserid() +"$";
|
|
|
|
- row.createCell(index).setCellValue("待项目审核人" + "(" + projectAuditorName + ")审核");
|
|
|
|
|
|
+ for (User userItem : userList) {
|
|
|
|
+ if (userItem.getId().equals(projectAuditorId)){
|
|
|
|
+ projectAuditorName ="$userName="+ userItem.getCorpwxUserid() +"$";
|
|
|
|
+ item.add("待项目审核人" + "(" + projectAuditorName + ")审核");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
- row.createCell(index).setCellValue("待项目审核人" + "(" + projectAuditorName + ")审核");
|
|
|
|
|
|
+ item.add("待项目审核人" + "(" + projectAuditorName + ")审核");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ dataList.add(item);
|
|
rowNum++;
|
|
rowNum++;
|
|
}
|
|
}
|
|
//生成Excel文件
|
|
//生成Excel文件
|
|
//String fileUrlSuffix = (startDate==null?"":(startDate+"至"+endDate))+"工作日报" + System.currentTimeMillis() + ".xls";
|
|
//String fileUrlSuffix = (startDate==null?"":(startDate+"至"+endDate))+"工作日报" + System.currentTimeMillis() + ".xls";
|
|
String fileUrlSuffix = (startDate==null?"":(startDate+MessageUtils.message("leave.to")+endDate))+MessageUtils.message("excel.workReport") + System.currentTimeMillis() + ".xls";
|
|
String fileUrlSuffix = (startDate==null?"":(startDate+MessageUtils.message("leave.to")+endDate))+MessageUtils.message("excel.workReport") + System.currentTimeMillis() + ".xls";
|
|
- FileOutputStream fos = new FileOutputStream(path + fileUrlSuffix);
|
|
|
|
- workbook.write(fos);
|
|
|
|
- fos.flush();
|
|
|
|
- fos.close();
|
|
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
- String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
|
|
|
|
- String jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
|
|
|
|
- /*if(jobId!=null&&!jobId.equals("")){
|
|
|
|
- File file=new File(path + fileUrlSuffix);
|
|
|
|
- if(file.exists()){
|
|
|
|
- file.delete();
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
- int i = 0;
|
|
|
|
- String syncTranslationResult = null;
|
|
|
|
- /**
|
|
|
|
- * 异步上传转译文件的任务完成时会触发回调,在WeiXinCorpController中的commonDevCallbackPost实现了对回调的处理,存储到corpwxJobResult表中
|
|
|
|
- * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
|
|
|
|
- */
|
|
|
|
- while (i < 10) {
|
|
|
|
- Thread.sleep(300);
|
|
|
|
- CorpwxJobResult corpwxJobResult = corpwxJobCenter.get(jobId);
|
|
|
|
- if (corpwxJobResult != null) {
|
|
|
|
- if (corpwxJobResult.getErrCode() == 0) {
|
|
|
|
- syncTranslationResult = wxCorpInfoService.getSyncTranslationResult(jobId);
|
|
|
|
- corpwxJobCenter.remove(jobId);
|
|
|
|
- } else {
|
|
|
|
- httpRespMsg.setError(corpwxJobResult.getErrMsg());
|
|
|
|
- return httpRespMsg;
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- i++;
|
|
|
|
- }
|
|
|
|
- if (syncTranslationResult != null) {
|
|
|
|
- httpRespMsg.data = syncTranslationResult;
|
|
|
|
- } else {
|
|
|
|
- //httpRespMsg.setError("处理超时...");
|
|
|
|
- httpRespMsg.setError(MessageUtils.message("request.outTime"));
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- httpRespMsg.data = "/upload/" + fileUrlSuffix;
|
|
|
|
- }
|
|
|
|
|
|
+ excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileUrlSuffix,dataList,path);
|
|
} catch (NullPointerException e) {
|
|
} catch (NullPointerException e) {
|
|
//httpRespMsg.setError("验证失败或缺少数据");
|
|
//httpRespMsg.setError("验证失败或缺少数据");
|
|
httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
|
|
httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
|