|
@@ -4,6 +4,8 @@ import java.io.IOException;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.dgtly.common.annotation.ApiPassToken;
|
|
import com.dgtly.common.annotation.ApiPassToken;
|
|
|
import com.dgtly.common.annotation.Log;
|
|
import com.dgtly.common.annotation.Log;
|
|
|
import com.dgtly.common.core.controller.ApiBaseController;
|
|
import com.dgtly.common.core.controller.ApiBaseController;
|
|
@@ -12,8 +14,16 @@ import com.dgtly.common.core.domain.ParameterObject;
|
|
|
import com.dgtly.common.core.domain.Ztree;
|
|
import com.dgtly.common.core.domain.Ztree;
|
|
|
import com.dgtly.common.enums.BusinessType;
|
|
import com.dgtly.common.enums.BusinessType;
|
|
|
import com.dgtly.common.utils.StringUtils;
|
|
import com.dgtly.common.utils.StringUtils;
|
|
|
|
|
+import com.dgtly.common.utils.http.HttpUtils;
|
|
|
|
|
+import com.dgtly.sync.domain.Customers;
|
|
|
|
|
+import com.dgtly.sync.domain.SyncFailDetail;
|
|
|
|
|
+import com.dgtly.sync.domain.SyncLog;
|
|
|
|
|
+import com.dgtly.sync.mapper.CustomersMapper;
|
|
|
|
|
+import com.dgtly.sync.service.AnalysisDiyCustomerComponent;
|
|
|
|
|
+import com.dgtly.sync.utils.CustomerAccessTokenUtil;
|
|
|
import com.dgtly.system.domain.*;
|
|
import com.dgtly.system.domain.*;
|
|
|
import com.dgtly.system.service.*;
|
|
import com.dgtly.system.service.*;
|
|
|
|
|
+import com.dgtly.system.service.impl.SysUserServiceImpl;
|
|
|
import com.dgtly.wxportal.domain.HelpCenter;
|
|
import com.dgtly.wxportal.domain.HelpCenter;
|
|
|
import com.dgtly.wxportal.domain.WxBanner;
|
|
import com.dgtly.wxportal.domain.WxBanner;
|
|
|
import com.dgtly.wxportal.domain.WxMagnet;
|
|
import com.dgtly.wxportal.domain.WxMagnet;
|
|
@@ -449,9 +459,62 @@ public class WxPortalController extends ApiBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@PostMapping("/getHomeIconInfo")
|
|
@PostMapping("/getHomeIconInfo")
|
|
|
public AjaxResult getHoemIconCongif() throws IOException {
|
|
public AjaxResult getHoemIconCongif() throws IOException {
|
|
|
Map<String,Object> iconInfo= wxMagnetService.selectHomeIconInfoById();
|
|
Map<String,Object> iconInfo= wxMagnetService.selectHomeIconInfoById();
|
|
|
return AjaxResult.success(iconInfo);
|
|
return AjaxResult.success(iconInfo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //拉取经销商负责人 按照经销商编码
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CustomerAccessTokenUtil customerAccessTokenUtil;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private AnalysisDiyCustomerComponent analysisDiyCustomerComponent;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SysUserServiceImpl sysUserService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CustomersMapper customersMapper;
|
|
|
|
|
+ @PostMapping("/getCustomerManage")
|
|
|
|
|
+ public AjaxResult getCustomerManage(@RequestBody Map m) throws IOException {
|
|
|
|
|
+ String userNo=m.get("userNo").toString();
|
|
|
|
|
+ String depCode=m.get("depCode").toString();
|
|
|
|
|
+ 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.getUrlByParam(CustomerAccessTokenUtil.UrlType.MANAGERPARAM,userNo,depCode));
|
|
|
|
|
+ }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+=analysisDiyCustomerComponent.buildSysUser(MANAGER,loginNameSet,diyNameSet,1,failDetails,packageId,chainsMap);
|
|
|
|
|
+ total+=mjson.getJSONArray("userlist").size();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ Map<String,Object> iconInfo= wxMagnetService.selectHomeIconInfoById();
|
|
|
|
|
+ return AjaxResult.success(iconInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|