|
@@ -220,6 +220,68 @@ public class AnalysisDiyCustomerComponent {
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public void analyDiyCustomer2() {
|
|
|
|
|
+ //老板角色
|
|
|
|
|
+ if(roleIds==null){
|
|
|
|
|
+ Long roleId = Long.parseLong(configService.selectConfigByKey("libang.customer.roleid"));
|
|
|
|
|
+ roleIds = new Long[]{roleId};
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Map<String,Customers> chainsMap = customersMapper.selectCustomerMapByChainsCode();
|
|
|
|
|
+
|
|
|
|
|
+ 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();
|
|
|
|
|
+
|
|
|
|
|
+ String managerJson ="";
|
|
|
|
|
+ try{
|
|
|
|
|
+ managerJson = HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.MANAGER,null));
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ log.error("获取经销商经理接口错误!");
|
|
|
|
|
+ customerAccessTokenUtil.reSetToken();
|
|
|
|
|
+ throw e;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject mjson = JSONObject.parseObject(managerJson);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ int code = mjson.getInteger("code");
|
|
|
|
|
+ if(code==0){
|
|
|
|
|
+ JSONArray MANAGER = new JSONArray();
|
|
|
|
|
+ MANAGER.addAll(mjson.getJSONArray("userlist"));
|
|
|
|
|
+ success+=buildSysUser(MANAGER,loginNameSet,diyNameSet,1,failDetails,packageId,chainsMap);
|
|
|
|
|
+ total+=mjson.getJSONArray("userlist").size();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ String homeCustomerJson ="";
|
|
|
|
|
+ try{
|
|
|
|
|
+ homeCustomerJson = HttpUtils.sendSSLGet(customerAccessTokenUtil.getUrl(UrlType.HOMEDECORATION,null));
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ log.error("获取家装顾问师经销商人员接口错误!");
|
|
|
|
|
+ customerAccessTokenUtil.reSetToken();
|
|
|
|
|
+ throw e;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject homeJson = JSONObject.parseObject(homeCustomerJson);
|
|
|
|
|
+ code = homeJson.getInteger("code");
|
|
|
|
|
+ if(code==0){
|
|
|
|
|
+ JSONArray homeCustomer = new JSONArray();
|
|
|
|
|
+ homeCustomer.addAll(homeJson.getJSONArray("userlist"));
|
|
|
|
|
+ success+=buildSysUser(homeCustomer,loginNameSet,diyNameSet,9,failDetails,packageId,chainsMap);
|
|
|
|
|
+ total+=homeCustomer.size();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取并解析DIY经销商用户
|
|
* 获取并解析DIY经销商用户
|
|
|
* 因为经销商用户并不涉及用信息更新等方面 所以只插入不更新
|
|
* 因为经销商用户并不涉及用信息更新等方面 所以只插入不更新
|