修改了放心签的验证逻辑1
This commit is contained in:
parent
d57329cf1c
commit
09b631436f
@ -45,7 +45,6 @@ public class Base {
|
||||
public String postJson(String url, String jsonData, Map<String, String> headers) {
|
||||
// 获取token
|
||||
String tokenKey = "fangxinqian:" + clientId;
|
||||
// redisTemplate.delete(tokenKey);
|
||||
String token = redisTemplate.opsForValue().get(tokenKey);
|
||||
if (token == null) {
|
||||
token = getAccessToken();
|
||||
@ -55,7 +54,7 @@ public class Base {
|
||||
HttpRequest request = HttpRequest.post(url)
|
||||
.body(jsonData)
|
||||
.header("Content-Type", "application/json")
|
||||
.header("Authorization", "Bearer " + token);
|
||||
.header("Authorization", String.format("Bearer %s",token));
|
||||
|
||||
if (headers != null) {
|
||||
headers.forEach(request::header);
|
||||
|
||||
@ -23,7 +23,6 @@ public class FxqTask extends Base {
|
||||
requestData.put("unionId", unionId); // 个人/企业主体在放心签平台与接入方关联的唯一性标识(发起方账号)
|
||||
|
||||
String jsonBody = JSONUtil.toJsonStr(requestData);
|
||||
log.info("获取app数据参数:{}",jsonBody);
|
||||
|
||||
String response = postJson(url,jsonBody,null);
|
||||
GetTemplateListResponse result = JSONUtil.toBean(response, GetTemplateListResponse.class);
|
||||
|
||||
@ -158,10 +158,12 @@ public class ExpertFxqController {
|
||||
|
||||
// 签署任务详情查询
|
||||
FxqExpertTaskEntity fxqExpertTask = expertFxqService.getTaskDetail(expertId);
|
||||
if (fxqExpertTask != null) {
|
||||
if (Objects.equals(fxqExpertTask.getTaskStatus(), "20")) {
|
||||
// 已签署
|
||||
return ResponseDTO.userErrorParam("您已签订协议,无需再次签订");
|
||||
}
|
||||
}
|
||||
|
||||
// 获取签署的模版数据
|
||||
FxqTemplateEntity fxqTemplate = expertFxqService.getTemplate(company.getId());
|
||||
|
||||
@ -298,6 +298,17 @@ public class ExpertFxqService {
|
||||
@Transactional
|
||||
public AddFxqVo addTemplateTask(FxqCompanyEntity company, FxqUserEntity fxqUser, FxqTemplateEntity fxqTemplate,ExpertEntity expert){
|
||||
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();
|
||||
r.setUnionId(company.getUnionId());
|
||||
@ -318,28 +329,28 @@ public class ExpertFxqService {
|
||||
|
||||
r.setSigners(signersList);
|
||||
|
||||
// 初始化 components 列表
|
||||
List<AddTemplateTaskRequest.componentsData> componentsList = new ArrayList<>();
|
||||
|
||||
// 乙方姓名
|
||||
AddTemplateTaskRequest.componentsData name = new AddTemplateTaskRequest.componentsData();
|
||||
name.setFileKey("name");
|
||||
name.setFileValue(fxqUser.getName());
|
||||
componentsList.add(name);
|
||||
|
||||
// 乙方工作单位
|
||||
AddTemplateTaskRequest.componentsData work = new AddTemplateTaskRequest.componentsData();
|
||||
work.setFileKey("work");
|
||||
work.setFileValue(expert.getHospitalName());
|
||||
componentsList.add(work);
|
||||
|
||||
// 乙方联系电话
|
||||
AddTemplateTaskRequest.componentsData mobile = new AddTemplateTaskRequest.componentsData();
|
||||
mobile.setFileKey("mobile");
|
||||
mobile.setFileValue(expert.getMobile());
|
||||
componentsList.add(mobile);
|
||||
|
||||
r.setComponents(componentsList);
|
||||
// // 初始化 components 列表
|
||||
// List<AddTemplateTaskRequest.componentsData> componentsList = new ArrayList<>();
|
||||
//
|
||||
// // 乙方姓名
|
||||
// AddTemplateTaskRequest.componentsData name = new AddTemplateTaskRequest.componentsData();
|
||||
// name.setFileKey("name");
|
||||
// name.setFileValue(fxqUser.getName());
|
||||
// componentsList.add(name);
|
||||
//
|
||||
// // 乙方工作单位
|
||||
// AddTemplateTaskRequest.componentsData work = new AddTemplateTaskRequest.componentsData();
|
||||
// work.setFileKey("work");
|
||||
// work.setFileValue(expert.getHospitalName());
|
||||
// componentsList.add(work);
|
||||
//
|
||||
// // 乙方联系电话
|
||||
// AddTemplateTaskRequest.componentsData mobile = new AddTemplateTaskRequest.componentsData();
|
||||
// mobile.setFileKey("mobile");
|
||||
// mobile.setFileValue(expert.getMobile());
|
||||
// componentsList.add(mobile);
|
||||
//
|
||||
// r.setComponents(componentsList);
|
||||
|
||||
AddTemplateTaskResponse templateTask = fxqTask.addTemplateTask(r);
|
||||
if (templateTask.getData() == null) {
|
||||
@ -350,17 +361,6 @@ public class ExpertFxqService {
|
||||
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());
|
||||
if (fxqLink == null) {
|
||||
@ -456,7 +456,7 @@ public class ExpertFxqService {
|
||||
|
||||
// 修改专家签署任务表
|
||||
if (taskLink.getData().getTaskStatus() == 20){
|
||||
int rows = fxqSignDao.updateSignStatus(fxqExpertTask.getExpertId(), taskId,2);
|
||||
int rows = fxqSignDao.updateSignStatus(fxqExpertTask.getExpertId(), taskId,1);
|
||||
if (rows == 0) {
|
||||
throw new BusinessException("更新失败,未找到符合条件的记录");
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ public class CaseplatformCaseVO {
|
||||
private String signStatus;
|
||||
|
||||
@ApiModelProperty(value = "协议地址")
|
||||
private String taskLink;
|
||||
private String signLink;
|
||||
|
||||
@ApiModelProperty(value = "签署完成时间")
|
||||
private LocalDateTime signTime;
|
||||
|
||||
@ -9,10 +9,13 @@
|
||||
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.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
|
||||
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_fxq_sign on t_caseplatform_fxq_sign.expert_id = t_caseplatform_expert.id
|
||||
<where>
|
||||
<!--name-->
|
||||
<if test="queryForm.name != null and queryForm.name != ''">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user