diff --git a/modules/bmw/src/main/java/com/bonus/bmw/person/dao/InOutDao.java b/modules/bmw/src/main/java/com/bonus/bmw/person/dao/InOutDao.java index 3b8c821..116986d 100644 --- a/modules/bmw/src/main/java/com/bonus/bmw/person/dao/InOutDao.java +++ b/modules/bmw/src/main/java/com/bonus/bmw/person/dao/InOutDao.java @@ -102,4 +102,16 @@ public interface InOutDao { List exportInOutList(@Param("params") Map params); List exportTemporaryData(@Param("params") Map params); + + /** + * 入场超七天临时人员 + * @return + */ + List getWorkerByTemporary(); + + /** + * 修改入场超七天临时人员为固定人员 + * @return + */ + void updateWorkerType(List list); } diff --git a/modules/bmw/src/main/java/com/bonus/bmw/suspend/controller/SuspendPersonController.java b/modules/bmw/src/main/java/com/bonus/bmw/suspend/controller/SuspendPersonController.java index 694853e..38b7f7f 100644 --- a/modules/bmw/src/main/java/com/bonus/bmw/suspend/controller/SuspendPersonController.java +++ b/modules/bmw/src/main/java/com/bonus/bmw/suspend/controller/SuspendPersonController.java @@ -42,7 +42,7 @@ public class SuspendPersonController { private GetChildListDao getChildListDao; @PostMapping("/getSuspendPersonList") - @Log(title = "暂退人员管理-list查询", businessType = BusinessType.SELECT) + @Log(title = "固定暂退人员管理-list查询", businessType = BusinessType.SELECT) @RequiresPermissions("sys:suspend:query") public PageTableResponse getSuspendPersonList(PageTableRequest request) { @@ -70,7 +70,7 @@ public class SuspendPersonController { @PostMapping("/getTemporarySuspendPersonList") - @Log(title = "暂退人员管理-list查询", businessType = BusinessType.SELECT) + @Log(title = "临时暂退人员管理-list查询", businessType = BusinessType.SELECT) @RequiresPermissions("sys:suspend:query") public PageTableResponse getTemporarySuspendPersonList(PageTableRequest request) { @@ -97,7 +97,7 @@ public class SuspendPersonController { } @PostMapping("/getCheckPersonList") - @Log(title = "暂退人员管理-在场人员-list查询", businessType = BusinessType.SELECT) + @Log(title = "固定暂退人员管理-在场人员-list查询", businessType = BusinessType.SELECT) @RequiresPermissions("sys:suspend:query") public PageTableResponse getCheckPersonList(PageTableRequest request) { @@ -123,7 +123,7 @@ public class SuspendPersonController { } @PostMapping("/getCheckTemporaryPersonList") - @Log(title = "暂退人员管理-在场人员-list查询", businessType = BusinessType.SELECT) + @Log(title = "临时暂退人员管理-在场人员-list查询", businessType = BusinessType.SELECT) @RequiresPermissions("sys:suspend:query") public PageTableResponse getCheckTemporaryPersonList(PageTableRequest request) { diff --git a/modules/bmw/src/main/java/com/bonus/bmw/task/WorkerByTemporaryToFixedTask.java b/modules/bmw/src/main/java/com/bonus/bmw/task/WorkerByTemporaryToFixedTask.java new file mode 100644 index 0000000..5ffcd96 --- /dev/null +++ b/modules/bmw/src/main/java/com/bonus/bmw/task/WorkerByTemporaryToFixedTask.java @@ -0,0 +1,44 @@ +package com.bonus.bmw.task; + +import com.bonus.bmw.person.dao.InOutDao; +import com.bonus.bmw.person.entity.OutPersonTimeoutBean; +import lombok.extern.slf4j.Slf4j; +import net.javacrumbs.shedlock.core.SchedulerLock; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author admin + * 临时人员七天自动转固定人员 + */ +@Configuration +@EnableScheduling +@Slf4j +@EnableAsync +public class WorkerByTemporaryToFixedTask { + + + @Resource + private InOutDao dao; + + /** + * 临时人员七天自动转固定人员 + */ + @Scheduled(cron = "0 15 9 * * ?") + @Async + public void getWorkerByTemporary(){ + log.info("--------临时人员七天自动转固定人员定时器打开------"); + List list = dao.getWorkerByTemporary(); + if(!list.isEmpty()){ + dao.updateWorkerType(list); + } + log.info("--------临时人员七天自动转固定人员定时器执行完毕------"); + } + +} diff --git a/modules/bmw/src/main/resources/mapper/person/InOutMapper.xml b/modules/bmw/src/main/resources/mapper/person/InOutMapper.xml index 0353217..345c0da 100644 --- a/modules/bmw/src/main/resources/mapper/person/InOutMapper.xml +++ b/modules/bmw/src/main/resources/mapper/person/InOutMapper.xml @@ -717,4 +717,21 @@ ORDER BY einTime DESC + + + + update bm_worker set worker_type = '1' where id_number in + + #{item.idNumber} + + diff --git a/modules/bmw/src/main/resources/mapper/suspend/SuspendPersonMapper.xml b/modules/bmw/src/main/resources/mapper/suspend/SuspendPersonMapper.xml index 832f0db..33d52ce 100644 --- a/modules/bmw/src/main/resources/mapper/suspend/SuspendPersonMapper.xml +++ b/modules/bmw/src/main/resources/mapper/suspend/SuspendPersonMapper.xml @@ -47,7 +47,7 @@ LEFT JOIN bm_worker_furlough_history bwfh ON bwfh.id_number = bw.id_number AND bweh.project_id = bwfh.pro_id LEFT JOIN ( SELECT id_number, pro_id, CURRENT_DAY FROM fc_face_contrast WHERE CURRENT_DAY = #{params.today} GROUP BY id_number, CURRENT_DAY ) ffc ON ffc.ID_NUMBER = bw.id_number and ffc.PRO_ID = bweh.project_id - WHERE bw.IS_ACTIVE = 1 AND bweh.is_furlough_person = 1 and bw.worker_type != '0' + WHERE bw.IS_ACTIVE = 1 AND bweh.is_furlough_person = 1 and bw.worker_type = '1' ORDER BY bwfh.furlough_time DESC LIMIT 999999999999 ) a @@ -121,8 +121,7 @@ ORDER BY bwfh.furlough_time DESC LIMIT 999999999999 ) a - WHERE - 1 = 1 + AND a.orgId in (${params.orgAll}) @@ -138,6 +137,7 @@ AND a.teamName like concat('%',#{params.teamName},'%') + GROUP BY a.idNumber,a.CURRENT_DAY limit #{offset}, #{limit} @@ -252,4 +252,4 @@ - \ No newline at end of file +