|
@@ -3,9 +3,15 @@ package com.fs.hisStore.controller.store;
|
|
|
import com.fs.common.annotation.Log;
|
|
import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
|
|
+import com.fs.common.core.domain.model.LoginUser;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
import com.fs.common.enums.BusinessType;
|
|
|
|
|
+import com.fs.common.exception.base.BaseException;
|
|
|
|
|
+import com.fs.common.utils.ServletUtils;
|
|
|
|
|
+import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
|
|
+import com.fs.erp.utils.CommonUtils;
|
|
|
import com.fs.framework.service.TokenServiceScrm;
|
|
import com.fs.framework.service.TokenServiceScrm;
|
|
|
import com.fs.his.param.FsStoreAuditParam;
|
|
import com.fs.his.param.FsStoreAuditParam;
|
|
|
import com.fs.hisStore.domain.FsStoreScrm;
|
|
import com.fs.hisStore.domain.FsStoreScrm;
|
|
@@ -14,10 +20,14 @@ import com.fs.hisStore.param.FsStoreScrmInfoParam;
|
|
|
import com.fs.hisStore.service.IFsStoreScrmService;
|
|
import com.fs.hisStore.service.IFsStoreScrmService;
|
|
|
import com.fs.hisStore.utils.UserUtil;
|
|
import com.fs.hisStore.utils.UserUtil;
|
|
|
import com.fs.hisStore.vo.FsStoreDetailsScrmVo;
|
|
import com.fs.hisStore.vo.FsStoreDetailsScrmVo;
|
|
|
|
|
+import io.jsonwebtoken.lang.Collections;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 店铺管理Controller
|
|
* 店铺管理Controller
|
|
@@ -27,19 +37,18 @@ import java.util.List;
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/store/store/store")
|
|
@RequestMapping("/store/store/store")
|
|
|
-public class FsStoreScrmController extends BaseController
|
|
|
|
|
-{
|
|
|
|
|
|
|
+public class FsStoreScrmController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsStoreScrmService fsStoreService;
|
|
private IFsStoreScrmService fsStoreService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenServiceScrm tokenService;
|
|
private TokenServiceScrm tokenService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询店铺管理列表
|
|
* 查询店铺管理列表
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(FsStoreScrm fsStore)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo list(FsStoreScrm fsStore) {
|
|
|
startPage();
|
|
startPage();
|
|
|
List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
|
|
List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
@@ -49,10 +58,9 @@ public class FsStoreScrmController extends BaseController
|
|
|
* 导出店铺管理列表
|
|
* 导出店铺管理列表
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- @Log(title = "店铺管理", businessType = BusinessType.EXPORT,logParam = {"店铺","导出店铺信息"},isStoreLog = true)
|
|
|
|
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.EXPORT, logParam = {"店铺", "导出店铺信息"}, isStoreLog = true)
|
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|
|
|
- public AjaxResult export(FsStoreScrm fsStore)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult export(FsStoreScrm fsStore) {
|
|
|
List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
|
|
List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
|
|
|
ExcelUtil<FsStoreScrm> util = new ExcelUtil<FsStoreScrm>(FsStoreScrm.class);
|
|
ExcelUtil<FsStoreScrm> util = new ExcelUtil<FsStoreScrm>(FsStoreScrm.class);
|
|
|
return util.exportExcel(list, "店铺管理数据");
|
|
return util.exportExcel(list, "店铺管理数据");
|
|
@@ -62,8 +70,7 @@ public class FsStoreScrmController extends BaseController
|
|
|
* 获取店铺管理详细信息
|
|
* 获取店铺管理详细信息
|
|
|
*/
|
|
*/
|
|
|
@GetMapping(value = "/{storeId}")
|
|
@GetMapping(value = "/{storeId}")
|
|
|
- public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("storeId") Long storeId) {
|
|
|
return AjaxResult.success(fsStoreService.selectFsStoreByStoreId(storeId));
|
|
return AjaxResult.success(fsStoreService.selectFsStoreByStoreId(storeId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -71,10 +78,9 @@ public class FsStoreScrmController extends BaseController
|
|
|
* 新增店铺管理
|
|
* 新增店铺管理
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- @Log(title = "店铺管理", businessType = BusinessType.INSERT,logParam = {"店铺","新增店铺信息"},isStoreLog = true)
|
|
|
|
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.INSERT, logParam = {"店铺", "新增店铺信息"}, isStoreLog = true)
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody FsStoreScrm fsStore)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult add(@RequestBody FsStoreScrm fsStore) {
|
|
|
return toAjax(fsStoreService.insertFsStore(fsStore).intValue());
|
|
return toAjax(fsStoreService.insertFsStore(fsStore).intValue());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -82,24 +88,22 @@ public class FsStoreScrmController extends BaseController
|
|
|
* 修改店铺管理
|
|
* 修改店铺管理
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺信息"},isStoreLog = true)
|
|
|
|
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.UPDATE, logParam = {"店铺", "修改店铺信息"}, isStoreLog = true)
|
|
|
@PutMapping
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody FsStoreScrmInfoParam fsStore)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult edit(@RequestBody FsStoreScrmInfoParam fsStore) {
|
|
|
return toAjax(fsStoreService.updateStoreInfo(fsStore));
|
|
return toAjax(fsStoreService.updateStoreInfo(fsStore));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改店铺logo
|
|
* 修改店铺logo
|
|
|
*/
|
|
*/
|
|
|
- @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺LOGO信息"},isStoreLog = true)
|
|
|
|
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.UPDATE, logParam = {"店铺", "修改店铺LOGO信息"}, isStoreLog = true)
|
|
|
@PutMapping("/editLogo")
|
|
@PutMapping("/editLogo")
|
|
|
- public AjaxResult editLogo(@RequestBody FsStoreScrm fsStore)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult editLogo(@RequestBody FsStoreScrm fsStore) {
|
|
|
StoreLoginUserScrm loginUser = UserUtil.getLoginUser();
|
|
StoreLoginUserScrm loginUser = UserUtil.getLoginUser();
|
|
|
fsStore.setStoreId(loginUser.getFsStore().getStoreId());
|
|
fsStore.setStoreId(loginUser.getFsStore().getStoreId());
|
|
|
|
|
|
|
|
- if (fsStoreService.updateFsStoreLogo(fsStore) > 0)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (fsStoreService.updateFsStoreLogo(fsStore) > 0) {
|
|
|
// 更新缓存用户信息
|
|
// 更新缓存用户信息
|
|
|
FsStoreScrm fsStore1 = loginUser.getFsStore();
|
|
FsStoreScrm fsStore1 = loginUser.getFsStore();
|
|
|
fsStore1.setLogoUrl(fsStore.getLogoUrl());
|
|
fsStore1.setLogoUrl(fsStore.getLogoUrl());
|
|
@@ -114,14 +118,12 @@ public class FsStoreScrmController extends BaseController
|
|
|
/**
|
|
/**
|
|
|
* 修改店铺基础信息
|
|
* 修改店铺基础信息
|
|
|
*/
|
|
*/
|
|
|
- @Log(title = "修改店铺基础信息", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺基础信息"},isStoreLog = true)
|
|
|
|
|
|
|
+ @Log(title = "修改店铺基础信息", businessType = BusinessType.UPDATE, logParam = {"店铺", "修改店铺基础信息"}, isStoreLog = true)
|
|
|
@PutMapping("/editData")
|
|
@PutMapping("/editData")
|
|
|
- public AjaxResult editData(@RequestBody FsStoreScrm fsStore)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult editData(@RequestBody FsStoreScrm fsStore) {
|
|
|
StoreLoginUserScrm loginUser = UserUtil.getLoginUser();
|
|
StoreLoginUserScrm loginUser = UserUtil.getLoginUser();
|
|
|
fsStore.setStoreId(loginUser.getFsStore().getStoreId());
|
|
fsStore.setStoreId(loginUser.getFsStore().getStoreId());
|
|
|
- if (fsStoreService.updateEditData(fsStore) > 0)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (fsStoreService.updateEditData(fsStore) > 0) {
|
|
|
// 更新缓存用户信息
|
|
// 更新缓存用户信息
|
|
|
FsStoreScrm fsStore1 = loginUser.getFsStore();
|
|
FsStoreScrm fsStore1 = loginUser.getFsStore();
|
|
|
fsStore1.setPhone(fsStore.getPhone());
|
|
fsStore1.setPhone(fsStore.getPhone());
|
|
@@ -141,10 +143,9 @@ public class FsStoreScrmController extends BaseController
|
|
|
* 删除店铺管理
|
|
* 删除店铺管理
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- @Log(title = "店铺管理", businessType = BusinessType.DELETE,logParam = {"店铺","删除店铺信息"},isStoreLog = true)
|
|
|
|
|
- @DeleteMapping("/{storeIds}")
|
|
|
|
|
- public AjaxResult remove(@PathVariable Long[] storeIds)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.DELETE, logParam = {"店铺", "删除店铺信息"}, isStoreLog = true)
|
|
|
|
|
+ @DeleteMapping("/{storeIds}")
|
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] storeIds) {
|
|
|
return toAjax(fsStoreService.deleteFsStoreByStoreIds(storeIds));
|
|
return toAjax(fsStoreService.deleteFsStoreByStoreIds(storeIds));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -152,10 +153,9 @@ public class FsStoreScrmController extends BaseController
|
|
|
* 修改店铺管理
|
|
* 修改店铺管理
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","店铺审核"},isStoreLog = true)
|
|
|
|
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.UPDATE, logParam = {"店铺", "店铺审核"}, isStoreLog = true)
|
|
|
@PutMapping("/audit")
|
|
@PutMapping("/audit")
|
|
|
- public AjaxResult audit(@RequestBody FsStoreAuditParam fsStore)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult audit(@RequestBody FsStoreAuditParam fsStore) {
|
|
|
return toAjax(fsStoreService.updateFsStoreAudit(fsStore));
|
|
return toAjax(fsStoreService.updateFsStoreAudit(fsStore));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -163,10 +163,31 @@ public class FsStoreScrmController extends BaseController
|
|
|
* 获取店铺管理详细信息
|
|
* 获取店铺管理详细信息
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/getStoreInfo")
|
|
@GetMapping("/getStoreInfo")
|
|
|
- public AjaxResult getStoreInfo()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult getStoreInfo() {
|
|
|
FsStoreScrm user = UserUtil.getLoginUser().getFsStore();
|
|
FsStoreScrm user = UserUtil.getLoginUser().getFsStore();
|
|
|
FsStoreDetailsScrmVo fsStore = fsStoreService.getStoreInfoByStoreId(user.getStoreId());
|
|
FsStoreDetailsScrmVo fsStore = fsStoreService.getStoreInfoByStoreId(user.getStoreId());
|
|
|
return AjaxResult.success(fsStore);
|
|
return AjaxResult.success(fsStore);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商家店铺资质提示信息
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/queryValidStoreLastInfo")
|
|
|
|
|
+ public R queryValidStoreLastInfo() {
|
|
|
|
|
+ StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ if (loginUser != null) {
|
|
|
|
|
+ if (loginUser.getFsStore() != null) {
|
|
|
|
|
+ // 判断account是否为空
|
|
|
|
|
+ String account = loginUser.getFsStore().getAccount();
|
|
|
|
|
+ if (account == null && account.isEmpty()) {
|
|
|
|
|
+ throw new BaseException("请先完善店铺账户信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<String> list = fsStoreService.queryValidStoreLastInfo(account);
|
|
|
|
|
+ if (!Collections.isEmpty(list)) {
|
|
|
|
|
+ return R.ok().put("code", 200).put("data", list);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return R.ok().put("code", 0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|