Commit 5598699ebc3bcfb14cadd3dfeb0c1b573aed3ad4
1 parent
a903de90
feat: 修改获取人员数据的方法名
Showing
3 changed files
with
8 additions
and
11 deletions
Bsth-admin/src/main/java/com/ruoyi/common/cache/TempCache.java
| @@ -39,6 +39,9 @@ public class TempCache { | @@ -39,6 +39,9 @@ public class TempCache { | ||
| 39 | return !Objects.isNull(map.get(jobCode)); | 39 | return !Objects.isNull(map.get(jobCode)); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | + /** | ||
| 43 | + * 整个类中的所有方法全是测试需要 | ||
| 44 | + */ | ||
| 42 | public static void resetMapStatus() { | 45 | public static void resetMapStatus() { |
| 43 | // map.put("620001", true); | 46 | // map.put("620001", true); |
| 44 | // map.put("620002", true); | 47 | // map.put("620002", true); |
Bsth-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
| @@ -4,7 +4,6 @@ import java.io.File; | @@ -4,7 +4,6 @@ import java.io.File; | ||
| 4 | import java.io.IOException; | 4 | import java.io.IOException; |
| 5 | import java.io.InputStream; | 5 | import java.io.InputStream; |
| 6 | import java.nio.file.Paths; | 6 | import java.nio.file.Paths; |
| 7 | -import java.time.LocalDate; | ||
| 8 | import java.time.LocalDateTime; | 7 | import java.time.LocalDateTime; |
| 9 | import java.time.temporal.ChronoUnit; | 8 | import java.time.temporal.ChronoUnit; |
| 10 | import java.util.*; | 9 | import java.util.*; |
| @@ -12,8 +11,6 @@ import java.util.stream.Collectors; | @@ -12,8 +11,6 @@ import java.util.stream.Collectors; | ||
| 12 | 11 | ||
| 13 | import cn.hutool.core.collection.CollectionUtil; | 12 | import cn.hutool.core.collection.CollectionUtil; |
| 14 | import cn.hutool.http.HttpUtil; | 13 | import cn.hutool.http.HttpUtil; |
| 15 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 16 | -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | ||
| 17 | import com.github.pagehelper.util.StringUtil; | 14 | import com.github.pagehelper.util.StringUtil; |
| 18 | import com.ruoyi.common.cache.NowSchedulingCache; | 15 | import com.ruoyi.common.cache.NowSchedulingCache; |
| 19 | import com.ruoyi.common.cache.SchedulingCache; | 16 | import com.ruoyi.common.cache.SchedulingCache; |
| @@ -28,7 +25,6 @@ import com.ruoyi.common.utils.DateUtils; | @@ -28,7 +25,6 @@ import com.ruoyi.common.utils.DateUtils; | ||
| 28 | import com.ruoyi.common.utils.file.FileUploadUtils; | 25 | import com.ruoyi.common.utils.file.FileUploadUtils; |
| 29 | import com.ruoyi.common.utils.file.FileUtils; | 26 | import com.ruoyi.common.utils.file.FileUtils; |
| 30 | import com.ruoyi.common.utils.file.MimeTypeUtils; | 27 | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| 31 | -import com.ruoyi.domain.RuleAttendanceMain; | ||
| 32 | import com.ruoyi.equipment.mapper.EquipmentMapper; | 28 | import com.ruoyi.equipment.mapper.EquipmentMapper; |
| 33 | import com.ruoyi.framework.config.ServerConfig; | 29 | import com.ruoyi.framework.config.ServerConfig; |
| 34 | import com.ruoyi.job.DriverJob; | 30 | import com.ruoyi.job.DriverJob; |
| @@ -42,7 +38,6 @@ import com.ruoyi.pojo.response.DriverResponseVo; | @@ -42,7 +38,6 @@ import com.ruoyi.pojo.response.DriverResponseVo; | ||
| 42 | import com.ruoyi.pojo.response.ResponseSchedulingDto; | 38 | import com.ruoyi.pojo.response.ResponseSchedulingDto; |
| 43 | import com.ruoyi.pojo.response.personnel.PersonnelResultResponseVo; | 39 | import com.ruoyi.pojo.response.personnel.PersonnelResultResponseVo; |
| 44 | import com.ruoyi.pojo.response.personnel.TokenResponseVo; | 40 | import com.ruoyi.pojo.response.personnel.TokenResponseVo; |
| 45 | -import com.ruoyi.service.AttendanceService; | ||
| 46 | import com.ruoyi.service.RuleAttendanceMainService; | 41 | import com.ruoyi.service.RuleAttendanceMainService; |
| 47 | import com.ruoyi.service.SchedulingService; | 42 | import com.ruoyi.service.SchedulingService; |
| 48 | import com.ruoyi.service.ThreadJobService; | 43 | import com.ruoyi.service.ThreadJobService; |
| @@ -70,7 +65,6 @@ import javax.servlet.http.HttpServletResponse; | @@ -70,7 +65,6 @@ import javax.servlet.http.HttpServletResponse; | ||
| 70 | import static com.ruoyi.common.ApiProperties.PERSONNEL_API_KEY; | 65 | import static com.ruoyi.common.ApiProperties.PERSONNEL_API_KEY; |
| 71 | import static com.ruoyi.common.ConstDriverProperties.*; | 66 | import static com.ruoyi.common.ConstDriverProperties.*; |
| 72 | import static com.ruoyi.common.ConstSignInConstSignInProperties.*; | 67 | import static com.ruoyi.common.ConstSignInConstSignInProperties.*; |
| 73 | -import static com.ruoyi.common.RuleSchedulingProperties.WORK_FLAG; | ||
| 74 | import static com.ruoyi.common.redispre.GlobalRedisPreName.DRIVER_SCHEDULING_PRE; | 68 | import static com.ruoyi.common.redispre.GlobalRedisPreName.DRIVER_SCHEDULING_PRE; |
| 75 | import static com.ruoyi.common.redispre.GlobalRedisPreName.REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW; | 69 | import static com.ruoyi.common.redispre.GlobalRedisPreName.REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW; |
| 76 | 70 | ||
| @@ -637,9 +631,9 @@ public class DriverServiceImpl implements IDriverService { | @@ -637,9 +631,9 @@ public class DriverServiceImpl implements IDriverService { | ||
| 637 | PersonnelResultResponseVo vo = DriverJob.getPersonInfo(tokenVo.getAccessToken(), pageSize, 1); | 631 | PersonnelResultResponseVo vo = DriverJob.getPersonInfo(tokenVo.getAccessToken(), pageSize, 1); |
| 638 | int countPage = vo.getTotalCount() / pageSize; | 632 | int countPage = vo.getTotalCount() / pageSize; |
| 639 | countPage = vo.getTotalCount() % pageSize == 0 ? countPage : countPage + 1; | 633 | countPage = vo.getTotalCount() % pageSize == 0 ? countPage : countPage + 1; |
| 640 | - List<Driver> drivers = DriverJob.getDrivers(date, vo); | 634 | + List<Driver> drivers = DriverJob.handlerDrivers(date, vo); |
| 641 | for (int i = 2; i <= countPage; i++) { | 635 | for (int i = 2; i <= countPage; i++) { |
| 642 | - drivers.addAll(DriverJob.getDrivers(date, DriverJob.getPersonInfo(tokenVo.getAccessToken(), 100, i))); | 636 | + drivers.addAll(DriverJob.handlerDrivers(date, DriverJob.getPersonInfo(tokenVo.getAccessToken(), 100, i))); |
| 643 | } | 637 | } |
| 644 | if (CollectionUtil.isNotEmpty(drivers)) { | 638 | if (CollectionUtil.isNotEmpty(drivers)) { |
| 645 | driverMapper.updateDriverBaseInfoByJobCodes(drivers, 1); | 639 | driverMapper.updateDriverBaseInfoByJobCodes(drivers, 1); |
Bsth-admin/src/main/java/com/ruoyi/job/DriverJob.java
| @@ -422,9 +422,9 @@ public class DriverJob implements InitializingBean { | @@ -422,9 +422,9 @@ public class DriverJob implements InitializingBean { | ||
| 422 | PersonnelResultResponseVo vo = getPersonInfo(accessToken, pageSize, 1); | 422 | PersonnelResultResponseVo vo = getPersonInfo(accessToken, pageSize, 1); |
| 423 | int countPage = vo.getTotalCount() / pageSize; | 423 | int countPage = vo.getTotalCount() / pageSize; |
| 424 | countPage = vo.getTotalCount() % pageSize == 0 ? countPage : countPage + 1; | 424 | countPage = vo.getTotalCount() % pageSize == 0 ? countPage : countPage + 1; |
| 425 | - List<Driver> drivers = getDrivers(date, vo); | 425 | + List<Driver> drivers = handlerDrivers(date, vo); |
| 426 | for (int i = 2; i <= countPage; i++) { | 426 | for (int i = 2; i <= countPage; i++) { |
| 427 | - drivers.addAll(getDrivers(date, getPersonInfo(accessToken, 100, i))); | 427 | + drivers.addAll(handlerDrivers(date, getPersonInfo(accessToken, 100, i))); |
| 428 | } | 428 | } |
| 429 | List<String> jobList = drivers.stream().map(Driver::getJobCode).distinct().collect(Collectors.toList()); | 429 | List<String> jobList = drivers.stream().map(Driver::getJobCode).distinct().collect(Collectors.toList()); |
| 430 | // 删除离职员工 | 430 | // 删除离职员工 |
| @@ -486,7 +486,7 @@ public class DriverJob implements InitializingBean { | @@ -486,7 +486,7 @@ public class DriverJob implements InitializingBean { | ||
| 486 | DRIVER_SERVICE.deleteNotEmptyJob(jobList); | 486 | DRIVER_SERVICE.deleteNotEmptyJob(jobList); |
| 487 | } | 487 | } |
| 488 | 488 | ||
| 489 | - public static List<Driver> getDrivers(Date date, PersonnelResultResponseVo vo) { | 489 | + public static List<Driver> handlerDrivers(Date date, PersonnelResultResponseVo vo) { |
| 490 | List<Driver> drivers = vo.getData().stream().map(item -> { | 490 | List<Driver> drivers = vo.getData().stream().map(item -> { |
| 491 | Driver driver = new Driver(); | 491 | Driver driver = new Driver(); |
| 492 | FormData formData = item.getFormData(); | 492 | FormData formData = item.getFormData(); |