Przeglądaj źródła

三方服务-调整大淘客功能

sunxbiao 8 miesięcy temu
rodzic
commit
cab7b4e550

+ 1 - 0
thirdPartyWares_service/src/main/java/com/bjtdba/thirdPartWares/dao/ThirdPartyGoodsDao.java

@@ -83,5 +83,6 @@ public interface ThirdPartyGoodsDao {
83
      */
83
      */
84
     int deleteById( );
84
     int deleteById( );
85
 
85
 
86
+    int deleteByType(Integer type);
86
 }
87
 }
87
 
88
 

+ 5 - 2
thirdPartyWares_service/src/main/java/com/bjtdba/thirdPartWares/service/impl/TaobaoServiceImpl.java

@@ -151,7 +151,8 @@ public class TaobaoServiceImpl implements TaobaoService {
151
 
151
 
152
             ThirdPartyWares thirdPartyWares = new ThirdPartyWares();
152
             ThirdPartyWares thirdPartyWares = new ThirdPartyWares();
153
             thirdPartyWares.setType(5);
153
             thirdPartyWares.setType(5);
154
-            Number commissionRate = obj.get("commissionRate")!=null?(Number)obj.get("commissionRate"):(((Number)obj.get("commission_rate")).doubleValue()*0.01);
154
+            // 当前 淘宝联盟账号等级为初级 的总收益的 33%;中级 66%; 高级 100% -10%服务手续费
155
+            Number commissionRate = obj.get("commissionRate")!=null?(double)obj.get("commissionRate")*0.25:(((Number)obj.get("commission_rate")).doubleValue()*0.01);
155
             thirdPartyWares.setCommission_rate(commissionRate);//佣金比例
156
             thirdPartyWares.setCommission_rate(commissionRate);//佣金比例
156
 
157
 
157
             Number market_price = obj.get("originalPrice") != null ? (Number)obj.get("originalPrice") : new Double(obj.get("zk_final_price").toString());
158
             Number market_price = obj.get("originalPrice") != null ? (Number)obj.get("originalPrice") : new Double(obj.get("zk_final_price").toString());
@@ -200,6 +201,7 @@ public class TaobaoServiceImpl implements TaobaoService {
200
      public Object saveThirdPartGood(){
201
      public Object saveThirdPartGood(){
201
         //定时执行180次3.6万条数据存入数据库
202
         //定时执行180次3.6万条数据存入数据库
202
         int aa=1;
203
         int aa=1;
204
+         thirdPartyGoodsDao.deleteByType(1);
203
         for(int i=1;i<=180;i++){
205
         for(int i=1;i<=180;i++){
204
             log.info("=================================开始循环第"+i+"次=========================");
206
             log.info("=================================开始循环第"+i+"次=========================");
205
             List<ThirdPartyWares> thirdPartyWaresList =selectTaobaoWaresList(i+"",200+"",null);
207
             List<ThirdPartyWares> thirdPartyWaresList =selectTaobaoWaresList(i+"",200+"",null);
@@ -320,7 +322,8 @@ public class TaobaoServiceImpl implements TaobaoService {
320
             waresDetail.setCouponEndTime(dateFormat.format(dateFormat.parse((String) jsonObjects.get("couponEndTime"))));
322
             waresDetail.setCouponEndTime(dateFormat.format(dateFormat.parse((String) jsonObjects.get("couponEndTime"))));
321
         }
323
         }
322
         //佣金 已经
324
         //佣金 已经
323
-        double yongjin = waresDetail.getZk_final_price().doubleValue() * Double.parseDouble(jsonObjects.get("commissionRate").toString())/100;
325
+        // 当前 淘宝联盟账号等级为初级 的总收益的 33%;中级 66%; 高级 100% -10%服务手续费
326
+        double yongjin = waresDetail.getZk_final_price().doubleValue() * Double.parseDouble(jsonObjects.get("commissionRate").toString())/100*0.25;
324
         BigDecimal pv=null;//新增pv值  pv=佣金=养老金
327
         BigDecimal pv=null;//新增pv值  pv=佣金=养老金
325
         BigDecimal yanglaojin=null; //养老金=pv
328
         BigDecimal yanglaojin=null; //养老金=pv
326
         BigDecimal yongjin_obj=new BigDecimal(yongjin).setScale(2,BigDecimal.ROUND_HALF_UP);
329
         BigDecimal yongjin_obj=new BigDecimal(yongjin).setScale(2,BigDecimal.ROUND_HALF_UP);

+ 4 - 0
thirdPartyWares_service/src/main/resources/mapper/ThirdPartyGoodsDao.xml

@@ -110,5 +110,9 @@
110
         delete from rrx_third_party_goods
110
         delete from rrx_third_party_goods
111
     </delete>
111
     </delete>
112
 
112
 
113
+    <delete id="deleteByType" parameterType="java.lang.Integer">
114
+        delete from rrx_third_party_goods
115
+        where type = #{type,jdbcType=INTEGER}
116
+    </delete>
113
 </mapper>
117
 </mapper>
114
 
118