Bladeren bron

Merge remote-tracking branch 'origin/feature-2022.07.29' into feature-2022.07.29

sakuya 3 jaren geleden
bovenliggende
commit
c2081cb169

+ 5 - 3
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/UserController.java

@@ -83,9 +83,11 @@ public class UserController {
         JwtUserDto jwtUserDto = contextUtil.getCurrentUser();
         // 处理图片的显示,重新查询一下当前的用户的值
         UserDto cacheUser = jwtUserDto.getUser();
-        UserDto user = userService.findUserNoCacheId(cacheUser.getId());
-        if (user != null) {
-            FileInfoEntity fileInfo = fileInfoService.getById(user.getSignImgId());
+        UserDto nocacheUser = userService.findUserNoCacheId(cacheUser.getId());
+        //重新设置user
+        if (nocacheUser != null) {
+        	jwtUserDto.setUser(nocacheUser);
+            FileInfoEntity fileInfo = fileInfoService.getById(nocacheUser.getSignImgId());
             if (fileInfo != null) {
                 String signImgUrl = FileUploadUtil.getFileUrl(fileInfo.getPath());
                 cacheUser.setSignImgUrl(signImgUrl);

+ 4 - 0
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/vo/ModelReq.java

@@ -26,4 +26,8 @@ public class ModelReq extends BaseRequest {
     private String notaryOfficeName;
     private Integer notaryOfficeId;
     private Date createTime;
+	//    个人购车【ZH04035】
+	//    邮享贷【ZH04021】
+	//    小额贷款【ZH02001】
+    private String productType;
 }

+ 18 - 12
eladmin-system/src/main/java/me/zhengjie/application/admin/job/GenerateNotarizationJob.java

@@ -14,10 +14,13 @@ import me.zhengjie.base.util.CFCACertUtil;
 import me.zhengjie.dao.mybatis.OrderFileRepository;
 import me.zhengjie.dao.mybatis.entity.*;
 import me.zhengjie.utils.StringUtils;
+
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.stereotype.Component;
 
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 
@@ -47,7 +50,7 @@ public class GenerateNotarizationJob {
         orderQw.eq("auto_generate", "1");
         List<NotaryOrderEntity> orderList = notaryOrderMapper.selectList(orderQw);
         if (orderList != null && orderList.size() > 0) {
-            List<Long> collection = new ArrayList();
+            List<Long> collection = new ArrayList<>();
             for (NotaryOrderEntity order : orderList) {
                 QueryWrapper<BorrowerEntity> borrowerQw = new QueryWrapper<>();
                 borrowerQw.eq("business_no", order.getBusinessNo());
@@ -73,20 +76,23 @@ public class GenerateNotarizationJob {
                     collection.add(guarantee.getId());
                 }
             }
-            List<OrderFileEntity> orderFileList = orderFileRepository.canBeSignedNotarization(collection);
-            for (OrderFileEntity orderFile : orderFileList) {
-                try {
-                    if(StringUtils.isEmpty(orderFile.getAxqContractNo())) {
-                        signNotarization(orderFile);
-                    }
-                    if(StringUtils.isEmpty(orderFile.getSignedPdfUrl())) {
-                        downloadNotarization(orderFile);
+            if(CollectionUtils.isNotEmpty(collection)) {
+                List<OrderFileEntity> orderFileList = orderFileRepository.canBeSignedNotarization(collection);
+                for (OrderFileEntity orderFile : orderFileList) {
+                    try {
+                        if(StringUtils.isEmpty(orderFile.getAxqContractNo())) {
+                            signNotarization(orderFile);
+                        }
+                        if(StringUtils.isEmpty(orderFile.getSignedPdfUrl())) {
+                            downloadNotarization(orderFile);
+                        }
+                    }catch (Exception e){
+                        e.printStackTrace();
+                        XxlJobHelper.log(e.getMessage());
                     }
-                }catch (Exception e){
-                    e.printStackTrace();
-                    XxlJobHelper.log(e.getMessage());
                 }
             }
+    
         }
         XxlJobHelper.log("Generate signed notarization endding ......");
     }

+ 32 - 0
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/UserServiceImpl.java

@@ -286,6 +286,17 @@ public class UserServiceImpl implements UserService {
                     throw new EntityExistException(User.class, "错误:", "注册用户失败");
                 }
             }
+        } else if(UserConstant.USER_TYPE_BANK.equals(resources.getUserType())){
+            try {
+                // 安心签注册个人用户
+                PersonVO person = PersonVO.builder().personName(resources.getNickName())
+                        .identNo(resources.getIdCard()).mobilePhone(resources.getPhone()).build();
+                String userId = CFCACertUtil.registerPerson(person);
+                resources.setAxqUserId(userId);
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new EntityExistException(User.class, "错误:", "注册用户失败");
+            }        
         }
 
         userRepository.save(resources);
@@ -324,6 +335,27 @@ public class UserServiceImpl implements UserService {
                     response.fail(ResultCode.UPLOAD_SEAL_FAIL);
                 }
             }
+        }else if(UserConstant.USER_TYPE_BANK.equals(user.getOrgId().split("_")[0])){
+        	try {
+                SysUserEntity saveEntity = new SysUserEntity();
+                CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
+                if(StringUtils.isEmpty(user.getAxqSealId())) {
+                    // 上传公证员签章,修改通过统一方式得到文件的流
+                    byte[] b = FileUploadUtil.getByte(resources.getSignImgId());
+                    String sealId = CFCACertUtil.addSeal(user.getAxqUserId(), b);
+                    saveEntity.setAxqSealId(sealId);
+                } else {
+                    // 修改公证员签章
+                	byte[] b = FileUploadUtil.getByte(resources.getSignImgId());  
+                    CFCACertUtil.updateSeal(user.getAxqUserId(), user.getAxqSealId(), b);
+                }
+                saveEntity.setUserId(user.getUserId());
+                saveEntity.setSignImgId(resources.getSignImgId());
+                userDao.updateById(saveEntity);
+            } catch (Exception e) {
+                e.printStackTrace();
+                response.fail(ResultCode.UPLOAD_SEAL_FAIL);
+            }
         }
         return response;
     }

+ 3 - 0
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/entity/ModelEntity.java

@@ -53,4 +53,7 @@ public class ModelEntity implements Serializable {
 
 	@TableField("create_time")
 	private Date createTime;
+
+	@TableField("product_type")
+	private String productType;
 }

+ 1 - 1
eladmin-system/src/main/resources/config/application-prod.yml

@@ -196,5 +196,5 @@ xxl:
       logretentiondays: 30
 
 logging:
-  config: classpath:./logback-spring.xml
+  config: classpath:logback-spring.xml
   logdir: ./logs/java-app

+ 1 - 1
eladmin-system/src/main/resources/config/application.yml

@@ -3,7 +3,7 @@ spring:
   freemarker:
     check-template-location: false
   profiles:
-    active: dev
+    active: prod
   jackson:
     time-zone: GMT+8
   data: