Explorar el Código

fix(苏商银行):字典类

liutao hace 2 días
padre
commit
aea7f7d33a

+ 3 - 0
src/main/java/com/sunxung/factoring/service/financing/contract/impl/ContractMakingServiceImpl.java

@@ -2109,6 +2109,9 @@ public class ContractMakingServiceImpl implements ContractMakingService {
                 electronicSignaturePersonal.setSocialCreditCode(financingFromInvestorsPerson.getSocialCreditCode());
                 electronicSignaturePersonal.setCardType("idCard");
                 electronicSignaturePersonal.setMobile(financingFromInvestorsPerson.getPhoneNumber());
+                if(sysCustomer != null){
+                    sysCustomer.setElectronicSignaturePersonal(electronicSignaturePersonal);
+                }
                 electronicSignaturePersonalService.updateById(electronicSignaturePersonal);
             }
             if (sysCustomer != null && sysCustomer.getFddCustomerId() != null) {

+ 42 - 33
src/main/java/com/sunxung/factoring/service/financing/contract/impl/SysCustomerServiceImpl.java

@@ -63,41 +63,50 @@ public class SysCustomerServiceImpl extends ServiceImpl<SysCustomerMapper, SysCu
 
         if (customer == null) {
             if (sysCustomer.getAccountType().equals("1")) {
-                String openId = getOpenId(sysCustomer);
-                //法大大认证
-                //添加身份信息
-                String customerId = ElectronicSignatureUtil.registerAccount(openId, sysCustomer.getAccountType());
-                String authResult = ElectronicSignatureUtil.getAuthUrl(sysCustomer.getAccountType(), customerId, null);
-                JSONObject authJson = (JSONObject) JSONObject.parse(authResult);
-                String authUrl = authJson.getString("authUrl");
-                if (authUrl == null || customerId == null) {
-                    throw new ValidatorException(CodeUtil.FAIL, "生成认证链接出错");
-                }
-                String shortUrl = ElectronicSignatureUtil.shortUrl(null, authUrl);
-                sysCustomer.setShortAuthUrl(shortUrl);
-                sysCustomer.setShortAuthUrlCreate(new Date());
-                sysCustomer.setFddCustomerId(customerId);
-                sysCustomer.setAuthStatus(false);
-                sysCustomer.setAuthUrl(authUrl);
-                //开启自动签署
-                String transactionId = UUID.randomUUID().toString().trim().replaceAll("-", "").toUpperCase();
-                String beforeAutoSignUrl = ElectronicSignatureUtil.beforeAutoSign(transactionId, customerId, customerId);
-                String shortAutoSignUrl = ElectronicSignatureUtil.shortUrl(null, beforeAutoSignUrl);
-                sysCustomer.setShortAutoSignUrl(shortAutoSignUrl);
-                sysCustomer.setShortAutoSignUrlCreate(new Date());
-                sysCustomer.setTransactionId(transactionId);
-                sysCustomer.setAutoSignStatus(0);
-                sysCustomer.setAutoSignUrl(beforeAutoSignUrl);
-
                 //更新电子签个人
                 ElectronicSignaturePersonal electronicSignaturePersonal = sysCustomer.getElectronicSignaturePersonal();
-                electronicSignaturePersonal.setFddCustomerId(customerId);
-                electronicSignaturePersonal.setOpenId(openId);
-                electronicSignaturePersonal.setAuthUrl(authUrl);
-                electronicSignaturePersonal.setShortAuthUrl(shortUrl);
-                electronicSignaturePersonal.setShortAuthUrlCreat(new Date());
-                electronicSignaturePersonal.setAuthStatus(0);
-                electronicSignaturePersonalService.save(electronicSignaturePersonal);
+                if(electronicSignaturePersonal.getId() == null){
+                    String openId = getOpenId(sysCustomer);
+                    //法大大认证
+                    //添加身份信息
+                    String customerId = ElectronicSignatureUtil.registerAccount(openId, sysCustomer.getAccountType());
+                    String authResult = ElectronicSignatureUtil.getAuthUrl(sysCustomer.getAccountType(), customerId, null);
+                    JSONObject authJson = (JSONObject) JSONObject.parse(authResult);
+                    String authUrl = authJson.getString("authUrl");
+                    if (authUrl == null || customerId == null) {
+                        throw new ValidatorException(CodeUtil.FAIL, "生成认证链接出错");
+                    }
+                    String shortUrl = ElectronicSignatureUtil.shortUrl(null, authUrl);
+                    sysCustomer.setShortAuthUrl(shortUrl);
+                    sysCustomer.setShortAuthUrlCreate(new Date());
+                    sysCustomer.setFddCustomerId(customerId);
+                    sysCustomer.setAuthStatus(false);
+                    sysCustomer.setAuthUrl(authUrl);
+                    //开启自动签署
+                    String transactionId = UUID.randomUUID().toString().trim().replaceAll("-", "").toUpperCase();
+                    String beforeAutoSignUrl = ElectronicSignatureUtil.beforeAutoSign(transactionId, customerId, customerId);
+                    String shortAutoSignUrl = ElectronicSignatureUtil.shortUrl(null, beforeAutoSignUrl);
+                    sysCustomer.setShortAutoSignUrl(shortAutoSignUrl);
+                    sysCustomer.setShortAutoSignUrlCreate(new Date());
+                    sysCustomer.setTransactionId(transactionId);
+                    sysCustomer.setAutoSignStatus(0);
+                    sysCustomer.setAutoSignUrl(beforeAutoSignUrl);
+
+                    electronicSignaturePersonal.setFddCustomerId(customerId);
+                    electronicSignaturePersonal.setOpenId(openId);
+                    electronicSignaturePersonal.setAuthUrl(authUrl);
+                    electronicSignaturePersonal.setShortAuthUrl(shortUrl);
+                    electronicSignaturePersonal.setShortAuthUrlCreat(new Date());
+                    electronicSignaturePersonal.setAuthStatus(0);
+                    electronicSignaturePersonalService.save(electronicSignaturePersonal);
+                }else {
+                    sysCustomer.setShortAuthUrl(electronicSignaturePersonal.getShortAuthUrl());
+                    sysCustomer.setShortAuthUrlCreate(new Date());
+                    sysCustomer.setFddCustomerId(electronicSignaturePersonal.getFddCustomerId());
+                    sysCustomer.setAuthStatus(false);
+                    sysCustomer.setAuthUrl(electronicSignaturePersonal.getAuthUrl());
+                    sysCustomer.setAutoSignStatus(electronicSignaturePersonal.getAuthStatus());
+                }
 
                 sysCustomer.setEntBusinessId(electronicSignaturePersonal.getId());