Commit 5645ad17 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent 9c1f2c44
......@@ -19,11 +19,18 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fadada.api.bean.rsp.sign.SignUrlRsp;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddContractAttachInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddContractInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.FddUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
......@@ -32,6 +39,11 @@ import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* 法大大合同与员工合同信息
......@@ -48,6 +60,8 @@ public class FddContractInfoController {
private final FddContractInfoService fddContractInfoService;
private final FddContractAttachInfoService fddContractAttachInfoService;
/**
* 分页查询
* @param page 分页对象
......@@ -123,6 +137,133 @@ public class FddContractInfoController {
@SysLog("发送法大大电子合同定稿任务" )
@PostMapping("/send")
public R<String> send(FddContractInfo fddContractInfo) throws ApiException {
return fddContractInfoService.saveEmpContract(fddContractInfo);
FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoService.getById(fddContractInfo.getId());
return fddContractInfoService.saveEmpContract(fddContractAttachInfo);
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description:作废重签
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "作废重签", description = "作废重签")
@PostMapping("/invalidAndsend")
public R<String> invalidAndsend(FddContractInfo fddContractInfo) throws ApiException {
return fddContractInfoService.invalidAndsend(fddContractInfo);
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description:公司获取在线定稿地址
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "公司获取在线定稿地址", description = "公司获取在线定稿地址")
@PostMapping("/getCompanyFillFileUrl")
public R<String> getCompanyFillFileUrl(FddContractInfo fddContractInfo) throws ApiException {
return fddContractInfoService.getFillFileUrl(fddContractInfo, FddUtil.COMPANY);
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 员工获取在线定稿地址
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "员工获取在线定稿地址", description = "员工获取在线定稿地址")
@PostMapping("/getPersonFillFileUrl")
public R<String> getPersonFillFileUrl(FddContractInfo fddContractInfo) throws ApiException {
return fddContractInfoService.getFillFileUrl(fddContractInfo, FddUtil.PERSON);
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 引用模板创建签署任务
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "引用模板创建签署任务", description = "引用模板创建签署任务")
@PostMapping("/createTaskByDraftId")
public R<String> createTaskByDraftId(FddContractInfo fddContractInfo) throws ApiException {
//获取法大大电子合同
FddContractInfo entity = fddContractInfoService.getById(fddContractInfo.getId());
if (entity == null) {
return R.failed("未查询到相关记录");
}
YifuUser user = SecurityUtils.getUser();
FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoService.getOne(Wrappers.<FddContractAttachInfo>query().lambda()
.eq(FddContractAttachInfo::getContractId,entity.getContractId()));
if (!user.getId().equals(fddContractAttachInfo.getCreateBy())) {
return R.failed("当前用户不是电子合同导入用户,不能操作");
}
R<String> returnR = fddContractInfoService.createTaskByDraftId(entity);
if (returnR != null) {
//记录返回信息
if(returnR.getCode()== CommonConstants.SUCCESS){
fddContractInfo.setRemark("成功");
}else {
fddContractInfo.setRemark(returnR.getMsg());
}
}
fddContractInfoService.updateById(fddContractInfo);
return returnR;
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 获取签署链接
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "获取签署链接", description = "获取签署链接")
@PostMapping("/getSignUrl")
public R<Map<String, List<SignUrlRsp>>> getSignUrl(FddContractInfo fddContractInfo) throws ApiException {
return fddContractInfoService.getSignUrl(fddContractInfo);
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 获取签署文件预览地址
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "获取签署文件预览地址", description = "获取签署文件预览地址")
@PostMapping("/getSignPreviewUrl")
public R<String> getSignPreviewUrl(FddContractInfo fddContractInfo) throws ApiException {
return fddContractInfoService.getSignPreviewUrl(fddContractInfo);
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 签署文件下载
**/
@Operation(summary = "签署文件下载", description = "签署文件下载")
@PostMapping("/getBySignFileId")
public void getBySignFileId(FddContractInfo fddContractInfo, HttpServletResponse response) throws ApiException, IOException {
fddContractInfoService.getBySignFileId(fddContractInfo, response);
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 签署文件转移为合同附件
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "签署文件转移为合同附件", description = "签署文件转移为合同附件")
@PostMapping("/moveFileToEmpConcat")
public R<String> moveFileToEmpConcat(FddContractInfo fddContractInfo, HttpServletResponse response) throws ApiException, IOException {
return fddContractInfoService.moveFileToEmpConcat(fddContractInfo, response);
}
}
......@@ -17,12 +17,18 @@
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fadada.api.bean.rsp.sign.SignUrlRsp;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* 法大大合同与员工合同信息
*
......@@ -31,5 +37,77 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
*/
public interface FddContractInfoService extends IService<FddContractInfo> {
R<String> saveEmpContract(FddContractInfo fddContractInfo) throws ApiException;
/**
* 发送法大大电子合同定稿任务
* @param fddContractInfo 法大大合同信息表
* @Author: huyc
* @Date: 2022/6/30
* @return R
*/
R<String> saveEmpContract(FddContractAttachInfo fddContractInfo) throws ApiException;
/**
* 作废重签
* @param fddContractInfo 法大大合同信息表
* @Author: huyc
* @Date: 2022/6/30
* @return R
*/
R<String> invalidAndsend(FddContractInfo fddContractInfo) throws ApiException;
/**
* 获取在线定稿地址
* @param fddContractInfo
* @param roleName
* @Author: huyc
* @Date: 2022/6/30
* @return R
*/
R<String> getFillFileUrl(FddContractInfo fddContractInfo,String roleName) throws ApiException;
/**
* 引用模板创建签署任务
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @return R
*/
R<String> createTaskByDraftId(FddContractInfo fddContractInfo) throws ApiException;
/**
* 获取签署链接
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @return R
*/
R<Map<String, List<SignUrlRsp>>> getSignUrl(FddContractInfo fddContractInfo) throws ApiException;
/**
* 获取签署链接
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @return R
*/
R<String> getSignPreviewUrl(FddContractInfo fddContractInfo) throws ApiException;
/**
* 获取签署链接
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @return: void
*/
void getBySignFileId(FddContractInfo fddContractInfo, HttpServletResponse response) throws ApiException, IOException;
/**
* 签署文件转移为合同附件
* @param fddContractInfo
* @param response
* @Author: huyc
* @Date: 2022/6/30
* @return: R
**/
R<String> moveFileToEmpConcat(FddContractInfo fddContractInfo, HttpServletResponse response) throws ApiException, IOException;
}
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