Ver código fonte

聚好麦同步增加订单号、快递单号

cgp 1 dia atrás
pai
commit
fe1d963d9a

+ 12 - 1
fs-admin/src/main/java/com/fs/his/task/JhmTask.java

@@ -90,7 +90,10 @@ public class JhmTask {
                 newCustomer.setPhone(phone);
                 newCustomer.setCustomerName(order.getBuyer().getConsignee());
                 newCustomer.setAddress(buildFullAddress(order.getBuyer()));
-
+                //聚好麦订单号
+                newCustomer.setJhmOrderCode(order.getOrderNum());
+                //聚好麦快递单号
+                newCustomer.setJhmCourierNumber(order.getBuyer().getExpressNumber());
                 // 成交状态:订单状态为4(已完成)设为1,否则0
                 Integer kdzlMakeStatus = (order.getStatus() != null && order.getStatus() == 4) ? 1 : 0;
                 newCustomer.setKdzlMakeStatus(kdzlMakeStatus);
@@ -134,6 +137,14 @@ public class JhmTask {
                 customer.setCustomerName(customerName);
                 needUpdate = true;
             }
+            if (!Objects.equals(customer.getJhmOrderCode(), order.getOrderNum())) {
+                customer.setJhmOrderCode(order.getOrderNum());
+                needUpdate = true;
+            }
+            if (!Objects.equals(customer.getJhmCourierNumber(), order.getBuyer().getExpressNumber())) {
+                customer.setJhmCourierNumber(order.getBuyer().getExpressNumber());
+                needUpdate = true;
+            }
             if (orderTime != null && !Objects.equals(customer.getCreateTime(), orderTime)) {
                 customer.setCreateTime(orderTime);
                 needUpdate = true;

+ 10 - 0
fs-service/src/main/java/com/fs/qw/domain/FsCompanyCustomer.java

@@ -143,6 +143,16 @@ public class FsCompanyCustomer extends BaseEntity {
      */
     private String jsonInfo;
 
+    /**
+     * 聚好麦订单号
+     */
+    private String jhmOrderCode;
+
+    /**
+     * 聚好麦快递单号
+     */
+    private String jhmCourierNumber;
+
     //以下字段(非数据库字段,用于接收查询参数)
 
     /*** 认领号码*/

+ 36 - 4
fs-service/src/main/resources/mapper/qw/FsCompanyCustomerMapper.xml

@@ -31,7 +31,8 @@
         <result property="completeStatus"    column="complete_status"    />
         <result property="deptId"            column="dept_id"            />
         <result property="deptName"          column="dept_name"          />
-        <result property="userSource"        column="user_source"      />
+        <result property="userSource"        column="user_source"        />
+        <result property="patientMainComplaint" column="patient_main_complaint" />
         <!-- 口袋助理相关字段 -->
         <result property="kdzlAddWechatStatus" column="kdzl_add_wechat_status" />
         <result property="kdzlMakeStatus"      column="kdzl_make_status"      />
@@ -40,6 +41,8 @@
         <result property="prescribeId"         column="prescribe_id"         />
         <result property="templateId"         column="template_id"         />
         <result property="jsonInfo"          column="json_info"          />
+        <result property="jhmOrderCode"          column="jhm_order_code"          />
+        <result property="jhmCourierNumber"          column="jhm_courier_number"          />
     </resultMap>
 
     <sql id="selectFsCompanyCustomerVo">
@@ -50,7 +53,8 @@
                buy_count, claim_status,
                complete_status, dept_id, dept_name,
                kdzl_add_wechat_status, kdzl_make_status, kdzl_call_status,
-               process_status, prescribe_id, template_id, json_info,user_source
+               process_status, prescribe_id, template_id, json_info,user_source,jhm_order_code,
+               jhm_courier_number
         from fs_company_customer
     </sql>
 
@@ -272,6 +276,8 @@
             <if test="templateId != null">template_id,</if>
             <if test="jsonInfo != null">json_info,</if>
             <if test="userSource != null">user_source,</if>
+            <if test="jhmOrderCode != null">jhm_order_code,</if>
+            <if test="jhmCourierNumber != null">jhm_courier_number,</if>
             create_time
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -307,6 +313,8 @@
             <if test="templateId != null">#{templateId},</if>
             <if test="jsonInfo != null">#{jsonInfo},</if>
             <if test="userSource != null">#{userSource},</if>
+            <if test="jhmOrderCode != null">#{jhmOrderCode},</if>
+            <if test="jhmCourierNumber != null">#{jhmCourierNumber},</if>
             sysdate()
         </trim>
     </insert>
@@ -340,7 +348,9 @@
         kdzl_make_status,
         kdzl_call_status,
         process_status,
-        user_source
+        user_source,
+        jhm_order_code,
+        jhm_courier_number
         ) VALUES
         <foreach collection="toInsertList" item="item" separator=",">
             (
@@ -354,7 +364,9 @@
             #{item.kdzlMakeStatus},
             #{item.kdzlCallStatus},
             #{item.processStatus},
-            #{item.userSource}
+            #{item.userSource},
+            #{item.jhmOrderCode},
+            #{item.jhmCourierNumber}
             )
         </foreach>
     </insert>
@@ -394,6 +406,8 @@
             <if test="jsonInfo != null">json_info = #{jsonInfo},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="userSource != null">user_source = #{userSource},</if>
+            <if test="jhmOrderCode != null">jhm_order_code = #{jhmOrderCode},</if>
+            <if test="jhmCourierNumber != null">jhm_courier_number = #{jhmCourierNumber},</if>
             update_time = sysdate()
         </set>
         where id = #{id}
@@ -546,6 +560,24 @@
                 </foreach>
                 ELSE kdzl_make_status
             </trim>
+            <!-- 聚好麦订单号 -->
+            <trim prefix="jhm_order_code = CASE" suffix="END,">
+                <foreach collection="list" item="item">
+                    WHEN id = #{item.id}
+                    AND #{item.jhmOrderCode} IS NOT NULL
+                    THEN #{item.jhmOrderCode}
+                </foreach>
+                ELSE jhm_order_code
+            </trim>
+            <!-- 聚好麦快递单号 -->
+            <trim prefix="jhm_courier_number = CASE" suffix="END,">
+                <foreach collection="list" item="item">
+                    WHEN id = #{item.id}
+                    AND #{item.jhmCourierNumber} IS NOT NULL
+                    THEN #{item.jhmCourierNumber}
+                </foreach>
+                ELSE jhm_courier_number
+            </trim>
             <!-- 创建时间/订单时间 -->
             <trim prefix="create_time = CASE" suffix="END,">
                 <foreach collection="list" item="item">