添加一个更新人员红绿灯的接口
This commit is contained in:
parent
ae804d3643
commit
5bc1addcad
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.job.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 人员基础信息表
|
||||
*/
|
||||
@Data
|
||||
public class PmWorkerEinLightJob {
|
||||
|
||||
|
||||
/**
|
||||
* 施工人员id
|
||||
*/
|
||||
private String proId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String workerId;
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String lightStatus;
|
||||
|
||||
/**
|
||||
* 入场状态 0未入场 1 已入场
|
||||
*/
|
||||
private String yellowDate;
|
||||
|
||||
/**
|
||||
* 合同工资是否全
|
||||
*/
|
||||
private String conAndWage;
|
||||
}
|
||||
|
|
@ -116,4 +116,16 @@ public interface WorkerJobMapper {
|
|||
List<PmWorkerJob> getWorkerContractToday(String startDate);
|
||||
|
||||
void updateWorkerContractByListToday(List<PmWorkerJob> list);
|
||||
|
||||
List<PmWorkerEinLightJob> getEinWorker();
|
||||
|
||||
/**
|
||||
* 更新人员红绿灯
|
||||
* @param workerId
|
||||
* @param proId
|
||||
* @param lightStatus
|
||||
* @param now
|
||||
* @return
|
||||
*/
|
||||
int updateEinMsgByWorkerId(@Param("workerId") String id,@Param("proId") String proId, @Param("lightStatus") String lightStatus,@Param("lightDate") String lightDate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.job.task;
|
|||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.bonus.job.domain.BmWorkerBlackJob;
|
||||
import com.bonus.job.domain.PmWorkerEinLightJob;
|
||||
import com.bonus.job.domain.PmWorkerJob;
|
||||
import com.bonus.job.mapper.WorkerJobMapper;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -38,12 +39,35 @@ public class WorkerEinDayRecordTask{
|
|||
updateWorkerContract();
|
||||
//当天合同以最新的为准
|
||||
updateWorkerContractToday(startDate);
|
||||
//TODO加一个红绿灯判断和更新的接口
|
||||
//加一个红绿灯判断和更新的接口
|
||||
updateWorkerLight();
|
||||
}catch (Exception e){
|
||||
logger.error("人员入场更新表失败,{}",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 红绿灯判断和更新的接口
|
||||
*/
|
||||
private void updateWorkerLight() {
|
||||
List<PmWorkerEinLightJob> list = mapper.getEinWorker();
|
||||
if(list != null && !list.isEmpty()){
|
||||
for (PmWorkerEinLightJob worker : list) {
|
||||
if(!worker.getConAndWage().equals(worker.getLightStatus())){
|
||||
String lightStatus = worker.getConAndWage();
|
||||
String now = DateUtil.now();
|
||||
if("2".equals(lightStatus)){
|
||||
now = "";
|
||||
}
|
||||
int j = mapper.updateEinMsgByWorkerId(worker.getWorkerId(), worker.getProId(), lightStatus, now);
|
||||
}else{
|
||||
//匹配上的需要校验一下数据,但是现在就不校验了
|
||||
//黄灯看时间有没有,绿灯时间清没清除
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当天合同以最新的为准
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -425,4 +425,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update bm_worker_ein_day_record set contract_id = #{item.contractId} where worker_id = #{item.workerId} and pro_id = #{item.proId} and ein_day = #{item.einDay}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getEinWorker" resultType="com.bonus.job.domain.PmWorkerEinLightJob">
|
||||
SELECT
|
||||
bwem.pro_id,
|
||||
bwem.worker_id,
|
||||
light_status,
|
||||
yellow_date,
|
||||
IF(bwwc.id IS NOT NULL AND bwc.id IS NOT NULL, 2, 1) AS conAndWage
|
||||
FROM
|
||||
bm_worker_ein_msg bwem
|
||||
LEFT JOIN `bm_worker_wage_card` bwwc ON bwem.worker_id = bwwc.worker_id
|
||||
AND bwwc.is_active = 1
|
||||
LEFT JOIN `bm_worker_contract` bwc ON bwc.worker_id = bwem.worker_id
|
||||
AND bwc.pro_id = bwem.pro_id
|
||||
AND bwc.is_active = 1
|
||||
</select>
|
||||
|
||||
<update id="updateEinMsgByWorkerId">
|
||||
update bm_worker_ein_msg
|
||||
set light_status = #{lightStatus},yellow_date = #{lightDate}
|
||||
where worker_id = #{workerId} and pro_id = #{proId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue