Commit 19666a87 authored by fangxinjiang's avatar fangxinjiang

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

parents 2cfe6eeb 137d8bce
...@@ -41,6 +41,14 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable { ...@@ -41,6 +41,14 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@Schema(description = "员工身份证") @Schema(description = "员工身份证")
@ExcelProperty("员工身份证") @ExcelProperty("员工身份证")
private String empIdcard; private String empIdcard;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 20)
@Length(max = 20, message = "手机号码不能超过20个字符")
@ExcelProperty("手机号码")
@Schema(description = "手机号码")
private String phone;
/** /**
* 社保购买状态,0待确认,1待派单,2派单失败,3待审核,4审核不通过,5待办理,6办理中,7办理成功,8办理失败,9部分办理失败 * 社保购买状态,0待确认,1待派单,2派单失败,3待审核,4审核不通过,5待办理,6办理中,7办理成功,8办理失败,9部分办理失败
*/ */
......
package com.yifu.cloud.plus.v1.yifu.archives.controller; package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fadada.api.utils.crypt.FddCryptUtil;
import com.fasc.open.api.constants.RequestConstants;
import com.fasc.open.api.exception.ApiException; import com.fasc.open.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.config.FascConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascPushLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.FascService; import com.yifu.cloud.plus.v1.yifu.archives.service.FascService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TFascPushLogService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
/** /**
* @auther huyc * @auther huyc
* @date 2022/6/29 * @date 2022/6/29
...@@ -24,6 +39,13 @@ public class FascController { ...@@ -24,6 +39,13 @@ public class FascController {
@Autowired @Autowired
private FascService fascService; private FascService fascService;
@Autowired
private FascConfig fascConfig;
private final TFascPushLogService tFascPushLogService;
private static String FASC_EVENT = "X-FASC-Event";
private static String FASC_BIZ_CONTENT = "bizContent";
/** /**
* @param templateName 签署任务模板名称,如果传了该参数,会根据名称模糊匹配查询,长度最大100个字符。 * @param templateName 签署任务模板名称,如果传了该参数,会根据名称模糊匹配查询,长度最大100个字符。
...@@ -77,4 +99,104 @@ public class FascController { ...@@ -77,4 +99,104 @@ public class FascController {
return fascService.urgeTask(id); return fascService.urgeTask(id);
} }
// 法大大回调
/*@ResponseBody
@PostMapping(value = "/api/fascCallback")
public String fddEventCallback(@RequestHeader HttpHeaders headers,
@RequestParam("bizContent") String bizContent) throws Exception {
//appSecret,由开发者登陆到法大大官网,在应用管理管理中点击应用详情里面获取
String appSecret = "xxxx";
//获取请求头参数
String appId = headers.getFirst("X-FASC-App-Id");
String signType = headers.getFirst("X-FASC-Sign-Type");
String sign = headers.getFirst("X-FASC-Sign");
String timestamp = headers.getFirst("X-FASC-Timestamp");
//事件名称,开发者可以根据不同事件名称去解析bizContent的值,实现不同的逻辑
String event = headers.getFirst("X-FASC-Event");
String nonce = headers.getFirst("X-FASC-Nonce");
//验签
Map<String, String> paramMap = new HashMap<>();
paramMap.put("X-FASC-App-Id", appId);
paramMap.put("X-FASC-Sign-Type", "HMAC-SHA256");
paramMap.put("X-FASC-Timestamp", timestamp);
paramMap.put("X-FASC-Nonce", nonce);
paramMap.put("X-FASC-Event", event);
paramMap.put("bizContent", bizContent);
//参数排序,ascii码排序
String sortParam = FddCryptUtil.sortParameters(paramMap);
//生成签名后可以进行校验
String signature = FddCryptUtil.sign(sortParam, timestamp, appSecret);
if(!signature.equals(sign)) {
//log.error("日志记录,签名失败");
//为了不重复接收该请求,建议这里返回success,返回success后这条消息法大大将中断重试回调机制
return "{\"code\":\"200\";\"msg\":\"success\"}";
}
return "{\"code\":\"200\";\"msg\":\"success\"}";
}*/
@Operation(summary = "异步通知", description = "异步通知")
@RequestMapping(value = "/api/fascCallback")
public R<String> notifyUrl(HttpServletRequest request, HttpServletResponse response) throws Exception {
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setReturnData(JSON.toJSONString(request));
pushLog.setTaskStatus(CommonConstants.ONE_STRING);
pushLog.setTypeKey("签署任务事件,异步通知");
pushLog.setTypeName("签署任务事件,异步通知");
tFascPushLogService.save(pushLog);
if (checkSign(request)) {
return R.failed("验签失败");
}
String fddEvent = request.getHeader(FASC_EVENT);
String fddBizContent = request.getParameter(FASC_BIZ_CONTENT);
if (Common.isNotNull(fddEvent)) {
JSONObject jsonObject = JSON.parseObject(fddBizContent);
String taskId = jsonObject.getString("taskId");
String taskStatus = jsonObject.getString("taskStatus");
String signStatus = jsonObject.getString("signStatus");
String signerId = jsonObject.getString("signerId");
pushLog.setReturnData("fddEvent:" + fddEvent + ";fddBizContent:" + fddBizContent);
if (fddEvent.equals("sign-task-finished")) {
pushLog.setReturnData("签署任务完成事件:fddEvent:" + fddEvent + ";fddBizContent:" + fddBizContent);
return R.ok(null, "success");
} else if (fddEvent.equals("sign-task-canceled")) {
pushLog.setReturnData("签署任务撤销事件:fddEvent:" + fddEvent + ";fddBizContent:" + fddBizContent);
return R.ok(null, "success");
} else if (fddEvent.equals("sign-task-sign-failed")) {
pushLog.setReturnData("签署任务参与方签署失败事件:fddEvent:" + fddEvent + ";fddBizContent:" + fddBizContent);
return R.ok(null, "success");
} else if (fddEvent.equals("sign-task-abolish")) {
pushLog.setReturnData("签署任务作废事件:fddEvent:" + fddEvent + ";fddBizContent:" + fddBizContent);
return R.ok(null, "success");
}
}
tFascPushLogService.updateById(pushLog);
return R.ok(null, "success");
}
//验证签名,返回true表示失败
public boolean checkSign(HttpServletRequest request) throws Exception {
Map<String, String> paraMap = new HashMap<>();
paraMap.put(RequestConstants.APP_ID, request.getHeader(RequestConstants.APP_ID));
paraMap.put(RequestConstants.SIGN_TYPE, request.getHeader(RequestConstants.SIGN_TYPE));
paraMap.put(RequestConstants.TIMESTAMP, request.getHeader(RequestConstants.TIMESTAMP));
paraMap.put(RequestConstants.NONCE, request.getHeader(RequestConstants.NONCE));
paraMap.put(FASC_EVENT, request.getHeader(FASC_EVENT));
paraMap.put(FASC_BIZ_CONTENT, request.getParameter(FASC_BIZ_CONTENT));
//参数排序,ascii码排序
String sortParam = FddCryptUtil.sortParameters(paraMap);
//计算之后得到签名 该签名需要放到请求头
String signature = FddCryptUtil.sign(sortParam, request.getHeader(RequestConstants.TIMESTAMP), fascConfig.getAppSecret());
if (StringUtils.equals(signature, request.getHeader(RequestConstants.SIGN))) {
return false;
}
// 表示验签失败:
return true;
}
} }
...@@ -763,7 +763,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -763,7 +763,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
//1.9.16社保自动化校验逻辑 //1.9.16社保自动化校验逻辑
if (employeeRegistrationPre.getServerItem().contains("社保购买")) { if (employeeRegistrationPre.getServerItem().contains("社保")) {
//根据身份证号码和项目编号查询合同 //根据身份证号码和项目编号查询合同
TEmployeeAutoRegistCheckVo cardVo = new TEmployeeAutoRegistCheckVo(); TEmployeeAutoRegistCheckVo cardVo = new TEmployeeAutoRegistCheckVo();
cardVo.setEmpIdcard(employeeRegistrationPre.getEmpIdcard()); cardVo.setEmpIdcard(employeeRegistrationPre.getEmpIdcard());
......
...@@ -60,6 +60,7 @@ security: ...@@ -60,6 +60,7 @@ security:
- /tgzempinfo/saveTGzEmpInfo - /tgzempinfo/saveTGzEmpInfo
- /gz/core/saveOfferInfo - /gz/core/saveOfferInfo
- /gz/core/getGzBank - /gz/core/getGzBank
- /fasc/api/fascCallback
# 文件上传相关 支持阿里云、华为云、腾讯、minio # 文件上传相关 支持阿里云、华为云、腾讯、minio
......
...@@ -8,7 +8,6 @@ spring: ...@@ -8,7 +8,6 @@ spring:
on-profile: dev on-profile: dev
redis: redis:
host: 127.0.0.1 host: 127.0.0.1
password: '@yf_2017'
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
......
...@@ -643,7 +643,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -643,7 +643,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} }
} }
//1.9.16社保自动化校验逻辑 //1.9.16社保自动化校验逻辑
if (preVo.getServerItem().contains("社保购买")) { if (preVo.getServerItem().contains("社保")) {
//根据身份证号码和项目编号查询合同 //根据身份证号码和项目编号查询合同
R<Boolean> socialFlag = socialDaprUtils.selectExitEmpSocial(cardVo); R<Boolean> socialFlag = socialDaprUtils.selectExitEmpSocial(cardVo);
//是否已签署为是需要判断合同是否在用或者流程中 //是否已签署为是需要判断合同是否在用或者流程中
...@@ -706,7 +706,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -706,7 +706,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initContractPreInfo(registration, preVo.getEmployeeContractPreVos(), user, domainR.getData()); initContractPreInfo(registration, preVo.getEmployeeContractPreVos(), user, domainR.getData());
} }
//服务类型包含社保购买时 //服务类型包含社保购买时
if (preVo.getServerItem().contains("社保购买") && (null != preVo.getExitSocialInfoList() if (preVo.getServerItem().contains("社保") && (null != preVo.getExitSocialInfoList()
|| null != preVo.getDispatchInfoPreVo())) { || null != preVo.getDispatchInfoPreVo())) {
//生成社保待购买或者已购买数据 //生成社保待购买或者已购买数据
if (null != preVo.getDispatchInfoPreVo()) { if (null != preVo.getDispatchInfoPreVo()) {
...@@ -990,7 +990,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -990,7 +990,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} }
//1.9.16社保自动化校验逻辑 //1.9.16社保自动化校验逻辑
if (preVo.getServerItem().contains("社保购买") && null != preVo.getDispatchInfoPreVo()) { if (preVo.getServerItem().contains("社保") && null != preVo.getDispatchInfoPreVo()) {
//根据身份证号码和项目编号查询合同 //根据身份证号码和项目编号查询合同
flag = socialDaprUtils.selectExitEmpSocial(cardVo); flag = socialDaprUtils.selectExitEmpSocial(cardVo);
//是否已签署为否需要判断是否在用或者流程中的合同 //是否已签署为否需要判断是否在用或者流程中的合同
...@@ -1044,7 +1044,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1044,7 +1044,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initContractPreInfo(registration, employeeContractPreVo, user, domainR.getData()); initContractPreInfo(registration, employeeContractPreVo, user, domainR.getData());
} }
//服务类型包含社保购买时 //服务类型包含社保购买时
if (preVo.getServerItem().contains("社保购买") && (null != preVo.getExitSocialInfoList() if (preVo.getServerItem().contains("社保") && (null != preVo.getExitSocialInfoList()
|| null != preVo.getDispatchInfoPreVo())) { || null != preVo.getDispatchInfoPreVo())) {
//生成社保待购买或者已购买数据 //生成社保待购买或者已购买数据
if (null != preVo.getDispatchInfoPreVo()) { if (null != preVo.getDispatchInfoPreVo()) {
...@@ -1206,7 +1206,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1206,7 +1206,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initContractPreInfo(registrationNow, employeeContractPreVo, user, domainR.getData()); initContractPreInfo(registrationNow, employeeContractPreVo, user, domainR.getData());
} }
//服务类型包含社保购买时 //服务类型包含社保购买时
if (preVo.getServerItem().contains("社保购买") && (null != preVo.getExitSocialInfoList() if (preVo.getServerItem().contains("社保") && (null != preVo.getExitSocialInfoList()
|| null != preVo.getDispatchInfoPreVo())) { || null != preVo.getDispatchInfoPreVo())) {
//生成社保待购买或者已购买数据 //生成社保待购买或者已购买数据
initSocialPreInfo(registrationNow, preVo.getDispatchInfoPreVo(), user, domainR.getData()); initSocialPreInfo(registrationNow, preVo.getDispatchInfoPreVo(), user, domainR.getData());
...@@ -1713,6 +1713,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1713,6 +1713,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setJoinLeaveDate(registration.getJoinLeaveDate()); preVo.setJoinLeaveDate(registration.getJoinLeaveDate());
preVo.setDeptNo(registration.getDeptNo()); preVo.setDeptNo(registration.getDeptNo());
preVo.setEmpName(registration.getEmployeeName()); preVo.setEmpName(registration.getEmployeeName());
preVo.setPhone(registration.getEmpPhone());
preVo.setPosition(registration.getPosition()); preVo.setPosition(registration.getPosition());
preVo.setEmpIdcard(registration.getEmpIdcard()); preVo.setEmpIdcard(registration.getEmpIdcard());
preVo.setCreateBy(user.getId()); preVo.setCreateBy(user.getId());
...@@ -1720,13 +1721,18 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1720,13 +1721,18 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setUpdateBy(user.getId()); preVo.setUpdateBy(user.getId());
preVo.setTypeSub(CommonConstants.ZERO_STRING); preVo.setTypeSub(CommonConstants.ZERO_STRING);
preVo.setProcessStatus(CommonConstants.ZERO_STRING); preVo.setProcessStatus(CommonConstants.ZERO_STRING);
preVo.setDispatchItem("养老、医疗、生育、失业、工伤、大病");
if (CommonConstants.ZERO_STRING.equals(preVo.getIsCreateDate()) && Common.isEmpty(preVo.getSocialStartDate())) {
preVo.setSocialStartDate(registration.getJoinLeaveDate());
}
//如果自动触发派增为是,计算派单发起时间和派单确认时间 //如果自动触发派增为是,计算派单发起时间和派单确认时间
if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis()) if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
&& Common.isNotNull(preVo.getExpectedCollectionType())) { && Common.isNotNull(preVo.getExpectedCollectionType())) {
TEmployeeContractDateVo vo = new TEmployeeContractDateVo(); TEmployeeContractDateVo vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(preVo.getExpectedCollectionType())); vo.setMonthAfter(Integer.parseInt(preVo.getExpectedCollectionType()));
vo.setYearAfter(0); vo.setYearAfter(0);
vo.setRegistDate(preVo.getJoinLeaveDate()); vo.setRegistDate(registration.getJoinLeaveDate());
Date date = this.addYearsMonths(vo); Date date = this.addYearsMonths(vo);
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo(); TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING); dayVo.setType(CommonConstants.TWO_STRING);
......
...@@ -5,7 +5,6 @@ spring: ...@@ -5,7 +5,6 @@ spring:
matching-strategy: ant_path_matcher matching-strategy: ant_path_matcher
redis: redis:
host: 127.0.0.1 host: 127.0.0.1
password: '@yf_2017'
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
......
...@@ -49,6 +49,14 @@ public class TDispatchInfoPre extends BaseEntity { ...@@ -49,6 +49,14 @@ public class TDispatchInfoPre extends BaseEntity {
@ExcelProperty("身份证号") @ExcelProperty("身份证号")
@Schema(description = "身份证号") @Schema(description = "身份证号")
private String empIdcard; private String empIdcard;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 20)
@Length(max = 20, message = "手机号码不能超过20个字符")
@ExcelProperty("手机号码")
@Schema(description = "手机号码")
private String phone;
/** /**
* 社保购买状态,0待确认,1待派单,2派单失败,3待审核,4审核不通过,5待办理,6办理中,7办理成功,8办理失败,9部分办理失败 * 社保购买状态,0待确认,1待派单,2派单失败,3待审核,4审核不通过,5待办理,6办理中,7办理成功,8办理失败,9部分办理失败
*/ */
...@@ -385,7 +393,16 @@ public class TDispatchInfoPre extends BaseEntity { ...@@ -385,7 +393,16 @@ public class TDispatchInfoPre extends BaseEntity {
@Schema(description = "派单id") @Schema(description = "派单id")
private String dispatcherId; private String dispatcherId;
/**
* 社保公积金查询id
*/
@ExcelAttribute(name = "社保公积金查询id")
@ExcelProperty("社保公积金查询id")
@Schema(description = "社保公积金查询id")
private String socialFundId;
@Schema(description = "发起失败原因") @Schema(description = "发起失败原因")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String errorInfo; private String errorInfo;
@Schema(description = "发起失败时间") @Schema(description = "发起失败时间")
...@@ -393,6 +410,7 @@ public class TDispatchInfoPre extends BaseEntity { ...@@ -393,6 +410,7 @@ public class TDispatchInfoPre extends BaseEntity {
private Date errorTime; private Date errorTime;
@Schema(description = "派单审核/办理不通过原因") @Schema(description = "派单审核/办理不通过原因")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String errorBackInfo; private String errorBackInfo;
/** /**
......
...@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.social.vo; ...@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -16,7 +15,7 @@ import java.time.LocalDateTime; ...@@ -16,7 +15,7 @@ import java.time.LocalDateTime;
* @date 2025-09-30 16:40:07 * @date 2025-09-30 16:40:07
*/ */
@Data @Data
public class TDispatchInfoPreExportVo extends RowIndex implements Serializable { public class TDispatchInfoPreExportVo implements Serializable {
/** /**
* 项目名称 * 项目名称
*/ */
......
...@@ -203,6 +203,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -203,6 +203,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
if (Common.isNotNull(preVo.getExpectedConfirmTime())) { if (Common.isNotNull(preVo.getExpectedConfirmTime())) {
pre.setExpectedConfirmTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedConfirmTime())); pre.setExpectedConfirmTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedConfirmTime()));
} }
if (Common.isEmpty(pre.getDispatchItem())) {
preVo.setDispatchItem("养老、医疗、生育、失业、工伤、大病");
}
//如果自动触发派增为是,计算派单发起时间和派单确认时间 //如果自动触发派增为是,计算派单发起时间和派单确认时间
if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis()) if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
&& Common.isNotNull(preVo.getExpectedCollectionType()) && Common.isEmpty(preVo.getExpectedCollectionTime())) { && Common.isNotNull(preVo.getExpectedCollectionType()) && Common.isEmpty(preVo.getExpectedCollectionTime())) {
...@@ -339,7 +342,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -339,7 +342,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
if (Common.isNotNull(disList)) { if (Common.isNotNull(disList)) {
//调用批量派单接口100条处理一次,同原合同派单保持一致 //调用批量派单接口100条处理一次,同原合同派单保持一致
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
dispatchInfoService.importTDispatchInfo(excelVOList, errorMessageList,user, null, new HashMap<>()); dispatchInfoService.importTDispatchInfo(disList, errorMessageList,user, null, new HashMap<>());
if (!errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) { if (!errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) {
errorMessageListAll.addAll(errorMessageList); errorMessageListAll.addAll(errorMessageList);
//更新社保状态为2发起失败 //更新社保状态为2发起失败
......
...@@ -40,6 +40,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -40,6 +40,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
...@@ -174,6 +175,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -174,6 +175,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Autowired @Autowired
private TSocialFriendBackLogService socialFriendBackLogService; private TSocialFriendBackLogService socialFriendBackLogService;
@Autowired
private WxConfig wxConfig;
/** /**
* 派单信息记录表简单分页查询 * 派单信息记录表简单分页查询
* *
...@@ -650,7 +654,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -650,7 +654,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 开始插入各种数据了 // 开始插入各种数据了
insertAllInfo(excelVOList, errorMessageList, empVoMap, res, socialsMap, fundsMap, socialFundAddMap, dispatchMap, excelVOTemp, dispatchPart, injury); insertAllInfo(excelVOList, errorMessageList, empVoMap, res, socialsMap, fundsMap, socialFundAddMap, dispatchMap, excelVOTemp, dispatchPart, injury);
// 清理map list 等数据 // 清理map list 等数据
Common.clear(excelVOList); // Common.clear(excelVOList);
Common.clear(empAddsMap); Common.clear(empAddsMap);
Common.clear(contractsMap); Common.clear(contractsMap);
Common.clear(projectsMap); Common.clear(projectsMap);
...@@ -1139,7 +1143,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1139,7 +1143,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectById(preId); TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectById(preId);
if (Common.isNotNull(dispatchInfoPre)) { if (Common.isNotNull(dispatchInfoPre)) {
dispatchInfoPre.setProcessStatus(CommonConstants.THREE_STRING); dispatchInfoPre.setProcessStatus(CommonConstants.THREE_STRING);
dispatchInfoPre.setDispatcherId(socialFund.getId()); dispatchInfoPre.setDispatcherId(socialFund.getDispatchId());
dispatchInfoPre.setSocialFundId(socialFund.getId());
dispatchInfoPre.setErrorInfo(null); dispatchInfoPre.setErrorInfo(null);
dispatchInfoPre.setErrorTime(null); dispatchInfoPre.setErrorTime(null);
dispatchInfoPreMapper.updateById(dispatchInfoPre); dispatchInfoPreMapper.updateById(dispatchInfoPre);
...@@ -3688,7 +3693,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3688,7 +3693,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (null != socialInfo) { if (null != socialInfo) {
//派单审核通过更新社保待购买表的状态 //派单审核通过更新社保待购买表的状态
TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda() TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getDispatcherId, sf.getId()) .eq(TDispatchInfoPre::getSocialFundId, sf.getId())
.eq(TDispatchInfoPre::getProcessStatus, CommonConstants.THREE_STRING) .eq(TDispatchInfoPre::getProcessStatus, CommonConstants.THREE_STRING)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
// 派增审核 // 派增审核
...@@ -3704,6 +3709,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3704,6 +3709,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//审核通过更新状态 //审核通过更新状态
if (Common.isNotNull(dispatchInfoPre)) { if (Common.isNotNull(dispatchInfoPre)) {
dispatchInfoPre.setProcessStatus(CommonConstants.FIVE_STRING); dispatchInfoPre.setProcessStatus(CommonConstants.FIVE_STRING);
dispatchInfoPre.setErrorBackInfo(null);
dispatchInfoPreMapper.updateById(dispatchInfoPre); dispatchInfoPreMapper.updateById(dispatchInfoPre);
} }
//派增审核不通过 需要处理预估数据 //派增审核不通过 需要处理预估数据
...@@ -3723,6 +3729,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3723,6 +3729,7 @@ 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);
} }
} }
socialInfo.setAuditTime(now); socialInfo.setAuditTime(now);
...@@ -4422,23 +4429,50 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4422,23 +4429,50 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
//针对社保自动化过来的数据,办理更新待购买数据状态 //针对社保自动化过来的数据,办理更新待购买数据状态
TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda() TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getDispatcherId, sf.getId()) .eq(TDispatchInfoPre::getSocialFundId, sf.getId())
.eq(TDispatchInfoPre::getProcessStatus, CommonConstants.FIVE_STRING) .eq(TDispatchInfoPre::getProcessStatus, CommonConstants.FIVE_STRING)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(dispatchInfoPre)) { if (Common.isNotNull(dispatchInfoPre)) {
//此处状态可能会更新为 办理成功 办理中 部分办理失败和办理失败 //此处状态可能会更新为 办理成功 办理中 部分办理失败和办理失败
if (sf.getSocialStatus().equals(CommonConstants.TWO_STRING)) { if (sf.getSocialStatus().equals(CommonConstants.TWO_STRING)) {
dispatchInfoPre.setProcessStatus(CommonConstants.SIX_STRING); dispatchInfoPre.setProcessStatus(CommonConstants.SIX_STRING);
dispatchInfoPre.setErrorBackInfo(null);
} }
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);
StringBuffer errorTemp = new StringBuffer();
//针对部分办理失败更新社保待购买的派单项
if (CommonConstants.TWO_STRING.equals(sf.getPensionHandle())) {
errorTemp.append(DispatchConstants.DISPATCH_PENSION);
}
if (CommonConstants.TWO_STRING.equals(sf.getMedicalHandle())) {
errorTemp.append(DispatchConstants.DISPATCH_MEDICAL);
}
if (CommonConstants.TWO_STRING.equals(sf.getBirthHandle())) {
errorTemp.append(DispatchConstants.DISPATCH_BIRTH);
}
if (CommonConstants.TWO_STRING.equals(sf.getWorkInjuryHandle())) {
errorTemp.append(DispatchConstants.DISPATCH_INJURY);
}
if (CommonConstants.TWO_STRING.equals(sf.getUnemployHandle())) {
errorTemp.append(DispatchConstants.DISPATCH_UNEMP);
}
if (CommonConstants.TWO_STRING.equals(sf.getBigailmentHandle())) {
errorTemp.append(DispatchConstants.DISPATCH_BIGMAILMENT);
}
if (Common.isNotNull(errorTemp.toString())) {
dispatchInfoPre.setDispatchItem(errorTemp.deleteCharAt(errorTemp.length() - 1).toString());
}
sendDisFalureMessageToWx(dispatchInfoPre);
} }
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 (sf.getSocialStatus().equals(CommonConstants.THREE_STRING)) { if (sf.getSocialStatus().equals(CommonConstants.THREE_STRING)) {
dispatchInfoPre.setErrorBackInfo(null);
dispatchInfoPre.setProcessStatus(CommonConstants.SEVEN_STRING); dispatchInfoPre.setProcessStatus(CommonConstants.SEVEN_STRING);
} }
dispatchInfoPreMapper.updateById(dispatchInfoPre); dispatchInfoPreMapper.updateById(dispatchInfoPre);
...@@ -8784,4 +8818,45 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8784,4 +8818,45 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
return R.failed("未找到反馈文件"); return R.failed("未找到反馈文件");
} }
//发送企业微信待办
private void sendDisFalureMessageToWx(TDispatchInfoPre pre) {
//获取前端客服
SysUser user;
if (Common.isEmpty(pre.getCustomerUserLoginName())) {
return;
}
R<SysUser> res = upmsDaprUtils.getSimpleUserByLoginName(pre.getCustomerUserLoginName());
if (Common.isNotNull(res) && Common.isNotNull(res.getData())) {
user = res.getData();
} else {
return;
}
StringBuilder sendUser = null;
if (Common.isNotKong(user.getWxMessage())) {
sendUser = new StringBuilder(user.getWxMessage());
}
if (sendUser != null) {
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = 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());
StringBuilder description = new StringBuilder();
String title = "作业自动化——社保办理失败提醒";
description.append(pre.getEmpName()).append("-").append(pre.getEmpIdcard()).append("-")
.append(pre.getPhone()).append(",社保派单审核/办理失败").append("<br>");
description.append("请及时处理,以免产生用工风险!").append("<br>");
textcard.put("title", title);
textcard.put("url", authUrl);
textcard.put("description", description.toString());
requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid());
requestMap.put("msgtype", "textcard");
requestMap.put("textcard", textcard);
// 必须加上header说明
if (!wxConfig.sendTextCard(restTemplate, requestMap)) {
wxConfig.sendTextCard(restTemplate, requestMap);
}
}
}
} }
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<result property="contractStatus" column="CONTRACT_STATUS"/> <result property="contractStatus" column="CONTRACT_STATUS"/>
<result property="contractId" column="CONTRACT_ID"/> <result property="contractId" column="CONTRACT_ID"/>
<result property="dispatcherId" column="DISPATCHER_ID"/> <result property="dispatcherId" column="DISPATCHER_ID"/>
<result property="socialFundId" column="SOCIAL_FUND_ID"/>
<result property="createBy" column="CREATE_BY"/> <result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/> <result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/> <result property="createName" column="CREATE_NAME"/>
...@@ -63,6 +64,7 @@ ...@@ -63,6 +64,7 @@
<result property="errorBackInfo" column="error_back_info"/> <result property="errorBackInfo" column="error_back_info"/>
<result property="errorTime" column="error_time"/> <result property="errorTime" column="error_time"/>
<result property="position" column="position"/> <result property="position" column="position"/>
<result property="phone" column="phone"/>
</resultMap> </resultMap>
<resultMap id="tDispatchInfoPreExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo"> <resultMap id="tDispatchInfoPreExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo">
...@@ -131,7 +133,7 @@ ...@@ -131,7 +133,7 @@
a.CREATE_NAME, a.CREATE_NAME,
a.UPDATE_TIME, a.UPDATE_TIME,
a.CREATE_TIME, a.CREATE_TIME,
a.DELETE_FLAG,error_info,error_time,a.DISPATCHER_ID,a.error_back_info,a.position a.DELETE_FLAG,error_info,error_time,a.DISPATCHER_ID,a.error_back_info,a.position,SOCIAL_FUND_ID,a.phone
</sql> </sql>
<sql id="tDispatchInfoPre_where"> <sql id="tDispatchInfoPre_where">
<if test="tDispatchInfoPre != null"> <if test="tDispatchInfoPre != null">
...@@ -202,6 +204,9 @@ ...@@ -202,6 +204,9 @@
</if> </if>
<if test="tDispatchInfoPre.contractStatus != null and tDispatchInfoPre.contractStatus.trim() != ''"> <if test="tDispatchInfoPre.contractStatus != null and tDispatchInfoPre.contractStatus.trim() != ''">
AND a.CONTRACT_STATUS = #{tDispatchInfoPre.contractStatus} AND a.CONTRACT_STATUS = #{tDispatchInfoPre.contractStatus}
</if>
<if test="tDispatchInfoPre.failType != null and tDispatchInfoPre.failType.trim() != ''">
AND a.error_info is not null
</if> </if>
<if test="tDispatchInfoPre.authSql != null and tDispatchInfoPre.authSql.trim() != ''"> <if test="tDispatchInfoPre.authSql != null and tDispatchInfoPre.authSql.trim() != ''">
${tDispatchInfoPre.authSql} ${tDispatchInfoPre.authSql}
...@@ -290,7 +295,7 @@ ...@@ -290,7 +295,7 @@
(@i :=@i+1) as rowIndex, (@i :=@i+1) as rowIndex,
a.EMP_NAME empName, a.EMP_NAME empName,
a.EMP_IDCARD empIdcard, a.EMP_IDCARD empIdcard,
a.dept_no deptNo, a.dept_no settleDomainCode,
a.RECORD_BASE recordBase, a.RECORD_BASE recordBase,
a.SOCIAL_HOUSEHOLD_NAME socialHousehold, a.SOCIAL_HOUSEHOLD_NAME socialHousehold,
if(a.IS_CREATE_DATE = '0',a.SOCIAL_START_DATE,a.PENSION_START) as pensionStart, if(a.IS_CREATE_DATE = '0',a.SOCIAL_START_DATE,a.PENSION_START) as pensionStart,
...@@ -307,6 +312,7 @@ ...@@ -307,6 +312,7 @@
if(a.PAYMENT_TYPE = '1',BIRTH_CARDINAL,null) as birthCardinal, if(a.PAYMENT_TYPE = '1',BIRTH_CARDINAL,null) as birthCardinal,
if(a.PAYMENT_TYPE = '1',BIGAILMENT_CARDINAL,null) as bigailmentCardinal, if(a.PAYMENT_TYPE = '1',BIGAILMENT_CARDINAL,null) as bigailmentCardinal,
a.id preId, a.id preId,
a.TRUST_REMARK trustRemark,
a.CUSTOMER_USER_LOGIN_NAME as preLoginName, a.CUSTOMER_USER_LOGIN_NAME as preLoginName,
if(#{type} = '1',concat('手动派单-',a.customer_username),concat('自动化派单-',a.customer_username)) preName if(#{type} = '1',concat('手动派单-',a.customer_username),concat('自动化派单-',a.customer_username)) preName
FROM t_dispatch_info_pre a,(select @i:=0) as itable FROM t_dispatch_info_pre a,(select @i:=0) as itable
......
...@@ -1238,6 +1238,7 @@ ...@@ -1238,6 +1238,7 @@
<select id="selectSocialFundInfoCountByEmpIdcard" resultType="java.lang.Long"> <select id="selectSocialFundInfoCountByEmpIdcard" resultType="java.lang.Long">
SELECT count(1) SELECT count(1)
FROM t_social_fund_info a FROM t_social_fund_info a
inner join t_dispatch_info d on a.DISPATCH_ID = d.ID
where a.EMP_IDCARD = #{empIdcard} where a.EMP_IDCARD = #{empIdcard}
and a.social_status in ('0', '1', '2', '3', '4', '6', '7', '9', '11', '12') and a.social_status in ('0', '1', '2', '3', '4', '6', '7', '9', '11', '12')
</select> </select>
......
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