|
@@ -6,7 +6,10 @@ import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
+import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.framework.service.TokenServiceScrm;
|
|
|
+import com.fs.hisStore.domain.StoreLoginUserScrm;
|
|
|
import com.fs.hisStore.vo.FsStoreProductCategoryVO;
|
|
|
import com.fs.hisStore.vo.FsStoreProductCategorysVO;
|
|
|
import com.fs.his.vo.OptionsVO;
|
|
@@ -27,6 +30,8 @@ import java.util.List;
|
|
|
@RequestMapping("/store/store/storeProductCategory")
|
|
|
public class FsStoreProductCategoryScrmController extends BaseController
|
|
|
{
|
|
|
+ @Autowired
|
|
|
+ private TokenServiceScrm tokenService;
|
|
|
@Autowired
|
|
|
private IFsStoreProductCategoryScrmService fsStoreProductCategoryService;
|
|
|
|
|
@@ -37,7 +42,9 @@ public class FsStoreProductCategoryScrmController extends BaseController
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(FsStoreProductCategoryScrm fsStoreProductCategory)
|
|
|
{
|
|
|
-
|
|
|
+ StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long storeId = loginUser.getFsStore().getStoreId();
|
|
|
+ fsStoreProductCategory.setStoreId(storeId);
|
|
|
List<FsStoreProductCategoryVO> list = fsStoreProductCategoryService.selectFsStoreProductCategoryListVO(fsStoreProductCategory);
|
|
|
|
|
|
return getDataTable(list);
|
|
@@ -82,6 +89,11 @@ public class FsStoreProductCategoryScrmController extends BaseController
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody FsStoreProductCategoryScrm fsStoreProductCategory)
|
|
|
{
|
|
|
+ Long storeId = tokenService.getLoginUser(ServletUtils.getRequest()).getFsStore().getStoreId();
|
|
|
+ if (storeId == null){
|
|
|
+ return AjaxResult.error("请先登录");
|
|
|
+ }
|
|
|
+ fsStoreProductCategory.setStoreId(storeId);
|
|
|
return toAjax(fsStoreProductCategoryService.insertFsStoreProductCategory(fsStoreProductCategory));
|
|
|
}
|
|
|
|
|
@@ -93,6 +105,11 @@ public class FsStoreProductCategoryScrmController extends BaseController
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody FsStoreProductCategoryScrm fsStoreProductCategory)
|
|
|
{
|
|
|
+ Long storeId = tokenService.getLoginUser(ServletUtils.getRequest()).getFsStore().getStoreId();
|
|
|
+ if (storeId == null){
|
|
|
+ return AjaxResult.error("请先登录");
|
|
|
+ }
|
|
|
+ fsStoreProductCategory.setStoreId(storeId);
|
|
|
return toAjax(fsStoreProductCategoryService.updateFsStoreProductCategory(fsStoreProductCategory));
|
|
|
}
|
|
|
|
|
@@ -110,15 +127,19 @@ public class FsStoreProductCategoryScrmController extends BaseController
|
|
|
@GetMapping("/getAllList")
|
|
|
public R getAllList(FsStoreProductCategoryScrm fsStoreProductCategory)
|
|
|
{
|
|
|
-
|
|
|
- List<FsStoreProductCategorysVO> list = fsStoreProductCategoryService.selectFsStoreProductCategorysVOList();
|
|
|
+ StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long storeId = loginUser.getFsStore().getStoreId();
|
|
|
+ List<FsStoreProductCategorysVO> list = fsStoreProductCategoryService.selectFsStoreProductCategorysVOList(storeId);
|
|
|
return R.ok().put("data", list);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getPidList")
|
|
|
public R getPidList(FsStoreProductCategoryScrm fsStoreProductCategory)
|
|
|
{
|
|
|
- List<FsStoreProductCategoryVO> list = fsStoreProductCategoryService.getPidList();
|
|
|
+ StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ Long storeId = loginUser.getFsStore().getStoreId();
|
|
|
+ fsStoreProductCategory.setStoreId(storeId);
|
|
|
+ List<FsStoreProductCategoryVO> list = fsStoreProductCategoryService.getPidList(storeId);
|
|
|
return R.ok().put("data", list);
|
|
|
}
|
|
|
}
|