Commit 8d634168 authored by fangxinjiang's avatar fangxinjiang

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

parents bb381cc3 809dd843
......@@ -289,6 +289,11 @@ public class TEmployeeContractPre extends BaseEntity {
@TableField(exist = false)
private List<TAttaInfo> attaList;
@Schema(description = "超期标识 0已超期 1未超期")
private String overFlag;
@Schema(description = "催办标识 0已催办 1未催办")
private String isUrg;
@Schema(description = "法大大模版ID")
private String fadadaTemplateId;
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
......@@ -172,6 +173,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "入职日期", isDate = true)
@Schema(description = "入职日期")
@ExcelProperty("入职日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date joinLeaveDate;
/**
* 前端客服姓名
......@@ -193,6 +195,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "预计派单时间", isDate = true)
@Schema(description = "预计派单时间")
@ExcelProperty("预计派单时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date expectedCollectionTime;
/**
* 预计派单时间
......@@ -205,6 +208,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "派单确认时间", isDate = true)
@Schema(description = "派单确认时间")
@ExcelProperty("派单确认时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date expectedConfirmTime;
/**
* 是否自动触发派增 0 是 1否
......@@ -247,6 +251,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "起缴日期", isDate = true)
@Schema(description = "起缴日期")
@ExcelProperty("起缴日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date socialStartDate;
/**
* 养老起缴日期
......@@ -254,6 +259,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "养老起缴日期", isDate = true)
@Schema(description = "养老起缴日期")
@ExcelProperty("养老起缴日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date pensionStart;
/**
* 医疗起缴日期
......@@ -261,6 +267,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "医疗起缴日期", isDate = true)
@Schema(description = "医疗起缴日期")
@ExcelProperty("医疗起缴日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date medicalStart;
/**
* 失业起缴日期
......@@ -268,6 +275,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "失业起缴日期", isDate = true)
@Schema(description = "失业起缴日期")
@ExcelProperty("失业起缴日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date unemployStart;
/**
* 工伤起缴日期
......@@ -275,6 +283,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "工伤起缴日期", isDate = true)
@Schema(description = "工伤起缴日期")
@ExcelProperty("工伤起缴日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date workInjuryStart;
/**
* 生育起缴日期
......@@ -282,6 +291,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "生育起缴日期", isDate = true)
@Schema(description = "生育起缴日期")
@ExcelProperty("生育起缴日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date birthStart;
/**
* 大病起缴日期
......@@ -289,6 +299,7 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "大病起缴日期", isDate = true)
@Schema(description = "大病起缴日期")
@ExcelProperty("大病起缴日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date bigailmentStart;
/**
* 委托备注
......
......@@ -2,21 +2,25 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fadada.api.utils.crypt.FddCryptUtil;
import com.fasc.open.api.constants.RequestConstants;
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.TFascPushLogService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
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.vo.YifuUser;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -24,8 +28,7 @@ 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;
import java.util.*;
/**
* @auther huyc
......@@ -43,9 +46,14 @@ public class FascController {
private FascConfig fascConfig;
private final TFascPushLogService tFascPushLogService;
private final TEmployeeContractPreService tEmployeeContractPreService;
private final TEmployeeContractInfoService tEmployeeContractInfoService;
private final TEmployeeContractAuditService tEmployeeContractAuditService;
private static String FASC_EVENT = "X-FASC-Event";
private static String FASC_BIZ_CONTENT = "bizContent";
private static String FASC_SUCCESS = "success";
private static String FASC_BIZ_CONTENT_STR = ";fddBizContent:";
/**
* @param templateName 签署任务模板名称,如果传了该参数,会根据名称模糊匹配查询,长度最大100个字符。
......@@ -109,9 +117,22 @@ public class FascController {
@Operation(description = "获取附件")
@GetMapping("/getFileByRequestId")
public R<String> getFileByRequestId(@RequestParam String id) throws ApiException {
return fascService.getFileByRequestId(id);
boolean flag = fascService.getFileByRequestId(id);
return R.ok();
}
private YifuUser getNewYifuUser() {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser("2", 1L, "", "法大大电子签",
"法大大电子签", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null,null);
}
@Operation(summary = "异步通知", description = "异步通知")
@RequestMapping(value = "/api/fascCallback")
......@@ -134,29 +155,136 @@ public class FascController {
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");
// 任务ID
String signTaskId = jsonObject.getString("signTaskId");
// 原因
String terminationNote = jsonObject.getString("terminationNote");
// 操作人
String userName = jsonObject.getString("userName");
pushLog.setTypeKey("fddEvent:"+ fddEvent);
pushLog.setReturnData("初始无事件:fddEvent:" + fddEvent + "fddBizContent:" + fddBizContent);
if (Common.isNotNull(signTaskId)) {
// 根据requestId获取信息:
TEmployeeContractPre pre = tEmployeeContractPreService.getOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRequestId, signTaskId).last(CommonConstants.LAST_ONE_SQL));
YifuUser user = getNewYifuUser();
if (pre != null) {
TEmployeeContractInfo contractInfo = null;
if (Common.isNotNull(pre.getContractId())) {
//如果存在合同申请审核数据,将状态更新成待提交
contractInfo = tEmployeeContractInfoService.getById(pre.getContractId());
}
if (contractInfo != null) {
if (fddEvent.equals("sign-task-finished")) {
// 1:签署任务完成事件
// 8电子待归档
pre.setProcessStatus(CommonConstants.dingleDigitStrArray[8]);
// 加日志
this.saveAuditLogSuccess(pre, "签署成功");
// 尝试获取归档文件
boolean flag = fascService.getFileByRequestId(pre.getId());
contractInfo.setAuditStatus(CommonConstants.TWO_INT);
tEmployeeContractInfoService.auditContract(contractInfo, user);
if (flag) {
// 加日志
this.saveAuditLogSuccess(pre, "归档成功");
pre.setProcessStatus(CommonConstants.dingleDigitStrArray[9]);
contractInfo.setIsFile(CommonConstants.ZERO_STRING);
tEmployeeContractInfoService.updateById(contractInfo);
}
tEmployeeContractPreService.updateById(pre);
pushLog.setReturnData("签署任务完成事件:fddEvent:" + fddEvent + FASC_BIZ_CONTENT_STR + fddBizContent);
} else if (fddEvent.equals("sign-task-canceled") || fddEvent.equals("sign-task-abolish")) {
// 2:签署任务撤销事件 || 4:签署任务作废事件
if (fddEvent.equals("sign-task-canceled")) {
// 4:签署任务作废事件
pushLog.setReturnData("签署任务撤销事件:fddEvent:" + fddEvent + FASC_BIZ_CONTENT_STR + fddBizContent);
} else {
// 4:签署任务作废事件
pushLog.setReturnData("签署任务作废事件:fddEvent:" + fddEvent + FASC_BIZ_CONTENT_STR + fddBizContent);
}
//电子待归档、线下签待归档、已完结的不能撤销签署
if (Common.isNotNull(pre) && !CommonConstants.NINE_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.FOUR_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.EIGHT_STRING.equals(pre.getProcessStatus())) {
//如果不是待确认和待发起,需要记录操作记录
if (!CommonConstants.ZERO_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.ONE_STRING.equals(pre.getProcessStatus()) &&
Common.isNotNull(pre.getContractId())) {
// 加日志
this.saveAuditLogFail(pre, "撤销签署", terminationNote);
}
pre.setProcessStatus(CommonConstants.TEN_STRING);
pre.setSignFlag(CommonConstants.ZERO_STRING);
pre.setRevokeReason(terminationNote);
tEmployeeContractPreService.updateById(pre);
}
//如果存在合同申请审核数据,将状态更新成待提交
contractInfo.setAuditStatus(CommonConstants.ZERO_INT);
contractInfo.setInUse(CommonConstants.ONE_STRING);
tEmployeeContractInfoService.updateById(contractInfo);
} else if (fddEvent.equals("sign-task-sign-failed")) {
// 3:签署任务参与方签署失败事件
pre.setProcessStatus(CommonConstants.dingleDigitStrArray[7]);
pre.setRequestId("");
tEmployeeContractPreService.updateById(pre);
//如果存在合同申请审核数据,将状态更新成待提交
contractInfo.setAuditStatus(CommonConstants.ZERO_INT);
contractInfo.setInUse(CommonConstants.ONE_STRING);
tEmployeeContractInfoService.updateById(contractInfo);
// 加日志
this.saveAuditLogFail(pre, "签署失败", terminationNote);
pushLog.setReturnData("签署任务参与方签署失败事件:fddEvent:" + fddEvent + FASC_BIZ_CONTENT_STR + fddBizContent);
}
}
}
}
tFascPushLogService.updateById(pushLog);
return R.ok(null, FASC_SUCCESS);
}
return R.ok(null, "success");
return R.ok(null, FASC_SUCCESS);
}
// 加合同里的流程进展明细的日志——成功
public void saveAuditLogSuccess(TEmployeeContractPre tEmployeeContractPre, String rootName) {
// 加流程进展明细
if (tEmployeeContractPre != null && Common.isNotNull(tEmployeeContractPre.getContractId())) {
this.saveAuditLogInfo(tEmployeeContractPre.getContractId(), rootName, "审核通过", null);
}
}
// 加合同里的流程进展明细的日志——失败
public void saveAuditLogFail(TEmployeeContractPre tEmployeeContractPre, String rootName, String remark) {
// 加流程进展明细
if (tEmployeeContractPre != null && Common.isNotNull(tEmployeeContractPre.getContractId())) {
this.saveAuditLogInfo(tEmployeeContractPre.getContractId(), rootName, "审核不通过", remark);
}
}
// 加合同里的流程进展明细的日志
public void saveAuditLogInfo(String contractId, String rootName, String auditStatus, String remark) {
// 加流程进展明细
if (Common.isNotNull(contractId)) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName(rootName);
audit.setLinkId(contractId);
audit.setLinkType(CommonConstants.ONE_INT);
audit.setAuditStatus(auditStatus);
if (Common.isNotNull(remark)) {
audit.setRemark(remark);
}
audit.setCreateBy("1");
audit.setCreateName("法大大电子签");
tEmployeeContractAuditService.save(audit);
}
}
//验证签名,返回true表示失败
......
......@@ -267,7 +267,11 @@ public class TEmployeeContractInfoController {
@PostMapping("/filingContract")
@PreAuthorize("@pms.hasPermission('temployeecontractinfo_filing')")
public R<String> filingContract(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) {
return tEmployeeContractInfoService.filingContract(tEmployeeContractInfo);
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
return tEmployeeContractInfoService.filingContract(tEmployeeContractInfo, user);
}
/**
......
......@@ -284,4 +284,14 @@ public class TEmployeeContractPreController {
public R electronicSignExpiringReminder() {
return tEmployeeContractPreService.electronicSignExpiringReminder();
}
/**
* 一键催办
* @param idList 一键催办列表
**/
@Operation(description = "一键催办")
@PostMapping("/contractUrg")
public R contractUrg(@RequestBody List<String> idList) {
return tEmployeeContractPreService.contractUrg(idList);
}
}
......@@ -42,6 +42,6 @@ public interface FascService extends IService<FddContractInfo> {
// 催办签署任务
R<String> urgeTask(String id) throws ApiException;
// 获取附件
R<String> getFileByRequestId(String id) throws ApiException;
boolean getFileByRequestId(String id) throws ApiException;
}
......@@ -130,7 +130,7 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
* @Date: 2022/7/1 10:32
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> filingContract(TEmployeeContractInfo tEmployeeContractInfo);
R<String> filingContract(TEmployeeContractInfo tEmployeeContractInfo, YifuUser user);
/**
* @param inputStream
......
......@@ -97,4 +97,10 @@ public interface TEmployeeContractPreService extends IService<TEmployeeContractP
*/
R electronicSignExpiringReminder();
/**
* 合同待签订一键催办
* @param idList id集合
* @return
*/
R contractUrg(List<String> idList);
}
......@@ -21,11 +21,13 @@ import com.fasc.open.api.exception.ApiException;
import com.fasc.open.api.v5_1.res.template.SignTemplateListInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
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.utils.FascUtil;
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.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -51,6 +53,10 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
private final TFascTemplateService tFascTemplateService;
private final TFascTemplateDetailService tFascTemplateDetailService;
private final TEmployeeContractPreMapper tEmployeeContractPreMapper;
private final TAttaInfoMapper tAttaInfoMapper;
private final OSSUtil ossUtil;
private final static String FASC_NO_CONTRACT = "未找到合同";
@Override
public R<String> getTemplate(String templateName) throws ApiException {
......@@ -173,7 +179,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
// templateName 签署任务模板名称
TEmployeeContractPre contract = tEmployeeContractPreMapper.selectById(id);
if (contract == null) {
return R.failed("未找到合同");
return R.failed(FASC_NO_CONTRACT);
}
if (Common.isEmpty(contract.getFadadaTemplateId())) {
return R.failed("未找到合同模板ID,请联系管理员");
......@@ -212,7 +218,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
// templateName 签署任务模板名称
TEmployeeContractPre contract = tEmployeeContractPreMapper.selectById(id);
if (contract == null) {
return R.failed("未找到合同");
return R.failed(FASC_NO_CONTRACT);
}
if (Common.isEmpty(contract.getRequestId())) {
return R.failed("无requestId,请检查数据");
......@@ -235,7 +241,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
// templateName 签署任务模板名称
TEmployeeContractPre contract = tEmployeeContractPreMapper.selectById(id);
if (contract == null) {
return R.failed("未找到合同");
return R.failed(FASC_NO_CONTRACT);
}
if (Common.isEmpty(contract.getRequestId())) {
return R.failed("无requestId,请检查数据");
......@@ -253,20 +259,17 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> getFileByRequestId(String id) throws ApiException {
public boolean getFileByRequestId(String id) throws ApiException {
// templateName 签署任务模板名称
TEmployeeContractPre contract = tEmployeeContractPreMapper.selectById(id);
if (contract == null) {
return R.failed("未找到合同");
return false;
}
if (Common.isEmpty(contract.getRequestId())) {
return R.failed("无requestId,请检查数据");
// return R.failed("无requestId,请检查数据")
return false;
}
// TODO - 判断什么状态催办等,需要产品定
return fascUtil.getFileByRequestId(contract, tFascPushLogService, tEmployeeContractPreMapper);
return fascUtil.getFileByRequestId(contract, tFascPushLogService, tAttaInfoMapper, ossUtil);
}
......
......@@ -777,12 +777,19 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
@Override
public R<String> auditContract(TEmployeeContractInfo tEmployeeContractInfo, YifuUser user) {
// 是否电子签,默认否
boolean fascFlag = false;
if (tEmployeeContractInfo != null) {
if (Common.isEmpty(tEmployeeContractInfo.getId()) || Common.isEmpty(tEmployeeContractInfo.getAuditStatus())) {
return R.failed("id、意见必填");
}
TEmployeeContractInfo contractInfo = this.getById(tEmployeeContractInfo.getId());
if (contractInfo.getAuditStatus() != CommonConstants.ONE_INT) {
if (Common.isNotNull(contractInfo.getSignType()) && CommonConstants.ZERO_STRING.equals(contractInfo.getSignType())) {
fascFlag = true;
}
if (contractInfo.getAuditStatus() != CommonConstants.ONE_INT
&& !fascFlag) {
// 电子签的也要审核
return R.failed("不是待审核状态!");
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[2]) {
......@@ -802,11 +809,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.last(CommonConstants.LAST_ONE_SQL));
// 渲染字典值
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
Map<String, String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
String tempStr = null;
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getValue()) && entry.getValue().equals(contractInfo.getContractName())){
for (Map.Entry<String, String> entry : dicObj.entrySet()) {
if (Common.isNotNull(entry.getValue()) && entry.getValue().equals(contractInfo.getContractName())) {
tempStr = entry.getKey();
break;
}
......@@ -815,7 +822,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProject.setContractStatus(CommonConstants.ONE_INT);
//签订类型正常签订的时候更新项目档案信息
if (EmployeeConstants.SITUATION_ONE.equals(contractInfo.getSituation())) {
tEmployeeProject.setContractType(null == tempStr? "":tempStr);
tEmployeeProject.setContractType(null == tempStr ? "" : tempStr);
tEmployeeProject.setWorkingHours(contractInfo.getWorkingHours());
tEmployeeProject.setPost(contractInfo.getPost());
tEmployeeProject.setEnjoinDate(contractInfo.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
......@@ -842,7 +849,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TPreEmployeeProject preEmployeeProject = preEmployeeProjectMapper.selectOne(Wrappers.<TPreEmployeeProject>query()
.lambda().eq(TPreEmployeeProject::getPreMainId, empMain.getId()));
if (Optional.ofNullable(preEmployeeProject).isPresent()) {
preEmployeeProject.setContractType(null == tempStr? "":tempStr);
preEmployeeProject.setContractType(null == tempStr ? "" : tempStr);
preEmployeeProject.setWorkingHours(contractInfo.getWorkingHours());
preEmployeeProject.setPost(contractInfo.getPost());
preEmployeeProject.setEnjoinDate(contractInfo.getContractStart());
......@@ -856,7 +863,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation())
&& Common.isNotNull(contractInfo.getChangeContractAndEmployee())
&& CommonConstants.ZERO_STRING.equals(contractInfo.getChangeContractAndEmployee())) {
changeStatus(contractInfo,user);
changeStatus(contractInfo, user);
} else {
//先停用项目内的其他的员工合同————不要这个逻辑了
// 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
......@@ -909,14 +916,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
}
//更新合同状态为4线下签待归档
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, contractInfo.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.FOUR_STRING);
contractPreMapper.updateById(contractPre);
if (!fascFlag) {
//更新合同状态为4线下签待归档
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, contractInfo.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.FOUR_STRING);
contractPreMapper.updateById(contractPre);
}
}
//瓜子项目编码:皖A694302
if (CommonConstants.GZ_DEPT_NO.equals(contractInfo.getDeptNo())) {
......@@ -925,14 +934,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[3]) {
//更新合同状态为3线下签审核不通过
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, contractInfo.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.THREE_STRING);
contractPreMapper.updateById(contractPre);
if (!fascFlag) {
//更新合同状态为3线下签审核不通过
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, contractInfo.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.THREE_STRING);
contractPreMapper.updateById(contractPre);
}
}
}
tEmployeeContractInfo.setAuditUserName(user.getNickname());
......@@ -1018,11 +1029,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
@Override
public R<String> filingContract(TEmployeeContractInfo tEmployeeContractInfo) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
public R<String> filingContract(TEmployeeContractInfo tEmployeeContractInfo, YifuUser user) {
if (tEmployeeContractInfo != null) {
if ((Common.isNotNull(tEmployeeContractInfo.getContractNo()) && tEmployeeContractInfo.getContractNo().length() > 50)
|| (Common.isNotNull(tEmployeeContractInfo.getFileCabinetNo()) && tEmployeeContractInfo.getFileCabinetNo().length() > 50)) {
......
......@@ -947,6 +947,11 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
});
stats.setExpiringCount(stats.getExpiringCount() + 1);
}
//更新催办和超期标识标识
contract.setOverFlag(CommonConstants.ZERO_STRING);
if (Common.isEmpty(contract.getIsUrg())) {
contract.setIsUrg(CommonConstants.ONE_STRING);
}
}
}
}
......@@ -971,7 +976,29 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
return R.failed("执行电子签合同即将超期提醒任务时发生异常:" + e.getMessage());
}
}
@Override
public R contractUrg(List<String> idList) {
// 查询所有待催办的合同
List<TEmployeeContractPre> signingContracts = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query()
.lambda()
.eq(TEmployeeContractPre::getIsUrg, CommonConstants.ONE_STRING)
.in(TEmployeeContractPre::getId, idList)
);
if (Common.isNotNull(signingContracts) && signingContracts.size() > 0) {
try {
for (TEmployeeContractPre pre : signingContracts) {
fascService.urgeTask(pre.getId());
pre.setIsUrg(CommonConstants.ZERO_STRING);
baseMapper.updateById(pre);
}
} catch (Exception e) {
log.error("发送法大大催办时发生异常", e);
}
}
return R.ok();
}
/**
* 计算入职一个月最后一天往前3个工作日的日期列表
* @param lastDay 入职一个月的最后一天
......
......@@ -23,24 +23,26 @@ import com.fasc.open.api.v5_1.res.template.SignTemplateDetailRes;
import com.fasc.open.api.v5_1.res.template.SignTemplateListInfo;
import com.fasc.open.api.v5_1.res.template.SignTemplateListRes;
import com.yifu.cloud.plus.v1.yifu.archives.config.FascConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascPushLog;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascTemplate;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascTemplateDetail;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TFascPushLogService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
......@@ -609,8 +611,8 @@ public class FascUtil {
}
// 获取附件
public R<String> getFileByRequestId(TEmployeeContractPre contract, TFascPushLogService tFascPushLogService
, TEmployeeContractPreMapper tEmployeeContractPreMapper) throws ApiException {
public boolean getFileByRequestId(TEmployeeContractPre contract, TFascPushLogService tFascPushLogService
, TAttaInfoMapper tAttaInfoMapper , OSSUtil ossUtil) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
......@@ -639,25 +641,67 @@ public class FascUtil {
if (Common.isNotNull(res.getData()) && Common.isNotNull(res.getData().getDocs())) {
for (SignTaskGetFileRes.DocFileInfo doc : res.getData().getDocs()) {
if (Common.isNotNull(doc.getFddFileUrl())) {
// TODO-存储文档
//contract.setFileId(doc.getFileId());
// 存储文档
// 将法大大回传的url字符串转化为流,存储到阿里云
this.streamUpload(doc.getFddFileUrl(), ossUtil, tAttaInfoMapper, contract.getContractId(), doc.getDocName());
}
}
}
contract.setProcessStatus(CommonConstants.dingleDigitStrArray[9]);
tEmployeeContractPreMapper.updateById(contract);
return R.ok();
return true;
} else {
contract.setRequestMsg(res.getMsg());
tEmployeeContractPreMapper.updateById(contract);
return R.failed(res.getMsg());
return false;
}
}
return R.failed("res无返回");
return false;
}
public void streamUpload(String fileUrl, OSSUtil ossUtil, TAttaInfoMapper tAttaInfoMapper, String domainId, String fileName) {
InputStream inputStream = null;
HttpURLConnection connection = null;
try {
// 创建URL连接
URL url = new URL(fileUrl);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setConnectTimeout(30000);
connection.setReadTimeout(60000);
// 获取输入流
inputStream = connection.getInputStream();
String fileType = ".pdf";
fileName += fileType;
// Bucket 命名规范:1)只能包括小写字母,数字和短横线(-);2)必须以小写字母或者数字开头;3)长度必须在 3-63 字节之间。
String ossKey = "fasc/" + domainId + "/" + System.currentTimeMillis() + fileName;
// 直接流式上传到OSS
ossUtil.uploadFileByStream(inputStream, ossKey, null);
TAttaInfo unitAtta = new TAttaInfo();
unitAtta.setDomainId(domainId);
unitAtta.setRelationType(CommonConstants.FOUR_STRING);
unitAtta.setAttaName(fileName);
unitAtta.setAttaSrc(ossKey);
unitAtta.setAttaType(fileType);
unitAtta.setCreateTime(LocalDateTime.now());
unitAtta.setCreateName("法大大电子签");
tAttaInfoMapper.insert(unitAtta);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("法大大附件流式上传失败: " + e.getMessage());
} finally {
// 关闭资源
if (inputStream != null) {
try {
inputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
if (connection != null) {
connection.disconnect();
}
}
}
}
......@@ -61,6 +61,7 @@ security:
- /gz/core/saveOfferInfo
- /gz/core/getGzBank
- /fasc/api/fascCallback
- /fasc/getFileByRequestId
# 文件上传相关 支持阿里云、华为云、腾讯、minio
......
......@@ -88,6 +88,8 @@
<result property="contractSubName" column="CONTRACT_SUB_NAME"/>
<result property="requestId" column="request_id"/>
<result property="requestMsg" column="request_msg"/>
<result property="isUrg" column="is_urg"/>
<result property="overFlag" column="over_flag"/>
</resultMap>
<sql id="Base_Column_List">
id
......@@ -170,7 +172,7 @@
,TASK_TYPE
,TASK_END_STANDARD,contract_flag,a.CONTRACT_SUB_NAME
,a.request_id
,a.request_msg
,a.request_msg,a.over_flag,a.is_urg
</sql>
<sql id="tEmployeeContractPre_where">
<if test="tEmployeeContractPre != null">
......
......@@ -283,6 +283,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(preExit)) {
TDispatchInfoPreVo pre = new TDispatchInfoPreVo();
BeanUtils.copyProperties(preExit, pre);
preSocialListVo.setDispatchInfoPreVo(pre);
}
......
......@@ -4430,7 +4430,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//针对社保自动化过来的数据,办理更新待购买数据状态
TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getSocialFundId, sf.getId())
.eq(TDispatchInfoPre::getProcessStatus, CommonConstants.FIVE_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("5","6","9"))
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(dispatchInfoPre)) {
//此处状态可能会更新为 办理成功 办理中 部分办理失败和办理失败
......
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