Commit 4206ffcd authored by huyuchen's avatar huyuchen

huych-社保自动化相关提交

parent 0416aa07
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;
......
...@@ -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";
...@@ -275,8 +276,17 @@ public class FascController { ...@@ -275,8 +276,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);
...@@ -355,7 +365,7 @@ public class FascController { ...@@ -355,7 +365,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())) {
...@@ -376,7 +386,7 @@ public class FascController { ...@@ -376,7 +386,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);
}
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);
}
}
...@@ -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;
...@@ -289,6 +288,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -289,6 +288,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
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("撤销签署");
...@@ -845,15 +900,29 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -845,15 +900,29 @@ 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>");
...@@ -940,6 +1010,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -940,6 +1010,7 @@ 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,8 +88,11 @@ ...@@ -88,8 +88,11 @@
<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 id
...@@ -172,7 +175,7 @@ ...@@ -172,7 +175,7 @@
,TASK_TYPE ,TASK_TYPE
,TASK_END_STANDARD,contract_flag,a.CONTRACT_SUB_NAME ,TASK_END_STANDARD,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,a.archives_is_create
</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>
......
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查询:hasPermission('social_tsocialautolog_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tsocialautolog_get')" )
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