Commit a6f0556e authored by hongguangwu's avatar hongguangwu

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

parents 5e6bb4e8 2bfbc465
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:02:08
*/
@Data
@TableName("t_contract_auto_log")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "合同自动化企微日志表")
public class TContractAutoLog extends BaseEntity {
/**
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("ID")
@Schema(description = "ID")
private String id;
@Schema(description = "合同实时ID")
private String contractId;
@Schema(description = "合同主数据ID")
private String mainId;
@Schema(description = "催办标识 0已催办 1未催办")
private String isUrg;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 50)
@Length(max = 50, message = "员工姓名不能超过50个字符")
@ExcelProperty("员工姓名")
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证
*/
@ExcelAttribute(name = "员工身份证", maxLength = 20)
@Length(max = 20, message = "员工身份证不能超过20个字符")
@ExcelProperty("员工身份证")
@Schema(description = "员工身份证")
private String empIdcard;
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期", isDate = true)
@ExcelProperty("入职日期")
@Schema(description = "入职日期")
private Date joinLeaveDate;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 30)
@Length(max = 30, message = "手机号码不能超过30个字符")
@ExcelProperty("手机号码")
@Schema(description = "手机号码")
private String phone;
/**
* 异常原因说明
*/
@ExcelAttribute(name = "异常原因说明", maxLength = 200)
@Length(max = 200, message = "异常原因说明不能超过200个字符")
@ExcelProperty("异常原因说明")
@Schema(description = "异常原因说明")
private String errorInfo;
}
...@@ -91,6 +91,14 @@ public class TEmployeeContractPre extends BaseEntity { ...@@ -91,6 +91,14 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "电子签转线下签的原因") @Schema(description = "电子签转线下签的原因")
private String changeTypeReason; private String changeTypeReason;
@Schema(description = "电子签转线下签操作人")
private String changeTypeUser;
@Schema(description = "电子签转线下签操作时间")
private Date changeTypeTime;
@Schema(description = "是否已建档 0是 1否")
private String archivesIsCreate;
@Schema(description = "数据来源1客户端 2客服端") @Schema(description = "数据来源1客户端 2客服端")
private String dataSource; private String dataSource;
...@@ -295,9 +303,6 @@ public class TEmployeeContractPre extends BaseEntity { ...@@ -295,9 +303,6 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "超期标识 0已超期 1未超期") @Schema(description = "超期标识 0已超期 1未超期")
private String overFlag; private String overFlag;
@Schema(description = "催办标识 0已催办 1未催办")
private String isUrg;
@Schema(description = "法大大模版ID") @Schema(description = "法大大模版ID")
private String fadadaTemplateId; private String fadadaTemplateId;
......
...@@ -99,4 +99,9 @@ public class TEmployeeContractPreExportVo implements Serializable { ...@@ -99,4 +99,9 @@ public class TEmployeeContractPreExportVo implements Serializable {
@Schema(description = "状态") @Schema(description = "状态")
@ExcelProperty("状态") @ExcelProperty("状态")
private String processStatus; private String processStatus;
@ExcelAttribute(name = "是否已建档")
@Schema(description = "是否已建档")
@ExcelProperty("是否已建档")
private String archivesIsCreate;
} }
...@@ -57,6 +57,7 @@ public class FascController { ...@@ -57,6 +57,7 @@ public class FascController {
private final TEmployeeContractPreService tEmployeeContractPreService; private final TEmployeeContractPreService tEmployeeContractPreService;
private final TEmployeeContractInfoService tEmployeeContractInfoService; private final TEmployeeContractInfoService tEmployeeContractInfoService;
private final TEmployeeContractAuditService tEmployeeContractAuditService; private final TEmployeeContractAuditService tEmployeeContractAuditService;
private final TContractAutoLogService contractAutoLogService;
private static String FASC_EVENT = "X-FASC-Event"; private static String FASC_EVENT = "X-FASC-Event";
private static String FASC_BIZ_CONTENT = "bizContent"; private static String FASC_BIZ_CONTENT = "bizContent";
...@@ -278,8 +279,17 @@ public class FascController { ...@@ -278,8 +279,17 @@ public class FascController {
contractInfo.setInUse(CommonConstants.ONE_STRING); contractInfo.setInUse(CommonConstants.ONE_STRING);
tEmployeeContractInfoService.updateById(contractInfo); tEmployeeContractInfoService.updateById(contractInfo);
UUID uuid = UUID.randomUUID();
//生成快照数据
TContractAutoLog contractAutoLog = new TContractAutoLog();
contractAutoLog.setContractId(uuid.toString());
contractAutoLog.setEmpName(pre.getEmployeeName());
contractAutoLog.setEmpIdcard(pre.getEmpIdcard());
contractAutoLog.setMainId(pre.getId());
contractAutoLog.setErrorInfo(terminationNote);
contractAutoLogService.save(contractAutoLog);
//签署失败发送企微消息 //签署失败发送企微消息
sendFddFalureInfoToWx(pre); sendFddFalureInfoToWx(pre,contractAutoLog.getId());
// 加日志 // 加日志
this.saveAuditLogFail(pre, "签署失败", terminationNote); this.saveAuditLogFail(pre, "签署失败", terminationNote);
...@@ -358,7 +368,7 @@ public class FascController { ...@@ -358,7 +368,7 @@ public class FascController {
* 发送法大大失败提醒通知到企微 * 发送法大大失败提醒通知到企微
* @param pre 合同待购买 * @param pre 合同待购买
*/ */
private void sendFddFalureInfoToWx(TEmployeeContractPre pre) { private void sendFddFalureInfoToWx(TEmployeeContractPre pre,String id) {
//获取前端客服 //获取前端客服
SysUser user; SysUser user;
if (Common.isEmpty(pre.getCustomerUserLoginname())) { if (Common.isEmpty(pre.getCustomerUserLoginname())) {
...@@ -379,7 +389,7 @@ public class FascController { ...@@ -379,7 +389,7 @@ public class FascController {
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid() String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid()
, wxConfig.getDomainName() + "/auth/oauth/wxLogin", "72" + pre.getId()); , wxConfig.getDomainName() + "/auth/oauth/wxLogin", "72" + id);
StringBuilder description = new StringBuilder(); StringBuilder description = new StringBuilder();
String title = "作业自动化——电子合同签署超期自动撤回提醒"; String title = "作业自动化——电子合同签署超期自动撤回提醒";
description.append(pre.getEmployeeName() + "-" + pre.getEmpIdcard()+ "-" + pre.getEmpPhone() + description.append(pre.getEmployeeName() + "-" + pre.getEmpIdcard()+ "-" + pre.getEmpPhone() +
......
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TContractAutoLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.TContractAutoLogService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:02:08
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tcontractautolog" )
@Tag(name = "合同自动化企微日志表管理")
public class TContractAutoLogController {
private final TContractAutoLogService tContractAutoLogService;
/**
* 简单分页查询
* @param page 分页对象
* @param tContractAutoLog 合同自动化企微日志表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TContractAutoLog>> getTContractAutoLogPage(Page<TContractAutoLog> page, TContractAutoLog tContractAutoLog) {
return new R<>(tContractAutoLogService.getTContractAutoLogPage(page,tContractAutoLog));
}
/**
* 通过id查询客户信息
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<TContractAutoLog> getById(@PathVariable("id") String id) {
return R.ok(tContractAutoLogService.getById(id));
}
}
...@@ -12,6 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeAutoRegistRevokeVo; ...@@ -12,6 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeAutoRegistRevokeVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
...@@ -129,7 +130,21 @@ public class TEmployeeContractPreController { ...@@ -129,7 +130,21 @@ public class TEmployeeContractPreController {
**/ **/
@Operation(description = "合同待签订信息单个/批量发起签署任务") @Operation(description = "合同待签订信息单个/批量发起签署任务")
@PostMapping("/dispatcherContract") @PostMapping("/dispatcherContract")
public R dispatcherContract(@RequestBody List<String> idList) { public R dispatcherContract(@RequestBody List<String> idList, @RequestParam(required = false) String signType) {
YifuUser user = SecurityUtils.getUser();
//如果是电子签发起线下签先更新为线下签
if(null != signType && null != idList) {
for (String id : idList) {
TEmployeeContractPre tEmployeeContractPre = tEmployeeContractPreService.getById(id);
if (tEmployeeContractPre != null && "0".equals(tEmployeeContractPre.getSignType())) {
tEmployeeContractPre.setSignType("1");
tEmployeeContractPre.setChangeTypeReason("手动派单转为线下签");
tEmployeeContractPre.setChangeTypeUser(user.getNickname());
tEmployeeContractPre.setChangeTypeTime(DateUtil.getCurrentDateTime());
tEmployeeContractPreService.updateById(tEmployeeContractPre);
}
}
}
return tEmployeeContractPreService.dispatcherContract(idList,"1"); return tEmployeeContractPreService.dispatcherContract(idList,"1");
} }
......
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TContractAutoLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:02:08
*/
@Mapper
public interface TContractAutoLogMapper extends BaseMapper<TContractAutoLog> {
/**
* 合同自动化企微日志表简单分页查询
* @param tContractAutoLog 合同自动化企微日志表
* @return
*/
IPage<TContractAutoLog> getTContractAutoLogPage(Page<TContractAutoLog> page, @Param("tContractAutoLog") TContractAutoLog tContractAutoLog);
}
package com.yifu.cloud.plus.v1.yifu.archives.service;
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.yifu.archives.entity.TContractAutoLog;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:02:08
*/
public interface TContractAutoLogService extends IService<TContractAutoLog> {
/**
* 合同自动化企微日志表简单分页查询
* @param tContractAutoLog 合同自动化企微日志表
* @return
*/
IPage<TContractAutoLog> getTContractAutoLogPage(Page<TContractAutoLog> page, TContractAutoLog tContractAutoLog);
}
...@@ -60,7 +60,7 @@ import java.util.stream.Stream; ...@@ -60,7 +60,7 @@ import java.util.stream.Stream;
@Log4j2 @Log4j2
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@EnableConfigurationProperties({DaprInsurancesProperties.class,DaprCheckProperties.class}) @EnableConfigurationProperties({DaprInsurancesProperties.class, DaprCheckProperties.class})
public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegistrationPreMapper, EmployeeRegistrationPre> implements EmployeeRegistrationPreService { public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegistrationPreMapper, EmployeeRegistrationPre> implements EmployeeRegistrationPreService {
private final DaprInsurancesProperties daprInsurancesProperties; private final DaprInsurancesProperties daprInsurancesProperties;
...@@ -106,6 +106,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -106,6 +106,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Lazy @Lazy
private ScheduleService scheduleService; private ScheduleService scheduleService;
@Autowired
SysConfigMapper sysConfigMapper;
/** /**
* 入职待建档表简单分页查询 * 入职待建档表简单分页查询
* @param employeeRegistrationPre 入职待建档表 * @param employeeRegistrationPre 入职待建档表
...@@ -119,79 +122,81 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -119,79 +122,81 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
&& !CommonConstants.THREE_STRING.equals(employeeRegistrationPre.getType())) { && !CommonConstants.THREE_STRING.equals(employeeRegistrationPre.getType())) {
employeeRegistrationPre.setStatusList(CommonConstants.processPreArchivesStatus); employeeRegistrationPre.setStatusList(CommonConstants.processPreArchivesStatus);
} }
return baseMapper.getEmployeeRegistrationPrePage(page,employeeRegistrationPre); return baseMapper.getEmployeeRegistrationPrePage(page, employeeRegistrationPre);
} }
/** /**
* 入职待建档表批量导出 * 入职待建档表批量导出
* @param searchVo 入职待建档表 *
* @return * @param searchVo 入职待建档表
*/ * @return
@Override */
public void listExport(HttpServletResponse response, EmployeeRegistrationPreSearchVo searchVo){ @Override
String fileName = "入职待建档表批量导出" + DateUtil.getThisTime() + ".xlsx"; public void listExport(HttpServletResponse response, EmployeeRegistrationPreSearchVo searchVo) {
//获取要导出的列表 String fileName = "入职待建档表批量导出" + DateUtil.getThisTime() + ".xlsx";
List<EmployeeRegistrationPreExportVo> list = new ArrayList<>(); //获取要导出的列表
List<EmployeeRegistrationPreExportVo> list = new ArrayList<>();
//权限赋值 //权限赋值
initSearchVo(searchVo); initSearchVo(searchVo);
if (Common.isEmpty(searchVo.getStatusList()) if (Common.isEmpty(searchVo.getStatusList())
&& !CommonConstants.THREE_STRING.equals(searchVo.getType())) { && !CommonConstants.THREE_STRING.equals(searchVo.getType())) {
searchVo.setStatusList(CommonConstants.processPreArchivesStatus); searchVo.setStatusList(CommonConstants.processPreArchivesStatus);
} }
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,然后文件流会自动关闭
ExcelUtil<EmployeeRegistrationPreExportVo> util = new ExcelUtil<>(EmployeeRegistrationPreExportVo.class); ExcelUtil<EmployeeRegistrationPreExportVo> util = new ExcelUtil<>(EmployeeRegistrationPreExportVo.class);
// 获取所有字典type // 获取所有字典type
Map<String,String> nameAndDicTypeMap = util.getConverterDicType(); Map<String, String> nameAndDicTypeMap = util.getConverterDicType();
// 获取所有字典对应的值 // 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE); Map<String, String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
Set<String> exportFields = new HashSet<>(Arrays.asList("deptName", "deptNo", "employeeName", "empIdcard", Set<String> exportFields = new HashSet<>(Arrays.asList("deptName", "deptNo", "employeeName", "empIdcard",
"empPhone", "joinLeaveDate", "empNature", "contractType", "dataSource", "customerUsernameNew", "expectedCollectionTime", "processStatus")); "empPhone", "joinLeaveDate", "empNature", "contractType", "dataSource", "customerUsernameNew", "expectedCollectionTime", "processStatus"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationPreExportVo.class) ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationPreExportVo.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap)) .registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap))
.includeColumnFieldNames(exportFields).build(); .includeColumnFieldNames(exportFields).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.selectExportList(searchVo); list = baseMapper.selectExportList(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++;
} }
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
} }
}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)) {
list.clear(); list.clear();
} }
excelWriter.finish(); excelWriter.finish();
}catch (Exception e){ } catch (Exception e) {
log.error("执行异常" ,e); log.error("执行异常", e);
} }
} }
/** /**
* 入职确认信息批量导出 * 入职确认信息批量导出
*
* @param searchVo 入职待建档表 * @param searchVo 入职待建档表
* @return * @return
*/ */
@Override @Override
public void confirmExport(HttpServletResponse response, EmployeeRegistrationPreSearchVo searchVo){ public void confirmExport(HttpServletResponse response, EmployeeRegistrationPreSearchVo searchVo) {
String fileName = "入职确认信息批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "入职确认信息批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<EmployeeRegistrationPreInfoExportVo> list = new ArrayList<>(); List<EmployeeRegistrationPreInfoExportVo> list = new ArrayList<>();
...@@ -202,50 +207,50 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -202,50 +207,50 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
searchVo.setStatusList(CommonConstants.processPreArchivesStatus); searchVo.setStatusList(CommonConstants.processPreArchivesStatus);
} }
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,然后文件流会自动关闭
ExcelUtil<EmployeeRegistrationPreInfoExportVo> util = new ExcelUtil<>(EmployeeRegistrationPreInfoExportVo.class); ExcelUtil<EmployeeRegistrationPreInfoExportVo> util = new ExcelUtil<>(EmployeeRegistrationPreInfoExportVo.class);
// 获取所有字典type // 获取所有字典type
Map<String,String> nameAndDicTypeMap = util.getConverterDicType(); Map<String, String> nameAndDicTypeMap = util.getConverterDicType();
// 获取所有字典对应的值 // 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE); Map<String, String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
Set<String> exportFields = new HashSet<>(Arrays.asList("deptName", "deptNo", "employeeName", "empIdcard", Set<String> exportFields = new HashSet<>(Arrays.asList("deptName", "deptNo", "employeeName", "empIdcard",
"empPhone", "position","joinLeaveDate", "confirmUser", "confirmTime", "serverItem", "empNature", "empPhone", "position", "joinLeaveDate", "confirmUser", "confirmTime", "serverItem", "empNature",
"contractType", "fileAdress")); "contractType", "fileAdress"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationPreInfoExportVo.class) ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationPreInfoExportVo.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap)) .registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap))
.includeColumnFieldNames(exportFields).build(); .includeColumnFieldNames(exportFields).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.selectConfirmExportList(searchVo); list = baseMapper.selectConfirmExportList(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++;
} }
if (Common.isNotNull(list)){ if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
} }
}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)) {
list.clear(); list.clear();
} }
excelWriter.finish(); excelWriter.finish();
}catch (Exception e){ } catch (Exception e) {
log.error("执行异常" ,e); log.error("执行异常", e);
} }
} }
...@@ -284,7 +289,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -284,7 +289,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
.eq(EmployeeRegistrationPre::getDeptNo, preVo.getDeptNo()) .eq(EmployeeRegistrationPre::getDeptNo, preVo.getDeptNo())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
EmployeeRegistrationPre pre = new EmployeeRegistrationPre(); EmployeeRegistrationPre pre = new EmployeeRegistrationPre();
BeanUtils.copyProperties(preVo,pre); BeanUtils.copyProperties(preVo, pre);
if (Common.isNotNull(preVo.getExpectedCollectionTime())) { if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime())); pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
} }
...@@ -304,7 +309,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -304,7 +309,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
CommonConstants.ZERO_STRING.equals(preVo.getEmployeeContractPreVos().getContractFlag())) { CommonConstants.ZERO_STRING.equals(preVo.getEmployeeContractPreVos().getContractFlag())) {
//查询老的合同明细 //查询老的合同明细
TEmployeeContractPre contractOld = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda() TEmployeeContractPre contractOld = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId,pre.getId()) .eq(TEmployeeContractPre::getRegisterId, pre.getId())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractOld)) { if (Common.isNotNull(contractOld)) {
// 创建更新条件构造器 // 创建更新条件构造器
...@@ -474,11 +479,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -474,11 +479,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
//查询老的合同明细 //查询老的合同明细
TEmployeeContractPre contractOld = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda() TEmployeeContractPre contractOld = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId,pre.getId()) .eq(TEmployeeContractPre::getRegisterId, pre.getId())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
// 添加日志并修改商险list // 添加日志并修改商险list
tEmployeePreLogService.saveUpdateInsurance(preExit.getId(), preExit tEmployeePreLogService.saveUpdateInsurance(preExit.getId(), preExit
, pre, preVo.getCreateBy(),preVo.getCreateName(), oldMap,contractOld); , pre, preVo.getCreateBy(), preVo.getCreateName(), oldMap, contractOld);
} }
if (Common.isNotNull(preVo.getExpectedCollectionTime())) { if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
// 事务提交后触发调度 // 事务提交后触发调度
...@@ -488,7 +493,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -488,7 +493,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
if (pre.getExpectedCollectionTime().isEqual(now)) { if (pre.getExpectedCollectionTime().isEqual(now)) {
scheduleService.executeTask(pre.getId()); scheduleService.executeTask(pre.getId());
} else if (preVo.getExpectedCollectionTime().compareTo(LocalDateTimeUtils.convertLDTToDate(now)) > 0){ } else if (preVo.getExpectedCollectionTime().compareTo(LocalDateTimeUtils.convertLDTToDate(now)) > 0) {
scheduleService.scheduleTask(pre); scheduleService.scheduleTask(pre);
} }
} }
...@@ -525,12 +530,12 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -525,12 +530,12 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
//手机号真实性校验 //手机号真实性校验
TCheckMobile checkMobile = new TCheckMobile(); TCheckMobile checkMobile = new TCheckMobile();
checkMobile.setMobile(employeeRegistrationPre.getEmpPhone()); checkMobile.setMobile(employeeRegistrationPre.getEmpPhone());
R<TCheckMobile> res = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(),daprCheckProperties.getAppId(),"/tcheckmobile/inner/checkOneMobile", JSON.toJSONString(checkMobile), TCheckMobile.class, SecurityConstants.FROM_IN); R<TCheckMobile> res = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId(), "/tcheckmobile/inner/checkOneMobile", JSON.toJSONString(checkMobile), TCheckMobile.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res) || Common.isEmpty(res.getData())){ if (Common.isEmpty(res) || Common.isEmpty(res.getData())) {
return R.failed("校验手机号码信息失败!"); return R.failed("校验手机号码信息失败!");
} }
TCheckMobile cm = res.getData(); TCheckMobile cm = res.getData();
if (Common.isEmpty(cm.getStatus()) || !CommonConstants.ONE_STRING.equals(cm.getStatus())){ if (Common.isEmpty(cm.getStatus()) || !CommonConstants.ONE_STRING.equals(cm.getStatus())) {
return R.failed(cm.getMessage()); return R.failed(cm.getMessage());
} }
} }
...@@ -706,11 +711,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -706,11 +711,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
employeeRegistrationPre.setInsuranceIsBuy(""); employeeRegistrationPre.setInsuranceIsBuy("");
// 2:保存时不存在商险类型,判断是否有不可删除的数据,有则拒绝: // 2:保存时不存在商险类型,判断是否有不可删除的数据,有则拒绝:
if (oldList != null && !oldList.isEmpty()) { if (oldList != null && !oldList.isEmpty()) {
for (TEmployeeInsurancePre oldInsurance: oldList) { for (TEmployeeInsurancePre oldInsurance : oldList) {
if (Common.isNotNull(oldInsurance.getProcessStatus()) if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus()) && (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus()) || CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()) )) { || CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()))) {
return R.failed("含有不可删除的商险,请刷新后再修改!"); return R.failed("含有不可删除的商险,请刷新后再修改!");
} }
} }
...@@ -719,7 +724,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -719,7 +724,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
//查询老的合同明细 //查询老的合同明细
TEmployeeContractPre contractOld = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda() TEmployeeContractPre contractOld = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId,employeeRegistrationPre.getId()) .eq(TEmployeeContractPre::getRegisterId, employeeRegistrationPre.getId())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
//1.9.12合同自动化校验逻辑 //1.9.12合同自动化校验逻辑
//根据身份证号码和项目编号查询合同 //根据身份证号码和项目编号查询合同
...@@ -742,7 +747,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -742,7 +747,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
TEmployeeContractPre contractStatus = contractPreMapper.selectById(employeeContractPreVo.getId()); TEmployeeContractPre contractStatus = contractPreMapper.selectById(employeeContractPreVo.getId());
//待确认/待发起/发起失败/线下签待审核/线下签审核不通过/线下签待归档 不能编辑 //待确认/待发起/发起失败/线下签待审核/线下签审核不通过/线下签待归档 不能编辑
if (Common.isNotNull(contractStatus) && (CommonConstants.NINE_STRING.equals(contractStatus.getProcessStatus()) if (Common.isNotNull(contractStatus) && (CommonConstants.NINE_STRING.equals(contractStatus.getProcessStatus())
|| CommonConstants.TWO_STRING.equals(contractStatus.getProcessStatus()) || CommonConstants.TWO_STRING.equals(contractStatus.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(contractStatus.getProcessStatus()) || CommonConstants.SIX_STRING.equals(contractStatus.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(contractStatus.getProcessStatus()) || CommonConstants.FOUR_STRING.equals(contractStatus.getProcessStatus())
|| CommonConstants.EIGHT_STRING.equals(contractStatus.getProcessStatus())) || CommonConstants.EIGHT_STRING.equals(contractStatus.getProcessStatus()))
...@@ -755,7 +760,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -755,7 +760,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
return R.failed("该人员已存在审核中或已签署的合同,请勿重复发起签署!"); return R.failed("该人员已存在审核中或已签署的合同,请勿重复发起签署!");
} }
if (CommonConstants.ONE_STRING.equals(employeeContractPreVo.getContractFlag()) || Common.isEmpty(employeeContractPreVo.getContractFlag())) { if (CommonConstants.ONE_STRING.equals(employeeContractPreVo.getContractFlag()) || Common.isEmpty(employeeContractPreVo.getContractFlag())) {
initContractPreInfo(employeeRegistrationPre,employeeContractPreVo, user, id); initContractPreInfo(employeeRegistrationPre, employeeContractPreVo, user, id);
employeeRegistrationPre.setEmployeeContractPre(employeeContractPreVo); employeeRegistrationPre.setEmployeeContractPre(employeeContractPreVo);
} else { } else {
employeeRegistrationPre.setEmployeeContractPre(null); employeeRegistrationPre.setEmployeeContractPre(null);
...@@ -771,14 +776,14 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -771,14 +776,14 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
//是否已签署为是需要判断合同是否在用或者流程中 //是否已签署为是需要判断合同是否在用或者流程中
if (CommonConstants.ZERO_STRING.equals(employeeRegistrationPre.getSocialIsBuy()) && if (CommonConstants.ZERO_STRING.equals(employeeRegistrationPre.getSocialIsBuy()) &&
(Common.isEmpty(socialFlag) || Boolean.TRUE.equals(!socialFlag.getData()))) { (Common.isEmpty(socialFlag) || Boolean.TRUE.equals(!socialFlag.getData()))) {
return R.other(CommonConstants.TWO_INT,null,"未找到流程中或者在用的社保信息!"); return R.other(CommonConstants.TWO_INT, null, "未找到流程中或者在用的社保信息!");
} }
//是否已签署为否需要判断是否在用或者流程中的合同 //是否已签署为否需要判断是否在用或者流程中的合同
if (CommonConstants.ONE_STRING.equals(employeeRegistrationPre.getSocialIsBuy()) && if (CommonConstants.ONE_STRING.equals(employeeRegistrationPre.getSocialIsBuy()) &&
Common.isNotNull(socialFlag) && Boolean.TRUE.equals(socialFlag.getData()) && Common.isNotNull(socialFlag) && Boolean.TRUE.equals(socialFlag.getData()) &&
null != employeeRegistrationPre.getDispatchInfoPreVo() && null != employeeRegistrationPre.getDispatchInfoPreVo() &&
Common.isEmpty(employeeRegistrationPre.getDispatchInfoPreVo().getId())) { Common.isEmpty(employeeRegistrationPre.getDispatchInfoPreVo().getId())) {
return R.other(CommonConstants.TWO_INT,null,"该人员存在在途/有效的社保数据,请将“是否已参保”调整为“是”"); return R.other(CommonConstants.TWO_INT, null, "该人员存在在途/有效的社保数据,请将“是否已参保”调整为“是”");
} }
//流程中的社保数据不能修改 //流程中的社保数据不能修改
//查已购买社保明细 //查已购买社保明细
...@@ -789,7 +794,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -789,7 +794,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
&& null != socialSdr.getData().getDispatchInfoPreVo() && null != socialSdr.getData().getDispatchInfoPreVo()
&& (socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.THREE_STRING) || && (socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.THREE_STRING) ||
socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.FIVE_STRING) || socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.FIVE_STRING) ||
socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.SIX_STRING)|| socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.SIX_STRING) ||
socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.SEVEN_STRING) || socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.SEVEN_STRING) ||
socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.NINE_STRING))) { socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.NINE_STRING))) {
return R.failed("流程中的社保待购买数据不可修改!"); return R.failed("流程中的社保待购买数据不可修改!");
...@@ -797,7 +802,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -797,7 +802,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
//更新合同签署状态 //更新合同签署状态
if (null != employeeRegistrationPre.getDispatchInfoPreVo()) { if (null != employeeRegistrationPre.getDispatchInfoPreVo()) {
employeeRegistrationPre.getDispatchInfoPreVo().setContractStatus(flag ? CommonConstants.ZERO_STRING :CommonConstants.ONE_STRING); employeeRegistrationPre.getDispatchInfoPreVo().setContractStatus(flag ? CommonConstants.ZERO_STRING : CommonConstants.ONE_STRING);
} }
} }
...@@ -809,13 +814,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -809,13 +814,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
String contractXfBefore = null; String contractXfBefore = null;
String contractXfAfter = null; String contractXfAfter = null;
if (!comparePre.getContractType().equals(employeeRegistrationPre.getContractType())) { if (!comparePre.getContractType().equals(employeeRegistrationPre.getContractType())) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get( Map<String, String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type"); CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
for (Map.Entry<String,String> entry:dicObj.entrySet()){ for (Map.Entry<String, String> entry : dicObj.entrySet()) {
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getContractType())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getContractType())) {
contractItemBefore = entry.getValue(); contractItemBefore = entry.getValue();
} }
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getContractType())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getContractType())) {
contractItemAfter = entry.getValue(); contractItemAfter = entry.getValue();
} }
if (null != contractItemBefore && null != contractItemAfter) { if (null != contractItemBefore && null != contractItemAfter) {
...@@ -824,13 +829,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -824,13 +829,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
} }
if (!comparePre.getEmpNature().equals(employeeRegistrationPre.getEmpNature())) { if (!comparePre.getEmpNature().equals(employeeRegistrationPre.getEmpNature())) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get( Map<String, String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "emp_natrue"); CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "emp_natrue");
for (Map.Entry<String,String> entry:dicObj.entrySet()){ for (Map.Entry<String, String> entry : dicObj.entrySet()) {
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getEmpNature())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getEmpNature())) {
natureItemBefore = entry.getValue(); natureItemBefore = entry.getValue();
} }
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getEmpNature())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getEmpNature())) {
natureItemAfter = entry.getValue(); natureItemAfter = entry.getValue();
} }
if (null != natureItemAfter && null != natureItemBefore) { if (null != natureItemAfter && null != natureItemBefore) {
...@@ -839,34 +844,34 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -839,34 +844,34 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
} }
if (null != comparePre.getContractSubName() && null == employeeRegistrationPre.getContractSubName()) { if (null != comparePre.getContractSubName() && null == employeeRegistrationPre.getContractSubName()) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get( Map<String, String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "contract_business_type"); CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "contract_business_type");
for (Map.Entry<String,String> entry:dicObj.entrySet()){ for (Map.Entry<String, String> entry : dicObj.entrySet()) {
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getContractSubName())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getContractSubName())) {
contractXfBefore = entry.getValue(); contractXfBefore = entry.getValue();
break; break;
} }
} }
} }
if (null == comparePre.getContractSubName() && null != employeeRegistrationPre.getContractSubName()) { if (null == comparePre.getContractSubName() && null != employeeRegistrationPre.getContractSubName()) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get( Map<String, String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "contract_business_type"); CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "contract_business_type");
for (Map.Entry<String,String> entry:dicObj.entrySet()){ for (Map.Entry<String, String> entry : dicObj.entrySet()) {
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getContractSubName())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getContractSubName())) {
contractXfAfter = entry.getValue(); contractXfAfter = entry.getValue();
break; break;
} }
} }
} }
if (null != comparePre.getContractSubName() && null != employeeRegistrationPre.getContractSubName() if (null != comparePre.getContractSubName() && null != employeeRegistrationPre.getContractSubName()
&& !comparePre.getContractSubName().equals(employeeRegistrationPre.getContractSubName())) { && !comparePre.getContractSubName().equals(employeeRegistrationPre.getContractSubName())) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get( Map<String, String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "contract_business_type"); CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "contract_business_type");
for (Map.Entry<String,String> entry:dicObj.entrySet()){ for (Map.Entry<String, String> entry : dicObj.entrySet()) {
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getContractSubName())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getContractSubName())) {
contractXfBefore = entry.getValue(); contractXfBefore = entry.getValue();
} }
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getContractSubName())){ if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getContractSubName())) {
contractXfAfter = entry.getValue(); contractXfAfter = entry.getValue();
} }
if (null != contractXfBefore && null != contractXfAfter) { if (null != contractXfBefore && null != contractXfAfter) {
...@@ -907,7 +912,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -907,7 +912,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
//商险状态是否正常判断 //商险状态是否正常判断
private boolean checkInsuranceIsProcess(EmployeeRegistrationPre pre) { private boolean checkInsuranceIsProcess(EmployeeRegistrationPre pre) {
EmployeeRegistrationPreVo preVo = new EmployeeRegistrationPreVo(); EmployeeRegistrationPreVo preVo = new EmployeeRegistrationPreVo();
BeanUtils.copyProperties(pre,preVo); BeanUtils.copyProperties(pre, preVo);
R<Boolean> flag = insuranceDaprUtil.checkExitInsuanceIsProcess(preVo); R<Boolean> flag = insuranceDaprUtil.checkExitInsuanceIsProcess(preVo);
//是否已签署为是需要判断合同是否在用或者流程中 //是否已签署为是需要判断合同是否在用或者流程中
return Common.isEmpty(flag) || Boolean.TRUE.equals(!flag.getData()); return Common.isEmpty(flag) || Boolean.TRUE.equals(!flag.getData());
...@@ -1069,9 +1074,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1069,9 +1074,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
boolean erorFlag = false; boolean erorFlag = false;
R<TEmployeeInsuranceSelectVo> dataR = insuranceDaprUtil.selectInsurancePreInfoList(preVo); R<TEmployeeInsuranceSelectVo> dataR = insuranceDaprUtil.selectInsurancePreInfoList(preVo);
//查询商险数据 //查询商险数据
TInsuranceDetail insuranceDetail= null; TInsuranceDetail insuranceDetail = null;
R<TEmployeeInsuranceSelectVo> dataInsurR = insuranceDaprUtil.selectInsuranceInfo(preVo); R<TEmployeeInsuranceSelectVo> dataInsurR = insuranceDaprUtil.selectInsuranceInfo(preVo);
if (Common.isNotNull(dataInsurR) && Common.isNotNull(dataInsurR.getData())&& Common.isNotNull(dataInsurR.getData().getInsuranceDetail())) { if (Common.isNotNull(dataInsurR) && Common.isNotNull(dataInsurR.getData()) && Common.isNotNull(dataInsurR.getData().getInsuranceDetail())) {
insuranceDetail = dataInsurR.getData().getInsuranceDetail(); insuranceDetail = dataInsurR.getData().getInsuranceDetail();
} }
//二次确认接收场景 //二次确认接收场景
...@@ -1146,9 +1151,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1146,9 +1151,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Override @Override
public R registrationPreAudit(EmployeeRegistrationPre pre) { public R registrationPreAudit(EmployeeRegistrationPre pre) {
TPreEmpMain empMain = empMainMapper.selectOne(Wrappers.<TPreEmpMain>query().lambda() TPreEmpMain empMain = empMainMapper.selectOne(Wrappers.<TPreEmpMain>query().lambda()
.eq(TPreEmpMain::getEmpIdcard,pre.getEmpIdcard()) .eq(TPreEmpMain::getEmpIdcard, pre.getEmpIdcard())
.eq(TPreEmpMain::getDeptId,pre.getDeptId()) .eq(TPreEmpMain::getDeptId, pre.getDeptId())
.eq(TPreEmpMain::getStatus,CommonConstants.TWO_STRING) .eq(TPreEmpMain::getStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(empMain)) { if (Common.isEmpty(empMain)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE); return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
...@@ -1157,26 +1162,39 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1157,26 +1162,39 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
@Override @Override
public R batchSendMessage(List<SendMessageUpdateVo> voList,String type) { public R batchSendMessage(List<SendMessageUpdateVo> voList, String type) {
if (Common.isNotNull(voList) && voList.size() >200) { if (Common.isNotNull(voList) && voList.size() > 200) {
return R.failed("短信批量发送单次最多两百条"); return R.failed("短信批量发送单次最多两百条");
} }
//获取联系电话
String contactTel ="0551-63468931";
//获取模板
String modelCode = "";
SysConfig sysConfig = sysConfigMapper.getSysConfigLimitByKey("EMPLOYMENT_SMS_RLY");
if (null != sysConfig){
contactTel = sysConfig.getConfigValue();
modelCode = sysConfig.getConfigValue1();
}
MessageTempleteVo templeteVo = baseMapper.selectTempleteVo(modelCode);
String[] paramsDetail;
String[] phonesArr;
RlySmsUtil rlySmsUtil = new RlySmsUtil();
HashMap<String, Object> sendResult;
HashMap<String, Object> data;
HashMap<String, Object> detail;
String[][] t;
//获取短信待发放和信息待填写的数据 //获取短信待发放和信息待填写的数据
List<String> errorList = new ArrayList<>(); List<String> errorList = new ArrayList<>();
if (CommonConstants.ONE_STRING.equals(type)) { if (CommonConstants.ONE_STRING.equals(type)) {
for(SendMessageUpdateVo updateVo:voList) { for (SendMessageUpdateVo updateVo : voList) {
RegistParamVo paramVo = new RegistParamVo(); paramsDetail = new String[3];
List<RegistParamVo> params = new ArrayList<>(); phonesArr = new String[1];
List<String> phones = new ArrayList<>();
EmployeeRegistrationPre updatePre; EmployeeRegistrationPre updatePre;
AliSmsResult res;
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)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(updatePre)) { if (Common.isNotNull(updatePre)) {
paramVo.setName(updatePre.getEmployeeName());
phones.add(updatePre.getEmpPhone());
if (CommonConstants.ZERO_STRING.equals(updatePre.getProcessStatus())) { if (CommonConstants.ZERO_STRING.equals(updatePre.getProcessStatus())) {
updatePre.setProcessStatus(CommonConstants.ONE_STRING); updatePre.setProcessStatus(CommonConstants.ONE_STRING);
} }
...@@ -1191,33 +1209,36 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1191,33 +1209,36 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
smsEmployee.setType(CommonConstants.ONE_STRING); smsEmployee.setType(CommonConstants.ONE_STRING);
smsEmployee.setDeptId(updatePre.getDeptId()); smsEmployee.setDeptId(updatePre.getDeptId());
employeeService.save(smsEmployee); employeeService.save(smsEmployee);
paramVo.setLink(smsEmployee.getId().toString()); paramsDetail[0] = smsEmployee.getEmpName()!=null?smsEmployee.getEmpName():"";
params.add(paramVo); paramsDetail[1] = smsEmployee.getId()!=null?smsEmployee.getId().toString():"";
res = sendMessage(phones, params); paramsDetail[2] = contactTel;
if (null != res && null != res.getBizId()) { if (smsEmployee.getEmpPhone() == null){
smsEmployee.setBizId(res.getBizId()); smsEmployee.setMessage("短信发送失败: 电话不可为空!");
smsEmployee.setMessage(res.getMessage());
employeeService.updateById(smsEmployee); employeeService.updateById(smsEmployee);
this.updateById(updatePre); continue;
} else { }
smsEmployee.setMessage("短信发送失败"); if (null == templeteVo || null == templeteVo.getTempleteCode()){
smsEmployee.setMessage("短信发送失败: 模板不可为空!");
employeeService.updateById(smsEmployee); employeeService.updateById(smsEmployee);
errorList.add("短信发送失败"); continue;
} }
phonesArr[0]= smsEmployee.getEmpPhone();
t = new String[1][3]; // 创建正确大小的二维数组
t[0]=paramsDetail;
//调用RlySmsUtil的sendBatchSms方法
sendResult = rlySmsUtil.sendBatchSms(phonesArr, templeteVo.getTempleteCode(), t);
handleSmsRes(sendResult, errorList, updatePre, smsEmployee);
} }
} }
} else { } else {
TEmployeeInfo info; TEmployeeInfo info;
for(SendMessageUpdateVo updateVo:voList) { for (SendMessageUpdateVo updateVo : voList) {
RegistParamVo paramVo = new RegistParamVo(); paramsDetail = new String[3];
List<RegistParamVo> params = new ArrayList<>(); phonesArr = new String[1];
List<String> phones = new ArrayList<>();
EmployeeRegistrationPre updatePre; EmployeeRegistrationPre updatePre;
AliSmsResult res;
info = employeeInfoMapper.selectById(updateVo.getId()); info = employeeInfoMapper.selectById(updateVo.getId());
if (Common.isNotNull(info)) { if (Common.isNotNull(info)) {
paramVo.setName(info.getEmpName());
phones.add(info.getEmpPhone());
//如果有入职待建档数据同步更新 //如果有入职待建档数据同步更新
updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda() updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda()
.eq(EmployeeRegistrationPre::getEmpIdcard, info.getEmpIdcard()) .eq(EmployeeRegistrationPre::getEmpIdcard, info.getEmpIdcard())
...@@ -1238,36 +1259,73 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1238,36 +1259,73 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
smsEmployee.setType(CommonConstants.TWO_STRING); smsEmployee.setType(CommonConstants.TWO_STRING);
smsEmployee.setDeptId(updateVo.getDeptId()); smsEmployee.setDeptId(updateVo.getDeptId());
employeeService.save(smsEmployee); employeeService.save(smsEmployee);
paramVo.setLink(smsEmployee.getId().toString()); paramsDetail[0] = smsEmployee.getEmpName()!=null?smsEmployee.getEmpName():"";
params.add(paramVo); paramsDetail[1] = smsEmployee.getId()!=null?smsEmployee.getId().toString():"";
res = sendMessage(phones, params); paramsDetail[2] = contactTel;
if (null != res && null != res.getBizId()) { if (smsEmployee.getEmpPhone() == null){
smsEmployee.setBizId(res.getBizId()); smsEmployee.setMessage("短信发送失败: 电话不可为空!");
smsEmployee.setMessage(res.getMessage());
employeeService.updateById(smsEmployee); employeeService.updateById(smsEmployee);
if (Common.isNotNull(updatePre)) { continue;
this.updateById(updatePre); }
} if (null == templeteVo || null == templeteVo.getTempleteCode()){
} else { smsEmployee.setMessage("短信发送失败: 模板不可为空!");
smsEmployee.setMessage("短信发送失败");
employeeService.updateById(smsEmployee); employeeService.updateById(smsEmployee);
errorList.add("短信发送失败"); continue;
} }
phonesArr[0]= smsEmployee.getEmpPhone();
t = new String[1][3]; // 创建正确大小的二维数组
t[0]=paramsDetail;
//调用RlySmsUtil的sendBatchSms方法
sendResult = rlySmsUtil.sendBatchSms(phonesArr, templeteVo.getTempleteCode(), t);
handleSmsRes(sendResult, errorList, updatePre, smsEmployee);
} }
} }
} }
if (!errorList.isEmpty() && errorList.stream().allMatch(e->e.equals("短信发送失败"))) { if (!errorList.isEmpty() && errorList.stream().allMatch(e -> e.equals("短信发送失败"))) {
return R.ok("短信发送失败"); return R.ok("短信发送失败");
} }
return R.ok("短信发送成功"); return R.ok("短信发送成功");
} }
private void handleSmsRes(HashMap<String, Object> sendResult, List<String> errorList, EmployeeRegistrationPre updatePre, TRegisteWarningEmployee smsEmployee) {
HashMap<String, Object> detail;
HashMap<String, Object> data;
if (null != sendResult && "000000".equals(sendResult.get("statusCode"))) {
// 成功情况处理
data = (HashMap<String, Object>) sendResult.get("data");
detail = null;
if (data != null){
detail = (HashMap<String, Object>) data.get("templateSMS");
}
String smsMessageSid = "";
if (detail != null){
smsMessageSid = detail.get("smsMessageSid").toString();
}
smsEmployee.setBizId(smsMessageSid);
smsEmployee.setMessage("短信发送成功");
employeeService.updateById(smsEmployee);
if (Common.isNotNull(updatePre)) {
this.updateById(updatePre);
}
} else {
// 失败情况处理
String errorMsg = "未知错误";
if (sendResult != null) {
errorMsg = "错误码=" + sendResult.get("statusCode") + " 错误信息=" + sendResult.get("statusMsg");
}
smsEmployee.setMessage("短信发送失败: " + errorMsg);
employeeService.updateById(smsEmployee);
errorList.add("短信发送失败");
}
}
@Override @Override
public void updatePreStatusToEnd(String deptNo, String empIdcard) { public void updatePreStatusToEnd(String deptNo, String empIdcard) {
EmployeeRegistrationPre registrationPre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda() EmployeeRegistrationPre registrationPre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda()
.eq(EmployeeRegistrationPre::getEmpIdcard,empIdcard) .eq(EmployeeRegistrationPre::getEmpIdcard, empIdcard)
.eq(EmployeeRegistrationPre::getDeptNo,deptNo) .eq(EmployeeRegistrationPre::getDeptNo, deptNo)
.in(EmployeeRegistrationPre::getProcessStatus,CommonConstants.processPreArchivesStatus) .in(EmployeeRegistrationPre::getProcessStatus, CommonConstants.processPreArchivesStatus)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(registrationPre)) { if (Common.isNotNull(registrationPre)) {
registrationPre.setProcessStatus(CommonConstants.FOUR_STRING); registrationPre.setProcessStatus(CommonConstants.FOUR_STRING);
...@@ -1304,7 +1362,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1304,7 +1362,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Override @Override
public R<EmployeeInfoMsgVo> getEmployeeInfo(String id) { public R<EmployeeInfoMsgVo> getEmployeeInfo(String id) {
//获取人员档案id //获取人员档案id
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(id,CommonConstants.preMainStatus); EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(id, CommonConstants.preMainStatus);
if (Common.isEmpty(msgInfoVo)) { if (Common.isEmpty(msgInfoVo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR); return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
} }
...@@ -1399,10 +1457,10 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1399,10 +1457,10 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
* @Date: 2025/3/18 17:02 * @Date: 2025/3/18 17:02
* @return: * @return:
**/ **/
public AliSmsResult sendMessage (List<String> phones,List<RegistParamVo> params ) { public AliSmsResult sendMessage(List<String> phones, List<RegistParamVo> params) {
List<String> signNames = new ArrayList<>(); List<String> signNames = new ArrayList<>();
MessageTempleteVo templeteVo = baseMapper.selectTempleteVo(CommonConstants.ONE_STRING); MessageTempleteVo templeteVo = baseMapper.selectTempleteVo(CommonConstants.ONE_STRING);
for (int i=0;i<phones.size();i++){ for (int i = 0; i < phones.size(); i++) {
signNames.add(templeteVo.getSignName()); signNames.add(templeteVo.getSignName());
} }
return YiFuSmsUtil.sendRegistBatchSms(phones, params, signNames, templeteVo.getTempleteCode()); return YiFuSmsUtil.sendRegistBatchSms(phones, params, signNames, templeteVo.getTempleteCode());
...@@ -1497,7 +1555,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1497,7 +1555,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
//获取合同待签订数据 //获取合同待签订数据
TEmployeeContractPre contract = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda() TEmployeeContractPre contract = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId,id) .eq(TEmployeeContractPre::getRegisterId, id)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contract)) { if (Common.isNotNull(contract)) {
//附件赋值 //附件赋值
...@@ -1506,9 +1564,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1506,9 +1564,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
// 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中 // 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中
if (attaContractInfo != null && !attaContractInfo.isEmpty()) { if (attaContractInfo != null && !attaContractInfo.isEmpty()) {
URL url; URL url;
for (TAttaInfo a: attaContractInfo) { for (TAttaInfo a : attaContractInfo) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc()); url = ossUtil.getObjectUrl(null, a.getAttaSrc());
a.setAttaUrl(null != url ? url.toString(): ""); a.setAttaUrl(null != url ? url.toString() : "");
} }
contract.setAttaList(attaContractInfo); contract.setAttaList(attaContractInfo);
} }
...@@ -1520,9 +1578,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1520,9 +1578,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
// 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中 // 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中
if (attaInfo != null && !attaInfo.isEmpty()) { if (attaInfo != null && !attaInfo.isEmpty()) {
URL url; URL url;
for (TAttaInfo a: attaInfo) { for (TAttaInfo a : attaInfo) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc()); url = ossUtil.getObjectUrl(null, a.getAttaSrc());
a.setAttaUrl(null != url ? url.toString(): ""); a.setAttaUrl(null != url ? url.toString() : "");
} }
pre.setAttaList(attaInfo); pre.setAttaList(attaInfo);
} }
......
...@@ -1329,13 +1329,9 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri ...@@ -1329,13 +1329,9 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
if (Common.isNotNull(setInfo)) { if (Common.isNotNull(setInfo)) {
try { try {
// 添加了异常处理,避免 recordBase 不是合法数字格式时程序崩溃 // 添加了异常处理,避免 recordBase 不是合法数字格式时程序崩溃
if (CommonConstants.TWO_STRING.equals(rel.getPaymentType())) { if (CommonConstants.ZERO_STRING.equals(rel.getPaymentType())){
if (BigDecimal.valueOf(Double.valueOf(rel.getRecordBase())).compareTo(setInfo.getUpperLimit()) != 0) {
return R.failed("备案基数不等于社保户("+setInfo.getDepartName()+")最高基数:"+setInfo.getUpperLimit());
}
} else if (CommonConstants.ZERO_STRING.equals(rel.getPaymentType())){
if (BigDecimal.valueOf(Double.valueOf(rel.getRecordBase())).compareTo(setInfo.getLowerLimit()) != 0) { if (BigDecimal.valueOf(Double.valueOf(rel.getRecordBase())).compareTo(setInfo.getLowerLimit()) != 0) {
return R.failed("备案基数不等于社保户("+setInfo.getDepartName()+")最低基数:"+setInfo.getLowerLimit()); return R.failed("备案基数不等于配置名称("+rel.getConfigName()+")最低基数:"+setInfo.getLowerLimit());
} }
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
......
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TContractAutoLog;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TContractAutoLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TContractAutoLogService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:02:08
*/
@Log4j2
@Service
public class TContractAutoLogServiceImpl extends ServiceImpl<TContractAutoLogMapper, TContractAutoLog> implements TContractAutoLogService {
@Override
public IPage<TContractAutoLog> getTContractAutoLogPage(Page<TContractAutoLog> page, TContractAutoLog tContractAutoLog) {
return baseMapper.getTContractAutoLogPage(page,tContractAutoLog);
}
}
...@@ -545,7 +545,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -545,7 +545,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus) .in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) { if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.TWO_STRING); contractPre.setProcessStatus("1".equals(contractPre.getSignType()) ?
CommonConstants.TWO_STRING : CommonConstants.SIX_STRING);
contractPre.setContractId(tEmployeeContractInfo.getId()); contractPre.setContractId(tEmployeeContractInfo.getId());
contractPre.setErrorInfo(""); contractPre.setErrorInfo("");
contractPre.setErrorTime(null); contractPre.setErrorTime(null);
......
...@@ -10,10 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -10,10 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig; import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
...@@ -59,6 +56,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -59,6 +56,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
private final FascService fascService; private final FascService fascService;
private final TContractAutoLogService contractAutoLogService;
@Autowired @Autowired
private final TEmployeeContractInfoService contractInfoService; private final TEmployeeContractInfoService contractInfoService;
...@@ -288,7 +287,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -288,7 +287,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
// 创建一个Map映射preId到TEmployeeContractPre对象 // 创建一个Map映射preId到TEmployeeContractPre对象
Map<String, TEmployeeContractPre> preContractMap = contractPreList.stream() Map<String, TEmployeeContractPre> preContractMap = contractPreList.stream()
.collect(Collectors.toMap(TEmployeeContractPre::getId, pre -> pre)); .collect(Collectors.toMap(TEmployeeContractPre::getId, pre -> pre));
Map<String, String> loginNameMap = new HashMap<>();
//发起派单 //发起派单
List<ErrorMessage> errorMessageListAll = new ArrayList<>(); List<ErrorMessage> errorMessageListAll = new ArrayList<>();
List<EmployeeContractVO> excelVOList = baseMapper.getDisPatcherContractList(idList,CommonConstants.socialInfoStatus,type); List<EmployeeContractVO> excelVOList = baseMapper.getDisPatcherContractList(idList,CommonConstants.socialInfoStatus,type);
...@@ -320,6 +320,11 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -320,6 +320,11 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
for (EmployeeContractVO contractVO : electronicSignList) { for (EmployeeContractVO contractVO : electronicSignList) {
TEmployeeContractPre contractPre = preContractMap.get(contractVO.getPreId()); TEmployeeContractPre contractPre = preContractMap.get(contractVO.getPreId());
if (contractPre != null && contractPre.getJoinLeaveDate() != null) { if (contractPre != null && contractPre.getJoinLeaveDate() != null) {
if ("2".equals(type) && Common.isNotNull(contractPre.getCustomerUserLoginname()) &&
null == loginNameMap.get(contractPre.getCustomerUserLoginname())) {
UUID uuid = UUID.randomUUID();
loginNameMap.put(contractPre.getCustomerUserLoginname(), uuid.toString());
}
// 获取或创建客服统计信息 // 获取或创建客服统计信息
String customerLoginName = contractPre.getCustomerUserLoginname(); String customerLoginName = contractPre.getCustomerUserLoginname();
CustomerStatistics customerStats = customerStatisticsMap.computeIfAbsent(customerLoginName, k -> { CustomerStatistics customerStats = customerStatisticsMap.computeIfAbsent(customerLoginName, k -> {
...@@ -347,6 +352,17 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -347,6 +352,17 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now())); .set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper); this.update(updateWrapper);
if ("2".equals(type)) {
//生成快照数据
TContractAutoLog contractAutoLog = new TContractAutoLog();
contractAutoLog.setContractId(loginNameMap.get(contractPre.getCustomerUserLoginname()));
contractAutoLog.setEmpName(contractPre.getEmployeeName());
contractAutoLog.setEmpIdcard(contractPre.getEmpIdcard());
contractAutoLog.setMainId(contractPre.getId());
contractAutoLog.setErrorInfo("电子签发起失败:已超过入职日期一个月");
contractAutoLogService.save(contractAutoLog);
}
// 添加错误信息 // 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "电子签发起失败:已超过入职日期一个月"); ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "电子签发起失败:已超过入职日期一个月");
errorMessage.setData(contractVO); errorMessage.setData(contractVO);
...@@ -378,6 +394,16 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -378,6 +394,16 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now())); .set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper); this.update(updateWrapper);
if ("2".equals(type)) {
//生成快照数据
TContractAutoLog contractAutoLog = new TContractAutoLog();
contractAutoLog.setContractId(loginNameMap.get(contractPre.getCustomerUserLoginname()));
contractAutoLog.setEmpName(contractPre.getEmployeeName());
contractAutoLog.setEmpIdcard(contractPre.getEmpIdcard());
contractAutoLog.setErrorInfo(errorMsg);
contractAutoLog.setMainId(contractPre.getId());
contractAutoLogService.save(contractAutoLog);
}
// 添加错误信息 // 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg); ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
errorMessage.setData(contractVO); errorMessage.setData(contractVO);
...@@ -414,6 +440,16 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -414,6 +440,16 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
contractInfoService.updateById(empContract); contractInfoService.updateById(empContract);
} }
if ("2".equals(type)) {
//生成快照数据
TContractAutoLog contractAutoLog = new TContractAutoLog();
contractAutoLog.setContractId(loginNameMap.get(contractPre.getCustomerUserLoginname()));
contractAutoLog.setEmpName(contractPre.getEmployeeName());
contractAutoLog.setEmpIdcard(contractPre.getEmpIdcard());
contractAutoLog.setErrorInfo(errorMsg);
contractAutoLog.setMainId(contractPre.getId());
contractAutoLogService.save(contractAutoLog);
}
// 添加错误信息 // 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg); ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
errorMessage.setData(contractVO); errorMessage.setData(contractVO);
...@@ -466,6 +502,11 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -466,6 +502,11 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
// 获取合同预签订信息以便统计 // 获取合同预签订信息以便统计
TEmployeeContractPre contractPre = preContractMap.get(contractVO.getPreId()); TEmployeeContractPre contractPre = preContractMap.get(contractVO.getPreId());
if ("2".equals(type) && Common.isNotNull(contractPre.getCustomerUserLoginname()) &&
null == loginNameMap.get(contractPre.getCustomerUserLoginname())) {
UUID uuid = UUID.randomUUID();
loginNameMap.put(contractPre.getCustomerUserLoginname(), uuid.toString());
}
if (contractPre != null) { if (contractPre != null) {
String customerLoginName = contractPre.getCustomerUserLoginname(); String customerLoginName = contractPre.getCustomerUserLoginname();
CustomerStatistics customerStats = customerStatisticsMap.computeIfAbsent(customerLoginName, key -> { CustomerStatistics customerStats = customerStatisticsMap.computeIfAbsent(customerLoginName, key -> {
...@@ -477,11 +518,22 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -477,11 +518,22 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
customerStats.setFailedCount(customerStats.getFailedCount() + 1); customerStats.setFailedCount(customerStats.getFailedCount() + 1);
customerStats.setOfflineSignFailedCount(customerStats.getOfflineSignFailedCount() + 1); customerStats.setOfflineSignFailedCount(customerStats.getOfflineSignFailedCount() + 1);
} }
if ("2".equals(type)) {
//生成快照数据
TContractAutoLog contractAutoLog = new TContractAutoLog();
contractAutoLog.setContractId(loginNameMap.get(contractPre.getCustomerUserLoginname()));
contractAutoLog.setEmpName(contractPre.getEmployeeName());
contractAutoLog.setEmpIdcard(contractPre.getEmpIdcard());
contractAutoLog.setErrorInfo(errorMessage.getMessage());
contractAutoLog.setMainId(contractPre.getId());
contractAutoLogService.save(contractAutoLog);
}
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeContractPre::getId, contractVO.getPreId()) updateWrapper.in(TEmployeeContractPre::getId, contractVO.getPreId())
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus) .in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus)
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING) .set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING)
.set(TEmployeeContractPre::getErrorInfo, errorMessage.getMessage()) .set(TEmployeeContractPre::getErrorInfo, errorMessage.getMessage())
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now())); .set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
// 执行更新操作 // 执行更新操作
...@@ -507,7 +559,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -507,7 +559,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
stats.getElectronicSignFailedCount(), stats.getElectronicSignFailedCount(),
stats.getOfflineSignFailedCount()); stats.getOfflineSignFailedCount());
// 发送企微消息 // 发送企微消息
sendFailueMessageToWx(stats.getCustomerUserLoginname(), customerSummaryInfo); sendFailueMessageToWx(stats.getCustomerUserLoginname(), customerSummaryInfo, loginNameMap);
} }
} }
} }
...@@ -687,7 +739,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -687,7 +739,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
//发送企业微信待办 //发送企业微信待办
private void sendFailueMessageToWx(String loginName,String summary) { private void sendFailueMessageToWx(String loginName,String summary,Map<String, String> loginNameMap) {
//获取前端客服 //获取前端客服
SysUser user; SysUser user;
if (Common.isEmpty(loginName)) { if (Common.isEmpty(loginName)) {
...@@ -707,7 +759,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -707,7 +759,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "69" + loginName); String id = loginNameMap.get(loginName);
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "69" + id);
StringBuilder description = new StringBuilder(); StringBuilder description = new StringBuilder();
String title = "作业自动化——合同签署发起失败提醒"; String title = "作业自动化——合同签署发起失败提醒";
description.append(summary).append("<br>"); description.append(summary).append("<br>");
...@@ -766,7 +819,9 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -766,7 +819,9 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.ONE_STRING) // 待发起 .set(TEmployeeContractPre::getProcessStatus, CommonConstants.ONE_STRING) // 待发起
.set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING) // 线下签 .set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING) // 线下签
.set(TEmployeeContractPre::getRevokeReason, "超时未签署自行变更为线下签") .set(TEmployeeContractPre::getRevokeReason, "超时未签署自行变更为线下签")
.set(TEmployeeContractPre::getChangeTypeReason, "超时未签署自行变更为线下签"); .set(TEmployeeContractPre::getChangeTypeReason, "超时未签署自行变更为线下签")
.set(TEmployeeContractPre::getChangeTypeUser, "超管")
.set(TEmployeeContractPre::getChangeTypeTime, DateUtil.getCurrentDateTime());
this.update(updateWrapper); this.update(updateWrapper);
TEmployeeContractAudit audit = new TEmployeeContractAudit(); TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("撤销签署"); audit.setRootName("撤销签署");
...@@ -844,16 +899,30 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -844,16 +899,30 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
// 按前端客服分组统计 // 按前端客服分组统计
Map<String, CustomerRevokeStatistics> customerStatsMap = new HashMap<>(); Map<String, CustomerRevokeStatistics> customerStatsMap = new HashMap<>();
Map<String, String> loginNameMap = new HashMap<>();
for (TEmployeeContractPre contract : revokedContracts) { for (TEmployeeContractPre contract : revokedContracts) {
String customerLoginName = contract.getCustomerUserLoginname(); String customerLoginName = contract.getCustomerUserLoginname();
if (Common.isNotNull(customerLoginName)) { if (Common.isNotNull(customerLoginName)) {
if (null == loginNameMap.get(customerLoginName)) {
UUID uuid = UUID.randomUUID();
loginNameMap.put(customerLoginName, uuid.toString());
}
CustomerRevokeStatistics stats = customerStatsMap.computeIfAbsent(customerLoginName, k -> { CustomerRevokeStatistics stats = customerStatsMap.computeIfAbsent(customerLoginName, k -> {
CustomerRevokeStatistics newStats = new CustomerRevokeStatistics(); CustomerRevokeStatistics newStats = new CustomerRevokeStatistics();
newStats.setCustomerUserLoginname(customerLoginName); newStats.setCustomerUserLoginname(customerLoginName);
return newStats; return newStats;
}); });
stats.setRevokedCount(stats.getRevokedCount() + 1); stats.setRevokedCount(stats.getRevokedCount() + 1);
//生成快照数据
TContractAutoLog contractAutoLog = new TContractAutoLog();
contractAutoLog.setContractId(loginNameMap.get(customerLoginName));
contractAutoLog.setEmpName(contract.getEmployeeName());
contractAutoLog.setEmpIdcard(contract.getEmpIdcard());
contractAutoLog.setPhone(contract.getEmpPhone());
contractAutoLog.setJoinLeaveDate(contract.getJoinLeaveDate());
contractAutoLog.setMainId(contract.getId());
contractAutoLogService.save(contractAutoLog);
} }
} }
...@@ -866,7 +935,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -866,7 +935,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
stats.getRevokedCount()); stats.getRevokedCount());
// 发送企微通知 // 发送企微通知
sendRevokeNotificationToWx(stats.getCustomerUserLoginname(), notificationContent); sendRevokeNotificationToWx(stats.getCustomerUserLoginname(), notificationContent, loginNameMap);
} }
} }
return R.ok(); return R.ok();
...@@ -882,7 +951,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -882,7 +951,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
* @param loginName 客服登录名 * @param loginName 客服登录名
* @param content 通知内容 * @param content 通知内容
*/ */
private void sendRevokeNotificationToWx(String loginName, String content) { private void sendRevokeNotificationToWx(String loginName, String content,Map<String, String> loginNameMap) {
//获取前端客服 //获取前端客服
SysUser user; SysUser user;
if (Common.isEmpty(loginName)) { if (Common.isEmpty(loginName)) {
...@@ -902,7 +971,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -902,7 +971,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "71" + loginName); String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid()
, wxConfig.getDomainName() + "/auth/oauth/wxLogin", "71" + loginNameMap.get(loginName));
StringBuilder description = new StringBuilder(); StringBuilder description = new StringBuilder();
String title = "作业自动化——电子合同签署超期自动撤回提醒"; String title = "作业自动化——电子合同签署超期自动撤回提醒";
description.append(content).append("<br>"); description.append(content).append("<br>");
...@@ -939,7 +1009,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -939,7 +1009,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
// 按前端客服分组统计需要提醒的合同 // 按前端客服分组统计需要提醒的合同
Map<String, CustomerExpiringStatistics> customerStatsMap = new HashMap<>(); Map<String, CustomerExpiringStatistics> customerStatsMap = new HashMap<>();
Map<String, String> loginNameMap = new HashMap<>();
for (TEmployeeContractPre contract : signingContracts) { for (TEmployeeContractPre contract : signingContracts) {
if (contract.getJoinLeaveDate() != null) { if (contract.getJoinLeaveDate() != null) {
// 计算入职一个月的最后一天 // 计算入职一个月的最后一天
...@@ -953,18 +1024,29 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -953,18 +1024,29 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
if (reminderDates.contains(today)) { if (reminderDates.contains(today)) {
String customerLoginName = contract.getCustomerUserLoginname(); String customerLoginName = contract.getCustomerUserLoginname();
if (Common.isNotNull(customerLoginName)) { if (Common.isNotNull(customerLoginName)) {
if (null == loginNameMap.get(customerLoginName)) {
UUID uuid = UUID.randomUUID();
loginNameMap.put(customerLoginName, uuid.toString());
}
CustomerExpiringStatistics stats = customerStatsMap.computeIfAbsent(customerLoginName, k -> { CustomerExpiringStatistics stats = customerStatsMap.computeIfAbsent(customerLoginName, k -> {
CustomerExpiringStatistics newStats = new CustomerExpiringStatistics(); CustomerExpiringStatistics newStats = new CustomerExpiringStatistics();
newStats.setCustomerUserLoginname(customerLoginName); newStats.setCustomerUserLoginname(customerLoginName);
return newStats; return newStats;
}); });
stats.setExpiringCount(stats.getExpiringCount() + 1); stats.setExpiringCount(stats.getExpiringCount() + 1);
//生成快照数据
TContractAutoLog contractAutoLog = new TContractAutoLog();
contractAutoLog.setContractId(loginNameMap.get(customerLoginName));
contractAutoLog.setEmpName(contract.getEmployeeName());
contractAutoLog.setEmpIdcard(contract.getEmpIdcard());
contractAutoLog.setPhone(contract.getEmpPhone());
contractAutoLog.setJoinLeaveDate(contract.getJoinLeaveDate());
contractAutoLog.setMainId(contract.getId());
contractAutoLogService.save(contractAutoLog);
} }
//更新催办和超期标识标识 //更新催办和超期标识标识
contract.setOverFlag(CommonConstants.ZERO_STRING); contract.setOverFlag(CommonConstants.ZERO_STRING);
if (Common.isEmpty(contract.getIsUrg())) {
contract.setIsUrg(CommonConstants.ONE_STRING);
}
} }
} }
} }
...@@ -978,7 +1060,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -978,7 +1060,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
stats.getExpiringCount()); stats.getExpiringCount());
// 发送企微提醒 // 发送企微提醒
sendExpiringReminderToWx(stats.getCustomerUserLoginname(), reminderContent); sendExpiringReminderToWx(stats.getCustomerUserLoginname(), reminderContent,loginNameMap);
} }
} }
...@@ -993,17 +1075,18 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -993,17 +1075,18 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
@Override @Override
public R contractUrg(List<String> idList) { public R contractUrg(List<String> idList) {
// 查询所有待催办的合同 // 查询所有待催办的合同
List<TEmployeeContractPre> signingContracts = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query() List<TContractAutoLog> signingContracts = contractAutoLogService.list(Wrappers.<TContractAutoLog>query()
.lambda() .lambda()
.eq(TEmployeeContractPre::getIsUrg, CommonConstants.ONE_STRING) .in(TContractAutoLog::getId, idList)
.in(TEmployeeContractPre::getId, idList)
); );
if (Common.isNotNull(signingContracts) && signingContracts.size() > 0) { if (Common.isNotNull(signingContracts) && signingContracts.size() > 0) {
try { try {
for (TEmployeeContractPre pre : signingContracts) { for (TContractAutoLog log : signingContracts) {
//查询合同待购买数据
TEmployeeContractPre pre = baseMapper.selectById(log.getMainId());
fascService.urgeTask(pre.getId()); fascService.urgeTask(pre.getId());
pre.setIsUrg(CommonConstants.ZERO_STRING); log.setIsUrg(CommonConstants.ZERO_STRING);
baseMapper.updateById(pre); contractAutoLogService.updateById(log);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("发送法大大催办时发生异常", e); log.error("发送法大大催办时发生异常", e);
...@@ -1058,7 +1141,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -1058,7 +1141,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
* @param loginName 客服登录名 * @param loginName 客服登录名
* @param content 提醒内容 * @param content 提醒内容
*/ */
private void sendExpiringReminderToWx(String loginName, String content) { private void sendExpiringReminderToWx(String loginName, String content,Map<String, String> loginNameMap) {
//获取前端客服 //获取前端客服
SysUser user; SysUser user;
if (Common.isEmpty(loginName)) { if (Common.isEmpty(loginName)) {
...@@ -1078,7 +1161,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -1078,7 +1161,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "70" + loginName); String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid()
, wxConfig.getDomainName() + "/auth/oauth/wxLogin", "70" + loginNameMap.get(loginName));
StringBuilder description = new StringBuilder(); StringBuilder description = new StringBuilder();
String title = "作业自动化——合同签署超期提醒"; String title = "作业自动化——合同签署超期提醒";
description.append(content).append("<br>"); description.append(content).append("<br>");
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TContractAutoLogMapper">
<resultMap id="tContractAutoLogMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TContractAutoLog">
<id property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="joinLeaveDate" column="JOIN_LEAVE_DATE"/>
<result property="phone" column="PHONE"/>
<result property="errorInfo" column="ERROR_INFO"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="contractId" column="CONTRACT_ID"/>
<result property="mainId" column="MAIN_ID"/>
<result property="isUrg" column="is_urg"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.JOIN_LEAVE_DATE,
a.PHONE,
a.ERROR_INFO,
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME,a.CONTRACT_ID,a.MAIN_ID,a.is_urg
</sql>
<sql id="tContractAutoLog_where">
<if test="tContractAutoLog != null">
<if test="tContractAutoLog.id != null and tContractAutoLog.id.trim() != ''">
AND a.ID = #{tContractAutoLog.id}
</if>
<if test="tContractAutoLog.empName != null and tContractAutoLog.empName.trim() != ''">
AND a.EMP_NAME = #{tContractAutoLog.empName}
</if>
<if test="tContractAutoLog.contractId != null and tContractAutoLog.contractId.trim() != ''">
AND a.CONTRACT_ID = #{tContractAutoLog.contractId}
</if>
<if test="tContractAutoLog.empIdcard != null and tContractAutoLog.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tContractAutoLog.empIdcard}
</if>
<if test="tContractAutoLog.joinLeaveDate != null">
AND a.JOIN_LEAVE_DATE = #{tContractAutoLog.joinLeaveDate}
</if>
<if test="tContractAutoLog.phone != null and tContractAutoLog.phone.trim() != ''">
AND a.PHONE = #{tContractAutoLog.phone}
</if>
<if test="tContractAutoLog.errorInfo != null and tContractAutoLog.errorInfo.trim() != ''">
AND a.ERROR_INFO = #{tContractAutoLog.errorInfo}
</if>
<if test="tContractAutoLog.createBy != null and tContractAutoLog.createBy.trim() != ''">
AND a.CREATE_BY = #{tContractAutoLog.createBy}
</if>
<if test="tContractAutoLog.updateBy != null and tContractAutoLog.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tContractAutoLog.updateBy}
</if>
<if test="tContractAutoLog.createName != null and tContractAutoLog.createName.trim() != ''">
AND a.CREATE_NAME = #{tContractAutoLog.createName}
</if>
<if test="tContractAutoLog.updateTime != null">
AND a.UPDATE_TIME = #{tContractAutoLog.updateTime}
</if>
<if test="tContractAutoLog.createTime != null">
AND a.CREATE_TIME = #{tContractAutoLog.createTime}
</if>
</if>
</sql>
<!--tContractAutoLog简单分页查询-->
<select id="getTContractAutoLogPage" resultMap="tContractAutoLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_contract_auto_log a
<where>
1=1
<include refid="tContractAutoLog_where"/>
</where>
</select>
</mapper>
...@@ -88,91 +88,94 @@ ...@@ -88,91 +88,94 @@
<result property="contractSubName" column="CONTRACT_SUB_NAME"/> <result property="contractSubName" column="CONTRACT_SUB_NAME"/>
<result property="requestId" column="request_id"/> <result property="requestId" column="request_id"/>
<result property="requestMsg" column="request_msg"/> <result property="requestMsg" column="request_msg"/>
<result property="isUrg" column="is_urg"/>
<result property="overFlag" column="over_flag"/> <result property="overFlag" column="over_flag"/>
<result property="changeTypeReason" column="change_type_reason"/>
<result property="changeTypeUser" column="change_type_user"/>
<result property="changeTypeTime" column="change_type_time"/>
<result property="archivesIsCreate" column="archives_is_create"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id a.id
,dept_name ,a.dept_name
,dept_no ,a.dept_no
,dept_id ,a.dept_id
,employee_name ,a.employee_name
,emp_idcard ,a.emp_idcard
,emp_phone ,a.emp_phone
,position ,a.position
,join_leave_date ,a.join_leave_date
,contract_type ,a.contract_type
,process_status ,a.process_status
,signatory ,a.signatory
,customer_username ,a.customer_username
,customer_user_loginname ,a.customer_user_loginname
,sign_type ,a.sign_type
,fadada_template ,a.fadada_template
,fadada_template_id ,a.fadada_template_id
,data_source ,a.data_source
,expected_confirm_time ,a.expected_confirm_time
,expected_collection_time ,a.expected_collection_time
,contract_start ,a.contract_start
,contract_end ,a.contract_end
,situation ,a.situation
,try_period_start ,a.try_period_start
,try_period_end ,a.try_period_end
,config_name ,a.config_name
,update_flag ,a.update_flag
,try_period_type ,a.try_period_type
,try_period ,a.try_period
,salary_type ,a.salary_type
,salary_standard_per_hour ,a.salary_standard_per_hour
,salary_standard_per_piece ,a.salary_standard_per_piece
,config_id ,a.config_id
,working_dept ,a.working_dept
,working_company ,a.working_company
,risk_buy_desc ,a.risk_buy_desc
,other_wage ,a.other_wage
,labor_cost ,a.labor_cost
,default_amount ,a.default_amount
,settlement_cycle ,a.settlement_cycle
,payment_time ,a.payment_time
,payment_type ,a.payment_type
,dispatch_period_start ,a.dispatch_period_start
,dispatch_period_end ,a.dispatch_period_end
,work_type ,a.work_type
,work_day_count ,a.work_day_count
,work_day ,a.work_day
,work_hours ,a.work_hours
,other_work_day ,a.other_work_day
,internship_period ,a.internship_period
,internship_period_start ,a.internship_period_start
,internship_period_end ,a.internship_period_end
,post_type ,a.post_type
,post ,a.post
,work_address ,a.work_address
,contract_term ,a.contract_term
,contract_duration_year ,a.contract_duration_year
,contract_duration_month ,a.contract_duration_month
,register_id ,a.register_id
,sign_flag ,a.sign_flag
,error_info ,a.error_info
,contract_id ,a.contract_id
,revoke_reason ,a.revoke_reason
,working_reward ,a.working_reward
,working_hours ,a.working_hours
,dispatch_period_year ,a.dispatch_period_year
,dispatch_period_month ,a.dispatch_period_month
,error_time ,a.error_time
,contract_end_type ,a.contract_end_type
,confirm_emp_select ,a.confirm_emp_select
,timeout_elec_sign ,a.timeout_elec_sign
,update_time ,a.update_time
,create_by ,a.create_by
,create_name ,a.create_name
,create_time ,a.create_time
,update_by ,a.update_by
,TASK ,a.TASK
,TASK_TYPE ,a.TASK_TYPE
,TASK_END_STANDARD,contract_flag,a.CONTRACT_SUB_NAME ,a.TASK_END_STANDARD,a.contract_flag,a.CONTRACT_SUB_NAME
,a.request_id ,a.request_id
,a.request_msg,a.over_flag,a.is_urg ,a.request_msg,a.over_flag,a.change_type_reason,a.change_type_user,a.change_type_time
</sql> </sql>
<sql id="tEmployeeContractPre_where"> <sql id="tEmployeeContractPre_where">
<if test="tEmployeeContractPre != null"> <if test="tEmployeeContractPre != null">
...@@ -198,6 +201,9 @@ ...@@ -198,6 +201,9 @@
<if test="tEmployeeContractPre.employeeName != null and tEmployeeContractPre.employeeName.trim() != ''"> <if test="tEmployeeContractPre.employeeName != null and tEmployeeContractPre.employeeName.trim() != ''">
AND a.employee_name = #{tEmployeeContractPre.employeeName} AND a.employee_name = #{tEmployeeContractPre.employeeName}
</if> </if>
<if test="tEmployeeContractPre.archivesIsCreate != null and tEmployeeContractPre.archivesIsCreate.trim() != ''">
AND a.archives_is_create = #{tEmployeeContractPre.archivesIsCreate}
</if>
<if test="tEmployeeContractPre.empIdcard != null and tEmployeeContractPre.empIdcard.trim() != ''"> <if test="tEmployeeContractPre.empIdcard != null and tEmployeeContractPre.empIdcard.trim() != ''">
AND a.emp_idcard like CONCAT('%',#{tEmployeeContractPre.empIdcard},'%') AND a.emp_idcard like CONCAT('%',#{tEmployeeContractPre.empIdcard},'%')
</if> </if>
...@@ -270,7 +276,10 @@ ...@@ -270,7 +276,10 @@
<select id="getTEmployeeContractPrePage" resultMap="tEmployeeContractPreMap"> <select id="getTEmployeeContractPrePage" resultMap="tEmployeeContractPreMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
,if(b.id is null,'1','0') archives_is_create
FROM t_employee_contract_pre a FROM t_employee_contract_pre a
left join t_employee_project b on a.emp_idcard = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
and b.PROJECT_STATUS = 0 and b.DELETE_FLAG = '0'
<where> <where>
1=1 1=1
<include refid="tEmployeeContractPre_where"/> <include refid="tEmployeeContractPre_where"/>
...@@ -328,8 +337,11 @@ ...@@ -328,8 +337,11 @@
WHEN a.process_status =6 THEN "签署中" WHEN a.process_status =6 THEN "签署中"
WHEN a.process_status =7 THEN "签署失败" WHEN a.process_status =7 THEN "签署失败"
WHEN a.process_status =8 THEN "电子待归档" WHEN a.process_status =8 THEN "电子待归档"
ELSE a.process_status END as process_status ELSE a.process_status END as process_status,
if(b.id is null,'否','是') archives_is_create
FROM t_employee_contract_pre a FROM t_employee_contract_pre a
left join t_employee_project b on a.emp_idcard = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
and b.PROJECT_STATUS = 0 and b.DELETE_FLAG = '0'
<where> <where>
1=1 1=1
<include refid="tEmployeeContractPre_where"/> <include refid="tEmployeeContractPre_where"/>
......
...@@ -121,5 +121,17 @@ ...@@ -121,5 +121,17 @@
<artifactId>xlsx-streamer</artifactId> <artifactId>xlsx-streamer</artifactId>
<version>2.2.0</version> <version>2.2.0</version>
</dependency> </dependency>
<!-- 容联云短信SDK -->
<dependency>
<groupId>com.cloopen</groupId>
<artifactId>java-sms-sdk</artifactId>
<version>1.0.3</version>
</dependency>
<!-- gson 解析 -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
package com.yifu.cloud.plus.v1.yifu.common.core.util;
import com.cloopen.rest.sdk.BodyType;
import com.cloopen.rest.sdk.CCPRestSmsSDK;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Set;
/**
* 容联云短信实现工具类,可以单个发送短信,批量发送短信
*
* @author fxj
* @version 1.0
* @since 2025/10/21
*/
@Component
@Data
@Slf4j
public class RlySmsUtil {
private CCPRestSmsSDK sdk;
// 服务器地址
private String serverIp = "app.cloopen.com";
// 服务器端口
private String serverPort = "8883";
// 主账号
private String accountSId = "8a48b5515388ec150153acb1cd5b3899";
// 主账号令牌
private String accountToken = "5487aa42bb574b47aca1c785b4e7c018";
// 应用ID
private String appId = "2c94811c9787a27f019854cd1b532b7e";
/**
* 初始化SDK
*
* @param accountSId 主账号
* @param accountToken 主账号令牌
* @param appId 应用ID
*/
public void init(String accountSId, String accountToken, String appId) {
if (null == sdk){
this.accountSId = accountSId;
this.accountToken = accountToken;
this.appId = appId;
sdk = new CCPRestSmsSDK();
sdk.init(serverIp, serverPort);
sdk.setAccount(accountSId, accountToken);
sdk.setAppId(appId);
sdk.setBodyType(BodyType.Type_JSON);
}
}
/**
* 单个发送短信
*
* @param phoneNumber 手机号码
* @param templateId 模板ID
* @param datas 短信参数
* @return 发送结果 true-成功 false-失败
*/
public boolean sendSingleSms(String phoneNumber, String templateId, String[] datas) {
init(accountSId, accountToken, appId);
HashMap<String, Object> result = sdk.sendTemplateSMS(phoneNumber, templateId, datas);
if ("000000".equals(result.get("statusCode"))) {
// 正常返回输出data包体信息
HashMap<String, Object> data = (HashMap<String, Object>) result.get("data");
Set<String> keySet = data.keySet();
for (String key : keySet) {
Object object = data.get(key);
}
return true;
} else {
// 异常返回输出错误码和错误信息
log.error("错误码=" + result.get("statusCode") + " 错误信息= " + result.get("statusMsg"));
return false;
}
}
/**
* 批量发送短信
*
* @param phoneNumbers 手机号码数组
* @param templateId 模板ID
* @param datas 短信参数
* @return 发送结果 true-成功 false-失败
*/
public HashMap<String, Object> sendBatchSms(String[] phoneNumbers, String templateId, String[][] datas) {
init(accountSId, accountToken, appId);
// 将手机号数组转换为逗号分隔的字符串
StringBuilder phoneNumbersStr = new StringBuilder();
for (int i = 0; i < phoneNumbers.length; i++) {
if (i > 0) {
phoneNumbersStr.append(",");
}
phoneNumbersStr.append(phoneNumbers[i]);
}
// 容联云短信SDK只支持单个模板参数数组,不直接支持多个不同参数
// 这里假设所有手机号使用相同参数发送
// 如果需要不同的参数,需要多次调用单个发送方法
String[] singleData = datas.length > 0 ? datas[0] : new String[0];
HashMap<String, Object> result = sdk.sendTemplateSMS(phoneNumbersStr.toString(), templateId, singleData);
return result;
}
}
\ No newline at end of file
...@@ -7,4 +7,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ ...@@ -7,4 +7,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.core.config.WebMvcConfiguration,\ com.yifu.cloud.plus.v1.yifu.common.core.config.WebMvcConfiguration,\
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil,\ com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil,\
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil,\ com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil,\
com.yifu.cloud.plus.v1.yifu.common.core.redis.lock4j.MyLockFailureStrategy com.yifu.cloud.plus.v1.yifu.common.core.redis.lock4j.MyLockFailureStrategy,\
com.yifu.cloud.plus.v1.yifu.common.core.util.RlySmsUtil
package com.yifu.cloud.plus.v1.yifu.social.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:03:58
*/
@Data
@TableName("t_social_auto_log")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "合同自动化企微日志表")
public class TSocialAutoLog extends BaseEntity {
/**
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("ID")
@Schema(description = "ID")
private String id;
@Schema(description = "社保实时ID")
private String socialId;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 50)
@Length(max = 50, message = "员工姓名不能超过50个字符")
@ExcelProperty("员工姓名")
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证
*/
@ExcelAttribute(name = "员工身份证", maxLength = 20)
@Length(max = 20, message = "员工身份证不能超过20个字符")
@ExcelProperty("员工身份证")
@Schema(description = "员工身份证")
private String empIdcard;
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期", isDate = true)
@ExcelProperty("入职日期")
@Schema(description = "入职日期")
private Date joinLeaveDate;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 30)
@Length(max = 30, message = "手机号码不能超过30个字符")
@ExcelProperty("手机号码")
@Schema(description = "手机号码")
private String phone;
/**
* 异常原因说明
*/
@ExcelAttribute(name = "异常原因说明", maxLength = 200)
@Length(max = 200, message = "异常原因说明不能超过200个字符")
@ExcelProperty("异常原因说明")
@Schema(description = "异常原因说明")
private String errorInfo;
}
package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoLog;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialAutoLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:03:58
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialautolog" )
@Tag(name = "合同自动化企微日志表管理")
public class TSocialAutoLogController {
private final TSocialAutoLogService tSocialAutoLogService;
/**
* 简单分页查询
* @param page 分页对象
* @param tSocialAutoLog 合同自动化企微日志表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSocialAutoLog>> getTSocialAutoLogPage(Page<TSocialAutoLog> page, TSocialAutoLog tSocialAutoLog) {
return new R<>(tSocialAutoLogService.getTSocialAutoLogPage(page,tSocialAutoLog));
}
/**
* 通过id查询合同自动化企微日志表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R<TSocialAutoLog> getById(@PathVariable("id" ) String id) {
return R.ok(tSocialAutoLogService.getById(id));
}
}
package com.yifu.cloud.plus.v1.yifu.social.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:03:58
*/
@Mapper
public interface TSocialAutoLogMapper extends BaseMapper<TSocialAutoLog> {
/**
* 合同自动化企微日志表简单分页查询
* @param tSocialAutoLog 合同自动化企微日志表
* @return
*/
IPage<TSocialAutoLog> getTSocialAutoLogPage(Page<TSocialAutoLog> page, @Param("tSocialAutoLog") TSocialAutoLog tSocialAutoLog);
}
package com.yifu.cloud.plus.v1.yifu.social.service;
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.yifu.social.entity.TSocialAutoLog;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:03:58
*/
public interface TSocialAutoLogService extends IService<TSocialAutoLog> {
/**
* 合同自动化企微日志表简单分页查询
* @param tSocialAutoLog 合同自动化企微日志表
* @return
*/
IPage<TSocialAutoLog> getTSocialAutoLogPage(Page<TSocialAutoLog> page, TSocialAutoLog tSocialAutoLog);
}
...@@ -22,12 +22,10 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils; ...@@ -22,12 +22,10 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.config.WxConfig; import com.yifu.cloud.plus.v1.yifu.social.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialPreDetail; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialPreDetail;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TDispatchInfoPreMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TDispatchInfoPreMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoPreService; import com.yifu.cloud.plus.v1.yifu.social.service.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.THolidayInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialPreDetailService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreSearchVo;
...@@ -74,6 +72,8 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -74,6 +72,8 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
private final TDispatchInfoService dispatchInfoService; private final TDispatchInfoService dispatchInfoService;
private final TSocialAutoLogService socialAutoLogService;
/** /**
* 社保待购买表简单分页查询 * 社保待购买表简单分页查询
* @param tDispatchInfoPre 社保待购买表 * @param tDispatchInfoPre 社保待购买表
...@@ -349,6 +349,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -349,6 +349,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
// 初始化失败数量为0 // 初始化失败数量为0
falureMap.putIfAbsent(preLoginName, 0); falureMap.putIfAbsent(preLoginName, 0);
} }
Map<String, String> loginNameMap = new HashMap<>();
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
if (j == i - 1) { if (j == i - 1) {
disList = excelVOList.subList(k, excelVOList.size()); disList = excelVOList.subList(k, excelVOList.size());
...@@ -379,6 +380,19 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -379,6 +380,19 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
// 统计失败数量 // 统计失败数量
String preLoginName = contractVO.getPreLoginName(); String preLoginName = contractVO.getPreLoginName();
falureMap.put(preLoginName, falureMap.getOrDefault(preLoginName, 0) + 1); falureMap.put(preLoginName, falureMap.getOrDefault(preLoginName, 0) + 1);
//生成快照数据
if(type.equals("2")) {
if (null == loginNameMap.get(preLoginName)) {
UUID uuid = UUID.randomUUID();
loginNameMap.put(preLoginName, uuid.toString());
}
TSocialAutoLog socialAutoLog = new TSocialAutoLog();
socialAutoLog.setSocialId(loginNameMap.get(preLoginName));
socialAutoLog.setEmpName(contractVO.getEmpName());
socialAutoLog.setEmpIdcard(contractVO.getEmpIdcard());
socialAutoLog.setErrorInfo(errorMessage.getMessage());
socialAutoLogService.save(socialAutoLog);
}
} }
} }
} }
...@@ -390,7 +404,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -390,7 +404,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
String preLoginName = entry.getKey(); String preLoginName = entry.getKey();
int failureCount = entry.getValue(); int failureCount = entry.getValue();
int sum = sumMap.get(preLoginName); int sum = sumMap.get(preLoginName);
sendDisFalureMessageToWx(preLoginName ,sum, failureCount); sendDisFalureMessageToWx(preLoginName ,sum, failureCount, loginNameMap);
} }
} }
...@@ -466,7 +480,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -466,7 +480,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
} }
//发送企业微信待办 //发送企业微信待办
private void sendDisFalureMessageToWx(String LoginName, int sum, int falureNum) { private void sendDisFalureMessageToWx(String LoginName, int sum, int falureNum,Map<String, String> loginNameMap) {
//获取前端客服 //获取前端客服
SysUser user; SysUser user;
if (Common.isEmpty(LoginName)) { if (Common.isEmpty(LoginName)) {
...@@ -486,7 +500,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -486,7 +500,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "67" + LoginName); String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "67" + loginNameMap.get(LoginName));
StringBuilder description = new StringBuilder(); StringBuilder description = new StringBuilder();
String title = "作业自动化——社保派单发起失败提醒"; String title = "作业自动化——社保派单发起失败提醒";
description.append("社保派单数:").append(sum).append("份,失败份数:").append(falureNum).append("份;").append("<br>"); description.append("社保派单数:").append(sum).append("份,失败份数:").append(falureNum).append("份;").append("<br>");
......
...@@ -133,6 +133,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -133,6 +133,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private final TDispatchInfoPreMapper dispatchInfoPreMapper; private final TDispatchInfoPreMapper dispatchInfoPreMapper;
private final TSocialAutoLogService socialAutoLogService;
@Autowired @Autowired
private CacheManager cacheManager; private CacheManager cacheManager;
...@@ -3729,7 +3731,21 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3729,7 +3731,21 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatchInfoPre.setProcessStatus(CommonConstants.FOUR_STRING); dispatchInfoPre.setProcessStatus(CommonConstants.FOUR_STRING);
dispatchInfoPre.setErrorBackInfo(auditRemark); dispatchInfoPre.setErrorBackInfo(auditRemark);
dispatchInfoPreMapper.updateById(dispatchInfoPre); dispatchInfoPreMapper.updateById(dispatchInfoPre);
sendDisFalureMessageToWx(dispatchInfoPre);
Map<String, String> loginNameMap = new HashMap<>();
if (null == loginNameMap.get(dispatchInfoPre.getCustomerUserLoginName())) {
UUID uuid = UUID.randomUUID();
loginNameMap.put(dispatchInfoPre.getCustomerUserLoginName(), uuid.toString());
}
TSocialAutoLog socialAutoLog = new TSocialAutoLog();
socialAutoLog.setSocialId(loginNameMap.get(dispatchInfoPre.getCustomerUserLoginName()));
socialAutoLog.setEmpName(dispatchInfoPre.getEmpName());
socialAutoLog.setEmpIdcard(dispatchInfoPre.getEmpIdcard());
socialAutoLog.setErrorInfo(auditRemark);
socialAutoLogService.save(socialAutoLog);
sendDisFalureMessageToWx(dispatchInfoPre,null, loginNameMap);
} }
} }
socialInfo.setAuditTime(now); socialInfo.setAuditTime(now);
...@@ -4438,6 +4454,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4438,6 +4454,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatchInfoPre.setProcessStatus(CommonConstants.SIX_STRING); dispatchInfoPre.setProcessStatus(CommonConstants.SIX_STRING);
dispatchInfoPre.setErrorBackInfo(null); dispatchInfoPre.setErrorBackInfo(null);
} }
Map<String, String> loginNameMap = new HashMap<>();
if (sf.getSocialStatus().equals(CommonConstants.FOUR_STRING)) { if (sf.getSocialStatus().equals(CommonConstants.FOUR_STRING)) {
dispatchInfoPre.setProcessStatus(CommonConstants.NINE_STRING); dispatchInfoPre.setProcessStatus(CommonConstants.NINE_STRING);
dispatchInfoPre.setErrorBackInfo(handleRemark); dispatchInfoPre.setErrorBackInfo(handleRemark);
...@@ -4464,12 +4482,33 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4464,12 +4482,33 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(errorTemp.toString())) { if (Common.isNotNull(errorTemp.toString())) {
dispatchInfoPre.setDispatchItem(errorTemp.deleteCharAt(errorTemp.length() - 1).toString()); dispatchInfoPre.setDispatchItem(errorTemp.deleteCharAt(errorTemp.length() - 1).toString());
} }
sendDisFalureMessageToWx(dispatchInfoPre); if (null == loginNameMap.get(dispatchInfoPre.getCustomerUserLoginName())) {
UUID uuid = UUID.randomUUID();
loginNameMap.put(dispatchInfoPre.getCustomerUserLoginName(), uuid.toString());
}
TSocialAutoLog socialAutoLog = new TSocialAutoLog();
socialAutoLog.setSocialId(loginNameMap.get(dispatchInfoPre.getCustomerUserLoginName()));
socialAutoLog.setEmpName(dispatchInfoPre.getEmpName());
socialAutoLog.setEmpIdcard(dispatchInfoPre.getEmpIdcard());
socialAutoLog.setErrorInfo(handleRemark);
socialAutoLogService.save(socialAutoLog);
sendDisFalureMessageToWx(dispatchInfoPre,socialAutoLog.getId(),null);
} }
if (sf.getSocialStatus().equals(CommonConstants.FIVE_STRING)) { if (sf.getSocialStatus().equals(CommonConstants.FIVE_STRING)) {
dispatchInfoPre.setProcessStatus(CommonConstants.EIGHT_STRING); dispatchInfoPre.setProcessStatus(CommonConstants.EIGHT_STRING);
dispatchInfoPre.setErrorBackInfo(handleRemark); dispatchInfoPre.setErrorBackInfo(handleRemark);
sendDisFalureMessageToWx(dispatchInfoPre);
if (null == loginNameMap.get(dispatchInfoPre.getCustomerUserLoginName())) {
UUID uuid = UUID.randomUUID();
loginNameMap.put(dispatchInfoPre.getCustomerUserLoginName(), uuid.toString());
}
TSocialAutoLog socialAutoLog = new TSocialAutoLog();
socialAutoLog.setSocialId(loginNameMap.get(dispatchInfoPre.getCustomerUserLoginName()));
socialAutoLog.setEmpName(dispatchInfoPre.getEmpName());
socialAutoLog.setEmpIdcard(dispatchInfoPre.getEmpIdcard());
socialAutoLog.setErrorInfo(handleRemark);
socialAutoLogService.save(socialAutoLog);
sendDisFalureMessageToWx(dispatchInfoPre,socialAutoLog.getId(),null);
} }
if (sf.getSocialStatus().equals(CommonConstants.THREE_STRING)) { if (sf.getSocialStatus().equals(CommonConstants.THREE_STRING)) {
dispatchInfoPre.setErrorBackInfo(null); dispatchInfoPre.setErrorBackInfo(null);
...@@ -8820,7 +8859,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8820,7 +8859,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
//发送企业微信待办 //发送企业微信待办
private void sendDisFalureMessageToWx(TDispatchInfoPre pre) { private void sendDisFalureMessageToWx(TDispatchInfoPre pre,String id,Map<String, String> loginNameMap) {
//获取前端客服 //获取前端客服
SysUser user; SysUser user;
if (Common.isEmpty(pre.getCustomerUserLoginName())) { if (Common.isEmpty(pre.getCustomerUserLoginName())) {
...@@ -8840,7 +8879,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8840,7 +8879,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "68" + pre.getId()); String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid()
, wxConfig.getDomainName() + "/auth/oauth/wxLogin", "68" + null == id ? loginNameMap.get(pre.getCustomerUserLoginName()): id);
StringBuilder description = new StringBuilder(); StringBuilder description = new StringBuilder();
String title = "作业自动化——社保办理失败提醒"; String title = "作业自动化——社保办理失败提醒";
description.append(pre.getEmpName()).append("-").append(pre.getEmpIdcard()).append("-") description.append(pre.getEmpName()).append("-").append(pre.getEmpIdcard()).append("-")
......
package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoLog;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialAutoLogMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialAutoLogService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 合同自动化企微日志表
*
* @author huych
* @date 2025-10-20 20:03:58
*/
@Log4j2
@Service
public class TSocialAutoLogServiceImpl extends ServiceImpl<TSocialAutoLogMapper, TSocialAutoLog> implements TSocialAutoLogService {
/**
* 合同自动化企微日志表简单分页查询
* @param tSocialAutoLog 合同自动化企微日志表
* @return
*/
@Override
public IPage<TSocialAutoLog> getTSocialAutoLogPage(Page<TSocialAutoLog> page, TSocialAutoLog tSocialAutoLog){
return baseMapper.getTSocialAutoLogPage(page,tSocialAutoLog);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialAutoLogMapper">
<resultMap id="tSocialAutoLogMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoLog">
<id property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="joinLeaveDate" column="JOIN_LEAVE_DATE"/>
<result property="phone" column="PHONE"/>
<result property="errorInfo" column="ERROR_INFO"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="socialId" column="SOCIAL_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.JOIN_LEAVE_DATE,
a.PHONE,
a.ERROR_INFO,
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME,a.SOCIAL_ID
</sql>
<sql id="tSocialAutoLog_where">
<if test="tSocialAutoLog != null">
<if test="tSocialAutoLog.id != null and tSocialAutoLog.id.trim() != ''">
AND a.ID = #{tSocialAutoLog.id}
</if>
<if test="tSocialAutoLog.empName != null and tSocialAutoLog.empName.trim() != ''">
AND a.EMP_NAME = #{tSocialAutoLog.empName}
</if>
<if test="tSocialAutoLog.empIdcard != null and tSocialAutoLog.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tSocialAutoLog.empIdcard}
</if>
<if test="tSocialAutoLog.socialId != null and tSocialAutoLog.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tSocialAutoLog.socialId}
</if>
<if test="tSocialAutoLog.joinLeaveDate != null">
AND a.JOIN_LEAVE_DATE = #{tSocialAutoLog.joinLeaveDate}
</if>
<if test="tSocialAutoLog.phone != null and tSocialAutoLog.phone.trim() != ''">
AND a.PHONE = #{tSocialAutoLog.phone}
</if>
<if test="tSocialAutoLog.errorInfo != null and tSocialAutoLog.errorInfo.trim() != ''">
AND a.ERROR_INFO = #{tSocialAutoLog.errorInfo}
</if>
<if test="tSocialAutoLog.createBy != null and tSocialAutoLog.createBy.trim() != ''">
AND a.CREATE_BY = #{tSocialAutoLog.createBy}
</if>
<if test="tSocialAutoLog.updateBy != null and tSocialAutoLog.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tSocialAutoLog.updateBy}
</if>
<if test="tSocialAutoLog.createName != null and tSocialAutoLog.createName.trim() != ''">
AND a.CREATE_NAME = #{tSocialAutoLog.createName}
</if>
<if test="tSocialAutoLog.updateTime != null">
AND a.UPDATE_TIME = #{tSocialAutoLog.updateTime}
</if>
<if test="tSocialAutoLog.createTime != null">
AND a.CREATE_TIME = #{tSocialAutoLog.createTime}
</if>
</if>
</sql>
<!--tSocialAutoLog简单分页查询-->
<select id="getTSocialAutoLogPage" resultMap="tSocialAutoLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_auto_log a
<where>
1=1
<include refid="tSocialAutoLog_where"/>
</where>
</select>
</mapper>
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