Explorar el Código

快手小店--成本管理

yumeng hace 6 meses
padre
commit
910688fdab

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

@@ -88,6 +88,8 @@ public class KwaixiaodianCostDetailEnd extends BaseEntity {
     @Excel(name = "出单日期时间戳")
     private Long orderTemp;
     private Long sendTime;
+    private Long poId;
+    private Long poiId;
 
 
     /**
@@ -208,6 +210,22 @@ public class KwaixiaodianCostDetailEnd extends BaseEntity {
         this.sendTime = sendTime;
     }
 
+    public Long getPoId() {
+        return poId;
+    }
+
+    public void setPoId(Long poId) {
+        this.poId = poId;
+    }
+
+    public Long getPoiId() {
+        return poiId;
+    }
+
+    public void setPoiId(Long poiId) {
+        this.poiId = poiId;
+    }
+
     public Date getDataCreateTime() {
         return dataCreateTime;
     }
@@ -240,6 +258,8 @@ public class KwaixiaodianCostDetailEnd extends BaseEntity {
                 ", statDate=" + statDate +
                 ", orderTemp=" + orderTemp +
                 ", sendTime=" + sendTime +
+                ", poId=" + poId +
+                ", poiId=" + poiId +
                 ", dataCreateTime=" + dataCreateTime +
                 ", dataUpdateTime=" + dataUpdateTime +
                 '}';

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

@@ -236,7 +236,7 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
     }
 
     @Override
-    public JSONObject costDetail(String skuNick, Integer dataType,Long date) {
+    public JSONObject costDetail(String skuNick, Integer dataType, Long date) {
         JSONObject returnJSon = new JSONObject();
 
         try {
@@ -373,6 +373,8 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                 Integer startQty = rangeJson.getInteger("startQty");
                 Integer endQty = rangeJson.getInteger("endQty");
                 BigDecimal price = rangeJson.getBigDecimal("price");
+                Long poiId = rangeJson.getLong("poiId");
+                Long poId = rangeJson.getLong("poId");
                 List<JSONObject> details = new ArrayList<>();
                 if (dataSize >= endQty) { // 如果数据量大于采购
                     details = costDetail.subList(startQty, endQty + 1);
@@ -405,6 +407,8 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                     addCostDetailEnd.setDataType(dataType);
                     addCostDetailEnd.setSortNum(sortNum);
                     addCostDetailEnd.setCostPrice(price);
+                    addCostDetailEnd.setPoId(poId);
+                    addCostDetailEnd.setPoiId(poiId);
                     addCostDetailEnd.setSendTime(sendTime);
                     costDetailEnds.add(addCostDetailEnd);
                 }
@@ -465,7 +469,7 @@ public class KwaiJSTServiceImpl implements IKwaiJSTService {
                             KwaixiaodianJstPurchase jst = JSONObject.parseObject(skuInfo.toJSONString(), KwaixiaodianJstPurchase.class);
                             jstList.add(jst);
                             if (!Check.isNull(skuInfo.getJSONArray("items"))) {
-                                addPurchaseItems(skuInfo.getString("po_date"),skuInfo.getJSONArray("items"));
+                                addPurchaseItems(skuInfo.getString("po_date"), skuInfo.getJSONArray("items"));
                             }
                         }
                     }

+ 7 - 4
ruixuan-live/src/main/resources/mapper/isc/KwaiJSTMapper.xml

@@ -73,7 +73,7 @@
         GROUP BY sku_nick
     </select>
     <select id="getItemsRange" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.String">
-        SELECT start_qty AS 'startQty', end_qty AS 'endQty', price
+        SELECT start_qty AS 'startQty', end_qty AS 'endQty', price as 'price',po_id as 'poId', poi_id as 'poiId'
         FROM kwaixiaodian_jst_purchase_items_range
         WHERE sku_id = #{skuNick}
         ORDER BY sku_num ASC
@@ -342,7 +342,9 @@
         stat_date,
         order_temp,
         cost_price,
-        send_time
+        send_time,
+        po_id,
+        poi_id
         )
         values
         <foreach collection="adds" item="add" separator=",">
@@ -358,8 +360,9 @@
             #{add.statDate},
             #{add.orderTemp},
             #{add.costPrice},
-            #{add.sendTime}
-
+            #{add.sendTime},
+            #{add.poId},
+            #{add.poiId}
             )
         </foreach>