Browse Source

增加商城平台物料上传到ERP的功能

yujia 7 years ago
parent
commit
9cca0c1169

+ 179 - 0
src/main/java/com/uas/erp/schedular/mall/domain/Prod.java

@@ -0,0 +1,179 @@
+package com.uas.erp.schedular.mall.domain;
+
+import com.uas.erp.schedular.b2b.domain.KeyEntity;
+
+/**
+ * ERP系统的产品
+ * 
+ * @author yingp
+ * 
+ */
+public class Prod extends KeyEntity{
+
+	private Long pr_id;
+	private String pr_code; //物料编号
+	private String pr_detail; // 物料名称
+	private String pr_spec; // 物料规格
+	private String pr_unit; //单位
+	private String pr_manutype;	//生产类型;
+	private String pr_dhzc;	// 计划类型
+	private String pr_supplytype;	// 供应类型
+	private String pr_acceptmethod;	// 接收方式;
+	private Long pr_enid;	// 企业UU
+	private String pr_orispeccode;	// 原厂型号;
+	private String pr_status; //物料状态
+	private String pr_recordman;	//录入人;
+	private String pr_brand;		// 商城提供
+	private String pr_kind;		//商城提供
+	private String pr_cop;	// 所属公司
+	private String pr_uuid; // 标准料号
+
+	public Long getPr_id() {
+		return pr_id;
+	}
+
+	public void setPr_id(Long pr_id) {
+		this.pr_id = pr_id;
+	}
+
+	public String getPr_code() {
+		return pr_code;
+	}
+
+	public void setPr_code(String pr_code) {
+		this.pr_code = pr_code;
+	}
+
+	public String getPr_detail() {
+		return pr_detail;
+	}
+
+	public void setPr_detail(String pr_detail) {
+		this.pr_detail = pr_detail;
+	}
+
+	public String getPr_spec() {
+		return pr_spec;
+	}
+
+	public void setPr_spec(String pr_spec) {
+		this.pr_spec = pr_spec;
+	}
+
+	public String getPr_unit() {
+		return pr_unit;
+	}
+
+	public void setPr_unit(String pr_unit) {
+		this.pr_unit = pr_unit;
+	}
+
+	@Override
+	public Object getKey() {
+		return this.pr_id;
+	}
+
+	public String getPr_brand() {
+		return pr_brand;
+	}
+
+	public void setPr_brand(String pr_brand) {
+		this.pr_brand = pr_brand;
+	}
+
+	public String getPr_orispeccode() {
+		return pr_orispeccode;
+	}
+
+	public void setPr_orispeccode(String pr_orispeccode) {
+		this.pr_orispeccode = pr_orispeccode;
+	}
+
+	public String getPr_uuid() {
+		return pr_uuid;
+	}
+
+	public void setPr_uuid(String pr_uuid) {
+		this.pr_uuid = pr_uuid;
+	}
+
+	public String getPr_status() {
+		return pr_status;
+	}
+
+	public void setPr_status(String pr_status) {
+		this.pr_status = pr_status;
+	}
+
+	public String getPr_manutype() {
+		return pr_manutype;
+	}
+
+	public Prod setPr_manutype(String pr_manutype) {
+		this.pr_manutype = pr_manutype;
+		return this;
+	}
+
+	public String getPr_dhzc() {
+		return pr_dhzc;
+	}
+
+	public Prod setPr_dhzc(String pr_dhzc) {
+		this.pr_dhzc = pr_dhzc;
+		return this;
+	}
+
+	public String getPr_supplytype() {
+		return pr_supplytype;
+	}
+
+	public Prod setPr_supplytype(String pr_supplytype) {
+		this.pr_supplytype = pr_supplytype;
+		return this;
+	}
+
+	public String getPr_acceptmethod() {
+		return pr_acceptmethod;
+	}
+
+	public Prod setPr_acceptmethod(String pr_acceptmethod) {
+		this.pr_acceptmethod = pr_acceptmethod;
+		return this;
+	}
+
+	public Long getPr_enid() {
+		return pr_enid;
+	}
+
+	public Prod setPr_enid(Long pr_enid) {
+		this.pr_enid = pr_enid;
+		return this;
+	}
+
+	public String getPr_recordman() {
+		return pr_recordman;
+	}
+
+	public Prod setPr_recordman(String pr_recordman) {
+		this.pr_recordman = pr_recordman;
+		return this;
+	}
+
+	public String getPr_kind() {
+		return pr_kind;
+	}
+
+	public Prod setPr_kind(String pr_kind) {
+		this.pr_kind = pr_kind;
+		return this;
+	}
+
+	public String getPr_cop() {
+		return pr_cop;
+	}
+
+	public Prod setPr_cop(String pr_cop) {
+		this.pr_cop = pr_cop;
+		return this;
+	}
+}

+ 5 - 16
src/main/java/com/uas/erp/schedular/mall/task/ProductTask.java

@@ -1,31 +1,20 @@
 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;
+import org.springframework.stereotype.Component;
 
 /**
  * 商城同步物料信息
  *
  * Created by hejq on 2018-05-14.
  */
+@Component
+@TaskMapping(title = "商城物料")
 public class ProductTask extends AbstractTask {
 
-    @Autowired
-    private ProductService productService;
-
-    @TaskMapping(title = "根据原厂型号获取产品", fixedDelay = 20000, method = Method.DOWNLOAD)
+    @TaskMapping(title = "根据原厂型号获取产品", cron = "*/5 * * * * ?", 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
-        }
+        System.err.println("sffffasfsf");
     }
 }