|
@@ -51,12 +51,16 @@ import org.springblade.stock.vo.AppStockPartsVO;
|
|
|
import org.springblade.stock.vo.AppStockVO;
|
|
import org.springblade.stock.vo.AppStockVO;
|
|
|
import org.springblade.stock.vo.GoodsDescDto;
|
|
import org.springblade.stock.vo.GoodsDescDto;
|
|
|
import org.springblade.stock.vo.StockGoodsVO;
|
|
import org.springblade.stock.vo.StockGoodsVO;
|
|
|
|
|
+import org.springblade.system.entity.Tenant;
|
|
|
|
|
+import org.springblade.system.feign.ISysClient;
|
|
|
import org.springblade.system.user.entity.User;
|
|
import org.springblade.system.user.entity.User;
|
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
+import org.springframework.http.HttpRequest;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -97,6 +101,8 @@ public class StockGoodsController extends BladeController {
|
|
|
*/
|
|
*/
|
|
|
private final ICorpsAttnClient corpsAttnClient;
|
|
private final ICorpsAttnClient corpsAttnClient;
|
|
|
|
|
|
|
|
|
|
+ private final ISysClient sysClient;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 详情
|
|
* 详情
|
|
|
*/
|
|
*/
|
|
@@ -412,7 +418,21 @@ public class StockGoodsController extends BladeController {
|
|
|
* 自定义分页 手机端库存(新-配件)
|
|
* 自定义分页 手机端库存(新-配件)
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/app-stockPartsPage")
|
|
@GetMapping("/app-stockPartsPage")
|
|
|
- public R<IPage<AppStockPartsVO>> stockPartsPage(AppStockPartsVO appStockPartsVO, Query query) {
|
|
|
|
|
|
|
+ public R<IPage<AppStockPartsVO>> stockPartsPage(HttpServletRequest request , AppStockPartsVO appStockPartsVO, Query query) {
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println("Blade-Auth="+request.getHeader("Blade-Auth"));
|
|
|
|
|
+ if (ObjectUtils.isNull(request.getHeader("Blade-Auth"))){
|
|
|
|
|
+ // 获取租户信息
|
|
|
|
|
+ R<Tenant> tenant = sysClient.getTenantByAppId(request.getHeader("appId"));
|
|
|
|
|
+// R<Tenant> tenant = sysClient.getTenantByAppId("wx64d1f6c9aa9c92e6");
|
|
|
|
|
+ if (tenant.isSuccess() && ObjectUtils.isNotNull(tenant.getData())) {
|
|
|
|
|
+ appStockPartsVO.setTenantId(tenant.getData().getTenantId());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new RuntimeException("获取数据失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ appStockPartsVO.setTenantId(AuthUtil.getTenantId());
|
|
|
|
|
+ }
|
|
|
if (appStockPartsVO.getLabel() != null && appStockPartsVO.getLabel().length > 0) {
|
|
if (appStockPartsVO.getLabel() != null && appStockPartsVO.getLabel().length > 0) {
|
|
|
appStockPartsVO.setLabels(StringUtil.join(appStockPartsVO.getLabel(), ","));
|
|
appStockPartsVO.setLabels(StringUtil.join(appStockPartsVO.getLabel(), ","));
|
|
|
}
|
|
}
|
|
@@ -432,6 +452,8 @@ public class StockGoodsController extends BladeController {
|
|
|
shoppingMall = corpsDesc.getShoppingMall();
|
|
shoppingMall = corpsDesc.getShoppingMall();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }else{
|
|
|
|
|
+ shoppingMall = "游客";
|
|
|
}
|
|
}
|
|
|
String finalShoppingMall = shoppingMall;
|
|
String finalShoppingMall = shoppingMall;
|
|
|
records.forEach(item -> {
|
|
records.forEach(item -> {
|
|
@@ -451,7 +473,7 @@ public class StockGoodsController extends BladeController {
|
|
|
}
|
|
}
|
|
|
item.setUnit(goodsMessage.getData().getUnit());
|
|
item.setUnit(goodsMessage.getData().getUnit());
|
|
|
item.setUrl(goodsMessage.getData().getUrl());
|
|
item.setUrl(goodsMessage.getData().getUrl());
|
|
|
- if ("零售价1".equals(finalShoppingMall)) {
|
|
|
|
|
|
|
+ if ("零售价1".equals(finalShoppingMall) || "游客".equals(finalShoppingMall)) {
|
|
|
item.setSalesPrice(goodsMessage.getData().getStandardPrice());
|
|
item.setSalesPrice(goodsMessage.getData().getStandardPrice());
|
|
|
} else if ("零售价2".equals(finalShoppingMall)) {
|
|
} else if ("零售价2".equals(finalShoppingMall)) {
|
|
|
item.setSalesPrice(goodsMessage.getData().getWholesalePrice());
|
|
item.setSalesPrice(goodsMessage.getData().getWholesalePrice());
|