|
|
@@ -1,6 +1,5 @@
|
|
|
package com.uas.eis.task;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.uas.eis.dao.BaseDao;
|
|
|
import com.uas.eis.dao.SqlRowList;
|
|
|
import com.uas.eis.task.httpclient.X5JsonHttpClient;
|
|
|
@@ -35,18 +34,16 @@ public class SyncProductStockTask {
|
|
|
|
|
|
@Scheduled(cron = "0 0/1 * * * ?")
|
|
|
public void SyncProductStock() {
|
|
|
- System.out.println("13434");
|
|
|
X5JsonHttpClient x5JsonHttpClient = new X5JsonHttpClient(configuration.getX5appid(),configuration.getX5appkey(),configuration.getX5ProductStockUrl());
|
|
|
Map<String,Object> data = new HashMap<>();
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String format = sf.format(new Date());
|
|
|
- System.out.println("format:"+format);
|
|
|
data.put("request_time",format);
|
|
|
List<Map<String,Object>> list = new ArrayList<>();
|
|
|
- String Sql="select * from (select rownum rn, A.* from (select ct_code,CUSTOMTABLEDETAIL.*,nvl(remain_sum,0) remain_sum,nvl(pr_unit,'PCS') pr_unit from CUSTOMTABLE left join CUSTOMTABLEDETAIL on ct_id=cd_ctid " +
|
|
|
- " left join (select ba_prodcode,sum(ba_remain) remain_sum from batch where nvl(ba_remain,0)>0 group by ba_prodcode) A on ba_prodcode=cd_varchar50_1 " +
|
|
|
- " left join product on cd_varchar50_1=pr_code " +
|
|
|
- " where 1=2 and ct_caller='XiaoMiProduct' order by cd_detno) A) where rn<=5 and rn>4";
|
|
|
+ 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 " +
|
|
|
+ " 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 desc) where rownum=1)" +
|
|
|
+ " order by cd_detno) A) where rn<=1000";
|
|
|
SqlRowList rs = baseDao.queryForRowSet(Sql);
|
|
|
while (rs.next()){
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
@@ -57,13 +54,12 @@ public class SyncProductStockTask {
|
|
|
map.put("product_class",rs.getGeneralString("cd_varchar50_4"));
|
|
|
map.put("product_level",rs.getInt("cd_number_1"));
|
|
|
map.put("common_status",rs.getGeneralString("cd_varchar50_6"));
|
|
|
- map.put("stock_num",rs.getGeneralDouble("remain_sum"));
|
|
|
- map.put("stock_unit",rs.getGeneralString("pr_unit"));
|
|
|
+ map.put("stock_num",rs.getGeneralDouble("cd_number_2"));
|
|
|
+ map.put("stock_unit",rs.getGeneralString("cd_varchar50_5"));
|
|
|
+ map.put("ct_id",rs.getGeneralInt("ct_id"));
|
|
|
list.add(map);
|
|
|
}
|
|
|
data.put("data",list);
|
|
|
- System.out.println("1啊"+data);
|
|
|
- System.out.println("2啊"+ JSON.toJSONString(data));
|
|
|
if(list.size()>0){
|
|
|
x5JsonHttpClient.post(data, configuration, baseDao, "ProductStock");
|
|
|
}
|