七天入场自动转古定人固定
This commit is contained in:
parent
8bba22ef6c
commit
cdad70774f
|
|
@ -102,4 +102,16 @@ public interface InOutDao {
|
||||||
List<ExportBasePersonBean> exportInOutList(@Param("params") Map<String, Object> params);
|
List<ExportBasePersonBean> exportInOutList(@Param("params") Map<String, Object> params);
|
||||||
|
|
||||||
List<ExportBasePersonBean> exportTemporaryData(@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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class SuspendPersonController {
|
||||||
private GetChildListDao getChildListDao;
|
private GetChildListDao getChildListDao;
|
||||||
|
|
||||||
@PostMapping("/getSuspendPersonList")
|
@PostMapping("/getSuspendPersonList")
|
||||||
@Log(title = "暂退人员管理-list查询", businessType = BusinessType.SELECT)
|
@Log(title = "固定暂退人员管理-list查询", businessType = BusinessType.SELECT)
|
||||||
@RequiresPermissions("sys:suspend:query")
|
@RequiresPermissions("sys:suspend:query")
|
||||||
public PageTableResponse getSuspendPersonList(PageTableRequest request) {
|
public PageTableResponse getSuspendPersonList(PageTableRequest request) {
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ public class SuspendPersonController {
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/getTemporarySuspendPersonList")
|
@PostMapping("/getTemporarySuspendPersonList")
|
||||||
@Log(title = "暂退人员管理-list查询", businessType = BusinessType.SELECT)
|
@Log(title = "临时暂退人员管理-list查询", businessType = BusinessType.SELECT)
|
||||||
@RequiresPermissions("sys:suspend:query")
|
@RequiresPermissions("sys:suspend:query")
|
||||||
public PageTableResponse getTemporarySuspendPersonList(PageTableRequest request) {
|
public PageTableResponse getTemporarySuspendPersonList(PageTableRequest request) {
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ public class SuspendPersonController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/getCheckPersonList")
|
@PostMapping("/getCheckPersonList")
|
||||||
@Log(title = "暂退人员管理-在场人员-list查询", businessType = BusinessType.SELECT)
|
@Log(title = "固定暂退人员管理-在场人员-list查询", businessType = BusinessType.SELECT)
|
||||||
@RequiresPermissions("sys:suspend:query")
|
@RequiresPermissions("sys:suspend:query")
|
||||||
public PageTableResponse getCheckPersonList(PageTableRequest request) {
|
public PageTableResponse getCheckPersonList(PageTableRequest request) {
|
||||||
|
|
||||||
|
|
@ -123,7 +123,7 @@ public class SuspendPersonController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/getCheckTemporaryPersonList")
|
@PostMapping("/getCheckTemporaryPersonList")
|
||||||
@Log(title = "暂退人员管理-在场人员-list查询", businessType = BusinessType.SELECT)
|
@Log(title = "临时暂退人员管理-在场人员-list查询", businessType = BusinessType.SELECT)
|
||||||
@RequiresPermissions("sys:suspend:query")
|
@RequiresPermissions("sys:suspend:query")
|
||||||
public PageTableResponse getCheckTemporaryPersonList(PageTableRequest request) {
|
public PageTableResponse getCheckTemporaryPersonList(PageTableRequest request) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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("--------临时人员七天自动转固定人员定时器执行完毕------");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -717,4 +717,21 @@
|
||||||
ORDER BY einTime DESC
|
ORDER BY einTime DESC
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -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 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}
|
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
|
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
|
ORDER BY bwfh.furlough_time DESC
|
||||||
LIMIT 999999999999
|
LIMIT 999999999999
|
||||||
) a
|
) a
|
||||||
|
|
@ -121,8 +121,7 @@
|
||||||
ORDER BY bwfh.furlough_time DESC
|
ORDER BY bwfh.furlough_time DESC
|
||||||
LIMIT 999999999999
|
LIMIT 999999999999
|
||||||
) a
|
) a
|
||||||
WHERE
|
<where>
|
||||||
1 = 1
|
|
||||||
<if test="params.orgAll != null and params.orgAll != '' and params.roleLevel >= 2">
|
<if test="params.orgAll != null and params.orgAll != '' and params.roleLevel >= 2">
|
||||||
AND a.orgId in (${params.orgAll})
|
AND a.orgId in (${params.orgAll})
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -138,6 +137,7 @@
|
||||||
<if test="params.teamName != null and params.teamName !='' ">
|
<if test="params.teamName != null and params.teamName !='' ">
|
||||||
AND a.teamName like concat('%',#{params.teamName},'%')
|
AND a.teamName like concat('%',#{params.teamName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
</where>
|
||||||
GROUP BY a.idNumber,a.CURRENT_DAY
|
GROUP BY a.idNumber,a.CURRENT_DAY
|
||||||
<if test='type == "1"'>
|
<if test='type == "1"'>
|
||||||
limit #{offset}, #{limit}
|
limit #{offset}, #{limit}
|
||||||
|
|
@ -252,4 +252,4 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue