Commit fb4cb6ba authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.8' into MVP1.7.8

parents 5f93b63c 0cbf3f21
...@@ -265,9 +265,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -265,9 +265,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
//新增操作记录 //新增操作记录
EmployeeRegistrationUpdateVo receiveVo = new EmployeeRegistrationUpdateVo(); EmployeeRegistrationUpdateVo receiveVo = new EmployeeRegistrationUpdateVo();
receiveVo.setEmployeeName(user.getNickname()); receiveVo.setEmployeeName(user.getNickname());
receiveVo.setEmpIdcard(updatePre.getEmpIdcard()); receiveVo.setId(updatePre.getId());
receiveVo.setReason(employeeRegistrationPre.getReason()); receiveVo.setReason(employeeRegistrationPre.getReason());
receiveVo.setDeptNo(employeeRegistrationPre.getDeptNo()); receiveVo.setEmployeeId(user.getId());
try { try {
//调用csp服务更新状态和新增操作记录 //调用csp服务更新状态和新增操作记录
cspDaprUtils.updateRegistByPreInfo(receiveVo); cspDaprUtils.updateRegistByPreInfo(receiveVo);
...@@ -389,9 +389,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -389,9 +389,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
RegistParamVo paramVo = new RegistParamVo(); RegistParamVo paramVo = new RegistParamVo();
List<RegistParamVo> params = new ArrayList<>(); List<RegistParamVo> params = new ArrayList<>();
List<String> phones = new ArrayList<>(); List<String> phones = new ArrayList<>();
EmployeeRegistrationPre updatePre;
AliSmsResult res;
if (CommonConstants.ONE_STRING.equals(type)) { if (CommonConstants.ONE_STRING.equals(type)) {
for(SendMessageUpdateVo updateVo:voList) { for(SendMessageUpdateVo updateVo:voList) {
EmployeeRegistrationPre updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query() updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query()
.lambda().eq(EmployeeRegistrationPre::getId, updateVo.getId()) .lambda().eq(EmployeeRegistrationPre::getId, updateVo.getId())
.in(EmployeeRegistrationPre::getProcessStatus, CommonConstants.processStatus)); .in(EmployeeRegistrationPre::getProcessStatus, CommonConstants.processStatus));
if (Common.isNotNull(updatePre)) { if (Common.isNotNull(updatePre)) {
...@@ -413,7 +415,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -413,7 +415,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
employeeService.save(smsEmployee); employeeService.save(smsEmployee);
paramVo.setLink(smsEmployee.getId().toString()); paramVo.setLink(smsEmployee.getId().toString());
params.add(paramVo); params.add(paramVo);
AliSmsResult res = sendMessage(phones, params); res = sendMessage(phones, params);
if (null != res && null != res.getBizId()) { if (null != res && null != res.getBizId()) {
smsEmployee.setBizId(res.getBizId()); smsEmployee.setBizId(res.getBizId());
smsEmployee.setMessage(res.getMessage()); smsEmployee.setMessage(res.getMessage());
...@@ -428,19 +430,20 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -428,19 +430,20 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
} }
} else { } else {
TEmployeeInfo info;
for(SendMessageUpdateVo updateVo:voList) { for(SendMessageUpdateVo updateVo:voList) {
TEmployeeInfo info = employeeInfoMapper.selectById(updateVo.getId()); info = employeeInfoMapper.selectById(updateVo.getId());
if (Common.isNotNull(info)) { if (Common.isNotNull(info)) {
paramVo.setName(info.getEmpName()); paramVo.setName(info.getEmpName());
phones.add(info.getEmpPhone()); phones.add(info.getEmpPhone());
//如果有入职待建档数据同步更新 //如果有入职待建档数据同步更新
EmployeeRegistrationPre registrationPre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda() updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda()
.eq(EmployeeRegistrationPre::getEmpIdcard, info.getEmpIdcard()) .eq(EmployeeRegistrationPre::getEmpIdcard, info.getEmpIdcard())
.eq(EmployeeRegistrationPre::getDeptId, updateVo.getDeptId()) .eq(EmployeeRegistrationPre::getDeptId, updateVo.getDeptId())
.eq(EmployeeRegistrationPre::getProcessStatus, CommonConstants.ZERO_STRING) .eq(EmployeeRegistrationPre::getProcessStatus, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(registrationPre)) { if (Common.isNotNull(updatePre)) {
registrationPre.setProcessStatus(CommonConstants.ONE_STRING); updatePre.setProcessStatus(CommonConstants.ONE_STRING);
} }
//生成短信发送的记录 //生成短信发送的记录
TRegisteWarningEmployee smsEmployee = new TRegisteWarningEmployee(); TRegisteWarningEmployee smsEmployee = new TRegisteWarningEmployee();
...@@ -455,12 +458,14 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -455,12 +458,14 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
employeeService.save(smsEmployee); employeeService.save(smsEmployee);
paramVo.setLink(smsEmployee.getId().toString()); paramVo.setLink(smsEmployee.getId().toString());
params.add(paramVo); params.add(paramVo);
AliSmsResult res = sendMessage(phones, params); res = sendMessage(phones, params);
if (null != res && null != res.getBizId()) { if (null != res && null != res.getBizId()) {
smsEmployee.setBizId(res.getBizId()); smsEmployee.setBizId(res.getBizId());
smsEmployee.setMessage(res.getMessage()); smsEmployee.setMessage(res.getMessage());
employeeService.updateById(smsEmployee); employeeService.updateById(smsEmployee);
this.updateById(registrationPre); if (Common.isNotNull(updatePre)) {
this.updateById(updatePre);
}
return R.ok(); return R.ok();
} else { } else {
smsEmployee.setMessage("短信发送失败"); smsEmployee.setMessage("短信发送失败");
......
package com.yifu.cloud.plus.v1.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 入离职登记导出
*
* @author chenyuxi
* @date 2025-03-21
* @since 1.9.8
*/
@Data
@ColumnWidth(17)
public class EmployeeRegistrationHrAutoExportVo implements Serializable {
@ExcelAttribute(name = "项目名称")
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
@ExcelAttribute(name = "项目编码")
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
@ExcelAttribute(name = "员工姓名")
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String employeeName;
@ExcelAttribute(name = "身份证号")
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelAttribute(name = "手机号码")
@Schema(description = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
@ExcelAttribute(name = "就职岗位")
@Schema(description = "就职岗位")
@ExcelProperty("就职岗位")
private String position;
@ExcelAttribute(name = "登记类型")
@Schema(description = "登记类型 1入职 2离职")
@ExcelProperty("登记类型")
private String feedbackType;
@ExcelAttribute(name = "入/离职日期", isDate = true)
@Schema(description = "入/离职日期")
@ExcelProperty("入/离职日期")
@DateTimeFormat("yyyy-MM-dd")
private Date joinLeaveDate;
@ExcelAttribute(name = "登记人")
@Schema(description = "登记人")
@ExcelProperty("登记人")
private String registorUsername;
@ExcelAttribute(name = "登记时间", isDate = true)
@Schema(description = "登记时间")
@ExcelProperty("登记时间")
private Date createTime;
@ExcelAttribute(name = "前端客服")
@Schema(description = "前端客服")
@ExcelProperty("前端客服")
private String customerUsername;
@ExcelAttribute(name = "数据来源")
@Schema(description = "数据来源")
@ExcelProperty("数据来源")
private String dataSource;
@ExcelAttribute(name = "处理状态")
@Schema(description = "处理状态,0已接收,1未处理,2已处理")
@ExcelProperty("处理状态")
private String processStatus;
}
...@@ -77,7 +77,7 @@ public class EmployeeRegistrationHrExportVo implements Serializable { ...@@ -77,7 +77,7 @@ public class EmployeeRegistrationHrExportVo implements Serializable {
private Date createTime; private Date createTime;
@ExcelAttribute(name = "处理状态") @ExcelAttribute(name = "处理状态")
@Schema(description = "处理状态,0已接收,1未处理,2已处理") @Schema(description = "处理状态,0已接收,1未处理,2已处理,3拒绝入职")
@ExcelProperty("处理状态") @ExcelProperty("处理状态")
private String processStatus; private String processStatus;
......
...@@ -21,6 +21,9 @@ public class EmployeeRegistrationUpdateVo implements Serializable { ...@@ -21,6 +21,9 @@ public class EmployeeRegistrationUpdateVo implements Serializable {
@Schema(description = "身份证号") @Schema(description = "身份证号")
private String empIdcard; private String empIdcard;
@Schema(description = "操作人人id")
private String employeeId;
@Schema(description = "操作人人姓名") @Schema(description = "操作人人姓名")
private String employeeName; private String employeeName;
......
...@@ -83,7 +83,10 @@ public class EmployeeRegistrationController { ...@@ -83,7 +83,10 @@ public class EmployeeRegistrationController {
* *
* @param page 分页对象 * @param page 分页对象
* @param employeeRegistration 入离职登记表 * @param employeeRegistration 入离职登记表
* @return * @return R<IPage<EmployeeRegistration>>
* @author chenyuxi
* @date 2025-03-21
* @since 1.9.8
*/ */
@Operation(description = "作业自动化-入离职登记列表简单分页查询") @Operation(description = "作业自动化-入离职登记列表简单分页查询")
@GetMapping("/hrRegistrationPage") @GetMapping("/hrRegistrationPage")
...@@ -203,8 +206,9 @@ public class EmployeeRegistrationController { ...@@ -203,8 +206,9 @@ public class EmployeeRegistrationController {
/** /**
* 作业自动化-入离职登记导出 * 作业自动化-入离职登记导出
* *
* @author huych * @author chenyuxi
* @date 2025-02-25 14:48:11 * @date 2025-03-21
* @since 1.9.8
**/ **/
@Operation(description = "作业自动化-入离职登记导出") @Operation(description = "作业自动化-入离职登记导出")
@PostMapping("/hrRegistrationExport") @PostMapping("/hrRegistrationExport")
......
...@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration; import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationExportVo; import com.yifu.cloud.plus.v1.csp.vo.*;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationHrExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationHrPreExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -46,4 +43,7 @@ public interface EmployeeRegistrationMapper extends BaseMapper<EmployeeRegistrat ...@@ -46,4 +43,7 @@ public interface EmployeeRegistrationMapper extends BaseMapper<EmployeeRegistrat
// 将数据处理为已处理 // 将数据处理为已处理
int updateTwoRegistrationByIdCard(@Param("searchCspVo") TEmployeeProjectBelongDeptSearchCspVo searchCspVo); int updateTwoRegistrationByIdCard(@Param("searchCspVo") TEmployeeProjectBelongDeptSearchCspVo searchCspVo);
List<EmployeeRegistrationHrAutoExportVo> selectHrAutoExportList(@Param("employeeRegistration") EmployeeRegistrationSearchVo employeeRegistration);
} }
...@@ -56,4 +56,6 @@ public interface TOperationLogService extends IService<TOperationLog> { ...@@ -56,4 +56,6 @@ public interface TOperationLogService extends IService<TOperationLog> {
**/ **/
TOperationLog saveLog(String mainId, String type, String title, LocalDateTime operationTime, String operationName, String remark); TOperationLog saveLog(String mainId, String type, String title, LocalDateTime operationTime, String operationName, String remark);
TOperationLog saveInnerLog(String mainId, String type, String title, LocalDateTime operationTime, String operationName, String remark, String userId);
} }
...@@ -211,7 +211,43 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -211,7 +211,43 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
String fileName = "入离职待办任务表批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "入离职待办任务表批量导出" + DateUtil.getThisTime() + ".xlsx";
this.hrExportCommon(response,searchVo,fileName); //获取要导出的列表
List<EmployeeRegistrationHrExportVo> list = new ArrayList<>();
long count = baseMapper.selectExportCount(searchVo);
try (ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationHrExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.selectHrExportList(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("入离职待办任务表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("入离职待办任务表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
}
} }
/** /**
...@@ -230,35 +266,24 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -230,35 +266,24 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initSearchVo(searchVo); initSearchVo(searchVo);
String fileName = "入离职登记批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "入离职登记批量导出" + DateUtil.getThisTime() + ".xlsx";
this.hrExportCommon(response,searchVo,fileName);
}
/**
* 入离职导出公共
*
* @param searchVo 入离职登记表
*/
private void hrExportCommon(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo, String fileName){
//获取要导出的列表 //获取要导出的列表
List<EmployeeRegistrationHrExportVo> list = new ArrayList<>(); List<EmployeeRegistrationHrAutoExportVo> list = new ArrayList<>();
long count = baseMapper.selectExportCount(searchVo); long count = baseMapper.selectExportCount(searchVo);
try (ServletOutputStream out = response.getOutputStream()) { try (ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationHrExportVo.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationHrAutoExportVo.class).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) { for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.selectHrExportList(searchVo); list = baseMapper.selectHrAutoExportList(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("入离职待办任务表" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("入离职登记" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
...@@ -267,7 +292,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -267,7 +292,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} }
} }
} else { } else {
WriteSheet writeSheet = EasyExcel.writerSheet("入离职待办任务表" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("入离职登记" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
...@@ -278,8 +303,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -278,8 +303,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} catch (Exception e) { } catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
} }
}
}
/** /**
* 入职待确认批量导出 * 入职待确认批量导出
...@@ -650,11 +675,16 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -650,11 +675,16 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
? RegistConstants.BEFORE_IN_PROJECT : RegistConstants.BEFORE_OUT_PROJECT); ? RegistConstants.BEFORE_IN_PROJECT : RegistConstants.BEFORE_OUT_PROJECT);
SysCspDeptVo vo = new SysCspDeptVo(); SysCspDeptVo vo = new SysCspDeptVo();
if (CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())) { if (CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())) {
vo.setDepartName(registrationNow.getEmpDeptname()); if (Common.isNotNull(registrationNow.getEmpDeptid())) {
vo.setDepartId(Long.valueOf(registrationNow.getEmpDeptid())); vo.setDepartName(registrationNow.getEmpDeptname());
vo.setDepartId(Long.valueOf(registrationNow.getEmpDeptid()));
vo.setProjectId(registrationNow.getEmpProjectId());
archivesDaprUtil.saveOrDeleteDeptRelation(vo);
}
} else {
vo.setProjectId(registration.getEmpProjectId());
archivesDaprUtil.saveOrDeleteDeptRelation(vo);
} }
vo.setProjectId(registration.getEmpProjectId());
archivesDaprUtil.saveOrDeleteDeptRelation(vo);
baseMapper.updateById(registrationNow); baseMapper.updateById(registrationNow);
return R.ok(); return R.ok();
} }
...@@ -675,11 +705,16 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -675,11 +705,16 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
? RegistConstants.BEFORE_IN_PROJECT : RegistConstants.BEFORE_OUT_PROJECT); ? RegistConstants.BEFORE_IN_PROJECT : RegistConstants.BEFORE_OUT_PROJECT);
SysCspDeptVo deptVo = new SysCspDeptVo(); SysCspDeptVo deptVo = new SysCspDeptVo();
if (CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())) { if (CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())) {
deptVo.setDepartName(registrationNow.getEmpDeptname()); if (Common.isNotNull(registrationNow.getEmpDeptid())) {
deptVo.setDepartId(Long.valueOf(registrationNow.getEmpDeptid())); deptVo.setDepartName(registrationNow.getEmpDeptname());
deptVo.setDepartId(Long.valueOf(registrationNow.getEmpDeptid()));
deptVo.setProjectId(vo.getEmpProjectId());
archivesDaprUtil.saveOrDeleteDeptRelation(deptVo);
}
} else {
deptVo.setProjectId(vo.getEmpProjectId());
archivesDaprUtil.saveOrDeleteDeptRelation(deptVo);
} }
deptVo.setProjectId(vo.getEmpProjectId());
archivesDaprUtil.saveOrDeleteDeptRelation(deptVo);
baseMapper.updateById(registrationNow); baseMapper.updateById(registrationNow);
} }
return R.ok(); return R.ok();
...@@ -688,16 +723,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -688,16 +723,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
@Override @Override
public Boolean updateRegistByPreInfo(EmployeeRegistrationUpdateVo updateVo) { public Boolean updateRegistByPreInfo(EmployeeRegistrationUpdateVo updateVo) {
EmployeeRegistration registration = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda() EmployeeRegistration registration = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda()
.eq(EmployeeRegistration::getEmpIdcard, updateVo.getEmpIdcard()) .eq(EmployeeRegistration::getId, updateVo.getId())
.eq(EmployeeRegistration::getDeptNo, updateVo.getDeptNo()) .in(EmployeeRegistration::getProcessStatus, CommonConstants.processStatus));
.eq(EmployeeRegistration::getFeedbackType, CommonConstants.ONE_STRING)
.in(EmployeeRegistration::getProcessStatus, CommonConstants.processStatus)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(registration)) { if (Common.isNotNull(registration)) {
registration.setProcessStatus(CommonConstants.THREE_STRING); registration.setProcessStatus(CommonConstants.THREE_STRING);
baseMapper.updateById(registration);
//新增拒绝入职操作记录 //新增拒绝入职操作记录
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.BACK_RECEIVE, LocalDateTime.now(), logService.saveInnerLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.BACK_RECEIVE, LocalDateTime.now(),
updateVo.getEmployeeName(), "拒绝入职原因:" + updateVo.getReason()); updateVo.getEmployeeName(), updateVo.getReason(),updateVo.getEmployeeId());
} }
return true; return true;
} }
...@@ -710,6 +743,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -710,6 +743,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(registration)) { if (Common.isNotNull(registration)) {
registration.setCustomerUsernameNew(updateVo.getCustomerUserName()); registration.setCustomerUsernameNew(updateVo.getCustomerUserName());
baseMapper.updateById(registration);
} }
return true; return true;
} }
......
...@@ -123,4 +123,40 @@ public class TOperationLogServiceImpl extends ServiceImpl<TOperationLogMapper, T ...@@ -123,4 +123,40 @@ public class TOperationLogServiceImpl extends ServiceImpl<TOperationLogMapper, T
return log; return log;
} }
/**
* @param mainId 关联ID
* @param type 传0,就是入离职申请(可以为空)
* @param title 标题
* @param operationTime 操作时间
* @param operationName 操作人
* @param remark 备注(可以为空)
* @Description: 新增日志
* @Author: hgw
* @Date: 2025/2/28 16:13
* @return: com.yifu.cloud.plus.v1.csp.entity.TOperationLog
**/
@Override
public TOperationLog saveInnerLog(String mainId, String type, String title, LocalDateTime operationTime,
String operationName, String remark, String userId) {
if (Common.isEmpty(mainId) || Common.isEmpty(title)
|| Common.isEmpty(operationTime) || Common.isEmpty(operationName)) {
return null;
}
TOperationLog log = new TOperationLog();
log.setMainId(mainId);
if (Common.isEmpty(type)) {
type = CommonConstants.ZERO_STRING;
}
log.setType(type);
log.setTitle(title);
log.setOperationTime(operationTime);
log.setOperationName(operationName);
log.setRemark(remark);
log.setCreateBy(userId);
log.setCreateName(operationName);
log.setCreateTime(LocalDateTime.now());
this.save(log);
return log;
}
} }
...@@ -76,6 +76,22 @@ ...@@ -76,6 +76,22 @@
<result property="dataSource" column="data_source"/> <result property="dataSource" column="data_source"/>
<result property="customerUsernameNew" column="customer_username_new"/> <result property="customerUsernameNew" column="customer_username_new"/>
</resultMap> </resultMap>
<resultMap id="employeeRegistrationHrAutoExportMap" type="com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationHrAutoExportVo">
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="empPhone" column="emp_phone"/>
<result property="position" column="position"/>
<result property="feedbackType" column="feedback_type"/>
<result property="joinLeaveDate" column="join_leave_date"/>
<result property="processStatus" column="process_status"/>
<result property="registorUsername" column="registor_username"/>
<result property="customerUsername" column="customer_username"/>
<result property="createTime" column="create_time"/>
<result property="deptName" column="dept_name"/>
<result property="deptNo" column="dept_no"/>
<result property="dataSource" column="data_source"/>
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.id, a.id,
a.employee_name, a.employee_name,
...@@ -277,7 +293,7 @@ ...@@ -277,7 +293,7 @@
a.position, a.position,
if(a.feedback_type = '1','入职','离职') feedback_type, if(a.feedback_type = '1','入职','离职') feedback_type,
a.join_leave_date, a.join_leave_date,
if(a.process_status= '0','已接收',if(a.process_status= '1','待处理','已处理')) process_status, if(a.process_status= '0','已接收',if(a.process_status= '1','待处理',if(a.process_status= '2','已处理','拒绝入职'))) process_status,
a.registor_username, a.registor_username,
a.emp_deptname, a.emp_deptname,
a.create_time a.create_time
...@@ -337,6 +353,32 @@ ...@@ -337,6 +353,32 @@
order by a.create_time desc order by a.create_time desc
</select> </select>
<select id="selectHrAutoExportList" resultMap="employeeRegistrationHrAutoExportMap">
SELECT
a.dept_name,
a.dept_no,
a.employee_name,
a.emp_idcard,
a.emp_phone,
a.position,
if(a.feedback_type = '1','入职','离职') feedback_type,
a.join_leave_date,
if(a.process_status= '0','已接收',if(a.process_status= '1','待处理','已处理')) process_status,
a.registor_username,
a.create_time,
a.customer_username,
if(a.data_source = '1','客户端','客服端') data_source
FROM employee_registration a
<where>
1=1
<include refid="employeeRegistration_where"/>
</where>
order by a.create_time desc
<if test="employeeRegistration.limitStart != null">
limit #{employeeRegistration.limitStart},#{employeeRegistration.limitEnd}
</if>
</select>
<!-- 将数据处理为已处理 --> <!-- 将数据处理为已处理 -->
<update id="updateTwoRegistrationByIdCard"> <update id="updateTwoRegistrationByIdCard">
update employee_registration a update employee_registration a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment