修改了放心签的验证逻辑1

This commit is contained in:
wucongxing8150 2025-07-02 16:49:55 +08:00
parent d57329cf1c
commit 09b631436f
6 changed files with 45 additions and 42 deletions

View File

@ -45,7 +45,6 @@ public class Base {
public String postJson(String url, String jsonData, Map<String, String> headers) { public String postJson(String url, String jsonData, Map<String, String> headers) {
// 获取token // 获取token
String tokenKey = "fangxinqian:" + clientId; String tokenKey = "fangxinqian:" + clientId;
// redisTemplate.delete(tokenKey);
String token = redisTemplate.opsForValue().get(tokenKey); String token = redisTemplate.opsForValue().get(tokenKey);
if (token == null) { if (token == null) {
token = getAccessToken(); token = getAccessToken();
@ -55,7 +54,7 @@ public class Base {
HttpRequest request = HttpRequest.post(url) HttpRequest request = HttpRequest.post(url)
.body(jsonData) .body(jsonData)
.header("Content-Type", "application/json") .header("Content-Type", "application/json")
.header("Authorization", "Bearer " + token); .header("Authorization", String.format("Bearer %s",token));
if (headers != null) { if (headers != null) {
headers.forEach(request::header); headers.forEach(request::header);

View File

@ -23,7 +23,6 @@ public class FxqTask extends Base {
requestData.put("unionId", unionId); // 个人/企业主体在放心签平台与接入方关联的唯一性标识发起方账号 requestData.put("unionId", unionId); // 个人/企业主体在放心签平台与接入方关联的唯一性标识发起方账号
String jsonBody = JSONUtil.toJsonStr(requestData); String jsonBody = JSONUtil.toJsonStr(requestData);
log.info("获取app数据参数:{}",jsonBody);
String response = postJson(url,jsonBody,null); String response = postJson(url,jsonBody,null);
GetTemplateListResponse result = JSONUtil.toBean(response, GetTemplateListResponse.class); GetTemplateListResponse result = JSONUtil.toBean(response, GetTemplateListResponse.class);

View File

@ -158,9 +158,11 @@ public class ExpertFxqController {
// 签署任务详情查询 // 签署任务详情查询
FxqExpertTaskEntity fxqExpertTask = expertFxqService.getTaskDetail(expertId); FxqExpertTaskEntity fxqExpertTask = expertFxqService.getTaskDetail(expertId);
if (Objects.equals(fxqExpertTask.getTaskStatus(), "20")) { if (fxqExpertTask != null) {
// 已签署 if (Objects.equals(fxqExpertTask.getTaskStatus(), "20")) {
return ResponseDTO.userErrorParam("您已签订协议,无需再次签订"); // 已签署
return ResponseDTO.userErrorParam("您已签订协议,无需再次签订");
}
} }
// 获取签署的模版数据 // 获取签署的模版数据

View File

@ -298,6 +298,17 @@ public class ExpertFxqService {
@Transactional @Transactional
public AddFxqVo addTemplateTask(FxqCompanyEntity company, FxqUserEntity fxqUser, FxqTemplateEntity fxqTemplate,ExpertEntity expert){ public AddFxqVo addTemplateTask(FxqCompanyEntity company, FxqUserEntity fxqUser, FxqTemplateEntity fxqTemplate,ExpertEntity expert){
try { try {
// 授权处理
if (company.getAuthStatus() == 1){
if (company.getAuthExpireDate() != null && company.getAuthExpireDate().isBefore(LocalDateTime.now())) {
// 已授权但已过期
throw new BusinessException("操作失败:请联系客服人员更换授权");
}
}else{
// 未授权
throw new BusinessException("操作失败:请联系客服人员更换授权");
}
// 需创建模版任务 // 需创建模版任务
AddTemplateTaskRequest r = new AddTemplateTaskRequest(); AddTemplateTaskRequest r = new AddTemplateTaskRequest();
r.setUnionId(company.getUnionId()); r.setUnionId(company.getUnionId());
@ -318,28 +329,28 @@ public class ExpertFxqService {
r.setSigners(signersList); r.setSigners(signersList);
// 初始化 components 列表 // // 初始化 components 列表
List<AddTemplateTaskRequest.componentsData> componentsList = new ArrayList<>(); // List<AddTemplateTaskRequest.componentsData> componentsList = new ArrayList<>();
//
// 乙方姓名 // // 乙方姓名
AddTemplateTaskRequest.componentsData name = new AddTemplateTaskRequest.componentsData(); // AddTemplateTaskRequest.componentsData name = new AddTemplateTaskRequest.componentsData();
name.setFileKey("name"); // name.setFileKey("name");
name.setFileValue(fxqUser.getName()); // name.setFileValue(fxqUser.getName());
componentsList.add(name); // componentsList.add(name);
//
// 乙方工作单位 // // 乙方工作单位
AddTemplateTaskRequest.componentsData work = new AddTemplateTaskRequest.componentsData(); // AddTemplateTaskRequest.componentsData work = new AddTemplateTaskRequest.componentsData();
work.setFileKey("work"); // work.setFileKey("work");
work.setFileValue(expert.getHospitalName()); // work.setFileValue(expert.getHospitalName());
componentsList.add(work); // componentsList.add(work);
//
// 乙方联系电话 // // 乙方联系电话
AddTemplateTaskRequest.componentsData mobile = new AddTemplateTaskRequest.componentsData(); // AddTemplateTaskRequest.componentsData mobile = new AddTemplateTaskRequest.componentsData();
mobile.setFileKey("mobile"); // mobile.setFileKey("mobile");
mobile.setFileValue(expert.getMobile()); // mobile.setFileValue(expert.getMobile());
componentsList.add(mobile); // componentsList.add(mobile);
//
r.setComponents(componentsList); // r.setComponents(componentsList);
AddTemplateTaskResponse templateTask = fxqTask.addTemplateTask(r); AddTemplateTaskResponse templateTask = fxqTask.addTemplateTask(r);
if (templateTask.getData() == null) { if (templateTask.getData() == null) {
@ -350,17 +361,6 @@ public class ExpertFxqService {
throw new BusinessException("操作失败"); throw new BusinessException("操作失败");
} }
// 授权处理
if (company.getAuthStatus() == 1){
if (company.getAuthExpireDate() != null && company.getAuthExpireDate().isBefore(LocalDateTime.now())) {
// 已授权但已过期
throw new BusinessException("操作失败:请联系客服人员更换授权");
}
}else{
// 未授权
throw new BusinessException("操作失败:请联系客服人员更换授权");
}
// 获取签署链接 // 获取签署链接
GetTaskLinkResponse.taskDetailsData fxqLink = getTaskLink(templateTask.getData().getTaskNo(),fxqUser.getUnionId()); GetTaskLinkResponse.taskDetailsData fxqLink = getTaskLink(templateTask.getData().getTaskNo(),fxqUser.getUnionId());
if (fxqLink == null) { if (fxqLink == null) {
@ -456,7 +456,7 @@ public class ExpertFxqService {
// 修改专家签署任务表 // 修改专家签署任务表
if (taskLink.getData().getTaskStatus() == 20){ if (taskLink.getData().getTaskStatus() == 20){
int rows = fxqSignDao.updateSignStatus(fxqExpertTask.getExpertId(), taskId,2); int rows = fxqSignDao.updateSignStatus(fxqExpertTask.getExpertId(), taskId,1);
if (rows == 0) { if (rows == 0) {
throw new BusinessException("更新失败,未找到符合条件的记录"); throw new BusinessException("更新失败,未找到符合条件的记录");
} }

View File

@ -72,7 +72,7 @@ public class CaseplatformCaseVO {
private String signStatus; private String signStatus;
@ApiModelProperty(value = "协议地址") @ApiModelProperty(value = "协议地址")
private String taskLink; private String signLink;
@ApiModelProperty(value = "签署完成时间") @ApiModelProperty(value = "签署完成时间")
private LocalDateTime signTime; private LocalDateTime signTime;

View File

@ -9,10 +9,13 @@
t_caseplatform_expert.name expertName, t_caseplatform_expert.name expertName,
(select name from t_area where id=t_caseplatform_expert.prov_id) expertProvName, (select name from t_area where id=t_caseplatform_expert.prov_id) expertProvName,
(select name from t_area where id=t_caseplatform_expert.city_id) expertCityName, (select name from t_area where id=t_caseplatform_expert.city_id) expertCityName,
t_caseplatform_expert.hospital_name expertHospitalName t_caseplatform_expert.hospital_name expertHospitalName,
t_caseplatform_fxq_sign.sign_status signStatus,
t_caseplatform_fxq_sign.sign_link signLink
FROM t_caseplatform_case FROM t_caseplatform_case
left join t_caseplatform_user on t_caseplatform_case.user_id = t_caseplatform_user.id left join t_caseplatform_user on t_caseplatform_case.user_id = t_caseplatform_user.id
left join t_caseplatform_expert on t_caseplatform_case.expert_id = t_caseplatform_expert.id left join t_caseplatform_expert on t_caseplatform_case.expert_id = t_caseplatform_expert.id
left join t_caseplatform_fxq_sign on t_caseplatform_fxq_sign.expert_id = t_caseplatform_expert.id
<where> <where>
<!--name--> <!--name-->
<if test="queryForm.name != null and queryForm.name != ''"> <if test="queryForm.name != null and queryForm.name != ''">