Commit 89094466 by guojuxing

商户前置资源字典数据接口

parent a3667d47
......@@ -59,5 +59,5 @@ public interface TabSysBusinessFrontResMapper {
List<TabSysBusinessFrontRes> listGroupResourceCode();
List<TabSysBusinessFrontRes> listByCode(@Param("code") String code, @Param("resourceType") Integer resourceType);
List<TabSysBusinessFrontRes> listByCode(@Param("codeList") List<String> codeList, @Param("resourceType") Integer resourceType);
}
\ No newline at end of file
......@@ -18,11 +18,11 @@ public interface BusinessFrontResService {
/**
* 根据code查询页面
* @param code
* @param codeList
* @param resourceType
* @return
*/
List<TabSysBusinessFrontRes> listByCode(String code, Integer resourceType);
List<TabSysBusinessFrontRes> listByCode(List<String> codeList, Integer resourceType);
TabSysBusinessFrontRes getByResourceId(Integer resourceId);
}
......@@ -53,8 +53,8 @@ public class BusinessFrontResServiceImpl implements BusinessFrontResService{
}
@Override
public List<TabSysBusinessFrontRes> listByCode(String code, Integer resourceType) {
return tabSysBusinessFrontResMapper.listByCode(code, resourceType);
public List<TabSysBusinessFrontRes> listByCode(List<String> codeList, Integer resourceType) {
return tabSysBusinessFrontResMapper.listByCode(codeList, resourceType);
}
@Override
......
......@@ -4,6 +4,7 @@ import java.util.*;
import com.gic.auth.entity.TabSysBusinessFrontRes;
import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.dto.EnterpriseResourceRelDTO;
import com.gic.enterprise.service.EnterpriseApiService;
import com.gic.open.api.dto.*;
import com.gic.open.api.service.ServeApiService;
......@@ -911,15 +912,22 @@ public class MenuApiServiceImpl implements MenuApiService {
Map<String, Object> resourcePage = new HashMap<>(16);
//过滤商品资源页面
ServiceResponse<EnterpriseDTO> enterpriseResult = enterpriseApiService.getEnterpriseById(enterpriseId);
if (enterpriseResult.isSuccess()) {
Integer goodsResource = enterpriseResult.getResult().getGoodsResource();
if (goodsResource == null || goodsResource.intValue() != 1) {
ServiceResponse<List<EnterpriseResourceRelDTO>> resourceResult = enterpriseApiService.getBusinessFrontRes(enterpriseId);
if (resourceResult.isSuccess()) {
//查询需要过滤的资源
List<EnterpriseResourceRelDTO> resourceList = resourceResult.getResult();
if (CollectionUtils.isNotEmpty(resourceList)) {
List<String> resourceCodeList = new ArrayList<>();
for (EnterpriseResourceRelDTO res : resourceList) {
if (res.getResourceSwitch().intValue() == 0) {
resourceCodeList.add(res.getResourceCode());
}
}
//如果没有开启商品资源开关,需要过滤一些菜单
//查询配置页面
List<TabSysBusinessFrontRes> resourceList = businessFrontResService.listByParam(null, 1);
if (CollectionUtils.isNotEmpty(resourceList)) {
for (TabSysBusinessFrontRes resource : resourceList) {
List<TabSysBusinessFrontRes> frontResourceList = businessFrontResService.listByCode(resourceCodeList, 1);
if (CollectionUtils.isNotEmpty(frontResourceList)) {
for (TabSysBusinessFrontRes resource : frontResourceList) {
resourcePage.put(resource.getPageName(), 1);
}
}
......
......@@ -169,7 +169,10 @@
from tab_sys_business_front_res
where status = 1
and resource_type = #{resourceType}
and resource_code = #{code}
and resource_code in
<foreach close=")" collection="codeList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</select>
<select id="listGroupResourceCode" resultMap="BaseResultMap">
......
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