Преглед изворни кода

# Conflicts:
# suishenbang-system/src/main/java/com/dgtly/system/service/impl/MetaHanaDeliverSignServiceImpl.java
# suishenbang-system/src/main/resources/mapper/system/MetaHanaDeliverSignMapper.xml

yousongbo пре 2 недеља
родитељ
комит
1bec4a2c17

+ 23 - 1
suishenbang-system/src/main/java/com/dgtly/system/domain/CustomersExt.java

@@ -59,7 +59,29 @@ public class CustomersExt extends BaseEntity
     @Excel(name = "接收认证的手机号")
     private String receiveUrlMobileNo;
 
-    public void setChainsCode(String chainsCode) 
+    private  String type;
+
+    private  Date createTime;
+
+    @Override
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    @Override
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public void setChainsCode(String chainsCode)
     {
         this.chainsCode = chainsCode;
     }

+ 5 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/impl/MetaHanaDeliverSignServiceImpl.java

@@ -4,8 +4,10 @@ import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import com.alibaba.fastjson.JSON;
 import com.dgtly.system.domain.*;
 import com.dgtly.system.mapper.CustomersExtMapper;
+import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +22,7 @@ import com.dgtly.common.core.text.Convert;
  * @author dgtly
  * @date 2025-01-03
  */
+@Slf4j
 @Service
 public class MetaHanaDeliverSignServiceImpl implements IMetaHanaDeliverSignService
 {
@@ -271,6 +274,8 @@ public class MetaHanaDeliverSignServiceImpl implements IMetaHanaDeliverSignServi
                customersExtMapper.updateCustomersExt(customer);
            }else {
                cust.setChainsCode(deliverNumber);
+               cust.setOrgAttestationTime(new Date());
+               cust.setCreateTime(new Date());
                customersExtMapper.insertCustomersExt(cust);
            }
        }

+ 14 - 1
suishenbang-system/src/main/resources/mapper/system/CustomersExtMapper.xml

@@ -16,10 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isAuthentication"    column="is_authentication"    />
         <result property="orgAttestationTime"    column="org_attestation_time"    />
         <result property="receiveUrlMobileNo"    column="receive_url_mobile_no"    />
+        <result property="type"    column="type"    />
     </resultMap>
 
     <sql id="selectCustomersExtVo">
-        select chains_code, creator, customers_name, org_id, id_type, id_number, org_legalId_number, org_legal_name, is_authentication, org_attestation_time,receive_url_mobile_no from customers_ext
+        select chains_code, creator, customers_name, org_id, id_type, id_number, org_legalId_number, org_legal_name, is_authentication, org_attestation_time,receive_url_mobile_no,type from customers_ext
     </sql>
 
     <select id="selectCustomersExtList" parameterType="CustomersExt" resultMap="CustomersExtResult">
@@ -48,6 +49,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where chains_code in (SELECT main_customer_code FROM meta_relation_ship_diy  WHERE main_customer_name = #{chainsCode}) limit 1
     </select>
 
+
+    <select id="selectCustomersExt" parameterType="String" resultMap="CustomersExtResult">
+        <include refid="selectCustomersExtVo"/>
+        where chains_code in (SELECT main_customer_code FROM meta_relation_ship_diy  WHERE customer_code = #{chainsCode})
+    </select>
+
     <!--根据订单id关联订单基础信息表查询经销商注册id-->
     <select id="selectOrgIdByOrderId" resultType="java.lang.String">
         SELECT
@@ -84,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orgLegalName != null  and orgLegalName != ''">org_legal_name,</if>
             <if test="isAuthentication != null  and isAuthentication != ''">is_authentication,</if>
             <if test="receiveUrlMobileNo != null  and receiveUrlMobileNo != ''">receive_url_mobile_no,</if>
+            <if test="orgAttestationTime != null ">org_attestation_time,</if>
+            <if test="createTime != null  ">create_time,</if>
+            <if test="type != null  and type != ''">type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="chainsCode != null  and chainsCode != ''">#{chainsCode},</if>
@@ -96,6 +106,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orgLegalName != null  and orgLegalName != ''">#{orgLegalName},</if>
             <if test="isAuthentication != null  and isAuthentication != ''">#{isAuthentication},</if>
             <if test="receiveUrlMobileNo != null  and receiveUrlMobileNo != ''">#{receiveUrlMobileNo},</if>
+            <if test="orgAttestationTime != null ">#{orgAttestationTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="type != null  and type != ''">#{type},</if>
          </trim>
     </insert>
 

+ 14 - 12
suishenbang-system/src/main/resources/mapper/system/MetaHanaDeliverSignMapper.xml

@@ -218,18 +218,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </insert>
 
     <select id="selectCertificationSync"  resultType="java.lang.String">
-        SELECT * FROM (
-                          SELECT chains_code
-                          FROM customers_ext
-                          WHERE chains_code IN (
-                              SELECT t2.customer_code
-                              FROM customers_ext t1
-                                       LEFT JOIN meta_relation_ship_diy t2
-                                                 ON t1.chains_code = t2.main_customer_code
-                              WHERE t1.is_authentication = '1'
-                          )
-                            AND is_authentication != '1'
-                      ) AS temp_table
+        SELECT
+            IFNULL(ce.chains_code, t2.customer_code) AS chains_code
+        FROM
+            meta_relation_ship_diy t2
+                LEFT JOIN customers_ext ce
+                          ON ce.chains_code = t2.customer_code
+                              AND ce.is_authentication != '1'
+        WHERE
+            EXISTS (
+            SELECT 1
+            FROM customers_ext t1
+            WHERE t1.chains_code = t2.main_customer_code
+          AND t1.is_authentication = '1'
+            )
     </select>