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