Commit c7f7cf9c authored by huyuchen's avatar huyuchen

huych-入职登记提交

parent 15235f21
......@@ -89,6 +89,16 @@ public class EmployeeRegistrationPre extends BaseEntity {
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String fileTown;
@Schema(description = "档案所在地-省编号")
private String provinceCode;
@Schema(description = "档案所在地-市编号")
private String cityCode;
@Schema(description = "档案所在地-县编号")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String townCode;
@Schema(description = "确认人")
private String confirmUser;
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
......@@ -43,6 +44,15 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "档案所在地-县")
private String fileTown;
@Schema(description = "档案所在地-省编号")
private String provinceCode;
@Schema(description = "档案所在地-市编号")
private String cityCode;
@Schema(description = "档案所在地-县编号")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String townCode;
@Schema(description = "员工姓名")
......@@ -60,6 +70,9 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "入职日期")
private Date joinLeaveDate;
@Schema(description = "推送时间")
private String pushDate;
@Schema(description = "状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职,4已完成")
private String processStatus;
......@@ -82,7 +95,7 @@ public class EmployeeRegistrationPreVo implements Serializable {
private String dataSource;
@Schema(description = "预计收集时间")
private LocalDateTime expectedCollectionTime;
private Date expectedCollectionTime;
@Schema(description = "确认人")
private String confirmUser;
......
......@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author fxj
......@@ -14,9 +13,7 @@ import java.util.List;
@Data
public class SendMessageUpdateVo implements Serializable {
// 签名
private List<String> idList;
// 类型
private String type;
private String id;
//项目编码
private String deptNo;
}
package com.yifu.cloud.plus.v1.yifu.archives.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
@Configuration
public class TaskSchedulerConfig {
@Bean
public TaskScheduler taskScheduler() {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(10);
scheduler.setThreadNamePrefix("scheduled-task-");
scheduler.initialize();
return scheduler;
}
}
......@@ -19,6 +19,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 入职待建档表
......@@ -166,7 +167,7 @@ public class EmployeeRegistrationPreController {
@Operation(summary = "批量发送入职信息收集短信", description = "批量发送入职信息收集短信")
@SysLog("批量发送入职信息收集短信" )
@PostMapping("/batchSms")
public R batchSendMessage(@RequestBody SendMessageUpdateVo vo) {
return employeeRegistrationPreService.batchSendMessage(vo);
public R batchSendMessage(@RequestBody List<SendMessageUpdateVo> vo,String type) {
return employeeRegistrationPreService.batchSendMessage(vo, type);
}
}
......@@ -152,8 +152,7 @@ public class TEmployeeLogController {
**/
@Operation(summary = "通过EMP_ID查询入职确认信息变更日志", description = "通过EMP_ID查询入职确认信息变更日志")
@GetMapping("/getPreLogById")
public R<List<TEmployeeLog>> getPreLogById(@RequestParam String id) {
return R.ok(tEmployeeLogService.list(Wrappers.<TEmployeeLog>query().eq("EMP_ID", id)
.eq("TYPE", CommonConstants.FOUR_INT).orderByDesc(CommonConstants.CREATE_TIME)));
public R<IPage<TEmployeeLog>> getPreLogById(Page<TEmployeeLog> page, TEmployeeLog tEmployeeLog) {
return R.ok(tEmployeeLogService.page(page, Wrappers.query(tEmployeeLog).orderByDesc(CommonConstants.CREATE_TIME)));
}
}
......@@ -10,6 +10,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.SendMessageUpdateVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 入职待建档表
......@@ -62,7 +63,7 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
R updateCommonInfo(EmployeeRegistrationPre employeeRegistrationPre);
/**
* 入职确认信息信息修改
* 数量查询
* @param searchVo type 查询类型 1待办列表 2 监控列表
* @return
*/
......@@ -80,7 +81,7 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
* @param vo
* @return
*/
R batchSendMessage(SendMessageUpdateVo vo);
R batchSendMessage(List<SendMessageUpdateVo> vo, String type);
void updatePreStatusToEnd(String deptNo, String EmpIdcard);
void updatePreStatusToEnd(String deptNo, String empIdcard);
}
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
public interface ScheduleService {
void scheduleTask(EmployeeRegistrationPre record);
void executeTask(String aId);
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.service.EmployeeRegistrationPreService;
import com.yifu.cloud.plus.v1.yifu.archives.service.ScheduleService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SendMessageUpdateVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionTemplate;
import java.time.Instant;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
@Service
public class ScheduleServiceImpl implements ScheduleService {
@Autowired
@Lazy
private EmployeeRegistrationPreService registrationPreService;
@Autowired
private TaskScheduler taskScheduler;
@Autowired
private TransactionTemplate transactionTemplate;
// 调度单个任务
@Override
public void scheduleTask(EmployeeRegistrationPre record) {
Instant triggerTime = record.getExpectedCollectionTime().atZone(ZoneId.systemDefault()).toInstant();
taskScheduler.schedule(() -> executeTask(record.getId()), triggerTime);
}
// 执行发送短信操作(事务内处理)
@Override
public void executeTask(String aId) {
transactionTemplate.execute(status -> {
List<SendMessageUpdateVo> voList = new ArrayList<>();
SendMessageUpdateVo updateVo = new SendMessageUpdateVo();
updateVo.setId(aId);
voList.add(updateVo);
registrationPreService.batchSendMessage(voList, CommonConstants.ONE_STRING);
return null;
});
}
}
......@@ -26,6 +26,9 @@
<result property="fileProvince" column="file_province"/>
<result property="fileCity" column="file_city"/>
<result property="fileTown" column="file_town"/>
<result property="provinceCode" column="province_code"/>
<result property="cityCode" column="city_code"/>
<result property="townCode" column="town_code"/>
<result property="confirmUser" column="confirm_user"/>
<result property="confirmTime" column="confirm_time"/>
<result property="createBy" column="create_by"/>
......@@ -101,7 +104,8 @@
a.update_by,
a.update_time,
a.contract_sub_name,
a.customer_username_new
a.customer_username_new,
province_code,city_code,town_code
</sql>
<sql id="employeeRegistrationPre_where">
<if test="employeeRegistrationPre != null">
......
......@@ -211,7 +211,7 @@
a.CONTRACT_TYPE as contract_type,
if(a.UNCOMPLETE_TYPE = '1','基本信息',if(a.UNCOMPLETE_TYPE = '2','合同信息','基本信息、合同信息')) as type,
'待完善' as process_status,
a.ENJOIN_DATE as join_leave_date,
DATE_FORMAT(a.ENJOIN_DATE, '%Y-%m-%d') as join_leave_date,
CASE WHEN a.PROJECT_SOURCE='1' THEN "社保/公积金"
WHEN a.PROJECT_SOURCE ='2' THEN "薪酬"
WHEN a.PROJECT_SOURCE ='3' THEN "商险"
......@@ -222,7 +222,7 @@
WHEN a.PROJECT_SOURCE ='8' THEN "预入职"
ELSE a.PROJECT_SOURCE END as data_source,
c.CS_NAME as customer_username,
b.EMP_PHONE as emp_phone,
b.EMP_PHONE as emp_phone
FROM t_employee_project a
inner join t_employee_info b on a.EMP_ID = b.id
inner join t_settle_domain c on a.DEPT_NO = c.DEPART_NO
......
......@@ -638,6 +638,8 @@ public interface CommonConstants {
List<String> processStatus = Stream.of("0","1").collect(Collectors.toList());
List<String> processStatusEnd = Stream.of("3","4").collect(Collectors.toList());
List<String> processPreStatus = Stream.of("1").collect(Collectors.toList());
List<String> processPreArchivesStatus = Stream.of("0","1","2").collect(Collectors.toList());
......
......@@ -32,17 +32,6 @@ public class CspDaprUtils {
* @return
**/
public R<Boolean> updateRegistByPreInfo(EmployeeRegistrationUpdateVo updateVo) {
return HttpDaprUtil.invokeMethodPost(daprCspProperties.getAppUrl(),daprCspProperties.getAppId(),"/employeeregistration/inner/updateRegistPreInfo", JSON.toJSONString(updateVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 查询入职待确认数量
* @Date 19:47 2025/3/17
* @Param
* @return
**/
public R<EmployeeRegistrationDaprCountVo> getRegisterPreCount(EmployeeRegistrationDaprCountVo countVo) {
return HttpDaprUtil.invokeMethodPost(daprCspProperties.getAppUrl(),daprCspProperties.getAppId(),"/employeeregistration/inner/getRegisterPreCount", countVo, EmployeeRegistrationDaprCountVo.class, SecurityConstants.FROM_IN);
return HttpDaprUtil.invokeMethodPost(daprCspProperties.getAppUrl(),daprCspProperties.getAppId(),"/employeeregistration/inner/updateRegistByPreInfo", JSON.toJSONString(updateVo), Boolean.class, SecurityConstants.FROM_IN);
}
}
package com.yifu.cloud.plus.v1.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......
......@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationService;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationDaprCountVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationReceiveVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationUpdateVo;
......@@ -287,12 +286,10 @@ public class EmployeeRegistrationController {
**/
@Operation(summary = "查询入职待确认数量")
@SysLog("查询入职待确认数量")
@Inner
@PostMapping("/inner/getRegisterPreCount")
public EmployeeRegistrationDaprCountVo getRegisterPreCount(@RequestBody EmployeeRegistrationDaprCountVo countVo) {
EmployeeRegistrationSearchVo searchVo = new EmployeeRegistrationSearchVo();
searchVo.setMId(countVo.getMId());
menuUtil.setAuthSql(countVo.getUser(), searchVo);
return employeeRegistrationService.getRegisterPreCount(countVo,searchVo);
@PostMapping("/getRegisterPreCount")
public R getRegisterPreCount(@RequestBody EmployeeRegistrationSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
return R.ok(employeeRegistrationService.getRegisterPreCount(searchVo));
}
}
......@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationDaprCountVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationReceiveVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationUpdateVo;
......@@ -128,7 +127,7 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati
* @param countVo 查询入职待确认数量vo
* @return
*/
EmployeeRegistrationDaprCountVo getRegisterPreCount(EmployeeRegistrationDaprCountVo countVo,EmployeeRegistrationSearchVo searchVo);
long getRegisterPreCount(EmployeeRegistrationSearchVo searchVo);
/**
* @param searchCspVo 身份证 与 类型
......
......@@ -662,16 +662,12 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
@Override
public EmployeeRegistrationDaprCountVo getRegisterPreCount(EmployeeRegistrationDaprCountVo countVo,
EmployeeRegistrationSearchVo employeeRegistration) {
public long getRegisterPreCount(EmployeeRegistrationSearchVo employeeRegistration) {
//权限和条件赋值
employeeRegistration.setType(countVo.getType());
initDaprSearchVo(employeeRegistration,countVo.getUser());
initSearchVo(employeeRegistration);
employeeRegistration.setStatusList(CommonConstants.processPreStatus);
employeeRegistration.setTypeList(CommonConstants.processPreStatus);
long count = baseMapper.selectExportCount(employeeRegistration);
countVo.setCount(count);
return countVo;
return baseMapper.selectExportCount(employeeRegistration);
}
//单个新增、导入校验
......@@ -939,31 +935,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
/**
* @Description: 获取前端客服的所有项目权限
* @Author: huych
* @Date: 2025/3/13 17:02
* @return:
**/
public void initDaprSearchVo(EmployeeRegistrationSearchVo searchVo,YifuUser user) {
long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId);
if (isSsc || CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
searchVo.setAuthSql(null);
return;
}
if (Common.isNotNull(searchVo.getType()) && CommonConstants.ONE_STRING.equals(searchVo.getType())) {
searchVo.setAuthSql(null);
//获取项目信息
R<TSettleDomainRegistListVo> domainR = archivesDaprUtil.getAllDeptByCustomerLoginName(user.getUsername());
if (null != domainR && null != domainR.getData() && null != domainR.getData().getDeptNos()) {
searchVo.setDeptNoList(domainR.getData().getDeptNos());
} else {
searchVo.setId(CommonConstants.ONE_STRING_NEGATE);
}
}
}
public boolean haveRole(YifuUser user, long roleId) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) {
......@@ -976,22 +947,28 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
//数据初始化
private void initRegistPreInfo(EmployeeRegistration registration,EmployeeRegistrationPreVo preVo,YifuUser user) {
preVo.setCustomerUsername(registration.getCustomerUsername());
preVo.setCustomerUserLoginname(registration.getCustomerUserLoginname());
preVo.setDeptName(registration.getDeptName());
preVo.setDeptId(registration.getDeptId());
preVo.setDataSource(registration.getDataSource());
preVo.setPosition(registration.getPosition());
preVo.setJoinLeaveDate(registration.getJoinLeaveDate());
preVo.setProcessStatus(CommonConstants.ZERO_STRING);
preVo.setConfirmTime(DateUtil.getCurrentDateTime());
preVo.setDeptNo(registration.getDeptNo());
preVo.setConfirmUser(user.getNickname());
preVo.setCustomerUsernameNew(registration.getCustomerUsername());
preVo.setEmpPhone(registration.getEmpPhone());
preVo.setEmployeeName(registration.getEmployeeName());
preVo.setEmpIdcard(registration.getEmpIdcard());
preVo.setExpectedCollectionTime(LocalDateTimeUtils.formatTime(DateUtil.dateToString(
registration.getJoinLeaveDate(),DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 09:00:00",LocalDateTimeUtils.DATE_TIME_PATTERN));
try {
preVo.setCustomerUsername(registration.getCustomerUsername());
preVo.setCustomerUserLoginname(registration.getCustomerUserLoginname());
preVo.setDeptName(registration.getDeptName());
preVo.setDeptId(registration.getDeptId());
preVo.setDataSource(registration.getDataSource());
preVo.setPosition(registration.getPosition());
preVo.setJoinLeaveDate(registration.getJoinLeaveDate());
preVo.setProcessStatus(CommonConstants.ZERO_STRING);
preVo.setConfirmTime(DateUtil.getCurrentDateTime());
preVo.setDeptNo(registration.getDeptNo());
preVo.setConfirmUser(user.getNickname());
preVo.setCustomerUsernameNew(registration.getCustomerUsername());
preVo.setEmpPhone(registration.getEmpPhone());
preVo.setEmployeeName(registration.getEmployeeName());
preVo.setEmpIdcard(registration.getEmpIdcard());
if (Common.isNotNull(preVo.getPushDate())) {
preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
registration.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " " + preVo.getPushDate(), DateUtil.DATETIME_PATTERN_MINUTE));
}
}catch (Exception e) {
log.error("执行异常", e);
}
}
}
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