|
@@ -8,6 +8,7 @@ import com.dgtly.common.annotation.Log;
|
|
|
import com.dgtly.common.core.controller.ApiBaseController;
|
|
|
import com.dgtly.common.core.domain.AjaxResult;
|
|
|
import com.dgtly.common.core.domain.ParameterObject;
|
|
|
+import com.dgtly.common.core.domain.Ztree;
|
|
|
import com.dgtly.common.enums.BusinessType;
|
|
|
import com.dgtly.system.domain.*;
|
|
|
import com.dgtly.system.service.*;
|
|
@@ -54,6 +55,8 @@ public class WxPortalController extends ApiBaseController {
|
|
|
private ISysMagnetLogService sysMagnetLogService;
|
|
|
@Autowired
|
|
|
private ISysRidingLanternService sysRidingLanternService;
|
|
|
+ @Autowired
|
|
|
+ private ISysUserOrderAuthorService sysUserOrderAuthorService;
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "微信门户首页",notes = "参数:{userId:1}")
|
|
@@ -223,6 +226,15 @@ public class WxPortalController extends ApiBaseController {
|
|
|
if (row > 0) {
|
|
|
//通过userId查询用户信息
|
|
|
SysUser user = userService.selectUserById(Long.valueOf(userId));
|
|
|
+ List<Ztree> author = sysUserOrderAuthorService.userAuthorTreeDataFmt(user.getUserId());
|
|
|
+ if (author.size() > 0 && author.get(0).getChildren().size() > 1) {
|
|
|
+ user.setAuthorType("TUC");
|
|
|
+ } else if (author.size() > 0 && author.get(0).getChildren().size() == 1) {//设置BUSINESS_UNIT
|
|
|
+ user.setAuthorType(author.get(0).getChildren().get(0).getCode());
|
|
|
+ }else{
|
|
|
+ user.setAuthorType("DIY");//默认diy
|
|
|
+ }
|
|
|
+ user.setAuthor(author);
|
|
|
return AjaxResult.success().putKV("sysUser", user);
|
|
|
} else {
|
|
|
return AjaxResult.error("经销商切换失败");
|