Commit f495dd47 by 邓实川

电子合同报错信息优化

parent 8ce8533c
...@@ -895,19 +895,21 @@ public class DzhtController2 { ...@@ -895,19 +895,21 @@ public class DzhtController2 {
@ApiOperation(value = "获取签署地址", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取签署地址", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> qrySignUrl(@CurrentUser UserBean userBean, @RequestParam String flowId, public Result<Object> qrySignUrl(@CurrentUser UserBean userBean, @RequestParam String flowId,
@RequestParam(required = false) String organizeId, @RequestParam(required = false) String urlType) { @RequestParam(required = false) String organizeId, @RequestParam(required = false) String urlType) {
JSONObject jsonObject = null; JSONObject json = null;
try { try {
QueryWrapper<DzhtAssoGrzc> queryWrapper = new QueryWrapper<DzhtAssoGrzc>(); QueryWrapper<DzhtAssoGrzc> queryWrapper = new QueryWrapper<DzhtAssoGrzc>();
queryWrapper.eq("emp_num", userBean.getEmpNum()).select("account_id"); queryWrapper.eq("emp_num", userBean.getEmpNum()).select("account_id");
String accountId = DzhtAssoGrzc.builder().build().selectOne(queryWrapper).getAccountId(); String accountId = DzhtAssoGrzc.builder().build().selectOne(queryWrapper).getAccountId();
TokenHelper.getTokenData();// 获取鉴权 TokenHelper.getTokenData();// 获取鉴权
jsonObject = SignHelper.qrySignUrl(flowId, accountId, organizeId, urlType); json = SignHelper.qrySignUrl(flowId, accountId, organizeId, urlType);
} catch (DefineException e) { } catch (DefineException e) {
e.printStackTrace(); e.printStackTrace();
return ResultUtil.error(); return ResultUtil.error();
} }
return ResultUtil.data(jsonObject, "获取成功"); if (json != null && json.getLong("code") != 0)
return ResultUtil.error(json.getString("message"));
return ResultUtil.data(json.getJSONObject("data"), "成功");
} }
// 流程签署人催签 // 流程签署人催签
...@@ -943,7 +945,11 @@ public class DzhtController2 { ...@@ -943,7 +945,11 @@ public class DzhtController2 {
if (grzc != null) { if (grzc != null) {
operatorId = grzc.getAccountId(); operatorId = grzc.getAccountId();
} }
SignHelper.revokeSignFlow(flowId, revokeReason, operatorId); JSONObject json = SignHelper.revokeSignFlow(flowId, revokeReason, operatorId);
if (json != null && json.getLong("code") != 0) {
return ResultUtil.error(json.getString("message"));
}
} catch (DefineException e) { } catch (DefineException e) {
e.printStackTrace(); e.printStackTrace();
return ResultUtil.error(); return ResultUtil.error();
...@@ -975,9 +981,10 @@ public class DzhtController2 { ...@@ -975,9 +981,10 @@ public class DzhtController2 {
json = SignHelper.downloadFlowDoc(flowId); json = SignHelper.downloadFlowDoc(flowId);
} catch (DefineException e) { } catch (DefineException e) {
e.printStackTrace(); e.printStackTrace();
return ResultUtil.error();
} }
return ResultUtil.data(json, "成功"); if (json != null && json.getLong("code") != 0)
return ResultUtil.error(json.getString("message"));
return ResultUtil.data(json.getJSONObject("data"), "成功");
} }
/** /**
......
...@@ -90,12 +90,15 @@ public class SignHelper { ...@@ -90,12 +90,15 @@ public class SignHelper {
* @throws DefineException * @throws DefineException
* @author 宫清 * @author 宫清
* @param operatorId * @param operatorId
* @return
* @date 2019年7月21日 下午5:38:42 * @date 2019年7月21日 下午5:38:42
*/ */
public static void revokeSignFlow(String flowId, String revokeReason, String operatorId) throws DefineException { public static JSONObject revokeSignFlow(String flowId, String revokeReason, String operatorId)
throws DefineException {
String param = SignParamUtil.revokeSignFlowParam(revokeReason, operatorId); String param = SignParamUtil.revokeSignFlowParam(revokeReason, operatorId);
JSONObject json = HttpHelper.doCommHttp(RequestType.PUT, ConfigConstant.revokeFlows_URL(flowId),param); JSONObject json = HttpHelper.doCommHttp(RequestType.PUT, ConfigConstant.revokeFlows_URL(flowId), param);
JSONHelper.castDataJson(json, Object.class); // JSONHelper.castDataJson(json, Object.class);
return json;
} }
/** /**
...@@ -176,7 +179,8 @@ public class SignHelper { ...@@ -176,7 +179,8 @@ public class SignHelper {
*/ */
public static JSONObject downloadFlowDoc(String flowId) throws DefineException { public static JSONObject downloadFlowDoc(String flowId) throws DefineException {
JSONObject json = HttpHelper.doCommHttp(RequestType.GET, ConfigConstant.aboutDocument_URL(flowId, null), null); JSONObject json = HttpHelper.doCommHttp(RequestType.GET, ConfigConstant.aboutDocument_URL(flowId, null), null);
return JSONHelper.castDataJson(json, JSONObject.class); // return JSONHelper.castDataJson(json, JSONObject.class);
return json;
} }
// ------------------------------------------------------------------------------------------------流程文档相关end----------------------- // ------------------------------------------------------------------------------------------------流程文档相关end-----------------------
...@@ -360,7 +364,7 @@ public class SignHelper { ...@@ -360,7 +364,7 @@ public class SignHelper {
* @author 宫清 * @author 宫清
* @date 2019年7月21日 下午8:09:07 * @date 2019年7月21日 下午8:09:07
*/ */
public static JSONObject addSignerHandSignArea(String flowId,List<Signfield> list) throws DefineException { public static JSONObject addSignerHandSignArea(String flowId, List<Signfield> list) throws DefineException {
String param = SignParamUtil.addSignerHandSignAreaParam(list); String param = SignParamUtil.addSignerHandSignAreaParam(list);
JSONObject json = HttpHelper.doCommHttp(RequestType.POST, ConfigConstant.addHandSignfieldsForPerson_URL(flowId), JSONObject json = HttpHelper.doCommHttp(RequestType.POST, ConfigConstant.addHandSignfieldsForPerson_URL(flowId),
...@@ -458,7 +462,8 @@ public class SignHelper { ...@@ -458,7 +462,8 @@ public class SignHelper {
throws DefineException { throws DefineException {
JSONObject json = HttpHelper.doCommHttp(RequestType.GET, JSONObject json = HttpHelper.doCommHttp(RequestType.GET,
ConfigConstant.Sign_URL(flowId, accountId, organizeId, urlType), null); ConfigConstant.Sign_URL(flowId, accountId, organizeId, urlType), null);
return JSONHelper.castDataJson(json, JSONObject.class); // return JSONHelper.castDataJson(json, JSONObject.class);
return json;
} }
// ------------------------------------------------------------------------------------------------流程签署人相关end---------------------- // ------------------------------------------------------------------------------------------------流程签署人相关end----------------------
......
...@@ -31,7 +31,7 @@ public class CheckUtil { ...@@ -31,7 +31,7 @@ public class CheckUtil {
* @param obj 实体对象 * @param obj 实体对象
* @return 有则返回true * @return 有则返回true
*/ */
public static boolean checkObjFieldIsNull(Object obj) { public static <T> boolean checkObjFieldIsNull(T obj) {
boolean flag = false; boolean flag = false;
for (Field f : obj.getClass().getDeclaredFields()) { for (Field f : obj.getClass().getDeclaredFields()) {
f.setAccessible(true); f.setAccessible(true);
......
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