wkyy 3 년 전
부모
커밋
fd79e4152f

+ 2 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/dao/WorkScheduleAttendanceDAO.java

@@ -59,4 +59,6 @@ public interface WorkScheduleAttendanceDAO {
 	double findSumWorkMinuteByParams(Long personId, Date startDate, Date endDate, Map<String, Object> searchParams);
 
     List<Map> queryDuplicateRecord(Date startDate, int limit);
+
+	WorkScheduleAttendance findByScheduleAttendanceId(String personScheduleId, String workShiftId, String classify);
 }

+ 1 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/entity/WorkScheduleAttendance.java

@@ -132,4 +132,5 @@ public class WorkScheduleAttendance {
 
     @Transient
     private WorkOverPerson workOverPerson;
+
 }

+ 2 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/service/WorkScheduleAttendanceService.java

@@ -87,4 +87,6 @@ public interface WorkScheduleAttendanceService {
     BigDecimal findSumWorkMinuteByParams(Long personId, Date startDate, Date endDate,Map<String, Object> searchParams);
 
 	List<Map> queryDuplicateRecord(Date startDate, int limit);
+
+	WorkScheduleAttendance findByScheduleAttendanceId(String personScheduleId, String workShiftId, String classify);
 }

+ 7 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/WorkScheduleAttendanceServiceImpl.java

@@ -726,6 +726,13 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
         return attendanceList;
     }
 
+    @Override
+    public WorkScheduleAttendance findByScheduleAttendanceId(String personScheduleId, String workShiftId, String classify) {
+        WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceDAO.findByScheduleAttendanceId(personScheduleId, workShiftId, classify);
+
+        return workScheduleAttendance;
+    }
+
     @Override
     public WorkScheduleAttendance findLastByPersonScheduleIdAndClassify(String personScheduleId, String workShiftId, String classify) {
         WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceDAO.findLastByPersonScheduleIdAndClassify(personScheduleId, workShiftId, classify);

+ 8 - 5
common/src/main/java/com/jpsoft/shinestar/modules/workflow/service/impl/ProcinstActUserServiceImpl.java

@@ -788,12 +788,15 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                             for (SupplementWorkPerson supplementWorkPerson : supplementWorkPersonList) {
                                                 WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceService.get(supplementWorkPerson.getScheduleAttendanceId());
 
-                                                if (workScheduleAttendance != null) {
-                                                    workScheduleAttendance.setResult("1");
-                                                    workScheduleAttendance.setRemark("补卡");
-                                                    workScheduleAttendance.setUpdateTime(new Date());
-                                                    workScheduleAttendanceService.update(workScheduleAttendance);
+                                                WorkScheduleAttendance workScheduleAttendance1 = workScheduleAttendanceService.findByScheduleAttendanceId(workScheduleAttendance.getPersonScheduleId(),workScheduleAttendance.getWorkShiftId(),workScheduleAttendance.getClassify());
+                                                if (workScheduleAttendance1 != null) {
+                                                    workScheduleAttendance1.setResult("1");
+                                                    workScheduleAttendance1.setRemark("补卡");
+                                                    workScheduleAttendance1.setUpdateTime(new Date());
+                                                    workScheduleAttendanceService.update(workScheduleAttendance1);
+                                                    supplementWorkPerson.setScheduleAttendanceId(workScheduleAttendance1.getId());
                                                 }
+
                                             }
                                         }
                                     }

+ 8 - 0
common/src/main/resources/mapper/business/WorkScheduleAttendance.xml

@@ -191,6 +191,14 @@
         and del_flag=0
         order by record_time desc
     </select>
+    <select id="findByScheduleAttendanceId" resultMap="WorkScheduleAttendanceMap">
+        select * from business_work_schedule_attendance
+        where person_schedule_id=#{personScheduleId}
+        and work_shift_id = #{workShiftId}
+        and classify_=#{classify}
+        and del_flag=0
+        order by create_time desc
+    </select>
     <select id="findAttendanceDateByPersonAndMonths" resultType="date">
         SELECT DISTINCT
             attendance_date