|
|
@@ -24,12 +24,10 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.client.corps.service.ICorpsAttnService;
|
|
|
import org.springblade.client.corps.service.ICorpsDescService;
|
|
|
import org.springblade.client.dto.GoodsDescDto;
|
|
|
-import org.springblade.client.entity.CorpsDesc;
|
|
|
-import org.springblade.client.entity.GoodsDesc;
|
|
|
-import org.springblade.client.entity.GoodsFiles;
|
|
|
-import org.springblade.client.entity.GoodsType;
|
|
|
+import org.springblade.client.entity.*;
|
|
|
import org.springblade.client.feign.IRedisClient;
|
|
|
import org.springblade.client.goods.excel.GoodsInfoPartsExcel;
|
|
|
import org.springblade.client.goods.service.IGoodsDescService;
|
|
|
@@ -37,6 +35,7 @@ import org.springblade.client.goods.service.IGoodsFilesService;
|
|
|
import org.springblade.client.goods.service.IGoodsTypeService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.excel.util.ExcelUtil;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
@@ -71,6 +70,7 @@ public class GoodsDescPartsController extends BladeController {
|
|
|
|
|
|
private final IGoodsDescService goodsDescService;
|
|
|
private final ICorpsDescService corpsDescService;
|
|
|
+ private final ICorpsAttnService corpsAttnService;
|
|
|
|
|
|
private final IRedisClient redisClient;//redis缓存处理
|
|
|
private final IStockGoodsClient stockGoodsClient;//库存
|
|
|
@@ -105,13 +105,30 @@ public class GoodsDescPartsController extends BladeController {
|
|
|
@RequestParam(name = "corpId", required = false) String corpId) {
|
|
|
GoodsDesc goodsDesc = goodsDescService.getById(goodsId);
|
|
|
String shoppingMall = "";
|
|
|
- if (ObjectUtils.isNotNull(Long.parseLong(corpId))){
|
|
|
+ if (ObjectUtils.isNotNull(corpId)){
|
|
|
CorpsDesc corpsDesc = corpsDescService.getById(Long.parseLong(corpId));
|
|
|
if (ObjectUtils.isNull(corpsDesc)) {
|
|
|
throw new RuntimeException("未查到用户信息");
|
|
|
} else {
|
|
|
shoppingMall = corpsDesc.getShoppingMall();
|
|
|
}
|
|
|
+ }else{
|
|
|
+ if (AuthUtil.getUserRole().equals("客户")) {
|
|
|
+ CorpsAttn corpsAttn = corpsAttnService.getOne(new LambdaQueryWrapper<CorpsAttn>()
|
|
|
+ .eq(CorpsAttn::getIsDeleted,0)
|
|
|
+ .eq(CorpsAttn::getTenantId,AuthUtil.getTenantId())
|
|
|
+ .eq(CorpsAttn::getUserId,AuthUtil.getUserId()));
|
|
|
+ if (ObjectUtils.isNull(corpsAttn)) {
|
|
|
+ throw new RuntimeException("未查到用户信息");
|
|
|
+ } else {
|
|
|
+ CorpsDesc corpsDesc = corpsDescService.getCorpId(corpsAttn.getPid());
|
|
|
+ if (ObjectUtils.isNull(corpsDesc)) {
|
|
|
+ throw new RuntimeException("未查到用户信息");
|
|
|
+ } else {
|
|
|
+ shoppingMall = corpsDesc.getShoppingMall();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (ObjectUtils.isNotNull(goodsDesc.getGoodsTypeId())) {
|
|
|
String typeId = goodsDesc.getGoodsTypeId();
|