|
@@ -5,8 +5,10 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.qmth.sop.business.service.SysConfigService;
|
|
import com.qmth.sop.business.service.SysConfigService;
|
|
import com.qmth.sop.business.sync.been.FxxkAppAuthInfo;
|
|
import com.qmth.sop.business.sync.been.FxxkAppAuthInfo;
|
|
import com.qmth.sop.business.sync.been.FxxkAppAuthResult;
|
|
import com.qmth.sop.business.sync.been.FxxkAppAuthResult;
|
|
|
|
+import com.qmth.sop.business.sync.been.FxxkCrm;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.enums.ExceptionResultEnum;
|
|
import com.qmth.sop.common.enums.ExceptionResultEnum;
|
|
|
|
+import com.qmth.sop.common.enums.ProductTypeEnum;
|
|
import com.qmth.sop.common.util.HttpUtil;
|
|
import com.qmth.sop.common.util.HttpUtil;
|
|
import com.qmth.sop.common.util.JacksonUtil;
|
|
import com.qmth.sop.common.util.JacksonUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -99,7 +101,7 @@ public class FxxkApiUtils {
|
|
/**
|
|
/**
|
|
* 查询自定义对象列表
|
|
* 查询自定义对象列表
|
|
*/
|
|
*/
|
|
- public void findCustomList() {
|
|
|
|
|
|
+ public List<FxxkCrm> findCustomList() {
|
|
String currentOpenUserId = sysConfigService.findByConfigKey(SystemConstant.FXXK_CURRENT_OPEN_USER_ID).getConfigValue();
|
|
String currentOpenUserId = sysConfigService.findByConfigKey(SystemConstant.FXXK_CURRENT_OPEN_USER_ID).getConfigValue();
|
|
String postUrl = sysConfigService.findByConfigKey(SystemConstant.FXXK_CUSTOM_QUERY_URL).getConfigValue();
|
|
String postUrl = sysConfigService.findByConfigKey(SystemConstant.FXXK_CUSTOM_QUERY_URL).getConfigValue();
|
|
try {
|
|
try {
|
|
@@ -132,6 +134,45 @@ public class FxxkApiUtils {
|
|
if (errorCode != 0) {
|
|
if (errorCode != 0) {
|
|
throw ExceptionResultEnum.ERROR.exception("获取自定义对象列表失败 : " + errorMessage);
|
|
throw ExceptionResultEnum.ERROR.exception("获取自定义对象列表失败 : " + errorMessage);
|
|
}
|
|
}
|
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
|
+ JSONArray dataList = data.getJSONArray("dataList");
|
|
|
|
+
|
|
|
|
+ List<FxxkCrm> fxxkCrmList = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < dataList.size(); i++) {
|
|
|
|
+ JSONObject cell = dataList.getJSONObject(i);
|
|
|
|
+ String crmName = cell.getString("display_name");
|
|
|
|
+ String crmNo = cell.getString("name");
|
|
|
|
+ Long beginTime = cell.getLong("createTime");
|
|
|
|
+
|
|
|
|
+ JSONObject ownerR = cell.getJSONObject("owner__r.nAME");
|
|
|
|
+ String managerName = ownerR.getString("name");
|
|
|
|
+
|
|
|
|
+ String customType = cell.getString("field_spOcm__c");
|
|
|
|
+ String customName = cell.getString("field_6TD92__c__r");
|
|
|
|
+ String customCounty = cell.getString("field_O0l25__c__r");
|
|
|
|
+ String customProvince = cell.getString("field_Nc2M6__c__r");
|
|
|
|
+ String customCity = cell.getString("field_270tB__c__r");
|
|
|
|
+ String customAddress = cell.getString("field_KmXg2__c");
|
|
|
|
+
|
|
|
|
+ Long examStartTime = cell.getLong("field_Fl84j__c");
|
|
|
|
+ Long examEndTime = cell.getLong("field_Gcsmt__c");
|
|
|
|
+
|
|
|
|
+ FxxkCrm fxxkCrm = new FxxkCrm();
|
|
|
|
+ fxxkCrm.setCrmName(crmName);
|
|
|
|
+ fxxkCrm.setCrmNo(crmNo);
|
|
|
|
+ fxxkCrm.setBeginTime(beginTime);
|
|
|
|
+ fxxkCrm.setManagerName(managerName);
|
|
|
|
+ fxxkCrm.setCustomType(ProductTypeEnum.CLOUD_MARK);
|
|
|
|
+ fxxkCrm.setCustomName(customName);
|
|
|
|
+ fxxkCrm.setCustomCounty(customCounty);
|
|
|
|
+ fxxkCrm.setCustomProvince(customProvince);
|
|
|
|
+ fxxkCrm.setCustomCity(customCity);
|
|
|
|
+ fxxkCrm.setCustomAddress(customAddress);
|
|
|
|
+ fxxkCrm.setExamStartTime(examStartTime);
|
|
|
|
+ fxxkCrm.setExamEndTime(examEndTime);
|
|
|
|
+ fxxkCrmList.add(fxxkCrm);
|
|
|
|
+ }
|
|
|
|
+ return fxxkCrmList;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw ExceptionResultEnum.ERROR.exception(e.getMessage());
|
|
throw ExceptionResultEnum.ERROR.exception(e.getMessage());
|
|
}
|
|
}
|