Commit 2b433ba010fa8f479da06ad2a5c11c666f589101
1 parent
6443d13d
feat: 修复修改排班日期规则工作日期bug
Showing
7 changed files
with
90 additions
and
49 deletions
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| @@ -159,7 +159,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -159,7 +159,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 159 | signIn.setCreateTime(new Date()); | 159 | signIn.setCreateTime(new Date()); |
| 160 | signIn.setRemark(""); | 160 | signIn.setRemark(""); |
| 161 | GlobalIndex globalIndex = new GlobalIndex(); | 161 | GlobalIndex globalIndex = new GlobalIndex(); |
| 162 | - long now = System.currentTimeMillis(); | 162 | + long now = signIn.getCreateTime().getTime(); |
| 163 | List<DriverScheduling> dto = schedulingService.queryScheduling(signIn.getJobCode(), now); | 163 | List<DriverScheduling> dto = schedulingService.queryScheduling(signIn.getJobCode(), now); |
| 164 | // 签到检查 | 164 | // 签到检查 |
| 165 | if (checkSignIn(now, dto, globalIndex, signIn, driver)) { | 165 | if (checkSignIn(now, dto, globalIndex, signIn, driver)) { |
| @@ -182,6 +182,10 @@ public class SignInServiceImpl implements ISignInService { | @@ -182,6 +182,10 @@ public class SignInServiceImpl implements ISignInService { | ||
| 182 | threadJobService.asyncInsertExceptionRecord(signIn, driver, dto, globalIndex); | 182 | threadJobService.asyncInsertExceptionRecord(signIn, driver, dto, globalIndex); |
| 183 | 183 | ||
| 184 | // 驾驶人员二次签到酒精测试异常 | 184 | // 驾驶人员二次签到酒精测试异常 |
| 185 | + return handleAjaxResult(signIn, driver, vo); | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + private AjaxResult handleAjaxResult(SignIn signIn, Driver driver, SignInResponseVo vo) { | ||
| 185 | if (PERSONNEL_POSTS_DRIVER.equals(driver.getPosts()) && SIGN_IN_FAIL.equals(signIn.getStatus()) && signIn.getRemark().contains(ALCOHOL_SIGN_IN_ERROR)) { | 189 | if (PERSONNEL_POSTS_DRIVER.equals(driver.getPosts()) && SIGN_IN_FAIL.equals(signIn.getStatus()) && signIn.getRemark().contains(ALCOHOL_SIGN_IN_ERROR)) { |
| 186 | AjaxResult result = getAjaxResultByDriverSignInfo(signIn, vo); | 190 | AjaxResult result = getAjaxResultByDriverSignInfo(signIn, vo); |
| 187 | if (!Objects.isNull(result)) { | 191 | if (!Objects.isNull(result)) { |
ruoyi-admin/src/main/java/com/ruoyi/mapper/RuleAttendanceMainMapper.java
| @@ -10,33 +10,35 @@ import org.apache.ibatis.annotations.Param; | @@ -10,33 +10,35 @@ import org.apache.ibatis.annotations.Param; | ||
| 10 | import java.util.List; | 10 | import java.util.List; |
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | -* @author 20412 | ||
| 14 | -* @description 针对表【rule_attendance_main(考勤表)】的数据库操作Mapper | ||
| 15 | -* @createDate 2023-09-03 12:15:39 | ||
| 16 | -* @Entity .domain.RuleAttendanceMain | ||
| 17 | -*/ | 13 | + * @author 20412 |
| 14 | + * @description 针对表【rule_attendance_main(考勤表)】的数据库操作Mapper | ||
| 15 | + * @createDate 2023-09-03 12:15:39 | ||
| 16 | + * @Entity .domain.RuleAttendanceMain | ||
| 17 | + */ | ||
| 18 | public interface RuleAttendanceMainMapper extends BaseMapper<RuleAttendanceMain> { | 18 | public interface RuleAttendanceMainMapper extends BaseMapper<RuleAttendanceMain> { |
| 19 | /** | 19 | /** |
| 20 | * 批量更新 | 20 | * 批量更新 |
| 21 | * | 21 | * |
| 22 | * @param vo | 22 | * @param vo |
| 23 | - * @param main | 23 | + * @param mainList |
| 24 | */ | 24 | */ |
| 25 | - void updateByIdTotalQuantity(@Param("vo") UpdateAttendanceVo vo,@Param("main") RuleAttendanceMain main); | 25 | + void updateByIdTotalQuantity(@Param("vo") UpdateAttendanceVo vo, @Param("mainList") List<RuleAttendanceMain> mainList); |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| 28 | * 批量删除 | 28 | * 批量删除 |
| 29 | + * | ||
| 29 | * @param vo | 30 | * @param vo |
| 30 | */ | 31 | */ |
| 31 | void deleteByJobCodeTotalRecord(DeleteAttendanceVo vo); | 32 | void deleteByJobCodeTotalRecord(DeleteAttendanceVo vo); |
| 32 | 33 | ||
| 33 | /** | 34 | /** |
| 34 | * 获取当月的日期数据 | 35 | * 获取当月的日期数据 |
| 36 | + * | ||
| 35 | * @param vo | 37 | * @param vo |
| 36 | * @param jobCodes | 38 | * @param jobCodes |
| 37 | * @return | 39 | * @return |
| 38 | */ | 40 | */ |
| 39 | - List<RuleAttendanceMain> queryNowMonthDate(@Param("vo") PeopleRequestVo vo, @Param("jobCodes")List<String> jobCodes); | 41 | + List<RuleAttendanceMain> queryNowMonthDate(@Param("vo") PeopleRequestVo vo, @Param("jobCodes") List<String> jobCodes); |
| 40 | } | 42 | } |
| 41 | 43 | ||
| 42 | 44 |
ruoyi-admin/src/main/java/com/ruoyi/service/RuleAttendanceMainService.java
| @@ -5,11 +5,9 @@ import com.ruoyi.domain.RuleAttendanceMain; | @@ -5,11 +5,9 @@ import com.ruoyi.domain.RuleAttendanceMain; | ||
| 5 | import com.ruoyi.domain.RuleAttendanceMainHelp; | 5 | import com.ruoyi.domain.RuleAttendanceMainHelp; |
| 6 | import com.ruoyi.pojo.vo.DeleteAttendanceVo; | 6 | import com.ruoyi.pojo.vo.DeleteAttendanceVo; |
| 7 | import com.ruoyi.pojo.vo.PeopleRequestVo; | 7 | import com.ruoyi.pojo.vo.PeopleRequestVo; |
| 8 | -import com.ruoyi.pojo.vo.PeopleResponseVo; | ||
| 9 | import com.ruoyi.pojo.vo.UpdateAttendanceVo; | 8 | import com.ruoyi.pojo.vo.UpdateAttendanceVo; |
| 10 | import org.apache.ibatis.annotations.Param; | 9 | import org.apache.ibatis.annotations.Param; |
| 11 | 10 | ||
| 12 | -import java.time.LocalDate; | ||
| 13 | import java.util.List; | 11 | import java.util.List; |
| 14 | 12 | ||
| 15 | /** | 13 | /** |
| @@ -24,7 +22,7 @@ public interface RuleAttendanceMainService extends IService<RuleAttendanceMain> | @@ -24,7 +22,7 @@ public interface RuleAttendanceMainService extends IService<RuleAttendanceMain> | ||
| 24 | * @param vo | 22 | * @param vo |
| 25 | * @param main | 23 | * @param main |
| 26 | */ | 24 | */ |
| 27 | - void updateByJobCodeTotalQuantity(@Param("vo") UpdateAttendanceVo vo, @Param("main") RuleAttendanceMain main); | 25 | + void updateByJobCodeTotalQuantity(@Param("vo") UpdateAttendanceVo vo, @Param("main") List<RuleAttendanceMain> main); |
| 28 | 26 | ||
| 29 | /** | 27 | /** |
| 30 | * 删除排班 | 28 | * 删除排班 |
ruoyi-admin/src/main/java/com/ruoyi/service/SchedulingService.java
| @@ -118,16 +118,17 @@ public class SchedulingService { | @@ -118,16 +118,17 @@ public class SchedulingService { | ||
| 118 | return; | 118 | return; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | + String remark = getRemark(dto, signIn, globalIndex.getIndex()); | ||
| 121 | // 更新最新的签到记录判断是否需要更新考勤 | 122 | // 更新最新的签到记录判断是否需要更新考勤 |
| 122 | // 记录为空直接插入记录 | 123 | // 记录为空直接插入记录 |
| 123 | if (Objects.isNull(dto.get(globalIndex.getIndex()).getSignInId()) || dto.size() == 1) { | 124 | if (Objects.isNull(dto.get(globalIndex.getIndex()).getSignInId()) || dto.size() == 1) { |
| 124 | - schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), signIn.getRemark(), signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 125 | + schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 125 | // 更新缓存 | 126 | // 更新缓存 |
| 126 | nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | 127 | nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); |
| 127 | } | 128 | } |
| 128 | // 之前的无效 | 129 | // 之前的无效 |
| 129 | else if (!dto.get(globalIndex.getIndex()).getExType().equals(SIGN_NO_EX_NUM)) { | 130 | else if (!dto.get(globalIndex.getIndex()).getExType().equals(SIGN_NO_EX_NUM)) { |
| 130 | - schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), signIn.getRemark(), signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 131 | + schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 131 | nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | 132 | nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); |
| 132 | } | 133 | } |
| 133 | // 之前的有效 | 134 | // 之前的有效 |
| @@ -137,17 +138,31 @@ public class SchedulingService { | @@ -137,17 +138,31 @@ public class SchedulingService { | ||
| 137 | 138 | ||
| 138 | } | 139 | } |
| 139 | 140 | ||
| 141 | + private String getRemark(List<DriverScheduling> dto, SignIn signIn, Integer globalIndex) { | ||
| 142 | + DriverScheduling scheduling = dto.get(globalIndex); | ||
| 143 | + long date = scheduling.getBcType().equals(BC_TYPE_IN) ? scheduling.getZdsjT() : scheduling.getFcsjT(); | ||
| 144 | + long nowBetween = ChronoUnit.MINUTES.between(ConstDateUtil.getLocalDateTimeByLongTime(date), ConstDateUtil.getLocalDateTimeByLongTime(signIn.getCreateTime().getTime())); | ||
| 145 | + if (!(Math.abs(nowBetween) <= 60)) { | ||
| 146 | + if (nowBetween < -60L) { | ||
| 147 | + return "早签"; | ||
| 148 | + } else { | ||
| 149 | + return "迟到"; | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | + return signIn.getRemark(); | ||
| 153 | + } | ||
| 154 | + | ||
| 140 | private void handlerRecord(List<DriverScheduling> dto, SignIn signIn, GlobalIndex globalIndex) { | 155 | private void handlerRecord(List<DriverScheduling> dto, SignIn signIn, GlobalIndex globalIndex) { |
| 141 | if (globalIndex.getIndex() == dto.size() - 1) { | 156 | if (globalIndex.getIndex() == dto.size() - 1) { |
| 142 | return; | 157 | return; |
| 143 | } | 158 | } |
| 144 | - long timer = 1000 * 60 * 5; | ||
| 145 | - // 有效的在一分钟内重复签到不做修改 | 159 | + long timer = 1000 * 60 * 60; |
| 160 | + // 有效的在一小时内内重复签到不做修改 | ||
| 146 | if (signIn.getExType().equals(SIGN_NO_EX_NUM) && (DateUtils.getNowDate().getTime() - dto.get(globalIndex.getIndex()).getSignTime().getTime()) <= timer) { | 161 | if (signIn.getExType().equals(SIGN_NO_EX_NUM) && (DateUtils.getNowDate().getTime() - dto.get(globalIndex.getIndex()).getSignTime().getTime()) <= timer) { |
| 147 | - signIn.setRemark("您已经打卡过了,您已完成" + (globalIndex.getIndex() + 1) + "次打卡,请勿在5分钟内重复打卡"); | 162 | + signIn.setRemark("您已经打卡过了,请勿在一小时内重复打卡"); |
| 148 | return; | 163 | return; |
| 149 | } | 164 | } |
| 150 | - Integer index = globalIndex.getIndex() + 1; | 165 | + int index = globalIndex.getIndex() + 1; |
| 151 | // 之前是签到 | 目前有效记录 -》进行修改 变成无效 | 166 | // 之前是签到 | 目前有效记录 -》进行修改 变成无效 |
| 152 | if (signIn.getExType().equals(SIGN_NO_EX_NUM)) { | 167 | if (signIn.getExType().equals(SIGN_NO_EX_NUM)) { |
| 153 | signIn.setStatus(SIGN_IN_FAIL); | 168 | signIn.setStatus(SIGN_IN_FAIL); |
| @@ -160,7 +175,9 @@ public class SchedulingService { | @@ -160,7 +175,9 @@ public class SchedulingService { | ||
| 160 | signIn.setRemark((scheduling.getBcType().equals(BC_TYPE_IN) ? SIGN_OUT_TIMEOUT : SIGN_IN_TIMEOUT) + prompt); | 175 | signIn.setRemark((scheduling.getBcType().equals(BC_TYPE_IN) ? SIGN_OUT_TIMEOUT : SIGN_IN_TIMEOUT) + prompt); |
| 161 | signIn.setRemark(signIn.getRemark().replaceFirst(",$", "。")); | 176 | signIn.setRemark(signIn.getRemark().replaceFirst(",$", "。")); |
| 162 | // 之前是签到 | 目前无效 -》往后更新 | 177 | // 之前是签到 | 目前无效 -》往后更新 |
| 163 | - schedulingMapper.updateRoster(scheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), signIn.getRemark(), signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 178 | + |
| 179 | + String remark = getRemark(dto, signIn, index); | ||
| 180 | + schedulingMapper.updateRoster(scheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | ||
| 164 | nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex() + 1, signIn); | 181 | nowSchedulingCache.updateCacheByJobCode(ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex() + 1, signIn); |
| 165 | } | 182 | } |
| 166 | 183 |
ruoyi-admin/src/main/java/com/ruoyi/service/impl/AttendanceServiceImpl.java
| @@ -175,26 +175,45 @@ public class AttendanceServiceImpl implements AttendanceService { | @@ -175,26 +175,45 @@ public class AttendanceServiceImpl implements AttendanceService { | ||
| 175 | RuleAttendanceMain main = new RuleAttendanceMain(); | 175 | RuleAttendanceMain main = new RuleAttendanceMain(); |
| 176 | RuleScheduling ruleScheduling = ruleSchedulingService.selectRuleSchedulingById(vo.getRuleId().longValue()); | 176 | RuleScheduling ruleScheduling = ruleSchedulingService.selectRuleSchedulingById(vo.getRuleId().longValue()); |
| 177 | BeanUtils.copyProperties(ruleScheduling, main); | 177 | BeanUtils.copyProperties(ruleScheduling, main); |
| 178 | - main.setFirstWorkSignInTime(ConstDateUtil.dateAddition(LocalDate.now().toString(), ConstDateUtil.formatDate("HH:mm:ss", main.getFirstWorkSignInTime()))); | 178 | + List<RuleAttendanceMain> mainList = handleRuleUpdate(vo, main, ruleScheduling); |
| 179 | + attendanceMainService.updateByJobCodeTotalQuantity(vo, mainList); | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + private static List<RuleAttendanceMain> handleRuleUpdate(UpdateAttendanceVo vo, RuleAttendanceMain main, RuleScheduling ruleScheduling) { | ||
| 183 | + List<RuleAttendanceMain> mainList = new ArrayList<>(); | ||
| 184 | + LocalDate startDate = LocalDate.parse(vo.getStartDate()); | ||
| 185 | + LocalDate endDate = LocalDate.parse(vo.getEndDate()); | ||
| 186 | + while (startDate.compareTo(endDate) <= 0) { | ||
| 187 | + handleSegmentation(main, ruleScheduling, mainList, startDate); | ||
| 188 | + startDate = startDate.plusDays(1); | ||
| 189 | + } | ||
| 190 | + return mainList; | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + private static void handleSegmentation(RuleAttendanceMain main, RuleScheduling ruleScheduling, List<RuleAttendanceMain> mainList, LocalDate startDate) { | ||
| 194 | + RuleAttendanceMain nowMain = new RuleAttendanceMain(); | ||
| 195 | + BeanUtils.copyProperties(main,nowMain); | ||
| 196 | + nowMain.setFirstWorkSignInTime(ConstDateUtil.dateAddition(startDate.toString(), ConstDateUtil.formatDate("HH:mm:ss", nowMain.getFirstWorkSignInTime()))); | ||
| 179 | if (HAVE_SEGMENTATION.equals(ruleScheduling.getSecondFlag())) { | 197 | if (HAVE_SEGMENTATION.equals(ruleScheduling.getSecondFlag())) { |
| 180 | - main.setFirstQuittingSignInTime(ConstDateUtil.dateAddition(LocalDate.now().toString(), ConstDateUtil.formatDate("HH:mm:ss", main.getFirstQuittingSignInTime()))); | ||
| 181 | - main.setSecondWorkSignInTime(ConstDateUtil.dateAddition(LocalDate.now().toString(), ConstDateUtil.formatDate("HH:mm:ss", main.getSecondWorkSignInTime()))); | 198 | + nowMain.setFirstQuittingSignInTime(ConstDateUtil.dateAddition(startDate.toString(), ConstDateUtil.formatDate("HH:mm:ss", nowMain.getFirstQuittingSignInTime()))); |
| 199 | + nowMain.setSecondWorkSignInTime(ConstDateUtil.dateAddition(startDate.toString(), ConstDateUtil.formatDate("HH:mm:ss", nowMain.getSecondWorkSignInTime()))); | ||
| 182 | // 处理隔天 | 200 | // 处理隔天 |
| 183 | if (TOMORROW_YES.equals(ruleScheduling.getFirstSignInDayTomorrow())) { | 201 | if (TOMORROW_YES.equals(ruleScheduling.getFirstSignInDayTomorrow())) { |
| 184 | - main.setSecondQuittingSignInTime(ConstDateUtil.dateAddition(LocalDate.now().plusDays(1).toString(), ConstDateUtil.formatDate("HH:mm:ss", main.getSecondQuittingSignInTime()))); | 202 | + nowMain.setSecondQuittingSignInTime(ConstDateUtil.dateAddition(startDate.plusDays(1).toString(), ConstDateUtil.formatDate("HH:mm:ss", nowMain.getSecondQuittingSignInTime()))); |
| 185 | } else { | 203 | } else { |
| 186 | - main.setSecondQuittingSignInTime(ConstDateUtil.dateAddition(LocalDate.now().toString(), ConstDateUtil.formatDate("HH:mm:ss", main.getSecondQuittingSignInTime()))); | 204 | + nowMain.setSecondQuittingSignInTime(ConstDateUtil.dateAddition(startDate.toString(), ConstDateUtil.formatDate("HH:mm:ss", nowMain.getSecondQuittingSignInTime()))); |
| 187 | } | 205 | } |
| 188 | } else { | 206 | } else { |
| 189 | // 处理隔天 | 207 | // 处理隔天 |
| 190 | if (TOMORROW_YES.equals(ruleScheduling.getFirstSignInDayTomorrow())) { | 208 | if (TOMORROW_YES.equals(ruleScheduling.getFirstSignInDayTomorrow())) { |
| 191 | - main.setFirstQuittingSignInTime(ConstDateUtil.dateAddition(LocalDate.now().plusDays(1).toString(), ConstDateUtil.formatDate("HH:mm:ss", main.getFirstQuittingSignInTime()))); | 209 | + nowMain.setFirstQuittingSignInTime(ConstDateUtil.dateAddition(startDate.plusDays(1).toString(), ConstDateUtil.formatDate("HH:mm:ss", nowMain.getFirstQuittingSignInTime()))); |
| 192 | } else { | 210 | } else { |
| 193 | - main.setFirstQuittingSignInTime(ConstDateUtil.dateAddition(LocalDate.now().toString(), ConstDateUtil.formatDate("HH:mm:ss", main.getFirstQuittingSignInTime()))); | 211 | + nowMain.setFirstQuittingSignInTime(ConstDateUtil.dateAddition(startDate.toString(), ConstDateUtil.formatDate("HH:mm:ss", nowMain.getFirstQuittingSignInTime()))); |
| 194 | } | 212 | } |
| 195 | } | 213 | } |
| 196 | - main.setWorkFlag(ruleScheduling.getId() == 0 ? FREE_FLAG : WORK_FLAG); | ||
| 197 | - attendanceMainService.updateByJobCodeTotalQuantity(vo, main); | 214 | + nowMain.setWorkFlag(ruleScheduling.getId() == 0 ? FREE_FLAG : WORK_FLAG); |
| 215 | + nowMain.setSchedulingDate(Date.from(startDate.atStartOfDay(ZoneId.systemDefault()).toInstant())); | ||
| 216 | + mainList.add(nowMain); | ||
| 198 | } | 217 | } |
| 199 | 218 | ||
| 200 | @Override | 219 | @Override |
ruoyi-admin/src/main/java/com/ruoyi/service/impl/RuleAttendanceMainServiceImpl.java
| @@ -6,7 +6,6 @@ import com.ruoyi.domain.RuleAttendanceMainHelp; | @@ -6,7 +6,6 @@ import com.ruoyi.domain.RuleAttendanceMainHelp; | ||
| 6 | import com.ruoyi.mapper.RuleAttendanceMainMapper; | 6 | import com.ruoyi.mapper.RuleAttendanceMainMapper; |
| 7 | import com.ruoyi.pojo.vo.DeleteAttendanceVo; | 7 | import com.ruoyi.pojo.vo.DeleteAttendanceVo; |
| 8 | import com.ruoyi.pojo.vo.PeopleRequestVo; | 8 | import com.ruoyi.pojo.vo.PeopleRequestVo; |
| 9 | -import com.ruoyi.pojo.vo.PeopleResponseVo; | ||
| 10 | import com.ruoyi.pojo.vo.UpdateAttendanceVo; | 9 | import com.ruoyi.pojo.vo.UpdateAttendanceVo; |
| 11 | import com.ruoyi.service.RuleAttendanceMainHelpService; | 10 | import com.ruoyi.service.RuleAttendanceMainHelpService; |
| 12 | import com.ruoyi.service.RuleAttendanceMainService; | 11 | import com.ruoyi.service.RuleAttendanceMainService; |
| @@ -28,8 +27,8 @@ public class RuleAttendanceMainServiceImpl extends ServiceImpl<RuleAttendanceMai | @@ -28,8 +27,8 @@ public class RuleAttendanceMainServiceImpl extends ServiceImpl<RuleAttendanceMai | ||
| 28 | private RuleAttendanceMainHelpService helpService; | 27 | private RuleAttendanceMainHelpService helpService; |
| 29 | 28 | ||
| 30 | @Override | 29 | @Override |
| 31 | - public void updateByJobCodeTotalQuantity(UpdateAttendanceVo vo, RuleAttendanceMain main) { | ||
| 32 | - baseMapper.updateByIdTotalQuantity(vo, main); | 30 | + public void updateByJobCodeTotalQuantity(UpdateAttendanceVo vo, List<RuleAttendanceMain> mainList) { |
| 31 | + baseMapper.updateByIdTotalQuantity(vo, mainList); | ||
| 33 | } | 32 | } |
| 34 | 33 | ||
| 35 | @Override | 34 | @Override |
ruoyi-admin/src/main/resources/mapper/RuleAttendanceMainMapper.xml
| @@ -33,25 +33,27 @@ | @@ -33,25 +33,27 @@ | ||
| 33 | second_quitting_sign_in_time,second_sign_in_quitting_range,scheduling_date,work_flag | 33 | second_quitting_sign_in_time,second_sign_in_quitting_range,scheduling_date,work_flag |
| 34 | </sql> | 34 | </sql> |
| 35 | <update id="updateByIdTotalQuantity"> | 35 | <update id="updateByIdTotalQuantity"> |
| 36 | - update rule_attendance_main set | ||
| 37 | - working_hour_plan = #{main.workingHourPlan}, | ||
| 38 | - working_hour_type = #{main.workingHourType}, | ||
| 39 | - first_work_sign_in_time = #{main.firstWorkSignInTime}, | ||
| 40 | - first_sign_in_working_range = #{main.firstSignInWorkingRange}, | ||
| 41 | - first_quitting_sign_in_time = #{main.firstQuittingSignInTime}, | ||
| 42 | - first_sign_in_quitting_range = #{main.firstSignInQuittingRange}, | ||
| 43 | - sign_in_time_out_range = #{main.signInTimeOutRange}, | ||
| 44 | - second_work_sign_in_time = #{main.secondWorkSignInTime}, | ||
| 45 | - second_sign_in_working_range = #{main.secondSignInWorkingRange}, | ||
| 46 | - second_quitting_sign_in_time = #{main.secondQuittingSignInTime}, | ||
| 47 | - second_sign_in_quitting_range = #{main.secondSignInQuittingRange}, | ||
| 48 | - work_flag = #{main.workFlag} | 36 | + <foreach collection="mainList" item="main" index="index" separator=";"> |
| 37 | + update rule_attendance_main set | ||
| 38 | + working_hour_plan = #{main.workingHourPlan}, | ||
| 39 | + working_hour_type = #{main.workingHourType}, | ||
| 40 | + first_work_sign_in_time = #{main.firstWorkSignInTime}, | ||
| 41 | + first_sign_in_working_range = #{main.firstSignInWorkingRange}, | ||
| 42 | + first_quitting_sign_in_time = #{main.firstQuittingSignInTime}, | ||
| 43 | + first_sign_in_quitting_range = #{main.firstSignInQuittingRange}, | ||
| 44 | + sign_in_time_out_range = #{main.signInTimeOutRange}, | ||
| 45 | + second_work_sign_in_time = #{main.secondWorkSignInTime}, | ||
| 46 | + second_sign_in_working_range = #{main.secondSignInWorkingRange}, | ||
| 47 | + second_quitting_sign_in_time = #{main.secondQuittingSignInTime}, | ||
| 48 | + second_sign_in_quitting_range = #{main.secondSignInQuittingRange}, | ||
| 49 | + work_flag = #{main.workFlag} | ||
| 49 | where | 50 | where |
| 50 | - job_code IN | ||
| 51 | - <foreach collection="vo.jobCode" index="index" item="item" open="(" close=")" separator=","> | ||
| 52 | - #{item} | ||
| 53 | - </foreach> | ||
| 54 | - and scheduling_date >= #{vo.startDate} and scheduling_date <= #{vo.endDate} | 51 | + job_code IN |
| 52 | + <foreach collection="vo.jobCode" index="index" item="item" open="(" close=")" separator=","> | ||
| 53 | + #{item} | ||
| 54 | + </foreach> | ||
| 55 | + and scheduling_date = #{main.schedulingDate} | ||
| 56 | + </foreach> | ||
| 55 | </update> | 57 | </update> |
| 56 | <delete id="deleteByJobCodeTotalRecord"> | 58 | <delete id="deleteByJobCodeTotalRecord"> |
| 57 | delete from rule_attendance_main | 59 | delete from rule_attendance_main |