2 コミット 9022ba1ea9 ... 4724f23651

作者 SHA1 メッセージ 日付
  Wangyafan 4724f23651 Merge branch 'bocom' of http://192.168.0.200:3000/liuj/factoring-trade-backend into bocom 1 ヶ月 前
  Wangyafan cfa2ad0744 feat(对接交行):会员登记薄多个授权人 1 ヶ月 前

+ 14 - 42
src/main/java/com/sunxung/factoring/entity/bocom/vipaccount/BocomVipAccountBasicInfo.java

@@ -71,11 +71,6 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
     @TableField("legal_authorization_status")
     private Integer legalAuthorizationStatus;
 
-    /**
-     * 通知推送对象  1-法人 2-授权代理人 3-个人
-     */
-    @TableField("notice_object")
-    private String noticeObject;
 
     /**
      * 渠道
@@ -127,19 +122,6 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
     @TableField("currency")
     private String currency;
 
-    /**
-     * 授权二维码(base64)
-     */
-    @TableField("qr_code")
-    private String qrCode;
-
-    /**
-     * 授权二维码生效时间(base64)
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @TableField("qr_code_effect_time")
-    private Date qrCodeEffectTime;
-
     /**
      * 新增会员登记簿的平台流水号
      */
@@ -242,6 +224,12 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
     @TableField(exist = false)
     private String authenticator;
 
+    /**
+     * 认证信息
+     */
+    @TableField(exist = false)
+    private List<BocomVipAccountNoticeInfo> noticeInfoList;
+
     public List<BocomVipSilentAccountInfo> getSilentAccountInfoList() {
         return silentAccountInfoList;
     }
@@ -385,30 +373,6 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
         this.bindAccountInfoList = bindAccountInfoList;
     }
 
-    public String getQrCode() {
-        return qrCode;
-    }
-
-    public void setQrCode(String qrCode) {
-        this.qrCode = qrCode;
-    }
-
-    public Date getQrCodeEffectTime() {
-        return qrCodeEffectTime;
-    }
-
-    public void setQrCodeEffectTime(Date qrCodeEffectTime) {
-        this.qrCodeEffectTime = qrCodeEffectTime;
-    }
-
-    public String getNoticeObject() {
-        return noticeObject;
-    }
-
-    public void setNoticeObject(String noticeObject) {
-        this.noticeObject = noticeObject;
-    }
-
     public String getCustomerName() {
         return customerName;
     }
@@ -521,6 +485,14 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
         this.accountStatusReal = accountStatusReal;
     }
 
+    public List<BocomVipAccountNoticeInfo> getNoticeInfoList() {
+        return noticeInfoList;
+    }
+
+    public void setNoticeInfoList(List<BocomVipAccountNoticeInfo> noticeInfoList) {
+        this.noticeInfoList = noticeInfoList;
+    }
+
     @Override
     public String toString() {
         return "BocomVipAccountBasicInfo{" +

+ 106 - 0
src/main/java/com/sunxung/factoring/entity/bocom/vipaccount/BocomVipAccountNoticeInfo.java

@@ -0,0 +1,106 @@
+package com.sunxung.factoring.entity.bocom.vipaccount;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sunxung.factoring.entity.BaseEntity;
+
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 会员账户-通知推送表
+ * </p>
+ *
+ * @author wangyafan
+ * @since 2024-09-20
+ */
+@TableName("bocom_vip_account_notice_info")
+public class BocomVipAccountNoticeInfo extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 会员账户-基础信息表id
+     */
+    @TableField("bocom_vip_account_basic_info_id")
+    private Long bocomVipAccountBasicInfoId;
+
+    /**
+     * 授权二维码
+     */
+    @TableField("qr_code")
+    private String qrCode;
+
+    /**
+     * 授权二维码生效时间
+     */
+    @TableField("qr_code_effect_time")
+    private Date qrCodeEffectTime;
+
+    /**
+     * 通知推送对象  1-法人 2-授权代理人 3-个人
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField("qr_code_effect_time")
+    private String noticeObject;
+
+    /**
+     * 认证人
+     */
+    @TableField(exist = false)
+    private String authenticator;
+
+    public Long getBocomVipAccountBasicInfoId() {
+        return bocomVipAccountBasicInfoId;
+    }
+
+    public void setBocomVipAccountBasicInfoId(Long bocomVipAccountBasicInfoId) {
+        this.bocomVipAccountBasicInfoId = bocomVipAccountBasicInfoId;
+    }
+    public String getQrCode() {
+        return qrCode;
+    }
+
+    public void setQrCode(String qrCode) {
+        this.qrCode = qrCode;
+    }
+
+    public Date getQrCodeEffectTime() {
+        return qrCodeEffectTime;
+    }
+
+    public void setQrCodeEffectTime(Date qrCodeEffectTime) {
+        this.qrCodeEffectTime = qrCodeEffectTime;
+    }
+
+    public String getNoticeObject() {
+        return noticeObject;
+    }
+
+    public void setNoticeObject(String noticeObject) {
+        this.noticeObject = noticeObject;
+    }
+
+    public String getAuthenticator() {
+        return authenticator;
+    }
+
+    public void setAuthenticator(String authenticator) {
+        this.authenticator = authenticator;
+    }
+
+    @Override
+    public String toString() {
+        return "BocomVipAccountNoticeInfo{" +
+            ", bocomVipAccountBasicInfoId=" + bocomVipAccountBasicInfoId +
+            ", qrCode=" + qrCode +
+            ", qrCodeEffectTime=" + qrCodeEffectTime +
+            ", noticeObject=" + noticeObject +
+        "}";
+    }
+}

+ 16 - 0
src/main/java/com/sunxung/factoring/mapper/bocom/vipaccount/BocomVipAccountNoticeInfoMapper.java

@@ -0,0 +1,16 @@
+package com.sunxung.factoring.mapper.bocom.vipaccount;
+
+import com.sunxung.factoring.entity.bocom.vipaccount.BocomVipAccountNoticeInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 会员账户-通知推送表 Mapper 接口
+ * </p>
+ *
+ * @author wangyafan
+ * @since 2024-09-20
+ */
+public interface BocomVipAccountNoticeInfoMapper extends BaseMapper<BocomVipAccountNoticeInfo> {
+
+}

+ 16 - 0
src/main/java/com/sunxung/factoring/service/bocom/vipaccount/IBocomVipAccountNoticeInfoService.java

@@ -0,0 +1,16 @@
+package com.sunxung.factoring.service.bocom.vipaccount;
+
+import com.sunxung.factoring.entity.bocom.vipaccount.BocomVipAccountNoticeInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 会员账户-通知推送表 服务类
+ * </p>
+ *
+ * @author wangyafan
+ * @since 2024-09-20
+ */
+public interface IBocomVipAccountNoticeInfoService extends IService<BocomVipAccountNoticeInfo> {
+
+}

+ 52 - 43
src/main/java/com/sunxung/factoring/service/bocom/vipaccount/impl/BocomVipAccountBasicInfoServiceImpl.java

@@ -107,6 +107,8 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
     private BocomTransRecordsMapper bocomTransRecordsMapper;
     @Autowired
     private IBocomVipAccountComprehensiveDetailFileRelService bocomVipAccountComprehensiveDetailFileRelService;
+    @Autowired
+    private IBocomVipAccountNoticeInfoService bocomVipAccountNoticeInfoService;
 
     @Override
     public BocomVipAccountBasicInfo doAdd(Long bocomBasicInfoId) {
@@ -134,6 +136,13 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
             bocomVipAccountBasicInfo.setExpiringDate(new Date());
         }
         save(bocomVipAccountBasicInfo);
+        if (CollectionUtil.isNotEmpty(bocomVipAccountBasicInfo.getNoticeInfoList())){
+            bocomVipAccountBasicInfo.getNoticeInfoList().forEach(n->{
+                n.setBocomVipAccountBasicInfoId(bocomVipAccountBasicInfo.getId());
+                bocomVipAccountNoticeInfoService.save(n);
+            });
+        }
+
         //数据入库
         if (bocomVipAccountBasicInfo != null) {
 
@@ -449,7 +458,7 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
                 BocomVipAccountBasicInfo newVipAccountInfo = autoQueryVipRequest(vipAccountBasicInfo);
                 //新旧对比 如果之前状态不是客户授权中 现在是客户授权中 则重置二维码及二维码的生效时间
                 if (0 == newVipAccountInfo.getAuthorizationStatus() && !newVipAccountInfo.getAuthorizationStatus().equals(vipAccountBasicInfo.getAuthorizationStatus())) {
-                    newVipAccountInfo.setQrCodeEffectTime(new Date());
+                   resetUrl(newVipAccountInfo.getId());
                 }
                 if (1 == newVipAccountInfo.getAccountStatus() && !newVipAccountInfo.getAccountStatus().equals(vipAccountBasicInfo.getAccountStatus())) {
                     newVipAccountInfo.setOpenTime(new Date());
@@ -644,10 +653,14 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
         BocomVipAccountBasicInfo basicInfo = getById(id);
         if (basicInfo != null) {
             BocomVipAccountBasicInfo vipAccountBasicInfo = resetUrlAuthorized(basicInfo);
-            lambdaUpdate().eq(BocomVipAccountBasicInfo::getId, vipAccountBasicInfo.getId())
-                    .set(BocomVipAccountBasicInfo::getQrCode, vipAccountBasicInfo.getQrCode())
-                    .set(BocomVipAccountBasicInfo::getQrCodeEffectTime, vipAccountBasicInfo.getQrCodeEffectTime())
-                    .update();
+            //全删全进
+            bocomVipAccountNoticeInfoService.remove(new QueryWrapper<BocomVipAccountNoticeInfo>()
+                    .eq("bocom_vip_account_basic_info_id",vipAccountBasicInfo.getId()));
+            if (CollectionUtil.isNotEmpty(vipAccountBasicInfo.getNoticeInfoList())){
+                vipAccountBasicInfo.getNoticeInfoList().forEach(n->{
+                    bocomVipAccountNoticeInfoService.save(n);
+                });
+            }
         }
         BocomVipAccountBasicInfo newVipBasic = getById(id);
         return newVipBasic;
@@ -739,23 +752,26 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
             if ("00".equals(pptmBodyRequest.getOprTp()) && "13".equals(pptmBodyRequest.getRgsnBookPurp())) {
                 basicInfo.setAccountNumber(pptmBody.getRgsnBookId());
             }
+            List<BocomVipAccountNoticeInfo> noticeInfoList = new ArrayList<>();
             if (CollectionUtil.isNotEmpty(pptmBody.getNotyQue())) {
-                String notyPushObjs = pptmBody.getNotyQue().stream().map(n -> n.getNotyPushObj()).collect(Collectors.joining("/"));
-                basicInfo.setNoticeObject(notyPushObjs);
-                B2BJEBM1201ResponseV2.PptmBody.NotyQue que = pptmBody.getNotyQue().get(0);
-                basicInfo.setQrCode(que.getMerchNotyBase64Stream());
-                basicInfo.setQrCodeEffectTime(new Date());
-                basicInfo.setPlfmSerNo(pptmBodyRequest.getPlfmSerNo());
-
-                //填充认证人
-                if (notyPushObjs.contains("1")) {
-                    //需要法人授权 新建会员登记簿时 法人授权状态置为 0
-                    basicInfo.setLegalAuthorizationStatus(0);
-                }
-                if (notyPushObjs.contains("2")) {
-                    //需要授权代理人授权 新建会员登记簿时 授权代理人授权状态置为 0
-                    basicInfo.setAuthorizationStatus(0);
-                }
+                pptmBody.getNotyQue().forEach(notyQue -> {
+                    BocomVipAccountNoticeInfo noticeInfo = new BocomVipAccountNoticeInfo();
+                    noticeInfo.setQrCode(notyQue.getMerchNotyBase64Stream());
+                    noticeInfo.setQrCodeEffectTime(new Date());
+                    noticeInfo.setNoticeObject(notyQue.getNotyPushObj());
+                    noticeInfoList.add(noticeInfo);
+
+                    if (notyQue.getNotyPushObj().equals("1")) {
+                        //需要法人授权 新建会员登记簿时 法人授权状态置为 0
+                        basicInfo.setLegalAuthorizationStatus(0);
+                    }
+                    if (notyQue.getNotyPushObj().equals("2")) {
+                        //需要授权代理人授权 新建会员登记簿时 授权代理人授权状态置为 0
+                        basicInfo.setAuthorizationStatus(0);
+                    }
+                });
+
+
             }
         }
         basicInfo.setChannel("bocom");
@@ -1325,12 +1341,14 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
             b2BJEBM2001RequestV1.setBizContent(b2BJEBM2001RequestV1Biz);
             B2BJEBM2001ResponseV1.PptmBody pptmBodyResponse = bocomVipCommonService.resetUrl(b2BJEBM2001RequestV1);
 
+            List<BocomVipAccountNoticeInfo> noticeInfoList = new ArrayList<>();
             pptmBodyResponse.getNotyQue().forEach(notyQue -> {
-                if ("1".equals(notyQue.getNotyPushObj())) {
-                    vipAccountBasicInfo.setQrCode(notyQue.getMerchNotyBase64Stream());
-                    vipAccountBasicInfo.setQrCodeEffectTime(new Date());
-//                    replaceBase64(vipAccountBasicInfo);
-                }
+                BocomVipAccountNoticeInfo noticeInfo = new BocomVipAccountNoticeInfo();
+                noticeInfo.setBocomVipAccountBasicInfoId(vipAccountBasicInfo.getId());
+                noticeInfo.setQrCode(notyQue.getMerchNotyBase64Stream());
+                noticeInfo.setQrCodeEffectTime(new Date());
+                noticeInfo.setNoticeObject(notyQue.getNotyPushObj());
+                noticeInfoList.add(noticeInfo);
             });
         }
 
@@ -2465,8 +2483,7 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
      */
     private void autoAuthenticator(BocomVipAccountBasicInfo bocomVipAccountBasicInfo){
         BocomBasicInfo basicInfo = bocomBasicInfoService.get(bocomVipAccountBasicInfo.getBocomBasicInfoId());
-        if (StringUtil.isNotEmpty(bocomVipAccountBasicInfo.getNoticeObject())) {
-            String[] values = bocomVipAccountBasicInfo.getNoticeObject().split("/");
+        if (CollectionUtil.isNotEmpty(bocomVipAccountBasicInfo.getNoticeInfoList())) {
             //授权代理人
             BocomAuthorizedAgent authorizedAgent = bocomAuthorizedAgentService.lambdaQuery()
                     .eq(BocomAuthorizedAgent::getBocomBasicInfoId, basicInfo.getId())
@@ -2475,23 +2492,15 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
             BocomLegalPersonInfo legalPersonInfo = bocomLegalPersonInfoService.lambdaQuery()
                     .eq(BocomLegalPersonInfo::getBocomBasicInfoId, basicInfo.getId())
                     .one();
-            String authenticator = "";
-            if (values.length > 0) {
-                if (values.length == 1) {
-                    if (authorizedAgent != null) {
-                        //取授权代理人
-                        authenticator = authorizedAgent.getName();
-                    }
+            bocomVipAccountBasicInfo.getNoticeInfoList().forEach(n->{
+                if (n.getNoticeObject().equals("1")){
+                    n.setAuthenticator(legalPersonInfo.getName());
                 }
-
-                if (values.length > 1) {
-                    if (authorizedAgent != null && legalPersonInfo != null) {
-                        //取法人和授权代理人
-                        authenticator = authorizedAgent.getName() + "和" + legalPersonInfo.getName();
-                    }
+                if (n.getNoticeObject().equals("2")){
+                    n.setAuthenticator(authorizedAgent.getName());
                 }
-                bocomVipAccountBasicInfo.setAuthenticator(authenticator);
-            }
+            });
+
         }
     }
 

+ 20 - 0
src/main/java/com/sunxung/factoring/service/bocom/vipaccount/impl/BocomVipAccountNoticeInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.sunxung.factoring.service.bocom.vipaccount.impl;
+
+import com.sunxung.factoring.entity.bocom.vipaccount.BocomVipAccountNoticeInfo;
+import com.sunxung.factoring.mapper.bocom.vipaccount.BocomVipAccountNoticeInfoMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sunxung.factoring.service.bocom.vipaccount.IBocomVipAccountNoticeInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 会员账户-通知推送表 服务实现类
+ * </p>
+ *
+ * @author wangyafan
+ * @since 2024-09-20
+ */
+@Service
+public class BocomVipAccountNoticeInfoServiceImpl extends ServiceImpl<BocomVipAccountNoticeInfoMapper, BocomVipAccountNoticeInfo> implements IBocomVipAccountNoticeInfoService {
+
+}

+ 15 - 0
src/main/resources/data/update/bocom/yafan.sql

@@ -257,3 +257,18 @@ INSERT INTO `t_dictionary` ( `name`, `parentId`, `code`, `value`, `gradation`, `
 VALUES ( '开通失败', (select t.id from t_dictionary t where t.code = 'bocomVipAccountStatus'), 'vipAccountOpeningFailed', NULL, 3,now(),now());
 
 alter table bocom_vip_bind_account_info add `money_confirm_time` timestamp  NULL COMMENT '激活时间';
+
+
+DROP TABLE IF EXISTS `bocom_vip_account_notice_info`;
+CREATE TABLE `bocom_vip_account_notice_info` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+	`bocom_vip_account_basic_info_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '会员账户-基础信息表id',
+	`qr_code` longtext COMMENT '授权二维码',
+  `qr_code_effect_time` timestamp NULL DEFAULT NULL COMMENT '授权二维码生效时间',
+  `notice_object` varchar(10) DEFAULT NULL COMMENT '通知推送对象  1-法人 2-授权代理人 3-个人',
+  `user_create` varchar(32)  DEFAULT '' COMMENT '创建人',
+  `user_modified` varchar(32)  DEFAULT '' COMMENT '修改人',
+  `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员账户-通知推送表';

+ 0 - 10
src/main/resources/mapper/BocomVipAccountComprehensiveDetailFileRelMapper.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.inkasso.factoring.mapper.bocom.vipaccount.BocomVipAccountComprehensiveDetailFileRelMapper">
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, bocom_vip_account_basic_info_id, date, user_create, user_modified, gmt_create, gmt_modified
-    </sql>
-
-</mapper>