七天入场自动转古定人固定

This commit is contained in:
方亮 2026-02-09 17:16:11 +08:00
parent 8bba22ef6c
commit cdad70774f
5 changed files with 81 additions and 8 deletions

View File

@ -102,4 +102,16 @@ public interface InOutDao {
List<ExportBasePersonBean> exportInOutList(@Param("params") Map<String, Object> params);
List<ExportBasePersonBean> exportTemporaryData(@Param("params") Map<String, Object> params);
/**
* 入场超七天临时人员
* @return
*/
List<OutPersonTimeoutBean> getWorkerByTemporary();
/**
* 修改入场超七天临时人员为固定人员
* @return
*/
void updateWorkerType(List<OutPersonTimeoutBean> list);
}

View File

@ -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) {

View File

@ -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<OutPersonTimeoutBean> list = dao.getWorkerByTemporary();
if(!list.isEmpty()){
dao.updateWorkerType(list);
}
log.info("--------临时人员七天自动转固定人员定时器执行完毕------");
}
}

View File

@ -717,4 +717,21 @@
ORDER BY einTime DESC
</select>
<select id="getWorkerByTemporary" resultType="com.bonus.bmw.person.entity.OutPersonTimeoutBean">
SELECT
w.id_Number
FROM
bm_worker w
JOIN (SELECT id_Number, ein_time FROM bm_worker_ein_history WHERE is_furlough_person = '0' and exit_status != '1' GROUP BY id_number) h ON w.id_Number = h.id_Number
WHERE
DATEDIFF(NOW(), h.ein_time) > 7
AND w.worker_type = '0'
</select>
<update id="updateWorkerType">
update bm_worker set worker_type = '1' where id_number in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item.idNumber}
</foreach>
</update>
</mapper>

View File

@ -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
<where>
<if test="params.orgAll != null and params.orgAll != '' and params.roleLevel >= 2">
AND a.orgId in (${params.orgAll})
</if>
@ -138,6 +137,7 @@
<if test="params.teamName != null and params.teamName !='' ">
AND a.teamName like concat('%',#{params.teamName},'%')
</if>
</where>
GROUP BY a.idNumber,a.CURRENT_DAY
<if test='type == "1"'>
limit #{offset}, #{limit}
@ -252,4 +252,4 @@
</foreach>
</insert>
</mapper>
</mapper>