Jelajahi Sumber

日报批量审核修复审批流的问题

seyason 2 tahun lalu
induk
melakukan
7fb6a4b082

+ 24 - 23
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -358,38 +358,39 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                 }
                 userService.updateBatchById(dbUpUserList);
             }
-            //检查是否有删除的,需要删除掉
-            List<Integer> readyForDelete = new ArrayList<>();
-            oldFinanceList.forEach(old->{
-                boolean exists = false;
-                if (financeList.stream().filter(f->f.getName().equals(old.getName())).findAny().isPresent()) {
-                    exists = true;
-                }
-                if (!exists) {
-                    readyForDelete.add(old.getId());
-                }
-            });
-            if (readyForDelete.size() > 0) {
-                financeService.removeByIds(readyForDelete);
-            }
+            //修改成每次上传都新增更新,不删除。 前端界面增加删除功能。
+//            List<Integer> readyForDelete = new ArrayList<>();
+//            oldFinanceList.forEach(old->{
+//                boolean exists = false;
+//                if (financeList.stream().filter(f->f.getName().equals(old.getName())).findAny().isPresent()) {
+//                    exists = true;
+//                }
+//                if (!exists) {
+//                    readyForDelete.add(old.getId());
+//                }
+//            });
+//            if (readyForDelete.size() > 0) {
+//                financeService.removeByIds(readyForDelete);
+//            }
             //如果有必要,更新该月份的日报相关的成本
             if (syncHistoryReport) {
                 List<Report> reportList = reportMapper.selectSimpleTime(companyId, startStr, endStr);
                 if (reportList.size() > 0) {
+                    List<Report> updateReportList = new ArrayList<>();
                     for (Report r : reportList) {
                         Optional<User> first = updateUserList.stream().filter(u -> u.getId().equals(r.getCreatorId())).findFirst();
-                        if (!first.isPresent()) {
-                            String notFillUser = userMapper.selectById(r.getCreatorId()).getName();
-                            System.out.println("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
-                            throw new UserNotFoundException("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
+                        if (first.isPresent()) {
+                            BigDecimal hourCost = first.get().getCost();
+                            r.setCost(hourCost.multiply(new BigDecimal(r.getWorkingTime())));
+                            r.setCreatorId(null);
+                            r.setWorkingTime(null);
+                            updateReportList.add(r);
                         }
-                        BigDecimal hourCost = first.get().getCost();
-                        r.setCost(hourCost.multiply(new BigDecimal(r.getWorkingTime())));
-                        r.setCreatorId(null);
-                        r.setWorkingTime(null);
                     }
                     //批量更新日报的成本
-                    reportService.updateBatchById(reportList);
+                    if (updateReportList.size() > 0) {
+                        reportService.updateBatchById(updateReportList);
+                    }
                 }
             }
 

+ 3 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1659,9 +1659,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                     System.out.println("没有其他等待的项目了,继续更新到下个流程");
                                     //没有其他待审核的项目了,流程往下走
                                     Report upR = new Report();
-                                    for (int m=0;m<settings.size(); m++) {
-                                        if (settings.get(m).getIsDeptAudit()== 0) {//找到项目审核的那个节点
-                                            AuditWorkflowTimeSetting nextNode = settings.get(m + 1);
+                                    for (int m=0;m<deptSettings.size(); m++) {
+                                        if (deptSettings.get(m).getIsDeptAudit()== 0) {//找到项目审核的那个节点
+                                            AuditWorkflowTimeSetting nextNode = deptSettings.get(m + 1);
                                             curReport.setIsDeptAudit(nextNode.getIsDeptAudit());
                                             if (curReport.getIsDeptAudit() == 1) {
                                                 curReport.setAuditDeptid(nextNode.getAuditDeptId());
@@ -1669,7 +1669,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                                         .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
                                             }
                                             curReport.setIsFinalAudit(nextNode.getIsFinal());
-                                            System.out.println("设置下个流程节点:部门审核=" + nextNode.getIsDeptAudit());
                                             upR = curReport;
                                             break;
                                         }

+ 30 - 13
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-dev.yml

@@ -9,13 +9,13 @@ spring:
     multipart:
       # 配置上传文件的大小设置
       # Single file max size  即单个文件大小
-      max-file-size: 10000MB
-      max-request-size: 10000MB
+      max-file-size: 100MB
+      max-request-size: 100MB
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://118.190.47.230:3306/man2?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
+    url: jdbc:mysql://127.0.0.1:3306/man_dev?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
     username: root
-    password: p011430seya1026
+    password: HuoshiDB@2022
     hikari:
       maximum-pool-size: 10
       minimum-idle: 3
@@ -24,8 +24,8 @@ spring:
     #######redis配置######
     # redis
     redis:
-      host: 118.190.47.230
-      port: 6379
+      host: 127.0.0.1
+      port: 6479
       timeout: 3
       # password:
       pool:
@@ -48,11 +48,11 @@ spring:
 logging:
   level:
     root: info
-    org.mybatis: debug
-    java.sql: debug
-    org.springframework.web: trace
+    org.mybatis: error
+    java.sql: error
+    org.springframework.web: error
     #打印sql语句
-    com.management.platform.mapper: debug
+    com.management.platform.mapper: error
   path: /log/
   file: worktime.log
 ##########
@@ -80,9 +80,26 @@ mybatis:
   mapper-locations: mappers/*Mapper.xml
 #####配置图片上传路径####
 upload:
-  path: /www/worktime/client/timesheet/upload/
+  path: /www/staticproject/timesheet/upload/
+
+
+
 
-configEnv:
-  isDev: true
 
+##actuator健康检查配置
+management:
+  security:
+    enabled:false:
+  server:
+    port: 10011
+  #  endpoints:
+  #    web:
+  #      exposure:
+  #        include: "*"
 
+  health:
+    redis:
+      enabled: false
+
+configEnv:
+  isDev: true