anderx 1 éve%!(EXTRA string=óta)
szülő
commit
f2a1c92a66

+ 9 - 6
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -831,11 +831,12 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
                             if (dayOfMonth.equals(date)) {
                                 BigDecimal projectDuration = (BigDecimal) map2.get("projectDuration");
                                 BigDecimal added = projectDuration.add(BigDecimal.valueOf(e.getDuration()));
+                                BigDecimal checkDuration = BigDecimal.valueOf(e.getCheckDuration());
                                 map2.put("projectDuration", added);
-                                if (added.compareTo(BigDecimal.valueOf(8))>=0){
+                                if (projectDuration.compareTo(checkDuration) >= 0){
                                     map2.put("notDuration", BigDecimal.valueOf(0));
                                 }else {
-                                    map2.put("notDuration", BigDecimal.valueOf(8).subtract(added));
+                                    map2.put("notDuration", checkDuration.subtract(added));
                                 }
                                 break;
                             }
@@ -928,8 +929,8 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
                     map.put("week","日");
                     break;
             }
-            map.put("projectDuration", BigDecimal.valueOf(0));
-            map.put("notDuration", BigDecimal.valueOf(8));
+            map.put("projectDuration", BigDecimal.ZERO);
+            map.put("notDuration", BigDecimal.ZERO);
             list.add(map);
             startDate = startDate.plusDays(1);
         }
@@ -944,11 +945,13 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
             Integer date = (Integer) map2.get("date");
             if (recordTime.getDayOfMonth()==date) {
                 BigDecimal projectDuration = BigDecimal.valueOf(e.getDuration());
+                BigDecimal checkDuration = BigDecimal.valueOf(e.getCheckDuration());
                 map2.put("projectDuration", projectDuration);
-                if (projectDuration.compareTo(BigDecimal.valueOf(8))>=0){
+                map2.put("checkDuration", checkDuration);
+                if (projectDuration.compareTo(checkDuration) >= 0){
                     map2.put("notDuration", BigDecimal.valueOf(0));
                 }else {
-                    map2.put("notDuration", BigDecimal.valueOf(8).subtract(projectDuration));
+                    map2.put("notDuration", checkDuration.subtract(projectDuration));
                 }
                 break;
             }

+ 1 - 1
ruoyi-system/src/main/resources/mapper/project/ProjectStaffRecordMapper.xml

@@ -346,7 +346,7 @@
         select
         <include refid="Base_Column_List" />
         from project_staff_record
-        where process_status=2
+        where process_status=2 and check_duration >=0
         and pid = #{id}
         and record_time between #{startDate} and #{endDate}
     </select>

+ 1 - 1
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -314,7 +314,7 @@
         from (select a.id,a.name ,date_format(b.record_time,'%Y-%m')recordTime,d.company_name
         from project_task a left join project_staff_record b on a.id =b.pid
         left join sys_user c on b.aid=c.user_id left join sys_dept d on c.dept_id=d.dept_id
-              where b.process_status=2
+              where b.process_status=2 and b.check_duration>=0
               <if test="companyId !=null">
                   and  d.company_id= #{companyId}
               </if>