|
|
@@ -83,7 +83,11 @@ public class InsertServiceImpl implements InsertService {
|
|
|
//A0001309
|
|
|
//LYDF@890cdopBD
|
|
|
Map<String, Object> dataMaps = new HashMap<>();
|
|
|
- List<Map<String,Object>> list = baseDao.queryForList(" select to_char(sysdate,'yyyyMMdd')||UUID_SEQ.nextval UUID,pc_custprodcode,pc_mdname_user,qty from prodmdedi_view left join mdkc_vies on pc_prodcode=ba_prodcode");
|
|
|
+ List<Map<String,Object>> list = baseDao.queryForList("select to_char(sysdate,'yyyy-MM-dd hh24:mi:ss') transactionDate,to_char(sysdate,'yyyyMMdd')||UUID_SEQ.nextval UUID, AA.* from ( select pc_custprodcode,pc_mdname_user,nvl(sum(qty),0) qty " +
|
|
|
+ "from prodmdedi_view " +
|
|
|
+ "left join mdkc_vies on pc_prodcode=ba_prodcode " +
|
|
|
+ "where nvl(qty,0)<>0" +
|
|
|
+ "group by pc_custprodcode,pc_mdname_user ) AA ");
|
|
|
|
|
|
//timestamp 是 long 当前时间戳 当前时间戳
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
@@ -101,7 +105,7 @@ public class InsertServiceImpl implements InsertService {
|
|
|
for (int z = 0; z < list.size(); z++) {
|
|
|
Map<String, Object> data = new HashMap<>();
|
|
|
//??sourceId 是 String 供方系统数据id 数据唯一标识,每个供应商每个id数据只允许推送一次,重复会返回有重复数据(建议用uuid,可以百度uuid)
|
|
|
- data.put("sourceId",list.get(z).get("pc_custprodcode").toString());
|
|
|
+ data.put("sourceId",list.get(z).get("UUID").toString());
|
|
|
//-demandItemCode 是 String 美的物料编码 美的物料编码必须要有数据 //客户物料编码
|
|
|
data.put("demandItemCode",list.get(z).get("pc_custprodcode").toString());
|
|
|
//-organizationCode 是 String 库存组织编码 美的系统库存组织代码,比如:M01
|
|
|
@@ -111,7 +115,8 @@ public class InsertServiceImpl implements InsertService {
|
|
|
//-supplyItemCode 否 String 供方物料编码 供方系统的物料编码
|
|
|
//-itemDescription 否 String 物料描述 物料描述
|
|
|
//-transactionDate 否 String 交易时间 如果为空,系统默认为当前时间
|
|
|
- data.put("transactionDate",list.get(z).get("pc_custprodcode").toString());
|
|
|
+// data.put("transactionDate",Long.parseLong(list.get(z).get("UUID").toString()));
|
|
|
+ data.put("transactionDate",list.get(z).get("transactionDate").toString());
|
|
|
//-reference 否 String 备注信息 备注信息
|
|
|
//-sourceBill 否 String 来源单据
|
|
|
datas.add(data);
|
|
|
@@ -120,8 +125,10 @@ public class InsertServiceImpl implements InsertService {
|
|
|
//正式接口https://gsc.midea.com/gscapp/supplierInventoryInterface/doImport
|
|
|
|
|
|
try {
|
|
|
- Response response = HttpUtil.doPost("https://gscuat.midea.com/gscapp/supplierInventoryInterface/doImport",
|
|
|
- JSON.toJSONString(dataMaps), false, "NoSign");
|
|
|
+ // System.setProperty("https.protocols", "TLSv1.2,TLSv1.1,SSLv3");
|
|
|
+ String Jsondata = JSON.toJSONString(dataMaps);
|
|
|
+ Response response = HttpUtil.doPostWithHead("https://gsc.midea.com/gscapp/supplierInventoryInterface/doImport",
|
|
|
+ Jsondata, false, "NoSign");
|
|
|
String responseText = response.getResponseText();
|
|
|
com.alibaba.fastjson.JSONObject parseObject = JSONArray.parseObject(responseText);
|
|
|
String responseCode = parseObject.getString("code");
|
|
|
@@ -132,7 +139,7 @@ public class InsertServiceImpl implements InsertService {
|
|
|
// onInquiryDetailUploadSuccess(ids);
|
|
|
// } else
|
|
|
|
|
|
- } catch (Exception e) {
|
|
|
+ }catch (Exception e) {
|
|
|
baseDao.execute("insert into " +
|
|
|
"messagelog (ML_ID, ML_DATE, ML_MAN, ML_CONTENT, ML_RESULT) values " +
|
|
|
"(messagelog_seq.nextval,to_char(sysdate,'yyyy-MM-dd hh24:mm:mi'),'超级管理员',"+timestamp+",'对接美的失败')");
|