zhanghua
2023-09-08 7ef4892f9f24f941aca37e6b3991b808a0aca619
ycl-platform/src/main/java/com/ycl/controller/store/StoreInfoController.java
@@ -8,7 +8,7 @@
import com.ycl.common.util.UtilNumber;
import com.ycl.dto.store.UmsStoreInfoParam;
import com.ycl.entity.store.StoreInfo;
import com.ycl.entity.video.VideoPoint;
import com.ycl.entity.store.StoreScore;
import com.ycl.service.store.StoreInfoService;
import com.ycl.service.video.impl.IVideoPointService;
import com.ycl.vo.store.StoreInfoVO;
@@ -49,16 +49,20 @@
    @ApiOperation("根据门店名称分页获取门店列表列表")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ResponseBody
    @LogSave(operationType = "门店管理", contain = "查询门店")
    public CommonResult<CommonPage<StoreInfoVO>> list(@RequestParam(value = "keyword", required = false) String keyword,
                                                      @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                      @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
        Page<StoreInfoVO> storeInfoPage = storeInfoService.list(keyword, pageSize, pageNum);
                                                      @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                      @RequestParam(value = "status", required = false) String status
    ) {
        Page<StoreInfoVO> storeInfoPage = storeInfoService.list(keyword, pageSize, pageNum,status);
        return CommonResult.success(CommonPage.restPage(storeInfoPage));
    }
    @ApiOperation("根据id获取门店信息")
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    @LogSave(operationType = "门店管理", contain = "查询门店")
    public CommonResult<StoreInfoVO> getItem(@PathVariable Long id) {
        StoreInfo storeInfo = storeInfoService.getById(id);
        StoreInfoVO vo = new StoreInfoVO();
@@ -74,16 +78,17 @@
    public CommonResult<StoreInfo> add(@Validated @RequestBody UmsStoreInfoParam umsStoreInfoParam) {
        StoreInfo storeInfo = StoreInfo.builder()
                .owner(umsStoreInfoParam.getOwner())
                .storeName(umsStoreInfoParam.getStorename())
                .storeName(umsStoreInfoParam.getStoreName())
                .contact(umsStoreInfoParam.getContact())
                .storeAddress(umsStoreInfoParam.getStoreaddr())
                .storeAddress(umsStoreInfoParam.getStoreAddress())
                .storePhoto(umsStoreInfoParam.getStorephoto())
                .idCardInfo(umsStoreInfoParam.getIdcardinfo())
                .storeNumber(utilNumber.createShopCode())
                .storeScore(umsStoreInfoParam.getStorescore())
                .type(umsStoreInfoParam.getType())
                .description(umsStoreInfoParam.getDescription())
                .videoId(umsStoreInfoParam.getVideoId())
                .videoId(umsStoreInfoParam.getRelationVideo())
                .storeScore(100.0)
                .status(umsStoreInfoParam.getStatus())
                .build();
        boolean success = storeInfoService.save(storeInfo);
        if (success) {
@@ -96,6 +101,7 @@
    @ApiOperation(value = "根据id删除门店信息")
    @RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
    @ResponseBody
    @LogSave(operationType = "门店管理", contain = "删除门店")
    public CommonResult delete(@PathVariable Long id) {
        boolean success = storeInfoService.removeById(id);
        if (success) {
@@ -108,6 +114,7 @@
    @ApiOperation(value = "修改门店信息")
    @RequestMapping(value = "/update", method = RequestMethod.PUT)
    @ResponseBody
    @LogSave(operationType = "门店管理", contain = "修改门店")
    public CommonResult update(@RequestBody StoreInfo storeInfo) {
        boolean success = storeInfoService.updateById(storeInfo);
        if (success) {
@@ -120,6 +127,7 @@
    @ApiOperation(value = "根据excel模板批量导入门店信息")
    @RequestMapping(value = "/add/excel", method = RequestMethod.POST)
    @ResponseBody
    @LogSave(operationType = "门店管理", contain = "导入门店")
    public CommonResult addByExcel(MultipartFile file) {
        boolean success = storeInfoService.addByExcel(file);
        if (success) {
@@ -128,5 +136,16 @@
            return CommonResult.failed();
        }
    }
    @ApiOperation("根据id获取门店积分详情")
    @RequestMapping(value = "/{id}/storeScore", method = RequestMethod.GET)
    @ResponseBody
    @LogSave(operationType = "门店积分详情", contain = "门店积分详情")
    public CommonResult<Page<StoreScore>> getScoreList(@PathVariable Long id,
                                                       @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
        Page<StoreScore> page = storeInfoService.getScoreList(id, pageSize, pageNum);
        return CommonResult.success(page);
    }
}