Commit 863de7b4 by guojuxing

商品前置资源改成应用

parent 207d2fa4
......@@ -2,13 +2,17 @@ package com.gic.enterprise.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.AppMenuCodeConstants;
import com.gic.auth.dto.MenuDTO;
import com.gic.auth.dto.UserDTO;
import com.gic.auth.service.MenuApiService;
import com.gic.auth.service.UserApiService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.log.LogUtils;
import com.gic.enterprise.dto.BillingAccountDTO;
import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.dto.EnterpriseResourceRelDTO;
import com.gic.enterprise.response.EnterpriseRestResponse;
import com.gic.enterprise.service.BillingAccountApiService;
import com.gic.enterprise.service.EnterpriseApiService;
......@@ -25,6 +29,10 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
*
* @ClassName: EnterpriseController
......@@ -42,6 +50,8 @@ public class EnterpriseController {
private SmsOuterApiService smsOuterApiService;
@Autowired
private BillingAccountApiService billingAccountApiService;
@Autowired
private MenuApiService menuApiService;
@RequestMapping("get-enterprise-by-name")
public RestResponse getEnterpriseByName(String enterpriseName) {
......@@ -73,8 +83,27 @@ public class EnterpriseController {
@RequestMapping("/get-enterprise-info")
public RestResponse getEnterpriseInfo() {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
return ResultControllerUtils.commonResult(this.enterpriseApiService.getBusinessFrontRes(enterpriseId),
EnterpriseResourceRelVO.class);
//商品资源获取接口调整
ServiceResponse<MenuDTO> goods = menuApiService.getMenuByMenuCode(AppMenuCodeConstants.GOODS);
boolean hasGoodsAuth = false;
if (goods.isSuccess()) {
hasGoodsAuth = true;
}
List<EnterpriseResourceRelVO> result = new ArrayList<>();
EnterpriseResourceRelVO vo = new EnterpriseResourceRelVO();
vo.setResourceCode("901");
vo.setResourceName("商品选择器");
if (hasGoodsAuth) {
vo.setResourceSwitch(1);
} else {
vo.setResourceSwitch(0);
}
result.add(vo);
ServiceResponse<List<EnterpriseResourceRelDTO>> resourceResponse = this.enterpriseApiService.getBusinessFrontRes(enterpriseId);
if (resourceResponse.isSuccess()) {
result.addAll(EntityUtil.changeEntityListNew(EnterpriseResourceRelVO.class, resourceResponse.getResult()));
}
return RestResponse.success(result);
}
@RequestMapping("/update-enterprise")
......
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