|
@@ -8,6 +8,7 @@ import com.management.platform.controller.WeiXinCorpController;
|
|
|
import com.management.platform.entity.*;
|
|
|
import com.management.platform.entity.vo.DepartmentVO;
|
|
|
import com.management.platform.entity.vo.UserMonthWork;
|
|
|
+import com.management.platform.entity.vo.WorktimeItem;
|
|
|
import com.management.platform.mapper.*;
|
|
|
import com.management.platform.service.DepartmentService;
|
|
|
import com.management.platform.service.ReportProfessionProgressService;
|
|
@@ -62,6 +63,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
@Value("${wx.template_report_pass}")
|
|
|
public String TEMPLATE_REPORT_PASS;
|
|
|
+ @Value("${wx.template_report_reject}")
|
|
|
+ public String TEMPLATE_REPORT_REJECT;
|
|
|
+
|
|
|
@Value("${wx.app_id}")
|
|
|
public String appId;
|
|
|
@Value("${wx.app_secret}")
|
|
@@ -334,6 +338,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
report.put("pics", picList);
|
|
|
}
|
|
|
+ if (((Integer)report.get("multiWorktime")) == 1) {
|
|
|
+ //设置多个工时情况下的报告列表
|
|
|
+ String timeStr = (String)report.get("content");
|
|
|
+ report.put("worktimeList", JSONArray.parse(timeStr));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
httpRespMsg.data = nameList;
|
|
@@ -400,6 +409,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
r.setPics(list);
|
|
|
}
|
|
|
+ if (r.getMultiWorktime() == 1) {
|
|
|
+ //设置多个工时情况下的报告列表
|
|
|
+ String timeStr = r.getContent();
|
|
|
+ JSONArray parse = JSONArray.parseArray(timeStr);
|
|
|
+ List<WorktimeItem> list = new ArrayList<>();
|
|
|
+ for (int i=0;i<parse.size(); i++) {
|
|
|
+ JSONObject obj = parse.getJSONObject(i);
|
|
|
+ list.add(JSONObject.toJavaObject(obj, WorktimeItem.class));
|
|
|
+ }
|
|
|
+ r.setWorktimeList(list);
|
|
|
+ }
|
|
|
});
|
|
|
resultMap.put("report", reports);
|
|
|
//顺便再获取一下可分配时间
|
|
@@ -682,7 +702,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
report.put("pics", picList);
|
|
|
}
|
|
|
+ if (((Integer)report.get("multiWorktime")) == 1) {
|
|
|
+ //设置多个工时情况下的报告列表
|
|
|
+ String timeStr = (String)report.get("content");
|
|
|
+ report.put("worktimeList", JSONArray.parse(timeStr));
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
httpRespMsg.data = nameList;
|
|
|
} catch (NullPointerException e) {
|
|
@@ -809,14 +835,46 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
if (wxCorpInfo != null && user.getCorpwxUserid() != null) {
|
|
|
wxCorpInfoService.sendWXCorpMsg(wxCorpInfo, user.getCorpwxUserid(), msg);
|
|
|
} else if (user.getWxOpenid() != null){
|
|
|
- push(p.getProjectName(), user);
|
|
|
+ pushPass(p.getProjectName(), user);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ public boolean pushReject(String str, User user, String rejectUsername, String reason) {
|
|
|
+ //1,配置
|
|
|
+ WxMpInMemoryConfigStorage wxStorage = new WxMpInMemoryConfigStorage();
|
|
|
+ wxStorage.setAppId(appId);
|
|
|
+ wxStorage.setSecret(appSecret);
|
|
|
+ WxMpService wxMpService = new WxMpServiceImpl();
|
|
|
+ wxMpService.setWxMpConfigStorage(wxStorage);
|
|
|
+
|
|
|
+ //2,推送消息
|
|
|
+ WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
|
|
|
+ .toUser(user.getWxOpenid())//要推送的用户openid
|
|
|
+ .templateId(TEMPLATE_REPORT_REJECT)//模版id
|
|
|
+ .url("http://mobworktime.ttkuaiban.com/")//点击模版消息要访问的网址
|
|
|
+ .build();
|
|
|
+ //3,如果是正式版发送模版消息,这里需要配置你的信息
|
|
|
+ templateMessage.addData(new WxMpTemplateData("first", "你好,您的日报被驳回", "#FF00FF"));
|
|
|
+ templateMessage.addData(new WxMpTemplateData("keyword1", str, "#000000"));
|
|
|
+ templateMessage.addData(new WxMpTemplateData("keyword2", rejectUsername, "#000000"));
|
|
|
+ templateMessage.addData(new WxMpTemplateData("keyword3", reason, "#000000"));
|
|
|
+ templateMessage.addData(new WxMpTemplateData("keyword4", DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDateTime.now()), "#000000"));
|
|
|
+ templateMessage.addData(new WxMpTemplateData("remark", "请修改后重新提交", "#000000"));
|
|
|
+ // templateMessage.addData(new WxMpTemplateData(name2, value2, color2));
|
|
|
+ try {
|
|
|
+ wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("推送失败:" + e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- public boolean push(String projectName, User user) {
|
|
|
+ public boolean pushPass(String projectName, User user) {
|
|
|
//1,配置
|
|
|
WxMpInMemoryConfigStorage wxStorage = new WxMpInMemoryConfigStorage();
|
|
|
wxStorage.setAppId(appId);
|
|
@@ -849,13 +907,15 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
//审核未通过 以及 撤销审核某天某人
|
|
|
@Override
|
|
|
- public HttpRespMsg denyReport(String id, String date, String reportIds, HttpServletRequest request) {
|
|
|
+ public HttpRespMsg denyReport(String id, String date, String reportIds, String reason, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
try {
|
|
|
User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
final List<Long> ids = ListUtil.convertIdsArrayToList(reportIds);
|
|
|
-
|
|
|
+ if (reason == null) {
|
|
|
+ reason = "-";
|
|
|
+ }
|
|
|
if (company.getPackageEngineering() == 1) {
|
|
|
//检查是否有专业进度待审核
|
|
|
List<ReportProfessionProgress> list = reportProfessionProgressService.list(new QueryWrapper<ReportProfessionProgress>().eq("report_id", ids.get(0)).eq("audit_state", 0));
|
|
@@ -886,9 +946,26 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
}
|
|
|
//直接进行项目经理审核驳回
|
|
|
- reportMapper.update(new Report().setState(2),
|
|
|
+ reportMapper.update(new Report().setState(2)
|
|
|
+ .setRejectReason(reason).setRejectUserid(user.getId()).setRejectUsername(user.getName()),
|
|
|
new QueryWrapper<Report>().in("id", ListUtil.convertIdsArrayToList(reportIds)));
|
|
|
- informationMapper.insert(new Information().setType(0).setContent(date).setUserId(id));
|
|
|
+ List<Report> rList = reportMapper.selectList(new QueryWrapper<Report>().in("id", ListUtil.convertIdsArrayToList(reportIds)));
|
|
|
+ List<Integer> collect = rList.stream().map(Report::getProjectId).collect(Collectors.toList());
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", collect));
|
|
|
+ String pNames = projectList.stream().map(Project::getProjectName).collect(Collectors.joining(", ", "[", "]"));
|
|
|
+ String str = "您"+date+"填写的日报中"+pNames+"项目被领导驳回。原因:" + reason;
|
|
|
+ informationMapper.insert(new Information().setType(0).setContent(date).setUserId(id).setMsg(str));
|
|
|
+
|
|
|
+ //发送企业微信通知消息
|
|
|
+ User reporter = userMapper.selectById(id);
|
|
|
+ String corpwxUserid = reporter.getCorpwxUserid();
|
|
|
+ if (corpwxUserid != null) {
|
|
|
+ WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
|
|
|
+ wxCorpInfoService.sendWXCorpMsg(info, corpwxUserid, str);
|
|
|
+ } else if (reporter.getWxOpenid() != null){
|
|
|
+ //发送个人微信通知
|
|
|
+ pushReject(str, reporter, user.getName(), reason);
|
|
|
+ }
|
|
|
|
|
|
} catch (NullPointerException e) {
|
|
|
httpRespMsg.setError("验证失败");
|
|
@@ -1156,7 +1233,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
nameList.forEach(n->{
|
|
|
n.put("dateStr",sdf.format((java.sql.Date)n.get("date")));
|
|
|
});
|
|
|
- System.out.println("日报人员列表: "+nameList.size());
|
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
List<Profession> professions = professionMapper.selectList(new QueryWrapper<Profession>().eq("company_id", curUser.getCompanyId()));
|
|
|
for (int index=0;index<nameList.size(); index++) {
|
|
@@ -1165,9 +1241,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
List<Map<String, Object>> list2 = null;
|
|
|
//获取相关项目的报告
|
|
|
List<Map<String, Object>> inchargeReportList= reportMapper.getProfessionInchargeReportByDate(createDate.toString(), leaderId, state);
|
|
|
- System.out.println("人员日报列表:"+inchargeReportList.size());
|
|
|
list2 = inchargeReportList.stream().filter(i->i.get("creatorId").equals(map2.get("id"))).collect(Collectors.toList());
|
|
|
- System.out.println("人员日报列表, 过滤后:"+list2.size());
|
|
|
//按项目过滤
|
|
|
if (projectId != null) {
|
|
|
list2 = list2.stream().filter(report->(((Integer)report.get("projectId")).equals(projectId))).collect(Collectors.toList());
|
|
@@ -1217,6 +1291,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
report.put("pics", picList);
|
|
|
}
|
|
|
+ if (((Integer)report.get("multiWorktime")) == 1) {
|
|
|
+ //设置多个工时情况下的报告列表
|
|
|
+ String timeStr = (String)report.get("content");
|
|
|
+ report.put("worktimeList", JSONArray.parse(timeStr));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
httpRespMsg.data = nameList;
|
|
@@ -1242,7 +1321,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//按日期过滤
|
|
|
if (!StringUtils.isEmpty(date)) {
|
|
|
nameList = nameList.stream().filter(map->{
|
|
|
- System.out.println("已有数据日期=="+sdf.format((java.sql.Date)map.get("date"))+", 参数date="+date);
|
|
|
return (sdf.format((java.sql.Date)map.get("date"))).equals(date);
|
|
|
}).collect(Collectors.toList());
|
|
|
}
|
|
@@ -1306,6 +1384,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
report.put("pics", picList);
|
|
|
}
|
|
|
+ if (((Integer)report.get("multiWorktime")) == 1) {
|
|
|
+ //设置多个工时情况下的报告列表
|
|
|
+ String timeStr = (String)report.get("content");
|
|
|
+ report.put("worktimeList", JSONArray.parse(timeStr));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
httpRespMsg.data = nameList;
|
|
@@ -1471,22 +1554,57 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
try {
|
|
|
String userId = request.getHeader("Token");
|
|
|
User user = userMapper.selectById(userId);
|
|
|
+ //检查模式,是否是一个项目多个工作事项的情况
|
|
|
+ TimeType timeType = timeTypeMapper.selectOne(new QueryWrapper<TimeType>().eq("company_id", user.getCompanyId()));
|
|
|
+ Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
|
|
|
//准备导出
|
|
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
|
|
HSSFSheet sheet = workbook.createSheet("工作日报");
|
|
|
+ List<String> titles = new ArrayList<String>();
|
|
|
+ titles.addAll(Arrays.asList(new String[]{
|
|
|
+ "序号","上传者","项目名称","子项目名称"
|
|
|
+ }));
|
|
|
+ //项目管理专业版以上,包括任务
|
|
|
+ if (company.getPackageProject() == 1) {
|
|
|
+ titles.add("关联任务");
|
|
|
+ }
|
|
|
+ titles.add("工作日期");
|
|
|
+ titles.add("工作时长(小时)");
|
|
|
+ if (timeType.getMultiWorktime() == 1) {
|
|
|
+ titles.add("工时时间");
|
|
|
+ }
|
|
|
+ if (timeType.getMultiWorktime() == 0) {
|
|
|
+ titles.add("是否加班");
|
|
|
+ }
|
|
|
+ titles.add("工作事项");
|
|
|
+
|
|
|
//创建表头
|
|
|
HSSFRow headRow = sheet.createRow(0);
|
|
|
//设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
|
|
|
- sheet.setColumnWidth(0, 5 * 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);
|
|
|
+ for (int i=0;i<titles.size(); i++) {
|
|
|
+ int width = 10;
|
|
|
+ if (i == 0) {
|
|
|
+ width = 10;
|
|
|
+ } else if (i == 4 && 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();
|
|
@@ -1494,39 +1612,39 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
headStyle.setFont(font);
|
|
|
//表头
|
|
|
HSSFCell headCell;
|
|
|
- headCell = headRow.createCell(0);
|
|
|
- headCell.setCellValue("序号");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
- headCell = headRow.createCell(1);
|
|
|
- headCell.setCellValue("上传者");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
- headCell = headRow.createCell(2);
|
|
|
- headCell.setCellValue("项目名称");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
- headCell = headRow.createCell(3);
|
|
|
- headCell.setCellValue("子项目名称");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
- headCell = headRow.createCell(4);
|
|
|
- headCell.setCellValue("关联任务");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
- headCell = headRow.createCell(5);
|
|
|
- headCell.setCellValue("工作日期");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
- headCell = headRow.createCell(6);
|
|
|
- headCell.setCellValue("工作时长(小时)");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
- headCell = headRow.createCell(7);
|
|
|
- headCell.setCellValue("工作内容");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
- headCell = headRow.createCell(8);
|
|
|
- headCell.setCellValue("加班");
|
|
|
- headCell.setCellStyle(headStyle);
|
|
|
+
|
|
|
+ for (int i=0;i<titles.size(); i++) {
|
|
|
+ headCell = headRow.createCell(i);
|
|
|
+ headCell.setCellValue(titles.get(i));
|
|
|
+ headCell.setCellStyle(headStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+// headCell = headRow.createCell(1);
|
|
|
+// headCell.setCellValue("上传者");
|
|
|
+// headCell.setCellStyle(headStyle);
|
|
|
+// headCell = headRow.createCell(2);
|
|
|
+// headCell.setCellValue("项目名称");
|
|
|
+// headCell.setCellStyle(headStyle);
|
|
|
+// headCell = headRow.createCell(3);
|
|
|
+// headCell.setCellValue("子项目名称");
|
|
|
+// headCell.setCellStyle(headStyle);
|
|
|
+// headCell = headRow.createCell(4);
|
|
|
+// headCell.setCellValue("关联任务");
|
|
|
+// headCell.setCellStyle(headStyle);
|
|
|
+// headCell = headRow.createCell(5);
|
|
|
+// headCell.setCellValue("工作日期");
|
|
|
+// headCell.setCellStyle(headStyle);
|
|
|
+// headCell = headRow.createCell(6);
|
|
|
+// headCell.setCellValue("工作时长(小时)");
|
|
|
+// headCell.setCellStyle(headStyle);
|
|
|
+//
|
|
|
+
|
|
|
//设置日期格式
|
|
|
HSSFCellStyle style = workbook.createCellStyle();
|
|
|
style.setDataFormat(HSSFDataFormat.getBuiltinFormat("yy/mm/dd hh:mm"));
|
|
|
//新增数据行 并且装填数据
|
|
|
int rowNum = 1;
|
|
|
- List<Map<String, Object>> allReportByDate = null;
|
|
|
+ List<HashMap<String, Object>> allReportByDate = null;
|
|
|
if (user.getRole() == 0) {
|
|
|
//普通员工只能看自己的
|
|
|
allReportByDate = reportMapper.getAllReportByDate(startDate, null, user.getId(), endDate, projectId);
|
|
@@ -1534,6 +1652,31 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//管理员看公司所有人的
|
|
|
allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId);
|
|
|
}
|
|
|
+ if (timeType.getMultiWorktime() == 1) {
|
|
|
+ java.text.DecimalFormat df = new java.text.DecimalFormat("#0.00");
|
|
|
+ //重新处理一下数据,把工作时间和工作事项移出来
|
|
|
+ List<HashMap<String, Object>> dealDataList = new ArrayList<HashMap<String, Object>>();
|
|
|
+ for (HashMap<String, Object> map : allReportByDate) {
|
|
|
+ if ((Integer)map.get("multiWorktime") == 1) {
|
|
|
+ String data = (String)map.get("content");
|
|
|
+ JSONArray array = JSONArray.parseArray(data);
|
|
|
+ for (int i=0;i<array.size(); i++) {
|
|
|
+ JSONObject obj = array.getJSONObject(i);
|
|
|
+ WorktimeItem worktimeItem = JSONObject.toJavaObject(obj, WorktimeItem.class);
|
|
|
+ HashMap<String, Object> newMap = new HashMap<>();
|
|
|
+ newMap.putAll(map);
|
|
|
+ newMap.put("startTime", worktimeItem.getStartTime());
|
|
|
+ newMap.put("endTime", worktimeItem.getEndTime());
|
|
|
+ newMap.put("content", worktimeItem.getContent());
|
|
|
+ newMap.put("duration", df.format(worktimeItem.getTime()));
|
|
|
+ dealDataList.add(newMap);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ dealDataList.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ allReportByDate = dealDataList;
|
|
|
+ }
|
|
|
|
|
|
for (Map<String, Object> map : allReportByDate) {
|
|
|
HSSFRow row = sheet.createRow(rowNum);
|
|
@@ -1541,17 +1684,33 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
row.createCell(1).setCellValue((String) map.get("name"));
|
|
|
row.createCell(2).setCellValue((String) map.get("project"));
|
|
|
row.createCell(3).setCellValue((String) map.get("subProjectName"));
|
|
|
- row.createCell(4).setCellValue((String) map.get("taskName"));
|
|
|
-
|
|
|
- HSSFCell cell = row.createCell(5);
|
|
|
+ int index = 4;
|
|
|
+ if (company.getPackageProject() == 1) {
|
|
|
+ row.createCell(4).setCellValue((String) map.get("taskName"));
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ HSSFCell cell = row.createCell(index);
|
|
|
cell.setCellValue(new SimpleDateFormat("yyyy-MM-dd")
|
|
|
.format((java.sql.Date) map.get("createDate")));
|
|
|
cell.setCellStyle(style);
|
|
|
- row.createCell(6).setCellValue(map.get("duration").toString());
|
|
|
- row.createCell(7).setCellValue((String) map.get("content"));
|
|
|
- int isOverTime = (Integer) map.get("isOvertime");
|
|
|
- row.createCell(8).setCellValue(isOverTime==1?"加班":"-");
|
|
|
-
|
|
|
+ index++;
|
|
|
+ row.createCell(index).setCellValue(map.get("duration").toString());
|
|
|
+ index++;
|
|
|
+ if (timeType.getMultiWorktime() == 1) {
|
|
|
+ if ((Integer)map.get("multiWorktime") == 1) {
|
|
|
+ row.createCell(index).setCellValue(map.get("startTime").toString()+"-"+map.get("endTime").toString());
|
|
|
+ } else {
|
|
|
+ row.createCell(index).setCellValue("");
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ if (timeType.getMultiWorktime() == 0) {
|
|
|
+ int isOverTime = (Integer) map.get("isOvertime");
|
|
|
+ row.createCell(index).setCellValue(isOverTime==1?"加班":"-");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ row.createCell(index).setCellValue((String) map.get("content"));
|
|
|
+ index++;
|
|
|
rowNum++;
|
|
|
}
|
|
|
//生成Excel文件
|
|
@@ -1564,6 +1723,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
httpRespMsg.data = "/upload/" + fileUrlSuffix;
|
|
|
} catch (NullPointerException e) {
|
|
|
httpRespMsg.setError("验证失败或缺少数据");
|
|
|
+ e.printStackTrace();
|
|
|
return httpRespMsg;
|
|
|
} catch (IOException e) {
|
|
|
httpRespMsg.setError("文件生成错误");
|