parent
e9d69fad31
commit
9c198b36a6
|
|
@ -65,7 +65,7 @@ public class PmWorkerExitController extends BaseController {
|
|||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||
@PostMapping("/exit")
|
||||
@SysLog(title = "人员出场管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员出场管理", details = "人员出场")
|
||||
public AjaxResult exit(@RequestParam(value = "files") MultipartFile[] files, @RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
public AjaxResult exit(@RequestParam(value = "files",required = false) MultipartFile[] files, @RequestParam(value = "fileMsg", required = false) String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
PmWorkerDto o = FastJsonHelper.jsonStrToBean(params, PmWorkerDto.class);
|
||||
|
|
@ -105,7 +105,7 @@ public class PmWorkerExitController extends BaseController {
|
|||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||
@PostMapping("/exitFile")
|
||||
@SysLog(title = "人员出场管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员出场管理", details = "人员出场")
|
||||
public AjaxResult exitFile(@RequestParam(value = "files") MultipartFile[] files, @RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
public AjaxResult exitFile(@RequestParam(value = "files",required = false) MultipartFile[] files, @RequestParam(value = "fileMsg", required = false) String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
PmWorkerDto o = FastJsonHelper.jsonStrToBean(params, PmWorkerDto.class);
|
||||
|
|
|
|||
|
|
@ -62,5 +62,10 @@ public class PmWorkerDto {
|
|||
*/
|
||||
private String isUploadFile;
|
||||
|
||||
/**
|
||||
* 是否上传离职文件 0未上传 1已上传
|
||||
*/
|
||||
private String exitWay;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ public interface PmWorkerExitMapper {
|
|||
* @param einStatus
|
||||
* @return
|
||||
*/
|
||||
int updateEinProRecordStatus(@Param("id") Integer id,@Param("einStatus") Integer einStatus,@Param("isUploadFile") Integer isUploadFile);
|
||||
int updateEinProRecordStatus(@Param("id") Integer id,@Param("einStatus") Integer einStatus,@Param("isUploadFile") Integer isUploadFile,@Param("exitWay") String exitWay);
|
||||
|
||||
List<PmWorker> selectWorkListByWorkerId(PmWorkerDto o);
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
isUploadFile = 1;
|
||||
}
|
||||
|
||||
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile);
|
||||
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay());
|
||||
if(k==1){
|
||||
urkSendService.delUserByDevice(record.getId(),record.getProId());
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
int einStatus = 2;
|
||||
//是否上传文件
|
||||
int isUploadFile = 0;
|
||||
int k = mapper.updateEinProRecordStatus(bean.getId(),einStatus,isUploadFile);
|
||||
int k = mapper.updateEinProRecordStatus(bean.getId(),einStatus,isUploadFile,bean.getExitWay());
|
||||
if(k==1){
|
||||
userId.add(bean.getId());
|
||||
proId.add(bean.getProId());
|
||||
|
|
@ -128,7 +128,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
int einStatus = 0;
|
||||
//是否上传文件
|
||||
int isUploadFile = 1;
|
||||
int k = mapper.updateEinProRecordStatus(o.getId(),einStatus,isUploadFile);
|
||||
int k = mapper.updateEinProRecordStatus(o.getId(),einStatus,isUploadFile,o.getExitWay());
|
||||
return !uploadFileVos.isEmpty() ?1:0;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
</delete>
|
||||
|
||||
<update id="updateEinProRecordStatus">
|
||||
UPDATE bm_worker_ein_pro_record SET is_upload_file = #{isUploadFile},is_active = 0
|
||||
UPDATE bm_worker_ein_pro_record SET is_upload_file = #{isUploadFile},is_active = 0,exit_way = #{exitWay}
|
||||
<if test='einStatus != 0'>
|
||||
, ein_status = #{einStatus}
|
||||
, exit_time = NOW()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,89 @@
|
|||
package com.bonus.job.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 人员黑名单(失信人员)
|
||||
*/
|
||||
@Data
|
||||
public class BmWorkerBlackJob {
|
||||
|
||||
//用于excel导出的序号一列,不需要业务逻辑处理
|
||||
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
|
||||
int sequence;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 施工人员id
|
||||
*/
|
||||
private Integer workerId;
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
@Excel(name = "身份证号", sort = 3)
|
||||
private String idNumber;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Excel(name = "姓名", sort = 2)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
@Excel(name = "工种", sort = 4)
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 工程
|
||||
*/
|
||||
@Excel(name = "工程名称", sort = 5)
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 分包
|
||||
*/
|
||||
@Excel(name = "所属分包单位", sort = 6)
|
||||
private String subName;
|
||||
|
||||
/**
|
||||
* 理由
|
||||
*/
|
||||
@Excel(name = "事件", sort = 7)
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Excel(name = "开始时间", sort = 8)
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Excel(name = "结束时间", sort = 9)
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 是否解除 0 未解除 1 已解除
|
||||
*/
|
||||
@Excel(name = "是否解除", type = Excel.Type.EXPORT, sort = 10,readConverterExp = "执行中=0,已解除=1,已到解除时间=2")
|
||||
private Integer isRemove;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateUser;
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.job.mapper;
|
||||
|
||||
import com.bonus.job.domain.BmWorkerBlackJob;
|
||||
import com.bonus.job.domain.PmWorkerJob;
|
||||
import com.bonus.job.domain.SysJob;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
|
@ -24,4 +25,14 @@ public interface WorkerJobMapper {
|
|||
* @param workerList
|
||||
*/
|
||||
void insertEinDayRecord(List<PmWorkerJob> workerList);
|
||||
|
||||
/**
|
||||
* 获取超30天出场未上传文件人员
|
||||
* @return
|
||||
*/
|
||||
List<BmWorkerBlackJob> getWorkeExitThan30Day();
|
||||
|
||||
int insertWorkerBlack(List<BmWorkerBlackJob> list);
|
||||
|
||||
void updateWorkerEinDayRecordBlackStatus(List<BmWorkerBlackJob> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.job.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.bonus.job.domain.BmWorkerBlackJob;
|
||||
import com.bonus.job.domain.PmWorkerJob;
|
||||
import com.bonus.job.mapper.WorkerJobMapper;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -70,4 +71,18 @@ public class WorkerEinDayRecordTask{
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新超30天未上传离场文件人员去失信人员
|
||||
*/
|
||||
public void updateExitWorkerToBreachOfTrust(){
|
||||
try{
|
||||
List<BmWorkerBlackJob> list = mapper.getWorkeExitThan30Day();
|
||||
int count = mapper.insertWorkerBlack(list);
|
||||
logger.info("更新超30天未上传离场文件人员去失信人员成功,{}",count);
|
||||
mapper.updateWorkerEinDayRecordBlackStatus(list);
|
||||
}catch (Exception e){
|
||||
logger.error("人员入场更新表失败,{}",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,4 +59,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getWorkeExitThan30Day" resultType="com.bonus.job.domain.BmWorkerBlackJob">
|
||||
SELECT
|
||||
bwepr.id,
|
||||
bwepr.worker_id,
|
||||
pw.`name`,
|
||||
pw.id_number as idNumber,
|
||||
bwepr.pro_name,
|
||||
bwepr.sub_name,
|
||||
bwepr.post_name,
|
||||
'出场30天未上传《离场人员工资结算确认单》' as reason,
|
||||
'永久' as startTime,
|
||||
'永久' as endTime
|
||||
FROM
|
||||
pm_worker pw
|
||||
LEFT JOIN bm_worker_ein_pro_record bwepr ON pw.id = bwepr.worker_id
|
||||
WHERE
|
||||
if(is_upload_file=0,DATEDIFF(NOW(), exit_time),0) > 30
|
||||
and bwepr.is_go_black = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertWorkerBlack">
|
||||
replace INTO bm_worker_black(
|
||||
id_number,name,pro_name,sub_name,post_name,reason,start_time,end_time
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.idNumber},#{item.name},#{item.proName},#{item.subName},#{item.postName},#{item.reason},#{item.startTime},#{item.endTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateWorkerEinDayRecordBlackStatus">
|
||||
update bm_worker_ein_pro_record set is_go_black = 1 where id in
|
||||
<foreach item="item" collection="list" index="index" separator="," close=")" open="(">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue