yumeng 1 gadu atpakaļ
vecāks
revīzija
f65094217b

+ 35 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/settlementJob.java

@@ -24,6 +24,41 @@ public class settlementJob {
     private IKuaishouSupplyChainService ikuaishouSupplyChainService;
 
 
+    public static void main(String[] args) {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -31);
+        System.err.println(startDate);
+    }
+
+    @XxlJob("refreshCourierNumber")
+    public void refreshCourierNumber() throws Exception {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -31);
+        List<JSONObject> list = ikuaishouSupplyChainService.getSamplesData(startDate);
+        if (Check.isNull(list)) {
+            return;
+        }
+        for (JSONObject jsonObject : list) {
+            Long id = jsonObject.getLong("id");
+            String courierNumber = jsonObject.getString("courierNumber");
+            if (Check.isNull(courierNumber)) {
+                continue;
+            }
+            String companyCode = jsonObject.getString("companyCode");
+            if (Check.isNull(companyCode)) {
+                continue;
+            }
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", id);
+            map.put("courierNumber", courierNumber);
+            map.put("companyCode", companyCode);
+            HttpUtils.httpGet("http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/refreshCourierNumber", map, null);
+        }
+
+
+    }
+
+
     /**
      * 自定义创建监测链接预警
      */

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouSupplyChainMapper.java

@@ -30,4 +30,6 @@ public interface KuaishouSupplyChainMapper extends BaseMapper<KuaishouSupplyChai
     void deletePromoterBindChannelByDate(@Param("date") Long date);
 
     void cleanPromoterBindChannel(@Param("date") Long date);
+
+    List<JSONObject> getSamplesData(@Param("startDate") String startDate);
 }

+ 6 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouSupplyChainMapper.xml

@@ -159,5 +159,11 @@ group by t1.promoter_id;
 
 
     </select>
+    <select id="getSamplesData" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.String">
+      select  id,courier_number as 'courierNumber',company_code as 'companyCode' from kuaishou_item_collect_samples
+      where courier_number_time  &gt;= select str_to_date(CONCAT(date_format(#{startDate}, '%Y-%m-%d'), '00:00:01'), '%Y-%m-%d %H:%i:%s')
+      and collect_sample_status  = 4
+      and collect_sample_desc = '单号异常'
+    </select>
 
 </mapper>

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouSupplyChainService.java

@@ -27,4 +27,6 @@ public interface IKuaishouSupplyChainService extends IService<KuaishouSupplyChai
     void deletePromoterBindChannelByDate(Long date);
 
     void cleanPromoterBindChannel(Long date);
+
+    List<JSONObject> getSamplesData(String startDate);
 }

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouSupplyChainServiceImpl.java

@@ -206,6 +206,11 @@ public class KuaishouSupplyChainServiceImpl extends ServiceImpl<KuaishouSupplyCh
         supplyChainMapper.cleanPromoterBindChannel(date);
     }
 
+    @Override
+    public List<JSONObject> getSamplesData(String startDate) {
+        return supplyChainMapper.getSamplesData(startDate);
+    }
+
     public static String filterSupplement(String content) {
         StringBuilder sb = new StringBuilder();
         for (char ch : content.toCharArray()) {