|
@@ -12,18 +12,21 @@ public class sku_crm extends CrmBase {
|
|
|
super(logger);
|
|
super(logger);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void autoAction() throws YosException {
|
|
public void autoAction() throws YosException {
|
|
|
String result = getCRM("/ext/brproduct/machinecode/queryMachinecodePages?fbrandId=" + fbrandId + "&fisuploadflag=-1");
|
|
String result = getCRM("/ext/brproduct/machinecode/queryMachinecodePages?fbrandId=" + fbrandId + "&fisuploadflag=-1");
|
|
|
- JSONArray jsonArray = JSONArray.parseArray(result);
|
|
|
|
|
- for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
- JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
|
|
- String fmechineCode = jsonObject.getString("fmechineCode");
|
|
|
|
|
- if (oneAction(jsonObject)) {
|
|
|
|
|
- getCRM("/ext/brproduct/machinecode/editUploadflag?fbrandId=" + fbrandId + "&fmechineCode=" + fmechineCode + "&fisuploadflag=1&fisuploadnote=成功");
|
|
|
|
|
- } else {
|
|
|
|
|
- getCRM("/ext/brproduct/machinecode/editUploadflag?fbrandId=" + fbrandId + "&fmechineCode=" + fmechineCode + "&fisuploadflag=-1&fisuploadnote=失败");
|
|
|
|
|
|
|
+ JSONObject resultObject = JSONObject.parseObject(result);
|
|
|
|
|
+ if (resultObject.containsKey("data")) {
|
|
|
|
|
+ JSONArray dataArray = resultObject.getJSONArray("data");
|
|
|
|
|
+ logger.info("监测到crm有{}个序列号待同步", dataArray.size());
|
|
|
|
|
+ for (int i = 0; i < dataArray.size(); i++) {
|
|
|
|
|
+ JSONObject jsonObject = dataArray.getJSONObject(i);
|
|
|
|
|
+ String fmechineCode = jsonObject.getString("fmechineCode");
|
|
|
|
|
+ if (oneAction(jsonObject)) {
|
|
|
|
|
+ getCRM("/ext/brproduct/machinecode/editUploadflag?fbrandId=" + fbrandId + "&fmechineCode=" + fmechineCode + "&fisuploadflag=1&fisuploadnote=成功");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ getCRM("/ext/brproduct/machinecode/editUploadflag?fbrandId=" + fbrandId + "&fmechineCode=" + fmechineCode + "&fisuploadflag=-1&fisuploadnote=失败");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|