yangdamao il y a 19 heures
Parent
commit
e05461efc5

+ 49 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -70,6 +70,8 @@ import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysTaskService;
 import com.zhongzheng.modules.system.service.ISysTenantService;
+import com.zhongzheng.modules.tencentcloud.bo.FaceQueryBo;
+import com.zhongzheng.modules.tencentcloud.service.IFaceOcrService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.domain.UserCertificate;
@@ -184,6 +186,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     private ICourseService iCourseService;
     @Autowired
     private ICourseSectionService iCourseSectionService;
+    @Autowired
+    private IFaceOcrService iFaceOcrService;
     @Value("${liveGotoURL}")
     private String liveGotoURL;
     @Value("${oldSys.goods}")
@@ -543,12 +547,57 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 userUpdateAddBo.setIdCard(update.getIdCard());
             }
         }
+        if (ObjectUtils.isNotNull(bo.getCardCheck()) && bo.getCardCheck() == 1
+                && StringUtils.isNotBlank(bo.getIdCardImg1()) && StringUtils.isNotBlank(bo.getIdCard())){
+            //是否有修改
+            if (StringUtils.isBlank(oldUser.getIdCardImg1())){
+                //没有照片
+                Map<String, String> map = IdCardCheck(bo.getIdCardImg1());
+                String idCard = map.get("IdNum");
+                String name = map.get("IdName");
+                if (!idCard.equals(bo.getIdCard())){
+                    throw new CustomException(String.format("照片识别的身份证号【%s】与填写的身份证号【%s】不相同,请注意检查!",idCard,bo.getIdCard()),66066);
+                }
+                if (!name.equals(bo.getRealname())){
+                    throw new CustomException(String.format("照片识别的姓名【%s】与填写的姓名【%s】不相同,请注意检查!",name,bo.getRealname()),66066);
+                }
+            }
+
+            if (StringUtils.isNotBlank(bo.getIdCardImg1()) && StringUtils.isNotBlank(oldUser.getIdCardImg1())
+                    && (!oldUser.getIdCardImg1().equals(bo.getIdCardImg1())
+                    || !oldUser.getIdCard().equals(bo.getIdCard())
+                    || !oldUser.getRealname().equals(bo.getRealname()))){
+                //修改身份证照片/身份证号/姓名
+                Map<String, String> map = IdCardCheck(bo.getIdCardImg1());
+                String idCard = map.get("IdNum");
+                String name = map.get("IdName");
+                if (!idCard.equals(oldUser.getIdCard())){
+                    throw new CustomException(String.format("照片识别的身份证号【%s】与填写的身份证号【%s】不相同,请注意检查!",idCard,bo.getIdCard()),66066);
+                }
+                if (!name.equals(oldUser.getRealname())){
+                    throw new CustomException(String.format("照片识别的姓名【%s】与填写的姓名【%s】不相同,请注意检查!",name,bo.getRealname()),66066);
+                }
+            }
+
+        }
+
         if (Validator.isNotEmpty(userUpdateAddBo.getUserId())) {
             userUpdateService.insertByAddBo(userUpdateAddBo);
         }
         return this.updateById(update);
     }
 
+    private Map<String, String> IdCardCheck(String idCardUrl){
+        FaceQueryBo faceQueryBo = new FaceQueryBo();
+        faceQueryBo.setCardImageUrl(String.format("https://file.xyyxt.net/%s",idCardUrl));
+        faceQueryBo.setCardSide(1);
+        Map<String, String> map = iFaceOcrService.IDCardOCR(faceQueryBo);
+        if (StringUtils.isNotBlank(map.get("errorMsg"))){
+            throw new CustomException(map.get("errorMsg"),66066);
+        }
+        return map;
+    }
+
     @Override
     public Boolean appUpdateByEditBo(UserEditBo bo) throws IllegalAccessException {
         User update = BeanUtil.toBean(bo, User.class);

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -4258,6 +4258,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Map<String, Object> importXlsxQuestionList( List<QuestionImportV4> questionList2,String param) {
         if (CollectionUtils.isEmpty(questionList2)){
             return new HashMap<>();

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.pagehelper.Page;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.redis.RedisCache;
@@ -2097,7 +2098,16 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             if (Validator.isEmpty(userVo.getGzhOpenId())) {
                 throw new CustomException("请先授权绑定公众号信息");
             }
+            log.error("公众号opendID:"+userVo.getGzhOpenId());
             payResult = iWxPayService.paymentGzh(pay_no, userVo.getGzhOpenId(), body, payPrice, bo.getUrl());
+            try {
+                ObjectMapper mapper = new ObjectMapper();
+                String prettyJson = mapper.writerWithDefaultPrettyPrinter()
+                        .writeValueAsString(payResult);
+                log.error("payResul微信返回结果:"+prettyJson);
+            }catch (Exception e){
+                e.printStackTrace();
+            }
         }else {
             instTimeSettleOrder(add,DateUtils.getNowTime());
         }

+ 0 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/tencentcloud/service/impl/FaceOcrServiceImpl.java

@@ -383,7 +383,6 @@ public class FaceOcrServiceImpl implements IFaceOcrService {
             return rs;
         }catch (TencentCloudSDKException e){
             rs.put("errorMsg",e.getMessage());
-            System.out.println("错误"+e.getMessage());
         }
         return rs;
     }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserEditBo.java

@@ -210,4 +210,7 @@ public class UserEditBo {
     /** 来源平台 1小程序 2PC网站 */
     private String fromPlat;
 
+    @ApiModelProperty("是否身份证校验:1是 0否")
+    private Integer cardCheck;
+
 }