异常处理
parent
31c1ca0202
commit
b23aadb572
|
@ -16,7 +16,6 @@ import weaver.hrm.User;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -166,7 +165,7 @@ public class SignFtService {
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
tokenUtils.setAlgorithm(Algorithm.HMAC256(secretMap.get("clientSecret")));
|
tokenUtils.setAlgorithm(Algorithm.HMAC256(secretMap.get("clientSecret")));
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
tokenUtils.setExpiresAt(new Date());
|
tokenUtils.setExpiresAt(new Date());
|
||||||
|
|
|
@ -12,7 +12,6 @@ import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -68,7 +67,7 @@ public class TokenUtils {
|
||||||
this.secret = secret;
|
this.secret = secret;
|
||||||
try {
|
try {
|
||||||
this.algorithm = Algorithm.HMAC256(secret);
|
this.algorithm = Algorithm.HMAC256(secret);
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
this.claims = claims;
|
this.claims = claims;
|
||||||
|
|
|
@ -22,7 +22,6 @@ import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.StreamingOutput;
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
|
@ -42,8 +41,7 @@ public class FaDDController {
|
||||||
/**
|
/**
|
||||||
* 查询配置信息
|
* 查询配置信息
|
||||||
*
|
*
|
||||||
* @param workflowId
|
* @param workflowId 流程id
|
||||||
* 流程id
|
|
||||||
* @return 配置信息
|
* @return 配置信息
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
|
@ -60,8 +58,7 @@ public class FaDDController {
|
||||||
/**
|
/**
|
||||||
* 验证企业签署状态
|
* 验证企业签署状态
|
||||||
*
|
*
|
||||||
* @param params
|
* @param params 查验参数
|
||||||
* 查验参数
|
|
||||||
* @return 企业验证的状态
|
* @return 企业验证的状态
|
||||||
*/
|
*/
|
||||||
@Path("/signature")
|
@Path("/signature")
|
||||||
|
@ -80,10 +77,8 @@ public class FaDDController {
|
||||||
/**
|
/**
|
||||||
* 催一催
|
* 催一催
|
||||||
*
|
*
|
||||||
* @param workflowId
|
* @param workflowId 流程id
|
||||||
* 流程id
|
* @param requestId 请求id
|
||||||
* @param requestId
|
|
||||||
* 请求id
|
|
||||||
* @return 催一催
|
* @return 催一催
|
||||||
*/
|
*/
|
||||||
@Path("/signedContract/{languageGroupId}/{requestId}/{workflowId}")
|
@Path("/signedContract/{languageGroupId}/{requestId}/{workflowId}")
|
||||||
|
@ -108,10 +103,8 @@ public class FaDDController {
|
||||||
/**
|
/**
|
||||||
* 本方签署
|
* 本方签署
|
||||||
*
|
*
|
||||||
* @param workflowId
|
* @param workflowId 流程id
|
||||||
* 流程id
|
* @param requestId 请求id
|
||||||
* @param requestId
|
|
||||||
* 请求id
|
|
||||||
* @return 本方签署结果
|
* @return 本方签署结果
|
||||||
*/
|
*/
|
||||||
@Path("/signedContract/own/{languageGroupId}/{requestId}/{workflowId}")
|
@Path("/signedContract/own/{languageGroupId}/{requestId}/{workflowId}")
|
||||||
|
@ -135,7 +128,7 @@ public class FaDDController {
|
||||||
String info = language.get("contractSignedInfo");
|
String info = language.get("contractSignedInfo");
|
||||||
return ApiResult.success(info);
|
return ApiResult.success(info);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
toolUtil.writeErrorLog("错误:" + e.toString());
|
toolUtil.writeErrorLog("错误:" + e);
|
||||||
return ApiResult.error(e.toString());
|
return ApiResult.error(e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,8 +136,7 @@ public class FaDDController {
|
||||||
/**
|
/**
|
||||||
* 合同下载
|
* 合同下载
|
||||||
*
|
*
|
||||||
* @param requestId
|
* @param requestId 请求id
|
||||||
* 请求id
|
|
||||||
* @return 合同问价压缩包
|
* @return 合同问价压缩包
|
||||||
*/
|
*/
|
||||||
@Path("/contract/download/{workflowId}/{requestId}")
|
@Path("/contract/download/{workflowId}/{requestId}")
|
||||||
|
@ -158,7 +150,7 @@ public class FaDDController {
|
||||||
return Response.ok(contractZipStream, MediaType.APPLICATION_OCTET_STREAM).type("application/zip")
|
return Response.ok(contractZipStream, MediaType.APPLICATION_OCTET_STREAM).type("application/zip")
|
||||||
.header("Content-Disposition", "attachment;filename=contracts.zip").build();
|
.header("Content-Disposition", "attachment;filename=contracts.zip").build();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
toolUtil.writeErrorLog("转换失败," + e.toString());
|
toolUtil.writeErrorLog("转换失败," + e);
|
||||||
return Response.ok(ApiResult.error("出现错误,错误原因: " + e), MediaType.APPLICATION_JSON).build();
|
return Response.ok(ApiResult.error("出现错误,错误原因: " + e), MediaType.APPLICATION_JSON).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,8 +158,7 @@ public class FaDDController {
|
||||||
/**
|
/**
|
||||||
* 获取流程全版本
|
* 获取流程全版本
|
||||||
*
|
*
|
||||||
* @param workflowId
|
* @param workflowId 流程id
|
||||||
* 流程id
|
|
||||||
* @return 流程全版本id
|
* @return 流程全版本id
|
||||||
*/
|
*/
|
||||||
@Path("/getAllVersion/{workflowId}/{markOnly}")
|
@Path("/getAllVersion/{workflowId}/{markOnly}")
|
||||||
|
@ -179,7 +170,7 @@ public class FaDDController {
|
||||||
Map<String, Object> allVersion = faDDService.getAllVersion(workflowId, markOnly);
|
Map<String, Object> allVersion = faDDService.getAllVersion(workflowId, markOnly);
|
||||||
return ApiResult.success(allVersion);
|
return ApiResult.success(allVersion);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
toolUtil.writeErrorLog("错误:" + e.toString());
|
toolUtil.writeErrorLog("错误:" + e);
|
||||||
return ApiResult.error(e.toString());
|
return ApiResult.error(e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,8 +178,7 @@ public class FaDDController {
|
||||||
/**
|
/**
|
||||||
* 查验是否全部签订完毕
|
* 查验是否全部签订完毕
|
||||||
*
|
*
|
||||||
* @param requestId
|
* @param requestId 请求id
|
||||||
* 请求id
|
|
||||||
* @return 查验结果
|
* @return 查验结果
|
||||||
*/
|
*/
|
||||||
@Path("/isAllSigned/{workflowId}/{requestId}")
|
@Path("/isAllSigned/{workflowId}/{requestId}")
|
||||||
|
@ -236,14 +226,14 @@ public class FaDDController {
|
||||||
byte[] decode = Base64.getDecoder().decode(bizContent.getBytes(StandardCharsets.UTF_8));
|
byte[] decode = Base64.getDecoder().decode(bizContent.getBytes(StandardCharsets.UTF_8));
|
||||||
String decodeStr = null;
|
String decodeStr = null;
|
||||||
try {
|
try {
|
||||||
decodeStr = new String(decode, "UTF-8");
|
decodeStr = new String(decode, StandardCharsets.UTF_8);
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
String jsonStr = null;
|
String jsonStr = null;
|
||||||
try {
|
try {
|
||||||
jsonStr = URLDecoder.decode(decodeStr, "UTF-8");
|
jsonStr = URLDecoder.decode(decodeStr, "UTF-8");
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
|
|
Loading…
Reference in New Issue