Browse Source

快手小店--成本管理

yumeng 6 months ago
parent
commit
90256da979

+ 1 - 1
ruixuan-admin/src/main/resources/application-prod.yml

@@ -91,7 +91,7 @@ spring:
           enabled: true
           # 慢SQL记录
           log-slow-sql: true
-          slow-sql-millis: 1000
+          slow-sql-millis: 3000
           merge-sql: true
         wall:
           config:

+ 9 - 19
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KwaixiaodianCostDetail.java

@@ -72,6 +72,7 @@ public class KwaixiaodianCostDetail extends BaseEntity {
      */
     @Excel(name = "出单日期")
     private Long statDate;
+    private Long sendTime;
 
     /**
      * 出单日期时间戳
@@ -174,6 +175,14 @@ public class KwaixiaodianCostDetail extends BaseEntity {
         this.statDate = statDate;
     }
 
+    public Long getSendTime() {
+        return sendTime;
+    }
+
+    public void setSendTime(Long sendTime) {
+        this.sendTime = sendTime;
+    }
+
     public Long getOrderTemp() {
         return orderTemp;
     }
@@ -197,24 +206,5 @@ public class KwaixiaodianCostDetail extends BaseEntity {
     public void setDataUpdateTime(Date dataUpdateTime) {
         this.dataUpdateTime = dataUpdateTime;
     }
-
-    @Override
-    public String toString() {
-        return "KwaixiaodianCostDetail{" +
-                "id=" + id +
-                ", dataLongDate=" + dataLongDate +
-                ", dataType=" + dataType +
-                ", companyId=" + companyId +
-                ", oid=" + oid +
-                ", shopId=" + shopId +
-                ", itemId=" + itemId +
-                ", skuId='" + skuId + '\'' +
-                ", combinationSkuId='" + combinationSkuId + '\'' +
-                ", statDate=" + statDate +
-                ", orderTemp=" + orderTemp +
-                ", dataCreateTime=" + dataCreateTime +
-                ", dataUpdateTime=" + dataUpdateTime +
-                '}';
-    }
 }
 

+ 10 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KwaixiaodianCostDetailEnd.java

@@ -87,6 +87,7 @@ public class KwaixiaodianCostDetailEnd extends BaseEntity {
      */
     @Excel(name = "出单日期时间戳")
     private Long orderTemp;
+    private Long sendTime;
 
 
     /**
@@ -199,6 +200,14 @@ public class KwaixiaodianCostDetailEnd extends BaseEntity {
         this.orderTemp = orderTemp;
     }
 
+    public Long getSendTime() {
+        return sendTime;
+    }
+
+    public void setSendTime(Long sendTime) {
+        this.sendTime = sendTime;
+    }
+
     public Date getDataCreateTime() {
         return dataCreateTime;
     }
@@ -230,6 +239,7 @@ public class KwaixiaodianCostDetailEnd extends BaseEntity {
                 ", costPrice=" + costPrice +
                 ", statDate=" + statDate +
                 ", orderTemp=" + orderTemp +
+                ", sendTime=" + sendTime +
                 ", dataCreateTime=" + dataCreateTime +
                 ", dataUpdateTime=" + dataUpdateTime +
                 '}';

+ 6 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KwaiJSTServiceImpl.java

@@ -265,6 +265,7 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                     Integer num = jsonObject.getInteger("num");
                     Long statDate = jsonObject.getLong("statDate");
                     Long orderTemp = jsonObject.getLong("orderTemp");
+                    Long sendTime = jsonObject.getLong("sendTime");
                     for (int j = 0; j < num; j++) {
                         KwaixiaodianCostDetail addJson = new KwaixiaodianCostDetail();
                         addJson.setCompanyId(companyId);
@@ -276,6 +277,7 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                         addJson.setOrderTemp(orderTemp);
                         addJson.setDataType(dataType);
                         addJson.setDataLongDate(date);
+                        addJson.setSendTime(sendTime);
                         adds.add(addJson);
                     }
                 }
@@ -295,6 +297,7 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                     Integer num = jsonObject.getInteger("num");
                     Long statDate = jsonObject.getLong("statDate");
                     Long orderTemp = jsonObject.getLong("orderTemp");
+                    Long sendTime = jsonObject.getLong("sendTime");
                     for (int j = 0; j < num; j++) {  // 循环订单数量
                         for (int k = 0; k < skuInfo.size(); k++) { // 循环此组合sku下的单品sku
                             JSONObject skuDetailJson = skuInfo.get(k);
@@ -313,6 +316,7 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                                 addJson.setOrderTemp(orderTemp);
                                 addJson.setDataType(dataType);
                                 addJson.setDataLongDate(date);
+                                addJson.setSendTime(sendTime);
                                 adds.add(addJson);
                             }
                         }
@@ -389,6 +393,7 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                     String combinationSkuId = info.getString("combinationSkuId");
                     Long statDate = info.getLong("statDate");
                     Long orderTemp = info.getLong("orderTemp");
+                    Long sendTime = info.getLong("sendTime");
                     addCostDetailEnd.setCompanyId(companyId);
                     addCostDetailEnd.setOid(oid);
                     addCostDetailEnd.setItemId(itemId);
@@ -400,6 +405,7 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                     addCostDetailEnd.setDataType(dataType);
                     addCostDetailEnd.setSortNum(sortNum);
                     addCostDetailEnd.setCostPrice(price);
+                    addCostDetailEnd.setSendTime(sendTime);
                     costDetailEnds.add(addCostDetailEnd);
                 }
                 if (isBreak) {

+ 11 - 6
ruixuan-live/src/main/resources/mapper/isc/KwaiJSTMapper.xml

@@ -49,10 +49,10 @@
     </select>
     <select id="getOrderListBySku" resultType="com.alibaba.fastjson.JSONObject"
             parameterType="java.lang.String">
-        SELECT company_id AS 'companyId', oid AS 'oid', item_id AS 'itemId', shop_id AS 'shopId', sku_nick AS 'skuNick', num AS 'num', stat_date AS 'statDate', create_time AS 'orderTemp'
+        SELECT company_id AS 'companyId', oid AS 'oid', item_id AS 'itemId', shop_id AS 'shopId', sku_nick AS 'skuNick', num AS 'num', stat_date AS 'statDate', create_time AS 'orderTemp',send_time as 'sendTime'
         FROM kwaixiaodian_order_cursor_list
         WHERE sku_nick = #{skuNick}
-          AND status NOT IN (0, 10, 30, 80)
+          AND status IN (40, 50, 70)
         ORDER BY num DESC
     </select>
     <select id="getSkuInfo" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.String">
@@ -81,6 +81,7 @@
     <select id="getCostDetail" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.String">
         SELECT id,
                oid,
+               send_time AS 'sendTime',
                data_type AS 'dataType', company_id AS 'companyId', shop_id AS 'shopId', item_id AS 'itemId', sku_id AS 'skuId', combination_sku_id AS 'combinationSkuId', stat_date AS 'statDate', order_temp AS 'orderTemp'
         FROM kwaixiaodian_cost_detail
         WHERE sku_id = #{skuNick}
@@ -308,7 +309,8 @@
         combination_sku_id,
         stat_date,
         order_temp,
-        data_long_date
+        data_long_date,
+        send_time
         )
         values
         <foreach collection="adds" item="add" separator=",">
@@ -322,7 +324,8 @@
             #{add.combinationSkuId},
             #{add.statDate},
             #{add.orderTemp},
-            #{add.dataLongDate}
+            #{add.dataLongDate},
+            #{add.sendTime}
             )
         </foreach>
     </insert>
@@ -338,7 +341,8 @@
         combination_sku_id,
         stat_date,
         order_temp,
-        cost_price
+        cost_price,
+        send_time
         )
         values
         <foreach collection="adds" item="add" separator=",">
@@ -353,7 +357,8 @@
             #{add.combinationSkuId},
             #{add.statDate},
             #{add.orderTemp},
-            #{add.costPrice}
+            #{add.costPrice},
+            #{add.sendTime}
 
             )
         </foreach>