Browse Source

【华信科】【WIP小米对接 按不同供应商上传 VC按联合无线供应商账号,安世按华信科的code传】

wub 1 year ago
parent
commit
77ecb3cfdb

+ 4 - 3
src/main/java/com/uas/eis/task/SyncProductStockTask.java

@@ -48,16 +48,17 @@ public class SyncProductStockTask {
                 String format = sf.format(new Date());
                 data.put("request_time", format);
                 List<Map<String, Object>> list = new ArrayList<>();
-                String Sql = "select * from (select rownum rn, A.* from (select ct_id,ct_code,CUSTOMTABLEDETAIL.* from CUSTOMTABLE left join CUSTOMTABLEDETAIL on ct_id=cd_ctid " +
+                String Sql = "select * from (select rownum rn, A.* from (select pr_brand,ct_id,ct_code,CUSTOMTABLEDETAIL.* from CUSTOMTABLE left join CUSTOMTABLEDETAIL on ct_id=cd_ctid left join product on pr_code = cd_varchar50_1 " +
                         "                 where  ct_caller='XiaoMiProduct' and ct_id= " +
                         "                 (select ct_id from (select ct_id from CUSTOMTABLE where ct_caller='XiaoMiProduct' " +
                         //"and trunc(ct_recorddate)=trunc(sysdate) " +
-                        "and ct_statuscode='AUDITED' and nvl(CT_SENDSTATUS,' ')<>'已上传' order by ct_id ) where rownum=1)" +
+                        "and ct_statuscode='AUDITED' and nvl(CT_SENDSTATUS,' ')<>'已上传' order by ct_id ) where rownum=1) " +
+                        " and PR_BRAND in ('NEXPERIA','VANCHIP') " +
                         "                 order by cd_detno) A) where rn<=1000";
                 SqlRowList rs = baseDao.queryForRowSet(Sql);
                 while (rs.next()) {
                     Map<String, Object> map = new HashMap<>();
-                    map.put("factory_code", configuration.getX5vendercode());
+                    map.put("factory_code", "VANCHIP".equals(rs.getGeneralString("pr_brand")) ? configuration.getX5vendercode() : configuration.getX5vendercodeSZ());
                     map.put("component_code", rs.getGeneralString("cd_varchar50_3"));
                     map.put("product_code", rs.getGeneralString("cd_varchar50_2"));
                     map.put("product_desc", rs.getGeneralString("cd_varchar200_1"));

+ 1 - 1
src/main/java/com/uas/eis/task/SyncProductWIPTask.java

@@ -60,7 +60,7 @@ public class SyncProductWIPTask {
 
                 while (rs.next()){
                     Map<String,Object> map = new HashMap<>();
-                    map.put("factory_code","VANCHIP".equals(rs.getGeneralString("cd_varchar50_2")) ? configuration.getX5vendercode() : configuration.getX5vendercodeSZ());
+                    map.put("factory_code","VANCHIP".equals(rs.getGeneralString("pr_brand")) ? configuration.getX5vendercode() : configuration.getX5vendercodeSZ());
                     map.put("component_code",rs.getGeneralString("cd_varchar50_1"));
                     map.put("process",rs.getGeneralString("cd_varchar50_2"));
                     map.put("line_id",rs.getGeneralString("cd_varchar50_3"));