Commit 774183d3 authored by hezhen's avatar hezhen

Merge branch 'dev-chw' of http://113.105.137.151:22280/youjj/cloud-platform into dev-chw

parents aeb7191d 123699ee
...@@ -172,4 +172,11 @@ public class BranchCompany { ...@@ -172,4 +172,11 @@ public class BranchCompany {
@Column(name = "is_del") @Column(name = "is_del")
private Integer isDel; private Integer isDel;
//浏览量
@Column(name = "browse_num")
private Integer browseNum;
//点赞数量
@Column(name = "give_num")
private Integer giveNum;
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.dto.CompanySearchDTO; import com.github.wxiaoqi.security.admin.dto.CompanySearchDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import com.github.wxiaoqi.security.admin.entity.BranchCompany; import com.github.wxiaoqi.security.admin.entity.BranchCompany;
import com.github.wxiaoqi.security.admin.mapper.BranchCompanyMapper; import com.github.wxiaoqi.security.admin.mapper.BranchCompanyMapper;
import com.github.wxiaoqi.security.admin.vo.CompanySearchVO; import com.github.wxiaoqi.security.admin.vo.CompanySearchVO;
...@@ -16,6 +17,7 @@ import com.xxfc.platform.universal.feign.MQSenderFeign; ...@@ -16,6 +17,7 @@ import com.xxfc.platform.universal.feign.MQSenderFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List; import java.util.List;
...@@ -72,6 +74,12 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany ...@@ -72,6 +74,12 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
} }
public ObjectRestResponse getHotCompany(Integer page,Integer limit){
Example example = new Example(BranchCompany.class);
example.orderBy("browseNum").asc();
PageDataVO<BranchCompany> pageDataVO = PageDataVO.pageInfo(page, limit, () -> mapper.selectByExample(example));
return ObjectRestResponse.succ(pageDataVO);
}
} }
...@@ -164,6 +164,35 @@ public class GroupBiz extends BaseBiz<GroupMapper, Group> { ...@@ -164,6 +164,35 @@ public class GroupBiz extends BaseBiz<GroupMapper, Group> {
findParentID(map, relationMenus, parentId); findParentID(map, relationMenus, parentId);
} }
/**
* 分配资源权限(批量)
*
* @param groupId
* @param elements
*/
@CacheClear(keys = {"permission:ele","permission:u","app:permission:ele","app:permission:u"})
public void modifyAuthorityElements(int groupId, String[] elements) {
resourceAuthorityMapper.deleteByAuthorityIdAndResourceType(groupId + "", AdminCommonConstant.RESOURCE_TYPE_BTN);
if (elements.length>0){
// List<Menu> menuList = menuMapper.selectAll();
// Map<String, String> map = new HashMap<String, String>();
// for (Menu menu : menuList) {
// map.put(menu.getId().toString(), menu.getParentId().toString());
// }
// Set<String> relationMenus = new HashSet<String>();
// relationMenus.addAll(Arrays.asList(menus));
// ResourceAuthority authority = null;
// for (String menuId : menus) {
// findParentID(map, relationMenus, menuId);
// }
Set<String> relationElements = new HashSet<String>();
relationElements.addAll(Arrays.asList(elements));
for (String elementId : relationElements) {
modifyAuthorityElement(groupId, 0, Integer.valueOf(elementId));
}
}
}
/** /**
* 分配资源权限 * 分配资源权限
* *
......
package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.biz.BranchCompanyBiz;
import com.github.wxiaoqi.security.admin.biz.CompanyInfoApplyBiz;
import com.github.wxiaoqi.security.admin.biz.CompanyInfoOrderBiz;
import com.github.wxiaoqi.security.admin.entity.CompanyInfo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping("app/branchCompany")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
@Api(tags = {"商家"})
public class AppBranchCompanyController extends BaseController<CompanyInfoApplyBiz> {
@Autowired
BranchCompanyBiz branchCompanyBiz;
@GetMapping("getHotCompany")
@ApiModelProperty("获取热门商家")
public ObjectRestResponse getHotCompany(@RequestParam("page") Integer page,
@RequestParam("limit") Integer limit) {
return ObjectRestResponse.succ(branchCompanyBiz.getHotCompany(page,limit));
}
}
...@@ -93,6 +93,24 @@ public class GroupController extends BaseController<GroupBiz, Group> { ...@@ -93,6 +93,24 @@ public class GroupController extends BaseController<GroupBiz, Group> {
return new ObjectRestResponse().rel(true); return new ObjectRestResponse().rel(true);
} }
@RequestMapping(value = "V2/{id}/authority/menu", method = RequestMethod.PUT)
@ResponseBody
public ObjectRestResponse modifyMenuAuthorityV2(@PathVariable int id, String menuTrees, String elementTrees){
String [] menus =new String[]{};
String [] elements =new String[]{};
if (StringUtils.isNotBlank(menuTrees)){
menus= menuTrees.split(",");
}
if (StringUtils.isNotBlank(elementTrees)){
elements= elementTrees.split(",");
}
baseBiz.modifyAuthorityMenu(id, menus);
baseBiz.modifyAuthorityElements(id, elements);
return new ObjectRestResponse().rel(true);
}
@RequestMapping(value = "/{id}/authority/menu", method = RequestMethod.GET) @RequestMapping(value = "/{id}/authority/menu", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ObjectRestResponse<List<AuthorityMenuTree>> getMenuAuthority(@PathVariable int id){ public ObjectRestResponse<List<AuthorityMenuTree>> getMenuAuthority(@PathVariable int id){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment