feat: 店铺装修
This commit is contained in:
@@ -67,6 +67,7 @@ public class PlayClerkLevelInfoEntity extends BaseEntity<PlayClerkLevelInfoEntit
|
||||
*/
|
||||
private Integer notFirstRandomRadio;
|
||||
|
||||
private Integer styleType;
|
||||
|
||||
|
||||
private String styleImageUrl;
|
||||
}
|
||||
|
||||
@@ -52,4 +52,9 @@ public class PlayClerkLevelEditVo {
|
||||
*/
|
||||
private Integer notFirstRandomRadio;
|
||||
|
||||
|
||||
private Integer styleType;
|
||||
|
||||
private String styleImageUrl;
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ public class PlayClerkLevelInfoServiceImpl extends ServiceImpl<PlayClerkLevelInf
|
||||
entity.setFirstRegularRatio(45);
|
||||
entity.setNotFirstRegularRatio(50);
|
||||
entity.setLevel(1);
|
||||
entity.setStyleType(entity.getLevel());
|
||||
entity.setTenantId(sysTenantEntity.getTenantId());
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
@@ -63,6 +64,7 @@ public class PlayClerkLevelInfoServiceImpl extends ServiceImpl<PlayClerkLevelInf
|
||||
entity.setFirstRegularRatio(45);
|
||||
entity.setNotFirstRegularRatio(50);
|
||||
entity.setLevel(1);
|
||||
entity.setStyleType(1);
|
||||
this.baseMapper.insert(entity);
|
||||
return entity;
|
||||
}
|
||||
@@ -111,6 +113,7 @@ public class PlayClerkLevelInfoServiceImpl extends ServiceImpl<PlayClerkLevelInf
|
||||
playClerkLevelInfo.setId(IdUtils.getUuid());
|
||||
}
|
||||
playClerkLevelInfo.setCreatedTime(new Date());
|
||||
playClerkLevelInfo.setStyleType(playClerkLevelInfo.getLevel());
|
||||
return save(playClerkLevelInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.starry.admin.modules.shop.controller;
|
||||
|
||||
import com.starry.admin.modules.shop.module.entity.ShopUiSettingEntity;
|
||||
import com.starry.admin.modules.shop.service.IShopUiSettingService;
|
||||
import com.starry.common.result.R;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 店铺设置Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2025-06-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/setting")
|
||||
public class ShopUiSettingController {
|
||||
@Resource
|
||||
private IShopUiSettingService shopUiSettingService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺设置详细信息
|
||||
*/
|
||||
@GetMapping(value = "/info")
|
||||
public R getInfo() {
|
||||
return R.ok(shopUiSettingService.selectShopUiSettingInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店铺设置
|
||||
*/
|
||||
@PostMapping(value = "/update")
|
||||
public R update(@RequestBody ShopUiSettingEntity shopUiSetting) {
|
||||
boolean success = shopUiSettingService.update(shopUiSetting);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.shop.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.shop.module.entity.ShopUiSettingEntity;
|
||||
|
||||
/**
|
||||
* 店铺设置Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2025-06-11
|
||||
*/
|
||||
public interface ShopUiSettingMapper extends BaseMapper<ShopUiSettingEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.starry.admin.modules.shop.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 店铺设置对象 shop_ui_setting
|
||||
*
|
||||
* @author admin
|
||||
* @since 2025-06-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("shop_ui_setting")
|
||||
public class ShopUiSettingEntity extends BaseEntity<ShopUiSettingEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 创建人的id
|
||||
*/
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
|
||||
/**
|
||||
* 修改人的id
|
||||
*/
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updatedTime;
|
||||
|
||||
/**
|
||||
* 数据版本
|
||||
*/
|
||||
private Long version;
|
||||
|
||||
/**
|
||||
* 配置内容
|
||||
*/
|
||||
private String settingConfig;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.starry.admin.modules.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.shop.module.entity.ShopUiSettingEntity;
|
||||
|
||||
/**
|
||||
* 店铺设置Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2025-06-11
|
||||
*/
|
||||
public interface IShopUiSettingService extends IService<ShopUiSettingEntity> {
|
||||
/**
|
||||
* 查询店铺设置
|
||||
*
|
||||
* @return 店铺设置
|
||||
*/
|
||||
ShopUiSettingEntity selectShopUiSettingInfo();
|
||||
|
||||
/**
|
||||
* 修改店铺设置
|
||||
*
|
||||
* @param shopUiSetting 店铺设置
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(ShopUiSettingEntity shopUiSetting);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.starry.admin.modules.shop.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.starry.admin.modules.shop.mapper.ShopUiSettingMapper;
|
||||
import com.starry.admin.modules.shop.module.entity.ShopUiSettingEntity;
|
||||
import com.starry.admin.modules.shop.service.IShopUiSettingService;
|
||||
import com.starry.common.utils.IdUtils;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 店铺设置Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2025-06-11
|
||||
*/
|
||||
@Service
|
||||
public class ShopUiSettingServiceImpl extends ServiceImpl<ShopUiSettingMapper, ShopUiSettingEntity> implements IShopUiSettingService {
|
||||
@Resource
|
||||
private ShopUiSettingMapper shopUiSettingMapper;
|
||||
|
||||
/**
|
||||
* 查询店铺设置
|
||||
* @return 店铺设置
|
||||
*/
|
||||
@Override
|
||||
public ShopUiSettingEntity selectShopUiSettingInfo() {
|
||||
LambdaQueryWrapper<ShopUiSettingEntity> wrapper = Wrappers.lambdaQuery(ShopUiSettingEntity.class);
|
||||
ShopUiSettingEntity setting = this.baseMapper.selectOne(wrapper, false);
|
||||
if (Objects.nonNull(setting)) {
|
||||
return setting;
|
||||
} else {
|
||||
setting = new ShopUiSettingEntity();
|
||||
setting.setSettingConfig(null);
|
||||
this.baseMapper.insert(setting);
|
||||
}
|
||||
return setting;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改店铺设置
|
||||
*
|
||||
* @param shopUiSetting 店铺设置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(ShopUiSettingEntity shopUiSetting) {
|
||||
return updateById(shopUiSetting);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.common.oss.service.IOssFileService;
|
||||
import com.starry.admin.modules.shop.service.IShopUiSettingService;
|
||||
import com.starry.admin.modules.system.service.ISysAdministrativeAreaDictInfoService;
|
||||
import com.starry.admin.modules.weichat.service.WxAccessTokenService;
|
||||
import com.starry.admin.modules.weichat.utils.WxFileUtils;
|
||||
@@ -40,6 +41,8 @@ public class WxCommonController {
|
||||
|
||||
@Resource
|
||||
WxAccessTokenService wxAccessTokenService;
|
||||
@Resource
|
||||
private IShopUiSettingService shopUiSettingService;
|
||||
|
||||
|
||||
@GetMapping("area/tree")
|
||||
@@ -47,6 +50,11 @@ public class WxCommonController {
|
||||
return R.ok(areaDictInfoService.selectTree("2"));
|
||||
}
|
||||
|
||||
@GetMapping("setting/info")
|
||||
public R selectShopUiSettingInfo() {
|
||||
return R.ok(shopUiSettingService.selectShopUiSettingInfo());
|
||||
}
|
||||
|
||||
@PostMapping("file/upload")
|
||||
public R fileUpload(@RequestParam("file") MultipartFile file) throws IOException {
|
||||
String fileAddress = ossFileService.upload(file.getInputStream(), SecurityUtils.getTenantId(), file.getOriginalFilename());
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
ALTER TABLE `play_clerk_level_info`
|
||||
ADD COLUMN `style_type` int(10) NULL COMMENT '等级样式' AFTER `version`,
|
||||
ADD COLUMN `style_image_url` varchar(255) NULL COMMENT '等级图片' AFTER `style_type`;
|
||||
|
||||
|
||||
update `play_clerk_level_info` set `style_type` = `level`;
|
||||
CREATE TABLE `shop_ui_setting` (
|
||||
`id` varchar(32) NOT NULL COMMENT 'UUID',
|
||||
`tenant_id` varchar(32) NOT NULL COMMENT '租户ID',
|
||||
`created_by` varchar(32) DEFAULT NULL COMMENT '创建人的id',
|
||||
`created_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updated_by` varchar(32) DEFAULT NULL COMMENT '修改人的id',
|
||||
`updated_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除 1已删除 0未删除',
|
||||
`version` int(11) NOT NULL DEFAULT '1' COMMENT '数据版本',
|
||||
`setting_config` text COMMENT '配置内容',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `key_tenant_id` (`tenant_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='店员等级';
|
||||
Reference in New Issue
Block a user