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);
}
...@@ -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);
......
<?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