临时提交
This commit is contained in:
parent
3f08b1f54a
commit
0c3cc1aa1d
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.ss.store.domain;
|
package com.ruoyi.ss.store.domain;
|
||||||
|
|
||||||
import com.ruoyi.ss.store.domain.enums.StoreStatus;
|
import com.ruoyi.ss.store.domain.enums.StoreStatus;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,6 +28,9 @@ public class StoreBO extends Store {
|
||||||
bo.setType(getType());
|
bo.setType(getType());
|
||||||
bo.setContactName(getContactName());
|
bo.setContactName(getContactName());
|
||||||
bo.setContactMobile(getContactMobile());
|
bo.setContactMobile(getContactMobile());
|
||||||
|
bo.setBusinessTimeStart(getBusinessTimeStart());
|
||||||
|
bo.setBusinessTimeEnd(getBusinessTimeEnd());
|
||||||
|
bo.setShow(getShow());
|
||||||
return bo;
|
return bo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +54,15 @@ public class StoreBO extends Store {
|
||||||
bo.setContactMobile(getContactMobile());
|
bo.setContactMobile(getContactMobile());
|
||||||
bo.setShow(getShow());
|
bo.setShow(getShow());
|
||||||
bo.setUseOutTime(getUseOutTime());
|
bo.setUseOutTime(getUseOutTime());
|
||||||
|
bo.setBusinessTimeStart(getBusinessTimeStart());
|
||||||
|
bo.setBusinessTimeEnd(getBusinessTimeEnd());
|
||||||
|
|
||||||
|
// 若不展示,则默认为已生效
|
||||||
|
if (bo.getShow() == null || !bo.getShow()) {
|
||||||
|
bo.setStatus(StoreStatus.NORMAL.getStatus());
|
||||||
|
bo.setEnabled(true);
|
||||||
|
bo.setShow(false);
|
||||||
|
}
|
||||||
return bo;
|
return bo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +127,6 @@ public class StoreBO extends Store {
|
||||||
bo.setStoreId(getStoreId());
|
bo.setStoreId(getStoreId());
|
||||||
bo.setBusinessTimeStart(getBusinessTimeStart());
|
bo.setBusinessTimeStart(getBusinessTimeStart());
|
||||||
bo.setBusinessTimeEnd(getBusinessTimeEnd());
|
bo.setBusinessTimeEnd(getBusinessTimeEnd());
|
||||||
bo.setShow(getShow());
|
|
||||||
bo.setUseOutTime(getUseOutTime());
|
bo.setUseOutTime(getUseOutTime());
|
||||||
return bo;
|
return bo;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,19 @@
|
||||||
package com.ruoyi.web.controller.app;
|
package com.ruoyi.web.controller.app;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonView;
|
import com.fasterxml.jackson.annotation.JsonView;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
@ -10,19 +24,18 @@ import com.ruoyi.common.core.domain.ValidGroup;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.utils.ServiceUtil;
|
import com.ruoyi.common.utils.ServiceUtil;
|
||||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
import com.ruoyi.ss.store.domain.*;
|
import com.ruoyi.ss.store.domain.Store;
|
||||||
|
import com.ruoyi.ss.store.domain.StoreBO;
|
||||||
|
import com.ruoyi.ss.store.domain.StoreQuery;
|
||||||
|
import com.ruoyi.ss.store.domain.StoreView;
|
||||||
|
import com.ruoyi.ss.store.domain.StoreVo;
|
||||||
import com.ruoyi.ss.store.service.StoreAssembler;
|
import com.ruoyi.ss.store.service.StoreAssembler;
|
||||||
import com.ruoyi.ss.store.service.StoreService;
|
import com.ruoyi.ss.store.service.StoreService;
|
||||||
import com.ruoyi.ss.store.service.StoreValidator;
|
import com.ruoyi.ss.store.service.StoreValidator;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺Controller
|
* 店铺Controller
|
||||||
|
@ -66,7 +79,7 @@ public class AppStoreController extends BaseController {
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation("申请修改店铺信息")
|
@ApiOperation("修改店铺信息")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody @Validated(ValidGroup.FrontUpdate.class) StoreBO data) {
|
public AjaxResult edit(@RequestBody @Validated(ValidGroup.FrontUpdate.class) StoreBO data) {
|
||||||
StoreVo store = storeService.selectSmStoreById(data.getStoreId());
|
StoreVo store = storeService.selectSmStoreById(data.getStoreId());
|
||||||
|
@ -75,7 +88,16 @@ public class AppStoreController extends BaseController {
|
||||||
}
|
}
|
||||||
data = data.filterUpdateByApp();
|
data = data.filterUpdateByApp();
|
||||||
ServiceUtil.assertion(storeValidator.preUpdateByApp(data));
|
ServiceUtil.assertion(storeValidator.preUpdateByApp(data));
|
||||||
return toAjax(storeService.updateApply(data));
|
|
||||||
|
// 若店铺在地图上显示,则需要审核
|
||||||
|
Boolean finalShow = data.getShow() == null ? store.getShow() : data.getShow();
|
||||||
|
if (finalShow != null && finalShow) {
|
||||||
|
return toAjax(storeService.updateApply(data));
|
||||||
|
}
|
||||||
|
// 若店铺不在地图上显示,则直接修改
|
||||||
|
else {
|
||||||
|
return toAjax(storeService.updateSmStore(data));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改店铺配置")
|
@ApiOperation("修改店铺配置")
|
||||||
|
@ -94,7 +116,6 @@ public class AppStoreController extends BaseController {
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
// @MchRequired
|
|
||||||
@ApiOperation("删除店铺信息")
|
@ApiOperation("删除店铺信息")
|
||||||
@DeleteMapping("/{storeId}")
|
@DeleteMapping("/{storeId}")
|
||||||
public AjaxResult delete(@PathVariable Long storeId) {
|
public AjaxResult delete(@PathVariable Long storeId) {
|
||||||
|
@ -107,18 +128,21 @@ public class AppStoreController extends BaseController {
|
||||||
return AjaxResult.success(storeService.logicDel(storeIds));
|
return AjaxResult.success(storeService.logicDel(storeIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
// @MchRequired
|
// 新增店铺,无需审核,同时也无法在地图上显示
|
||||||
@ApiOperation("申请新增店铺")
|
@ApiOperation("新增店铺")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody @Validated(ValidGroup.FrontCreate.class) StoreBO store) {
|
public AjaxResult add(@RequestBody @Validated(ValidGroup.FrontCreate.class) StoreBO store) {
|
||||||
store = store.filterCreateByApp();
|
store = store.filterCreateByApp();
|
||||||
store.setUserId(getUserId());
|
store.setUserId(getUserId());
|
||||||
ServiceUtil.assertion(storeValidator.preCreateByApp(store));
|
ServiceUtil.assertion(storeValidator.preCreateByApp(store));
|
||||||
return toAjax(storeService.insertAndApply(store));
|
// 若不需要展示,则直接新增。
|
||||||
|
if (store.getShow() == null || !store.getShow()) {
|
||||||
|
return toAjax(storeService.insertSmStore(store));
|
||||||
|
} else {
|
||||||
|
return toAjax(storeService.insertAndApply(store));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @MchRequired
|
|
||||||
@ApiOperation("调整店铺排序")
|
@ApiOperation("调整店铺排序")
|
||||||
@PutMapping("/changeSort")
|
@PutMapping("/changeSort")
|
||||||
public AjaxResult changeSort(@RequestBody List<Store> list) {
|
public AjaxResult changeSort(@RequestBody List<Store> list) {
|
||||||
|
@ -162,7 +186,6 @@ public class AppStoreController extends BaseController {
|
||||||
return success(store);
|
return success(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @MchRequired
|
|
||||||
@ApiOperation("商户获取店铺信息")
|
@ApiOperation("商户获取店铺信息")
|
||||||
@GetMapping("/mch/{storeId}")
|
@GetMapping("/mch/{storeId}")
|
||||||
public AjaxResult getMchDetail(@PathVariable @ApiParam("店铺ID") Long storeId) {
|
public AjaxResult getMchDetail(@PathVariable @ApiParam("店铺ID") Long storeId) {
|
||||||
|
@ -175,7 +198,6 @@ public class AppStoreController extends BaseController {
|
||||||
return success(store);
|
return success(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @MchRequired
|
|
||||||
@ApiOperation("切换默认店铺")
|
@ApiOperation("切换默认店铺")
|
||||||
@PutMapping("/{storeId}/setDefault")
|
@PutMapping("/{storeId}/setDefault")
|
||||||
public AjaxResult setDefaultStore(@PathVariable Long storeId) {
|
public AjaxResult setDefaultStore(@PathVariable Long storeId) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user