|
@@ -0,0 +1,115 @@
|
|
|
+package com.fs.app.controller.store;
|
|
|
+
|
|
|
+import com.fs.app.annotation.Login;
|
|
|
+import com.fs.common.annotation.Log;
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
+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.ParseUtils;
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.his.param.FsStoreAuditParam;
|
|
|
+import com.fs.hisStore.domain.FsStoreScrm;
|
|
|
+import com.fs.hisStore.service.IFsStoreScrmService;
|
|
|
+import com.fs.hisStore.utils.StoreAuditLogUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 店铺管理Controller
|
|
|
+ *
|
|
|
+ * @author fs
|
|
|
+ * @date 2023-06-15
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/store/app/store")
|
|
|
+public class StoreScrmController extends BaseController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreScrmService fsStoreService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StoreAuditLogUtil storeAuditLogUtil;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询店铺管理列表
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(FsStoreScrm fsStore)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
|
|
|
+ for (FsStoreScrm store : list) {
|
|
|
+ store.setPhone(ParseUtils.parsePhone(store.getPhone()));
|
|
|
+ }
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取店铺管理详细信息
|
|
|
+ */
|
|
|
+ //@Login
|
|
|
+ @GetMapping(value = "/{storeId}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
|
|
|
+ {
|
|
|
+ FsStoreScrm fsStore = fsStoreService.selectFsStoreByStoreId(storeId);
|
|
|
+ fsStore.setPhone(ParseUtils.parsePhone(fsStore.getPhone()));
|
|
|
+ return AjaxResult.success(fsStore);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增店铺管理
|
|
|
+ */
|
|
|
+ //@Login
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.INSERT,logParam = {"店铺","新增店铺信息"},isStoreLog = true)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody FsStoreScrm fsStore)
|
|
|
+ {
|
|
|
+ storeAuditLogUtil.addOperLog(fsStoreService.insertFsStore(fsStore));
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改店铺管理
|
|
|
+ */
|
|
|
+ //@Login
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺信息"},isStoreLog = true)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody FsStoreScrm fsStore)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (fsStore.getPhone()!=null&&fsStore.getPhone().contains("*")){
|
|
|
+ fsStore.setPhone(null);
|
|
|
+ }
|
|
|
+ return toAjax(fsStoreService.updateFsStore(fsStore));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除店铺管理
|
|
|
+ */
|
|
|
+ //@Login
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.DELETE,logParam = {"店铺","删除店铺信息"},isStoreLog = true)
|
|
|
+ @DeleteMapping("/{storeIds}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] storeIds)
|
|
|
+ {
|
|
|
+ return toAjax(fsStoreService.deleteFsStoreByStoreIds(storeIds));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 重置店铺密码
|
|
|
+ * */
|
|
|
+ //@Login
|
|
|
+ @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","重置店铺密码"},isStoreLog = true)
|
|
|
+ @PutMapping("/refresh/{storeId}")
|
|
|
+ public AjaxResult refresh(Long storeId)
|
|
|
+ {
|
|
|
+ return toAjax(fsStoreService.refreshFsStore(storeId));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|