入场,出场,合同,工资优化
This commit is contained in:
parent
5920e8c1b2
commit
b112bc16e8
|
|
@ -57,5 +57,10 @@ public class PmWorkerDto {
|
||||||
*/
|
*/
|
||||||
private Integer workerId;
|
private Integer workerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否上传离职文件 0未上传 1已上传
|
||||||
|
*/
|
||||||
|
private String isUploadFile;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +32,7 @@ public interface PmWorkerExitMapper {
|
||||||
* @param einStatus
|
* @param einStatus
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateEinProRecordStatus(@Param("workerId") Integer id,@Param("einStatus") Integer einStatus,@Param("isUploadFile") Integer isUploadFile);
|
int updateEinProRecordStatus(@Param("id") Integer id,@Param("einStatus") Integer einStatus,@Param("isUploadFile") Integer isUploadFile);
|
||||||
|
|
||||||
List<PmWorker> selectWorkListByWorkerId(PmWorkerDto o);
|
List<PmWorker> selectWorkListByWorkerId(PmWorkerDto o);
|
||||||
}
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ import com.bonus.bmw.service.BmWorkerWageCardService;
|
||||||
import com.bonus.common.core.constant.Constants;
|
import com.bonus.common.core.constant.Constants;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.system.api.model.LoginUser;
|
||||||
import com.bonus.system.api.model.UploadFileVo;
|
import com.bonus.system.api.model.UploadFileVo;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
@ -40,6 +41,7 @@ public class BmWorkerWageCardServiceImpl implements BmWorkerWageCardService {
|
||||||
public int updateByPrimaryKey(BmWorkerWageCard record, List<WebFileDto> listFile) {
|
public int updateByPrimaryKey(BmWorkerWageCard record, List<WebFileDto> listFile) {
|
||||||
//存在则删除后新增,不存在则新增
|
//存在则删除后新增,不存在则新增
|
||||||
if(record.getId() != null){
|
if(record.getId() != null){
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
if(record.getDelIds() != null){
|
if(record.getDelIds() != null){
|
||||||
//修改时删除部分图片
|
//修改时删除部分图片
|
||||||
String[] split = record.getDelIds().split(",");
|
String[] split = record.getDelIds().split(",");
|
||||||
|
|
@ -59,7 +61,7 @@ public class BmWorkerWageCardServiceImpl implements BmWorkerWageCardService {
|
||||||
return 1;
|
return 1;
|
||||||
}else{
|
}else{
|
||||||
//新增
|
//新增
|
||||||
record.setCreateUser(SecurityUtils.getUsername());
|
record.setCreateUser(SecurityUtils.getLoginUser().getUsername());
|
||||||
int insert = mapper.insert(record);
|
int insert = mapper.insert(record);
|
||||||
//添加到文件库和minio上
|
//添加到文件库和minio上
|
||||||
if(insert > 0){
|
if(insert > 0){
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,11 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PmWorker> selectWorkList(PmWorkerDto o) {
|
public List<PmWorker> selectWorkList(PmWorkerDto o) {
|
||||||
|
// List<PmWorker> pmWorkers = mapper.selectWorkList(o);
|
||||||
|
// pmWorkers.forEach(pmWorker -> {
|
||||||
|
// List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", pmWorker.getId().toString(), Constants.FILE_UPLOAD_WORKER_EXIT, "");
|
||||||
|
// pmWorker.setFiles(contractFile);
|
||||||
|
// });
|
||||||
return mapper.selectWorkList(o);
|
return mapper.selectWorkList(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,8 +46,8 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
||||||
//修改在场记录表状态
|
//修改在场记录表状态
|
||||||
int einStatus = 2;
|
int einStatus = 2;
|
||||||
//是否上传文件
|
//是否上传文件
|
||||||
int isUploadFile = 1;
|
int isUploadFile = 0;
|
||||||
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile);
|
if(!listFile.isEmpty()){
|
||||||
//组装数据
|
//组装数据
|
||||||
MultipartFile[] workerFiles = new MultipartFile[listFile.size()];
|
MultipartFile[] workerFiles = new MultipartFile[listFile.size()];
|
||||||
String[] type = new String[listFile.size()];
|
String[] type = new String[listFile.size()];
|
||||||
|
|
@ -51,6 +56,10 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
||||||
type[i] = listFile.get(i).getType();
|
type[i] = listFile.get(i).getType();
|
||||||
}
|
}
|
||||||
List<UploadFileVo> uploadFileVos = fileUploadUtils.uploadFile(workerFiles, Constants.FILE_UPLOAD_WORKER_EXIT, record.getId().toString(), type,"", "");
|
List<UploadFileVo> uploadFileVos = fileUploadUtils.uploadFile(workerFiles, Constants.FILE_UPLOAD_WORKER_EXIT, record.getId().toString(), type,"", "");
|
||||||
|
isUploadFile = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile);
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,6 +94,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
||||||
public int exitFile(PmWorkerDto o, List<WebFileDto> listFile) {
|
public int exitFile(PmWorkerDto o, List<WebFileDto> listFile) {
|
||||||
//删除文件
|
//删除文件
|
||||||
fileUploadUtils.delFileListById("", o.getId().toString(), Constants.FILE_UPLOAD_WORKER_EXIT,"");
|
fileUploadUtils.delFileListById("", o.getId().toString(), Constants.FILE_UPLOAD_WORKER_EXIT,"");
|
||||||
|
if(!listFile.isEmpty()){
|
||||||
//录入文件
|
//录入文件
|
||||||
MultipartFile[] workerFiles = new MultipartFile[listFile.size()];
|
MultipartFile[] workerFiles = new MultipartFile[listFile.size()];
|
||||||
String[] type = new String[listFile.size()];
|
String[] type = new String[listFile.size()];
|
||||||
|
|
@ -95,10 +105,12 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
||||||
List<UploadFileVo> uploadFileVos = fileUploadUtils.uploadFile(workerFiles, Constants.FILE_UPLOAD_WORKER_EXIT, o.getId().toString(), type,"", "");
|
List<UploadFileVo> uploadFileVos = fileUploadUtils.uploadFile(workerFiles, Constants.FILE_UPLOAD_WORKER_EXIT, o.getId().toString(), type,"", "");
|
||||||
int einStatus = 0;
|
int einStatus = 0;
|
||||||
//是否上传文件
|
//是否上传文件
|
||||||
int isUploadFile = 0;
|
int isUploadFile = 1;
|
||||||
int k = mapper.updateEinProRecordStatus(o.getId(),einStatus,isUploadFile);
|
int k = mapper.updateEinProRecordStatus(o.getId(),einStatus,isUploadFile);
|
||||||
return !uploadFileVos.isEmpty() ?1:0;
|
return !uploadFileVos.isEmpty() ?1:0;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult lookFileByPrimaryKey(Integer id) {
|
public AjaxResult lookFileByPrimaryKey(Integer id) {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@
|
||||||
FROM
|
FROM
|
||||||
pm_worker pw
|
pm_worker pw
|
||||||
LEFT JOIN bm_worker_ein_pro_record bwepr ON pw.id = bwepr.worker_id
|
LEFT JOIN bm_worker_ein_pro_record bwepr ON pw.id = bwepr.worker_id
|
||||||
AND bwepr.is_active = 1
|
|
||||||
WHERE
|
WHERE
|
||||||
pw.is_active = 1 And bwepr.is_last = 1
|
pw.is_active = 1 And bwepr.is_last = 1
|
||||||
<if test="name != null and name != ''">
|
<if test="name != null and name != ''">
|
||||||
|
|
@ -72,6 +71,9 @@
|
||||||
<if test="einStatus != null and einStatus != ''">
|
<if test="einStatus != null and einStatus != ''">
|
||||||
AND bwepr.ein_status = #{einStatus}
|
AND bwepr.ein_status = #{einStatus}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="isUploadFile != null and isUploadFile != ''">
|
||||||
|
AND bwepr.is_upload_file = #{isUploadFile}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteEinMsgByWorkerId">
|
<delete id="deleteEinMsgByWorkerId">
|
||||||
|
|
@ -79,11 +81,12 @@
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="updateEinProRecordStatus">
|
<update id="updateEinProRecordStatus">
|
||||||
UPDATE bm_worker_ein_pro_record SET is_upload_file = #{isUploadFile}
|
UPDATE bm_worker_ein_pro_record SET is_upload_file = #{isUploadFile},is_active = 0
|
||||||
<if test='einStatus != 0'>
|
<if test='einStatus != 0'>
|
||||||
, ein_status = #{einStatus}
|
, ein_status = #{einStatus}
|
||||||
|
, exit_time = NOW()
|
||||||
</if>
|
</if>
|
||||||
WHERE worker_id = #{workerId}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectWorkListByWorkerId" resultMap="BaseResultMap">
|
<select id="selectWorkListByWorkerId" resultMap="BaseResultMap">
|
||||||
|
|
@ -97,6 +100,8 @@
|
||||||
bwepr.post_name,
|
bwepr.post_name,
|
||||||
bwepr.ein_time,
|
bwepr.ein_time,
|
||||||
bwepr.ein_status,
|
bwepr.ein_status,
|
||||||
|
bwepr.is_upload_file,
|
||||||
|
if(is_upload_file=0,DATEDIFF(NOW(), exit_time),0) as days_since_exit,
|
||||||
bwepr.exit_time
|
bwepr.exit_time
|
||||||
FROM
|
FROM
|
||||||
pm_worker pw
|
pm_worker pw
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue