Commit 33d1d35b authored by 5359's avatar 5359

测试环境文件提交

parent 72375a1c
......@@ -231,6 +231,27 @@ public class SignHclcController extends BaseController {
BeanUtils.copyProperties(dto, signUserInfoHclcHis);
signUserInfoHclcHisService.insert(iRequest, signUserInfoHclcHis);
//注销经办人用户
map = signHclcService.deletePersonAccount(iRequest, dto);
if ("0".equalsIgnoreCase(map.get("code").toString()) || "40051667".equalsIgnoreCase(map.get("code").toString()) || "000003".equalsIgnoreCase(map.get("code").toString())) {
// if ("N".equalsIgnoreCase(dto.getIsManagerFlag())) {
// map = organSignHclcService.unBindOrgansAgent(dto);
// }
signHclcService.deleteByPrimaryKey(dto);
//复制用户信息到历史表
//初始化经办人人脸识别信息
SignUserInfoHclc agentSignInfo = new SignUserInfoHclc();
agentSignInfo.setOpenId(dto.getOpenId() + "personHclc");
agentSignInfo = signHclcService.selectByPrimaryKey(iRequest, agentSignInfo);
SignUserInfoHclcHis agentUserInfoHclcHis = new SignUserInfoHclcHis();
BeanUtils.copyProperties(agentSignInfo, agentUserInfoHclcHis);
signUserInfoHclcHisService.insert(iRequest, agentUserInfoHclcHis);
signHclcService.deleteByPrimaryKey(agentSignInfo);
map.put("code", "0");
} else {
//重置结构用户信息为空
dto.setAccountId("");
dto.setAuthAccountId("");
......@@ -240,19 +261,6 @@ public class SignHclcController extends BaseController {
dto.setCreateMessage("");
dto.setManagerAuthFlag("N");
//注销经办人用户
//初始化经办人人脸识别信息
SignUserInfoHclc agentSignInfo = new SignUserInfoHclc();
agentSignInfo.setOpenId(dto.getOpenId());
// agentSignInfo.setIdNo(dto.getAgentIdNo());
// agentSignInfo.setMobile(dto.getMobile());
// agentSignInfo.setName(dto.getAgentName());
// agentSignInfo.setAccountId(dto.getAgentAccountId());
map = signHclcService.deletePersonAccount(iRequest, agentSignInfo);
if ("0".equalsIgnoreCase(map.get("code").toString()) || "40051667".equalsIgnoreCase(map.get("code").toString()) || "000003".equalsIgnoreCase(map.get("code").toString())) {
signHclcService.deleteByPrimaryKey(dto);
map.put("code", "0");
} else {
signHclcService.updateByPrimaryKey(iRequest, dto);
}
//机构已注销,accountaId为空的情况
......@@ -324,20 +332,20 @@ public class SignHclcController extends BaseController {
signUserInfoHclc.setOpenId(dto.getOpenId());
signUserInfoHclc = signHclcService.selectByPrimaryKey(iRequest, signUserInfoHclc);
if (Objects.nonNull(signUserInfoHclc) && Objects.nonNull(signUserInfoHclc.getOpenId())) {
if("Y".equalsIgnoreCase(dto.getManagerAuthFlag())){
map=organSignHclcService.bindOrgansAgent(signUserInfoHclc);
}else if("N".equalsIgnoreCase(dto.getManagerAuthFlag())){
map=organSignHclcService.unBindOrgansAgent(signUserInfoHclc);
}else{
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())){
if ("0".equalsIgnoreCase(map.get("code").toString())) {
signHclcService.updateByPrimaryKeySelective(iRequest, dto);
map.put("code", "000000");
map.put("message", "操作成功!");
}else{
} else {
map.put("code", "000004");
}
}
......@@ -407,7 +415,8 @@ public class SignHclcController extends BaseController {
return map;
}
infoHclc.setIsManagerFlag("Y");
organSignHclcService.setOrganIndividualAssignment(iRequest, dto);
organSignHclcService.setOrganIndividualAssignment(iRequest, infoHclc);
organSignHclcService.bindOrgansAgent(infoHclc);
//原管理员角色
SignUserInfoHclc signUserInfoHclc = new SignUserInfoHclc();
......@@ -426,6 +435,41 @@ public class SignHclcController extends BaseController {
return map;
}
/**
* 外部机构绑定经办人
*
* @param request
* @param dto 外部机构绑定经办人
* @return Map
*/
@ResponseBody
@RequestMapping("/auth/api/bind/organs/agent")
public Map<String, Object> bindOrgansAgent(HttpServletRequest request,
@RequestBody SignUserInfoHclc dto) {
Map<String, Object> map = new HashMap<>();
IRequest iRequest = createRequestContext(request);
if (Objects.isNull(dto.getOpenId())) {
map.put("code", "000001");
map.put("message", "关键参数openId,调用失败!");
return map;
} else {
try {
dto = signInfoHclcMapper.selectByPrimaryKey(dto);
map = organSignHclcService.bindOrgansAgent(dto);
} catch (Exception e) {
map.put("code", "000003");
e.printStackTrace();
map.put("message", "操作失败" + e.getMessage() + ",请检查!");
return map;
}
}
map.put("code", "000000");
map.put("message", "操作成功!");
return map;
}
/**
* 下载微信图片资源上传业务系统
*
......
......@@ -29,4 +29,6 @@ public interface IOrganSignInfoHclcService extends IBaseService<SignUserInfoHclc
Map<String, Object> bindOrgansAgent(SignUserInfoHclc info);
Map<String, Object> unBindOrgansAgent(SignUserInfoHclc info);
void createOrgPersonInfo(String openId);
}
......@@ -3,13 +3,17 @@ package com.hand.app.esignHclc.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hand.app.esignHclc.dto.SignUserInfoHclc;
import com.hand.app.esignHclc.dto.SignUserFaceHclc;
import com.hand.app.esignHclc.mapper.SignInfoHclcMapper;
import com.hand.app.esignHclc.service.IOrganSignInfoHclcService;
import com.hand.app.esignHclc.service.ISignInfoHclcFaceService;
import com.hand.app.esignHclc.service.ISignInfoHclcService;
import com.hand.hap.core.IRequest;
import com.hand.hap.system.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
......@@ -20,11 +24,16 @@ import java.util.Objects;
* Time: 9:08
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SignInfoHclcFaceServiceImpl extends BaseServiceImpl<SignUserFaceHclc> implements ISignInfoHclcFaceService {
private final Object lock = new Object();
@Autowired
private ISignInfoHclcService iSignInfoHclcService;
@Autowired
private SignInfoHclcMapper signInfoHclcMapper;
@Autowired
private IOrganSignInfoHclcService iOrganSignInfoHclcService;
public void postAuthResult(IRequest iRequest, JSONObject params) {
......@@ -51,14 +60,34 @@ public class SignInfoHclcFaceServiceImpl extends BaseServiceImpl<SignUserFaceHcl
signInfoHclc.setOpenId(signInfoHclcFace.getOpenId());
signInfoHclc = iSignInfoHclcService.selectByPrimaryKey(iRequest, signInfoHclc);
//更新用户认证状态为Y--modify by lsy 20200813调整
if (signInfoHclc.getCtitype().compareTo(1L) == 0 || (signInfoHclc.getCtitype().compareTo(2L) == 0
//非管理员用户人脸识别后认证成功
&& ((Objects.nonNull(signInfoHclc.getIsManagerFlag()) && "N".equalsIgnoreCase(signInfoHclc.getIsManagerFlag()) && "1".equalsIgnoreCase(signInfoHclcFace.getAuthType()))
//管理员用户对公打款后认证成功
|| "2".equalsIgnoreCase(signInfoHclcFace.getAuthType())))) {
if (signInfoHclc.getCtitype().compareTo(1L) == 0) {
signInfoHclc.setAuthFlag("Y");
iSignInfoHclcService.updateByPrimaryKeySelective(iRequest, signInfoHclc);
} else if (signInfoHclc.getCtitype().compareTo(2L) == 0) {
//获取已注册企业认证信息
SignUserInfoHclc managerSignInfo = new SignUserInfoHclc();
managerSignInfo.setIdNo(signInfoHclc.getIdNo());
managerSignInfo.setIsManagerFlag("Y");
managerSignInfo.setAuthFlag("Y");
List<SignUserInfoHclc> managerList = signInfoHclcMapper.select(managerSignInfo);
//存在已注册企业认证信息,更新当前用户信息
if (Objects.nonNull(managerList) && managerList.size() > 0) {
managerSignInfo = managerList.get(0);
signInfoHclc.setAccountId(managerSignInfo.getAccountId());
signInfoHclc.setOrgAuthId(managerSignInfo.getOrgAuthId());
}
if ("N".equalsIgnoreCase(signInfoHclc.getIsManagerFlag()) || "2".equalsIgnoreCase(signInfoHclcFace.getAuthType()) || (Objects.nonNull(managerList) && managerList.size() > 0)) {
signInfoHclc.setAuthFlag("Y");
}
//企业认证成功新增一条对应个人信息
if ("Y".equalsIgnoreCase(signInfoHclc.getAuthFlag())) {
iOrganSignInfoHclcService.createOrgPersonInfo(signInfoHclc.getOpenId());
}
}
iSignInfoHclcService.updateByPrimaryKeySelective(iRequest, signInfoHclc);
} else {
//更新认证明细表状态
signInfoHclcFace.setAuthStatus("FAIL");
......
......@@ -1173,6 +1173,7 @@ public class SignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHclc> i
JSONArray signers = params.getJSONArray("signers");
JSONArray signersNew = new JSONArray();
String initiatorAccountId = "";
List<String> wxOpenIds = new ArrayList<>();
//获取发起人信息
SignUserInfoHclc signInfo = new SignUserInfoHclc();
......@@ -1215,7 +1216,7 @@ public class SignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHclc> i
if (signInfoHclcs.size() == 0) {
logger.error("create sign flows failed, account:{} is not defined in wx", name + idNo);
jsonResult.put("errCode", "2");
jsonResult.put("msg", "创建签署流程失败,用户" + name + idNo + "在移动端未完成实名认证,请先认证!");
jsonResult.put("msg", "创建签署流程失败,用户" + name + idNo + ((Objects.nonNull(agentIdNo) && !"".equalsIgnoreCase(agentIdNo)) ? ("经办人" + agentIdNo) : "") + "在移动端未完成实名认证授权,请先认证授权!");
return jsonResult;
} else {
signInfoHclc = signInfoHclcs.get(0);
......@@ -1233,6 +1234,11 @@ public class SignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHclc> i
json1.put("uniqueId", signInfoHclc.getOpenId());
}
//获取需要发送微信通知的签署人
if (!"HCLC".equalsIgnoreCase(role) && !"AGENT".equalsIgnoreCase(role)) {
wxOpenIds.add(signInfoHclc.getOpenId());
}
// //代理店设置发起人
// if ("AGENT".equalsIgnoreCase(role)) {
// initiatorAccountId = signInfoHclc.getAccountId();
......@@ -1287,6 +1293,19 @@ public class SignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHclc> i
}
//微信电子签约通知模板
JSONObject wxParams = new JSONObject();
wxParams = params.getJSONObject("attachments");
wxParams.put("templateId", "lyMDp1r6Jp5r7eSiho0otSby4tY0pXjZg1gbcA1poNI");
wxParams.put("first", "您好,您申请的融资租赁合同已经通过审核,可以进行签约流程!");
wxParams.put("keyword1", "承租人:");
wxParams.put("keyword2", "合同号:");
wxParams.put("keyword3", "机号:");
wxParams.put("keyword4", "签约时间:");
wxParams.put("remark", "请点击互动中心-融资租赁进行签约。谢谢!");
wxParams.put("url", "");
JSONObject result = new JSONObject();
//附件信息集合
result.put("attachments", params.get("attachments"));
......@@ -1380,6 +1399,14 @@ public class SignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHclc> i
}
}
//发送微信通知
if (Objects.nonNull(wxOpenIds) && wxOpenIds.size() > 0) {
for (String id : wxOpenIds) {
wxParams.put("openId", id);
sendWxTemplateMsg(wxParams);
}
}
} catch (Exception e) {
logger.error("create sign flows failed, msg:{}", e.getMessage());
jsonResult.put("errCode", "000004");
......
......@@ -77,9 +77,7 @@
<update id="setOrganIndividualAssignment" parameterType="com.hand.app.esignHclc.dto.SignUserInfoHclc">
update SIGN_USER_INFO_HCLC
<set>
<if test="isManagerFlag != null">is_manager_flag=#{isManagerFlag,jdbcType=VARCHAR},</if>
</set>
SET is_manager_flag= NVL(#{isManagerFlag,jdbcType=VARCHAR},'Y')
where open_id=#{openId}
AND manager_auth_flag='Y'
</update>
......
......@@ -113,7 +113,7 @@ thread.taskSize = 5
tsign.project.id=1000029
tsign.project.secret=2e66a86bbc6fa9000d4a5f272cbc70e1
#e签宝地址
tsign.api.url=http://139.196.17.22:8035
tsign.api.url=http://tsign-test.hitachics.com
#用户认证地址
tsign.face.api.url=https://smlopenapi.esign.cn
#用户认证用户
......
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