|
@@ -270,7 +270,7 @@ public class AnalysisDiyCustomerComponent {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /* try {
|
|
|
|
|
|
|
+ /*try {
|
|
|
JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.BOSSLIST, null)));
|
|
JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.BOSSLIST, null)));
|
|
|
code = bossListJson.getInteger("code");
|
|
code = bossListJson.getInteger("code");
|
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
@@ -283,7 +283,7 @@ public class AnalysisDiyCustomerComponent {
|
|
|
throw e;
|
|
throw e;
|
|
|
}*/
|
|
}*/
|
|
|
|
|
|
|
|
- /* try {
|
|
|
|
|
|
|
+ /*try {
|
|
|
JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.MANAGERLIST, null)));
|
|
JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.MANAGERLIST, null)));
|
|
|
code = bossListJson.getInteger("code");
|
|
code = bossListJson.getInteger("code");
|
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
@@ -296,7 +296,7 @@ public class AnalysisDiyCustomerComponent {
|
|
|
throw e;
|
|
throw e;
|
|
|
}*/
|
|
}*/
|
|
|
|
|
|
|
|
- /* try {
|
|
|
|
|
|
|
+ /*try {
|
|
|
//获取厨卫业务员人员
|
|
//获取厨卫业务员人员
|
|
|
JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.BUSINESSLIST, null)));
|
|
JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.BUSINESSLIST, null)));
|
|
|
code = bossListJson.getInteger("code");
|
|
code = bossListJson.getInteger("code");
|
|
@@ -333,6 +333,112 @@ public class AnalysisDiyCustomerComponent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * @description: 厨卫人员拉取
|
|
|
|
|
+ * @author: qxm
|
|
|
|
|
+ * @date: 2022/4/25 10:03
|
|
|
|
|
+ */
|
|
|
|
|
+ public SyncLog analyCwCustomer() {
|
|
|
|
|
+ if(deptId==null){
|
|
|
|
|
+ deptId = Long.parseLong(configService.selectConfigByKey("libang.customer.deptid"));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(roleIds==null){
|
|
|
|
|
+ Long roleId = Long.parseLong(configService.selectConfigByKey("libang.customer.roleid"));
|
|
|
|
|
+ roleIds = new Long[]{roleId};
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (roleGuideIds == null) {
|
|
|
|
|
+ Long roleId = Long.parseLong(configService.selectConfigByKey("libang.guide.roleid"));
|
|
|
|
|
+ roleGuideIds = new Long[]{roleId};
|
|
|
|
|
+ }
|
|
|
|
|
+ if (roleCwIds == null) {
|
|
|
|
|
+ Long roleId = Long.parseLong(configService.selectConfigByKey("libang.cw.roleid"));
|
|
|
|
|
+ roleCwIds = new Long[]{roleId};
|
|
|
|
|
+ }
|
|
|
|
|
+ if (roleCwDiyIds == null) {
|
|
|
|
|
+ Long roleId = Long.parseLong(configService.selectConfigByKey("libang.cw.roleid"));
|
|
|
|
|
+ Long roleDiyId = Long.parseLong(configService.selectConfigByKey("libang.guide.roleid"));
|
|
|
|
|
+ roleCwDiyIds = new Long[]{roleId, roleDiyId};
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ List<SyncFailDetail> failDetails = new ArrayList<>();
|
|
|
|
|
+ SyncLog syncLog = new SyncLog();
|
|
|
|
|
+ syncLog.setStartTime(new Date());
|
|
|
|
|
+ String packageId = "diycustomer"+syncLog.getStartTime().getTime();
|
|
|
|
|
+ syncLog.setPackageId(packageId);
|
|
|
|
|
+ long total = 0;
|
|
|
|
|
+ long success = 0;
|
|
|
|
|
+ Set<String> loginNameSet = sysUserService.selectAllUserLoginName();
|
|
|
|
|
+ Set<String> diyNameSet = sysUserService.selectDiyUserLoginName();
|
|
|
|
|
+
|
|
|
|
|
+ Map<String,Customers> codeMap = customersMapper.selectCustomerMapByCode();
|
|
|
|
|
+
|
|
|
|
|
+ Map<String,Customers> chainsMap = customersMapper.selectCustomerMapByChainsCode();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.BOSSLIST, null)));
|
|
|
|
|
+ int code = bossListJson.getInteger("code");
|
|
|
|
|
+ if (code == 0) {
|
|
|
|
|
+ success += buildSysUserEbr(bossListJson, loginNameSet, diyNameSet, 4, failDetails, packageId, chainsMap);
|
|
|
|
|
+ total += bossListJson.getJSONArray("userlist").size();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("获取厨卫老板列表接口错误!");
|
|
|
|
|
+ customerAccessTokenUtil.reSetToken();
|
|
|
|
|
+ throw e;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.MANAGERLIST, null)));
|
|
|
|
|
+ int code = bossListJson.getInteger("code");
|
|
|
|
|
+ if (code == 0) {
|
|
|
|
|
+ success += buildSysUserEbr(bossListJson, loginNameSet, diyNameSet, 5, failDetails, packageId, chainsMap);
|
|
|
|
|
+ total += bossListJson.getJSONArray("userlist").size();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("获取厨卫经理列表接口错误!");
|
|
|
|
|
+ customerAccessTokenUtil.reSetToken();
|
|
|
|
|
+ throw e;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ //获取厨卫业务员人员
|
|
|
|
|
+ JSONObject bossListJson = JSONObject.parseObject(HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.BUSINESSLIST, null)));
|
|
|
|
|
+ int code = bossListJson.getInteger("code");
|
|
|
|
|
+ if (code == 0) {
|
|
|
|
|
+ success += buildSysUserEbr(bossListJson, loginNameSet, diyNameSet, 6, failDetails, packageId, chainsMap);
|
|
|
|
|
+ total += bossListJson.getJSONArray("userlist").size();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("获取厨卫业务人员列表接口错误!");
|
|
|
|
|
+ customerAccessTokenUtil.reSetToken();
|
|
|
|
|
+ throw e;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try{
|
|
|
|
|
+ syncLog.setTotalCount(total);
|
|
|
|
|
+ syncLog.setSuccessCount(success);
|
|
|
|
|
+ syncLog.setFaileCount((long)failDetails.size());
|
|
|
|
|
+ syncLog.setEndTime(new Date());
|
|
|
|
|
+ syncLog.setSyncType("diycustomer");
|
|
|
|
|
+
|
|
|
|
|
+ if(failDetails.size()>0){
|
|
|
|
|
+ syncFailDetailMapper.batchInsertSyncFailDetail(failDetails);
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ log.error("解析用户插入解析日志出错",e);
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ throw new BusinessException("解析用户插入解析日志出错",e);
|
|
|
|
|
+ }finally {
|
|
|
|
|
+ syncLogService.insertSyncLog(syncLog);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 构建 插入用户List
|
|
* 构建 插入用户List
|
|
|
* @param json
|
|
* @param json
|