|
@@ -5098,7 +5098,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
double time = 0;
|
|
|
if (!StringUtils.isEmpty(stringCellValue)) {
|
|
|
time = Double.parseDouble(stringCellValue);
|
|
|
- if (time > 0) {
|
|
|
+ if (time >= 0) {
|
|
|
+ //0也加进去,按删除老的待审核日报来处理
|
|
|
String pName = projectList.get(i-projectNameStartIndex);
|
|
|
Project project = allProjectList.stream().filter(p -> p.getProjectName().equals(pName)||(p.getProjectCode()!=null&&p.getProjectCode().equals(pName))).findFirst().get();
|
|
|
String subPName = subProjectList.get(i-projectNameStartIndex);
|
|
@@ -5176,7 +5177,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
msg.setError(MessageUtils.message("finance.importErrorByAllAdopt"));
|
|
|
return msg;
|
|
|
} else {
|
|
|
- reportService.saveBatch(reportList);
|
|
|
+ //只保存工时不为0的数据
|
|
|
+ List<Report> fReportList = reportList.stream().filter(r->r.getWorkingTime()>0).collect(Collectors.toList());
|
|
|
+ reportService.saveBatch(fReportList);
|
|
|
msg.data = dataCount;
|
|
|
String originName = fileName;
|
|
|
//定义一个独立的文件夹
|
|
@@ -5956,6 +5959,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
DateTimeFormatter dft = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
for (Map<String, Object> map : allReportByDate) {
|
|
|
long p1 = System.currentTimeMillis();
|
|
|
List<String> item=new ArrayList<>();
|
|
@@ -6141,86 +6145,106 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
item.add("");
|
|
|
}
|
|
|
}
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
- boolean isFirst = true;
|
|
|
- String logMsg = (String)map.get("logMsg");
|
|
|
- if (logMsg != null) {
|
|
|
- String[] logMsgs = logMsg.split("❤");
|
|
|
- for (String msgItem : logMsgs) {
|
|
|
- String[] splitItems = msgItem.split("@");
|
|
|
- //operator_id@operate_date@msg
|
|
|
- String operateDateStr = splitItems[1];
|
|
|
- LocalDateTime operateDate = LocalDateTime.parse(operateDateStr, dtf);
|
|
|
- ReportLogDetail audit = new ReportLogDetail();
|
|
|
- audit.setOperatorId(splitItems[0]);
|
|
|
- audit.setOperateDate(operateDate);
|
|
|
- audit.setMsg(splitItems[2]);
|
|
|
- String auditMsg = audit.getMsg();
|
|
|
-
|
|
|
- if (company.getIsInternational() == 1) {
|
|
|
- operateDate = operateDate.plusSeconds(offsetSeconds);
|
|
|
+ //全部导出的形式
|
|
|
+ if (exportType==0) {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ if (user.getCompanyId() == 839) {
|
|
|
+ //直接从reportLog表查询,更准确
|
|
|
+ List<ReportLog> rLogList = reportLogMapper.selectList(new QueryWrapper<ReportLog>().like("report_ids", "%"+map.get("id")+"%").eq("company_id", companyId).eq("create_date", map.get("createDate")).eq("creator_id", map.get("creatorId")));
|
|
|
+ boolean isFirst = true;
|
|
|
+ if (rLogList.size() > 0) {
|
|
|
+ for (ReportLog rLog : rLogList) {
|
|
|
+ String logMsg = rLog.getMsg();
|
|
|
+ String time = dtf.format(rLog.getOperateDate());
|
|
|
+ String msg = time + " " + logMsg;
|
|
|
+ if (isFirst) {
|
|
|
+ isFirst = false;
|
|
|
+ } else {
|
|
|
+ sb.append("->");
|
|
|
+ }
|
|
|
+ sb.append(msg);
|
|
|
+ }
|
|
|
}
|
|
|
- String time = dtf.format(operateDate);
|
|
|
- String msg= "";
|
|
|
- if (auditMsg != null) {
|
|
|
- if(needCorpWxTranslate){
|
|
|
- Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
|
|
|
- if(first.isPresent()){
|
|
|
- User corpwxUser = first.get();
|
|
|
- String corpwxUserName = corpwxUser.getName();
|
|
|
- if (!StringUtils.isEmpty(corpwxUserName) && (auditMsg.contains(corpwxUserName))) {
|
|
|
- if(auditMsg.contains("提交了")){
|
|
|
- int i = auditMsg.indexOf("提");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
|
|
|
- }else if(auditMsg.contains("审核通过了")){
|
|
|
- int i = auditMsg.indexOf("审");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
|
|
|
- }else if(auditMsg.contains("驳回了")) {
|
|
|
- int i = auditMsg.indexOf("驳");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
|
|
|
- }
|
|
|
- } else {
|
|
|
- msg = time+" " + auditMsg;
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
- Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
|
|
|
- if(first.isPresent()){
|
|
|
- String dingdingUserid = first.get().getDingdingUserid();
|
|
|
- if (!StringUtils.isEmpty(dingdingUserid) && auditMsg.contains(dingdingUserid)) {
|
|
|
- if(auditMsg.contains("提交了")){
|
|
|
- int i = auditMsg.indexOf("提");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"\\$userName="+dingdingUserid+"$\\");
|
|
|
- }else if(auditMsg.contains("审核通过了")){
|
|
|
- int i = auditMsg.indexOf("审");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"\\$userName="+dingdingUserid+"$\\");
|
|
|
- }else if(auditMsg.contains("驳回了")) {
|
|
|
- int i = auditMsg.indexOf("驳");
|
|
|
- String substring = auditMsg.substring(0, i);
|
|
|
- msg = time+" " + auditMsg.replace(substring,"\\$userName="+dingdingUserid+"$\\");
|
|
|
+ } else {
|
|
|
+ boolean isFirst = true;
|
|
|
+ String logMsg = (String)map.get("logMsg");
|
|
|
+ if (logMsg != null) {
|
|
|
+ String[] logMsgs = logMsg.split("❤");
|
|
|
+ for (String msgItem : logMsgs) {
|
|
|
+ String[] splitItems = msgItem.split("@");
|
|
|
+ //operator_id@operate_date@msg
|
|
|
+ String operateDateStr = splitItems[1];
|
|
|
+ LocalDateTime operateDate = LocalDateTime.parse(operateDateStr, dtf);
|
|
|
+ ReportLogDetail audit = new ReportLogDetail();
|
|
|
+ audit.setOperatorId(splitItems[0]);
|
|
|
+ audit.setOperateDate(operateDate);
|
|
|
+ audit.setMsg(splitItems[2]);
|
|
|
+ String auditMsg = audit.getMsg();
|
|
|
+
|
|
|
+ if (company.getIsInternational() == 1) {
|
|
|
+ operateDate = operateDate.plusSeconds(offsetSeconds);
|
|
|
+ }
|
|
|
+ String time = dtf.format(operateDate);
|
|
|
+ String msg= "";
|
|
|
+ if (auditMsg != null) {
|
|
|
+ if(needCorpWxTranslate){
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
|
|
|
+ if(first.isPresent()){
|
|
|
+ User corpwxUser = first.get();
|
|
|
+ String corpwxUserName = corpwxUser.getName();
|
|
|
+ if (!StringUtils.isEmpty(corpwxUserName) && (auditMsg.contains(corpwxUserName))) {
|
|
|
+ if(auditMsg.contains("提交了")){
|
|
|
+ int i = auditMsg.indexOf("提");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
|
|
|
+ }else if(auditMsg.contains("审核通过了")){
|
|
|
+ int i = auditMsg.indexOf("审");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
|
|
|
+ }else if(auditMsg.contains("驳回了")) {
|
|
|
+ int i = auditMsg.indexOf("驳");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ msg = time+" " + auditMsg;
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
+ }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
|
|
|
+ if(first.isPresent()){
|
|
|
+ String dingdingUserid = first.get().getDingdingUserid();
|
|
|
+ if (!StringUtils.isEmpty(dingdingUserid) && auditMsg.contains(dingdingUserid)) {
|
|
|
+ if(auditMsg.contains("提交了")){
|
|
|
+ int i = auditMsg.indexOf("提");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"\\$userName="+dingdingUserid+"$\\");
|
|
|
+ }else if(auditMsg.contains("审核通过了")){
|
|
|
+ int i = auditMsg.indexOf("审");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"\\$userName="+dingdingUserid+"$\\");
|
|
|
+ }else if(auditMsg.contains("驳回了")) {
|
|
|
+ int i = auditMsg.indexOf("驳");
|
|
|
+ String substring = auditMsg.substring(0, i);
|
|
|
+ msg = time+" " + auditMsg.replace(substring,"\\$userName="+dingdingUserid+"$\\");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ msg = time+" " + auditMsg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
msg = time+" " + auditMsg;
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
- msg = time+" " + auditMsg;
|
|
|
- }
|
|
|
- }
|
|
|
- if (!isFirst) {
|
|
|
- sb.append("->");
|
|
|
- } else {
|
|
|
- isFirst = false;
|
|
|
+ if (!isFirst) {
|
|
|
+ sb.append("->");
|
|
|
+ } else {
|
|
|
+ isFirst = false;
|
|
|
+ }
|
|
|
+ sb.append(msg);
|
|
|
+ }
|
|
|
}
|
|
|
- sb.append(msg);
|
|
|
}
|
|
|
- }
|
|
|
- if (exportType==0) {
|
|
|
item.add(sb.toString());
|
|
|
}
|
|
|
}
|