Forráskód Böngészése

销售易代码迁移

wangxy 5 napja
szülő
commit
eee1cea1fe

+ 1 - 1
fs-company/src/main/resources/application.yml

@@ -3,7 +3,7 @@ server:
 # Spring配置
 spring:
   profiles:
-    active: druid-jnsyj-test
+    active: dev
 #    active: druid-jnmy-test
 #    active: druid-jzzx-test
 #    active: druid-hdt

+ 43 - 7
fs-service/src/main/java/com/fs/his/domain/FsExternalOrder.java

@@ -41,9 +41,11 @@ public class FsExternalOrder extends BaseEntity
     @Excel(name = "订单商品总数")
     private Long totalNum;
 
+    /** 订单总价(即商品总额) */
     @Excel(name = "订单总价")
     private BigDecimal totalPrice;
 
+    /** 实际支付金额(即定金) */
     @Excel(name = "实际支付金额")
     private BigDecimal payPrice;
 
@@ -108,13 +110,47 @@ public class FsExternalOrder extends BaseEntity
     @Excel(name = "收件人电话")
     private String receiverPhone;
 
-    /**
-     * 扩展订单id
-     */
-    private  String extendOrderId;
+    private String extendOrderId;
 
-    /**
-     * 店铺id
-     */
     private Long storeId;
+
+    /** 定金回款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "定金回款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date depositReturnTime;
+
+    /** 代收金额 */
+    @Excel(name = "代收金额")
+    private BigDecimal collectionPrice;
+
+    /** 跟单时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "跟单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date followTime;
+
+    /** 退款金额 */
+    @Excel(name = "退款金额")
+    private BigDecimal refundPrice;
+
+    /** 退款日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "退款日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date refundTime;
+
+    /** 订单类型 */
+    @Excel(name = "订单类型")
+    private Integer orderType;
+
+    /** 审核人 */
+    @Excel(name = "审核人")
+    private String auditor;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date auditTime;
+
+    /** 病名 */
+    @Excel(name = "病名")
+    private String diseaseName;
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/domain/FsUserAddress.java

@@ -42,6 +42,10 @@ public class FsUserAddress extends BaseEntity
     @Excel(name = "收货人所在区")
     private String district;
 
+    /** 乡镇 */
+    @Excel(name = "乡镇")
+    private String township;
+
     /** 城市IDS */
     @Excel(name = "城市IDS")
     private String cityIds;

+ 121 - 76
fs-service/src/main/resources/mapper/his/FsExternalOrderMapper.xml

@@ -1,53 +1,70 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fs.his.mapper.FsExternalOrderMapper">
-    
+
     <resultMap type="FsExternalOrder" id="FsExternalOrderResult">
-        <result property="orderId"    column="order_id"    />
-        <result property="orderCode"    column="order_code"    />
-        <result property="source"    column="source"    />
-        <result property="userId"    column="user_id"    />
-        <result property="userName"    column="user_name"    />
-        <result property="userPhone"    column="user_phone"    />
-        <result property="userAddress"    column="user_address"    />
-        <result property="totalNum"    column="total_num"    />
-        <result property="totalPrice"    column="total_price"    />
-        <result property="payPrice"    column="pay_price"    />
-        <result property="freightPrice"    column="freight_price"    />
-        <result property="isPay"    column="is_pay"    />
-        <result property="payTime"    column="pay_time"    />
-        <result property="payType"    column="pay_type"    />
-        <result property="status"    column="status"    />
-        <result property="deliveryCode"    column="delivery_code"    />
-        <result property="deliveryName"    column="delivery_name"    />
-        <result property="deliverySn"    column="delivery_sn"    />
-        <result property="deliveryTime"    column="delivery_time"    />
-        <result property="deliveryStatus"    column="delivery_status"    />
-        <result property="deliveryType"    column="delivery_type"    />
-        <result property="deliveryUpdateTime"    column="delivery_update_time"    />
-        <result property="shippingType"    column="shipping_type"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyUserId"    column="company_user_id"    />
-        <result property="remark"    column="remark"    />
-        <result property="externalCreateTime"    column="external_create_time"    />
-        <result property="isSync"    column="is_sync"    />
-        <result property="syncMsg"    column="sync_msg"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="extendOrderId"    column="extend_order_id"    />
-        <result property="storeId"    column="store_id"    />
-        <result property="receiverPhone"    column="receiver_phone"    />
+        <result property="orderId"             column="order_id"             />
+        <result property="orderCode"           column="order_code"           />
+        <result property="source"              column="source"               />
+        <result property="userId"              column="user_id"              />
+        <result property="userName"            column="user_name"            />
+        <result property="userPhone"           column="user_phone"           />
+        <result property="userAddress"         column="user_address"         />
+        <result property="totalNum"            column="total_num"            />
+        <result property="totalPrice"          column="total_price"          />
+        <result property="payPrice"            column="pay_price"            />
+        <result property="freightPrice"        column="freight_price"        />
+        <result property="isPay"               column="is_pay"               />
+        <result property="payTime"             column="pay_time"             />
+        <result property="payType"             column="pay_type"             />
+        <result property="status"              column="status"               />
+        <result property="deliveryCode"        column="delivery_code"        />
+        <result property="deliveryName"        column="delivery_name"        />
+        <result property="deliverySn"          column="delivery_sn"          />
+        <result property="deliveryTime"        column="delivery_time"        />
+        <result property="deliveryStatus"      column="delivery_status"      />
+        <result property="deliveryType"        column="delivery_type"        />
+        <result property="deliveryUpdateTime"  column="delivery_update_time" />
+        <result property="shippingType"        column="shipping_type"        />
+        <result property="companyId"           column="company_id"           />
+        <result property="companyUserId"       column="company_user_id"      />
+        <result property="remark"              column="remark"               />
+        <result property="externalCreateTime"  column="external_create_time" />
+        <result property="isSync"              column="is_sync"              />
+        <result property="syncMsg"             column="sync_msg"             />
+        <result property="createTime"          column="create_time"          />
+        <result property="updateTime"          column="update_time"          />
+        <result property="extendOrderId"       column="extend_order_id"      />
+        <result property="storeId"             column="store_id"             />
+        <result property="receiverPhone"       column="receiver_phone"       />
+        <result property="depositReturnTime"   column="deposit_return_time"  />
+        <result property="collectionPrice"     column="collection_price"     />
+        <result property="followTime"          column="follow_time"          />
+        <result property="refundPrice"         column="refund_price"         />
+        <result property="refundTime"          column="refund_time"          />
+        <result property="orderType"           column="order_type"           />
+        <result property="auditor"             column="auditor"              />
+        <result property="auditTime"           column="audit_time"           />
+        <result property="diseaseName"         column="disease_name"         />
     </resultMap>
 
     <sql id="selectFsExternalOrderVo">
-        select order_id, order_code, source, user_id, user_name, user_phone, user_address, total_num, total_price, pay_price, freight_price, is_pay, pay_time, pay_type, status, delivery_code, delivery_name, delivery_sn, delivery_time, delivery_status, delivery_type, delivery_update_time, shipping_type, company_id, company_user_id, remark, external_create_time, is_sync, sync_msg, create_time, update_time, extend_order_id, store_id, receiver_phone from fs_external_order
+        select order_id, order_code, source, user_id, user_name, user_phone, user_address,
+               total_num, total_price, pay_price, freight_price, is_pay, pay_time, pay_type,
+               status, delivery_code, delivery_name, delivery_sn, delivery_time, delivery_status,
+               delivery_type, delivery_update_time, shipping_type, company_id, company_user_id,
+               remark, external_create_time, is_sync, sync_msg, create_time, update_time,
+               extend_order_id, store_id, receiver_phone,
+               deposit_return_time, collection_price, follow_time,
+               refund_price, refund_time, order_type, auditor, audit_time, disease_name
+        from fs_external_order
     </sql>
 
     <select id="selectFsExternalOrderList" parameterType="FsExternalOrder" resultMap="FsExternalOrderResult">
         <include refid="selectFsExternalOrderVo"/>
-        <where>  
+        <where>
             <if test="orderCode != null  and orderCode != ''"> and order_code = #{orderCode}</if>
             <if test="source != null  and source != ''"> and source = #{source}</if>
             <if test="userId != null "> and user_id = #{userId}</if>
@@ -60,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by create_time desc
     </select>
-    
+
     <select id="selectFsExternalOrderByOrderId" parameterType="Long" resultMap="FsExternalOrderResult">
         <include refid="selectFsExternalOrderVo"/>
         where order_id = #{orderId}
@@ -112,9 +129,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="externalCreateTime != null">external_create_time,</if>
             <if test="isSync != null">is_sync,</if>
             <if test="syncMsg != null and syncMsg != ''">sync_msg,</if>
-            <if test="extendOrderId !=null and extendOrderId !=''">extend_order_id,</if>
+            <if test="extendOrderId != null and extendOrderId != ''">extend_order_id,</if>
             <if test="storeId != null">store_id,</if>
             <if test="receiverPhone != null and receiverPhone != ''">receiver_phone,</if>
+            <if test="depositReturnTime != null">deposit_return_time,</if>
+            <if test="collectionPrice != null">collection_price,</if>
+            <if test="followTime != null">follow_time,</if>
+            <if test="refundPrice != null">refund_price,</if>
+            <if test="refundTime != null">refund_time,</if>
+            <if test="orderType != null">order_type,</if>
+            <if test="auditor != null and auditor != ''">auditor,</if>
+            <if test="auditTime != null">audit_time,</if>
+            <if test="diseaseName != null and diseaseName != ''">disease_name,</if>
             create_time
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -146,9 +172,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="externalCreateTime != null">#{externalCreateTime},</if>
             <if test="isSync != null">#{isSync},</if>
             <if test="syncMsg != null and syncMsg != ''">#{syncMsg},</if>
-            <if test="extendOrderId !=null and extendOrderId !=''">#{extendOrderId},</if>
+            <if test="extendOrderId != null and extendOrderId != ''">#{extendOrderId},</if>
             <if test="storeId != null">#{storeId},</if>
             <if test="receiverPhone != null and receiverPhone != ''">#{receiverPhone},</if>
+            <if test="depositReturnTime != null">#{depositReturnTime},</if>
+            <if test="collectionPrice != null">#{collectionPrice},</if>
+            <if test="followTime != null">#{followTime},</if>
+            <if test="refundPrice != null">#{refundPrice},</if>
+            <if test="refundTime != null">#{refundTime},</if>
+            <if test="orderType != null">#{orderType},</if>
+            <if test="auditor != null and auditor != ''">#{auditor},</if>
+            <if test="auditTime != null">#{auditTime},</if>
+            <if test="diseaseName != null and diseaseName != ''">#{diseaseName},</if>
             sysdate()
         </trim>
     </insert>
@@ -184,9 +219,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="externalCreateTime != null">external_create_time = #{externalCreateTime},</if>
             <if test="isSync != null">is_sync = #{isSync},</if>
             <if test="syncMsg != null and syncMsg != ''">sync_msg = #{syncMsg},</if>
-            <if test="extendOrderId !=null and extendOrderId !=''">extend_order_id = #{extendOrderId},</if>
+            <if test="extendOrderId != null and extendOrderId != ''">extend_order_id = #{extendOrderId},</if>
             <if test="storeId != null">store_id = #{storeId},</if>
             <if test="receiverPhone != null and receiverPhone != ''">receiver_phone = #{receiverPhone},</if>
+            <if test="depositReturnTime != null">deposit_return_time = #{depositReturnTime},</if>
+            <if test="collectionPrice != null">collection_price = #{collectionPrice},</if>
+            <if test="followTime != null">follow_time = #{followTime},</if>
+            <if test="refundPrice != null">refund_price = #{refundPrice},</if>
+            <if test="refundTime != null">refund_time = #{refundTime},</if>
+            <if test="orderType != null">order_type = #{orderType},</if>
+            <if test="auditor != null and auditor != ''">auditor = #{auditor},</if>
+            <if test="auditTime != null">audit_time = #{auditTime},</if>
+            <if test="diseaseName != null and diseaseName != ''">disease_name = #{diseaseName},</if>
             update_time = sysdate()
         </trim>
         where order_id = #{orderId}
@@ -197,39 +241,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteFsExternalOrderByOrderIds" parameterType="String">
-        delete from fs_external_order where order_id in 
+        delete from fs_external_order where order_id in
         <foreach item="orderId" collection="array" open="(" separator="," close=")">
             #{orderId}
         </foreach>
     </delete>
 
     <select id="selectExternalOrderListVO" parameterType="FsExternalOrder" resultType="com.fs.his.domain.vo.FsExternalOrderListVO">
-        SELECT 
-            o.order_id,
-            o.order_code,
-            c.company_name AS companyName,
-            cu.user_name AS companyUserName,
-            o.user_name AS userName,
-            o.user_phone AS userPhone,
-            GROUP_CONCAT(oi.product_name SEPARATOR ',') AS productNames,
-            IFNULL(o.total_price, SUM(oi.price)) AS receivablePrice,
-            o.pay_price AS payPrice,
-            o.pay_type AS payType,
-            o.external_create_time AS externalCreateTime,
-            o.status,
-            o.delivery_sn AS deliverySn,
-            o.delivery_status AS deliveryStatus,
-            o.delivery_type AS deliveryType,
-            o.delivery_update_time AS deliveryUpdateTime,
-            CASE o.status
-                WHEN 1 THEN '待审核'
-                WHEN 2 THEN '待发货'
-                WHEN 3 THEN '待收货'
-                WHEN 4 THEN '已完成'
-                WHEN -3 THEN '已取消'
-                ELSE '未知'
-            END AS statusDesc,
-            IF(fa.id IS NOT NULL AND fa.audit_status = 0, true, false) AS isApplyAudit
+        SELECT
+        o.order_id,
+        o.order_code,
+        c.company_name AS companyName,
+        cu.user_name AS companyUserName,
+        o.user_name AS userName,
+        o.user_phone AS userPhone,
+        GROUP_CONCAT(oi.product_name SEPARATOR ',') AS productNames,
+        IFNULL(o.total_price, SUM(oi.price)) AS receivablePrice,
+        o.pay_price AS payPrice,
+        o.pay_type AS payType,
+        o.external_create_time AS externalCreateTime,
+        o.status,
+        o.delivery_sn AS deliverySn,
+        o.delivery_status AS deliveryStatus,
+        o.delivery_type AS deliveryType,
+        o.delivery_update_time AS deliveryUpdateTime,
+        CASE o.status
+        WHEN 1 THEN '待审核'
+        WHEN 2 THEN '待发货'
+        WHEN 3 THEN '待收货'
+        WHEN 4 THEN '已完成'
+        WHEN -3 THEN '已取消'
+        ELSE '未知'
+        END AS statusDesc,
+        IF(fa.id IS NOT NULL AND fa.audit_status = 0, true, false) AS isApplyAudit
         FROM fs_external_order o
         LEFT JOIN company c ON o.company_id = c.company_id
         LEFT JOIN company_user cu ON o.company_user_id = cu.user_id
@@ -282,17 +326,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             c.company_name AS companyName,
             cu.nick_name AS companyUserName
         FROM fs_external_order o
-        LEFT JOIN company c ON o.company_id = c.company_id
-        LEFT JOIN company_user cu ON o.company_user_id = cu.user_id
+                 LEFT JOIN company c ON o.company_id = c.company_id
+                 LEFT JOIN company_user cu ON o.company_user_id = cu.user_id
         WHERE o.order_id = #{orderId}
     </select>
 
     <select id="selectSignedOrdersWithoutAudit" resultMap="FsExternalOrderResult">
         select * from fs_external_order o
-        where o.delivery_status = 3 and o.status !=-3
+        where o.delivery_status = 3 and o.status != -3
         and not exists (
             select 1 from fs_store_order_finance_audit fa
-            where fa.order_id = o.order_id and fa.audit_type = 2 and fa.order_type=0
+            where fa.order_id = o.order_id and fa.audit_type = 2 and fa.order_type = 0
         )
     </select>
-</mapper>
+
+</mapper>

+ 5 - 1
fs-service/src/main/resources/mapper/his/FsUserAddressMapper.xml

@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="province"    column="province"    />
         <result property="city"    column="city"    />
         <result property="district"    column="district"    />
+        <result property="township"    column="township"    />
         <result property="cityIds"    column="city_ids"    />
         <result property="detail"    column="detail"    />
         <result property="postCode"    column="post_code"    />
@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFsUserAddressVo">
-        select address_id, user_id, real_name, phone, province, city, district, city_ids, detail, post_code, longitude, latitude, is_default, is_del, create_time, update_time, is_confirm, help_company_user_id from fs_user_address
+        select address_id, user_id, real_name, phone, province, city, district, township, city_ids, detail, post_code, longitude, latitude, is_default, is_del, create_time, update_time, is_confirm, help_company_user_id from fs_user_address
     </sql>
 
     <select id="selectFsUserAddressList" parameterType="FsUserAddress" resultMap="FsUserAddressResult">
@@ -64,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="province != null and province != ''">province,</if>
             <if test="city != null and city != ''">city,</if>
             <if test="district != null and district != ''">district,</if>
+            <if test="township != null and township != ''">township,</if>
             <if test="cityIds != null">city_ids,</if>
             <if test="detail != null and detail != ''">detail,</if>
             <if test="postCode != null and postCode != ''">post_code,</if>
@@ -83,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="province != null and province != ''">#{province},</if>
             <if test="city != null and city != ''">#{city},</if>
             <if test="district != null and district != ''">#{district},</if>
+            <if test="township != null and township != ''">#{township},</if>
             <if test="cityIds != null">#{cityIds},</if>
             <if test="detail != null and detail != ''">#{detail},</if>
             <if test="postCode != null and postCode != ''">#{postCode},</if>
@@ -106,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="province != null and province != ''">province = #{province},</if>
             <if test="city != null and city != ''">city = #{city},</if>
             <if test="district != null and district != ''">district = #{district},</if>
+            <if test="township != null and township != ''">township = #{township},</if>
             <if test="cityIds != null">city_ids = #{cityIds},</if>
             <if test="detail != null and detail != ''">detail = #{detail},</if>
             <if test="postCode != null and postCode != ''">post_code = #{postCode},</if>