shenjingwei 6 месяцев назад
Родитель
Сommit
79c99df1af
1 измененных файлов с 29 добавлено и 1 удалено
  1. 29 1
      src/custom/common/crm/bean/warrantycard.java

+ 29 - 1
src/custom/common/crm/bean/warrantycard.java

@@ -4,7 +4,10 @@ import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import common.YosException;
 import common.crm.bean.core.CrmBase;
-import common.data.*;
+import common.data.QuerySQL;
+import common.data.Row;
+import common.data.Rows;
+import common.data.SQLFactory;
 import common.data.db.DBConnect;
 import org.apache.logging.log4j.Logger;
 
@@ -67,8 +70,33 @@ public class warrantycard extends CrmBase {
         Row cardRow = cardRows.get(0);
         JSONObject crm_cardObject = new JSONObject();
 
+        crm_cardObject.put("cid", cardRow.getString("sa_customersid")); //客户档案id
         crm_cardObject.put("fbrandId", fbrandId);
         crm_cardObject.put("fcardNum", cardno);
+        crm_cardObject.put("fagent_num_created", cardRow.getRow("sa_agents", "sa_agentsid=:sa_agentsid").getString("agentnum"));//创建经销商编码不能为空
+        crm_cardObject.put("fagent_num", cardRow.getString("toagentnum"));//经销商编码不能为空
+        //crm_cardObject.put("fstore_num", fagent_num);//门店编码不能为空
+        crm_cardObject.put("fcard_num", cardRow.getString("cardno"));//保修卡号不能为空
+        crm_cardObject.put("fmechine_code", cardRow.getString("sku"));//产品序列号不能为空
+        crm_cardObject.put("fbeg_date", cardRow.getString("begdate"));
+        crm_cardObject.put("fend_date", cardRow.getString("enddate"));
+        crm_cardObject.put("fcount", cardRow.getInteger("count"));
+
+        Row itemRow = cardRow.getRow("plm_item", "itemid=:itemid");
+
+        crm_cardObject.put("fprod_num", itemRow.getString("itemno"));//产品编码不能为空
+        crm_cardObject.put("fprod_name", itemRow.getString("itemname"));//产品名称不能为空
+        crm_cardObject.put("fmodel", itemRow.getString("model"));
+        crm_cardObject.put("funit", "台");
+        crm_cardObject.put("fnote", "");
+        crm_cardObject.put("fisexception", false);
+        crm_cardObject.put("fisvoid", cardRow.getString("isvoid"));
+        crm_cardObject.put("fvoid_date", cardRow.getString("voiddate"));
+        crm_cardObject.put("fvoid_reason", cardRow.getString("voidreason"));
+        crm_cardObject.put("forder_no", cardRow.getString("onlineordernum"));
+        crm_cardObject.put("fisonline", cardRow.getBoolean("isonline")); //是否线上
+        crm_cardObject.put("fisonline_join", cardRow.getBoolean("isonlinejoin")); //是否网销
+        crm_cardObject.put("fisonline_remodel", false);//是否家装
 
         return crm_cardObject;
     }