|
|
@@ -0,0 +1,31 @@
|
|
|
+package com.uas.erp.schedular.mall.task;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.uas.api.b2c_erp.baisc.service.ProductService;
|
|
|
+import com.uas.erp.schedular.task.support.Method;
|
|
|
+import com.uas.erp.schedular.task.support.TaskMapping;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 商城同步物料信息
|
|
|
+ *
|
|
|
+ * Created by hejq on 2018-05-14.
|
|
|
+ */
|
|
|
+public class ProductTask extends AbstractTask {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ProductService productService;
|
|
|
+
|
|
|
+ @TaskMapping(title = "根据原厂型号获取产品", fixedDelay = 20000, method = Method.DOWNLOAD)
|
|
|
+ public void updateMallProduct() {
|
|
|
+ String cmpCode = "按键组1_ABS半透明_喷灰油+镭雕_外购公模件 CNE-6119K-US使用";
|
|
|
+ List<com.uas.api.b2c_erp.baisc.model.Product> products = productService.findByCmpCode(cmpCode);
|
|
|
+ System.out.println(JSONObject.toJSON(products));
|
|
|
+ if (!CollectionUtils.isEmpty(products)) {
|
|
|
+ // TODO
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|