Commit 72375a1c authored by 5359's avatar 5359

Merge remote-tracking branch 'origin/master' into develop

parents 612f424e 59335049
......@@ -324,7 +324,22 @@ public class SignHclcController extends BaseController {
signUserInfoHclc.setOpenId(dto.getOpenId());
signUserInfoHclc = signHclcService.selectByPrimaryKey(iRequest, signUserInfoHclc);
if (Objects.nonNull(signUserInfoHclc) && Objects.nonNull(signUserInfoHclc.getOpenId())) {
signHclcService.updateByPrimaryKeySelective(iRequest, dto);
if("Y".equalsIgnoreCase(dto.getManagerAuthFlag())){
map=organSignHclcService.bindOrgansAgent(signUserInfoHclc);
}else if("N".equalsIgnoreCase(dto.getManagerAuthFlag())){
map=organSignHclcService.unBindOrgansAgent(signUserInfoHclc);
}else{
map.put("code", "000003");
map.put("message", "managerAuthFlag参数有误,请检查!");
continue;
}
if("0".equalsIgnoreCase(map.get("code").toString())){
signHclcService.updateByPrimaryKeySelective(iRequest, dto);
map.put("code", "000000");
map.put("message", "操作成功!");
}else{
map.put("code", "000004");
}
}
} catch (Exception e) {
map.put("code", "000002");
......@@ -334,8 +349,8 @@ public class SignHclcController extends BaseController {
}
}
map.put("code", "000000");
map.put("message", "操作成功!");
//map.put("code", "000000");
//map.put("message", "操作成功!");
return map;
}
......
......@@ -25,4 +25,8 @@ public interface IOrganSignInfoHclcService extends IBaseService<SignUserInfoHclc
List<SignUserInfoHclc> getOrganIndividualInfoQuery(IRequest iRequest, SignUserInfoHclc signInfoHclc);
Map<String,Object> setOrganIndividualAssignment(IRequest iRequest, SignUserInfoHclc info);
Map<String, Object> bindOrgansAgent(SignUserInfoHclc info);
Map<String, Object> unBindOrgansAgent(SignUserInfoHclc info);
}
......@@ -56,6 +56,8 @@ public class OrganSignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHc
public static final String signatureSysName = "HCLC_ELECTRONIC_SIGNATURE";
public static final String organsApiName = "outerOrgans";
public static final String deleteApiName = "organizationsDelete";
public static final String unBindApiName = "orgUnbindAcc";
public static final String bindApiName = "orgBindAcc";
private static final String HASH_ALGORITHM = "HmacSHA256";
//业务系统接口信息
......@@ -717,6 +719,107 @@ public class OrganSignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHc
return map;
}
/**
* 外部机构绑定经办人
* @param signInfoHclc
* @return
*/
public Map<String, Object> bindOrgansAgent(SignUserInfoHclc signInfoHclc) {
Map<String, Object> map = new HashMap<>();
//业务方交互上下文信息
JSONObject result = new JSONObject();
//绑定经办人账户
result.put("accountId", signInfoHclc.getAgentAccountId());
//当前登录账户ID
result.put("loginId", signInfoHclc.getAgentAccountId());
//机构账户
result.put("orgId", signInfoHclc.getAccountId());
JSONObject json = new JSONObject(result);
String param = json.toString();
//获取HMAC加密后的X-timevale-signature签名信息
AlgorithmHelper algorithmHelper = new AlgorithmHelper();
String EncryptedString = algorithmHelper.getXtimevaleSignature(param, projectSecret, HASH_ALGORITHM, "UTF-8");
//设置http请求head信息
Map<String, String> headInfo = new HashMap<String, String>();
headInfo.put("x-timevale-project-id", projectId);
headInfo.put("x-timevale-signature", EncryptedString);
try {
//初始化接口信息
String url = iSignInfoHclcService.getApiUrl(signatureSysName,bindApiName);
//发送http请求
SignHclcUtils signHclcUtils1 = new SignHclcUtils();
String stringResult = signHclcUtils1.postString(url, json, headInfo, signHclcUtils1.APPLICATION_JSON);
//解析返回结果
JSONObject jsonResult = JSONObject.parseObject(stringResult);
if ("0".equalsIgnoreCase(jsonResult.getString("errCode"))) {
JSONObject data = jsonResult.getJSONObject("data");
map.put("code", jsonResult.getString("errCode"));
map.put("message", "绑定经办人成功!");
} else {
map.put("code", jsonResult.getString("errCode"));
map.put("message", "绑定经办人失败," + jsonResult.getString("msg"));
}
} catch (Exception e) {
map.put("code", "000004");
map.put("message", "绑定经办人失败," + e.getMessage());
}
return map;
}
/**
* 外部机构解绑经办人
* @param signInfoHclc
* @return
*/
public Map<String, Object> unBindOrgansAgent(SignUserInfoHclc signInfoHclc) {
Map<String, Object> map = new HashMap<>();
JSONObject result = new JSONObject();
//绑定经办人账户
result.put("accountId", signInfoHclc.getAgentAccountId());
//当前登录账户ID
result.put("loginId", signInfoHclc.getAgentAccountId());
//机构账户
result.put("orgId", signInfoHclc.getAccountId());
JSONObject json = new JSONObject(result);
String param = json.toString();
//获取HMAC加密后的X-timevale-signature签名信息
AlgorithmHelper algorithmHelper = new AlgorithmHelper();
String EncryptedString = algorithmHelper.getXtimevaleSignature(param, projectSecret, HASH_ALGORITHM, "UTF-8");
//设置http请求head信息
Map<String, String> headInfo = new HashMap<String, String>();
headInfo.put("x-timevale-project-id", projectId);
headInfo.put("x-timevale-signature", EncryptedString);
try {
//初始化接口信息
String url = iSignInfoHclcService.getApiUrl(signatureSysName,unBindApiName);
//发送http请求
SignHclcUtils signHclcUtils1 = new SignHclcUtils();
String stringResult = signHclcUtils1.postString(url, json, headInfo, signHclcUtils1.APPLICATION_JSON);
//解析返回结果
JSONObject jsonResult = JSONObject.parseObject(stringResult);
if ("0".equalsIgnoreCase(jsonResult.getString("errCode"))) {
JSONObject data = jsonResult.getJSONObject("data");
map.put("code", jsonResult.getString("errCode"));
map.put("message", "解绑经办人成功!");
} else {
map.put("code", jsonResult.getString("errCode"));
map.put("message", "解绑经办人失败," + jsonResult.getString("msg"));
}
} catch (Exception e) {
map.put("code", "000004");
map.put("message", "解绑经办人失败," + e.getMessage());
}
return map;
}
public Map<String, Object> deleteOrgansAccount(IRequest iRequest, SignUserInfoHclc signInfoHclc) {
Map<String, Object> map = new HashMap<>();
......
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