From 7c9ec6e5b5ad5e744ddb65f876c4db4c4ae90501 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期四, 29 二月 2024 16:28:00 +0800 Subject: [PATCH] 系统配置 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TConfigController.java | 41 +++++++ ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml | 7 + ruoyi-system/src/main/java/com/ruoyi/system/domain/TCustomerService.java | 38 +++++++ ruoyi-system/src/main/java/com/ruoyi/system/mapper/TCustomerServiceMapper.java | 19 +++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCustomerServiceController.java | 67 +++++++++++++ ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java | 26 +++-- ruoyi-system/src/main/resources/mapper/system/TCustomerServiceMapper.xml | 16 +++ ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCustomerServiceServiceImpl.java | 23 ++++ ruoyi-system/src/main/java/com/ruoyi/system/domain/TConfig.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/TCustomerServiceService.java | 17 +++ 10 files changed, 241 insertions(+), 15 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TConfigController.java index 7418807..cb96df2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TConfigController.java @@ -1,8 +1,17 @@ package com.ruoyi.web.controller.api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain.TConfig; +import com.ruoyi.system.domain.TCustomerService; +import com.ruoyi.system.service.TConfigService; +import com.ruoyi.system.service.TCustomerServiceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * <p> @@ -12,9 +21,37 @@ * @author xiaochen * @since 2024-02-29 */ +@Api(tags = "基础配置") @RestController @RequestMapping("/tConfig") public class TConfigController { + private final TConfigService configService; + + @Autowired + public TConfigController(TConfigService configService) { + this.configService = configService; + } + + /** + * 通过id查询协议内容 + */ + @ApiOperation(value = "通过id查询协议内容",notes = "1=创业合伙人配置 2=会员说明 3=剧本出售说明 4=短剧出售说明 5=用户协议 6=隐私协议 7=注销协议") + @GetMapping("/getConfigById") + public AjaxResult<TConfig> getConfigById(@RequestParam Long id) + { + return AjaxResult.success(configService.getById(id)); + } + + /** + * 修改协议内容 + */ + @ApiOperation(value = "修改协议内容",notes = "修改协议内容") + @PostMapping("/updateConfigById") + public AjaxResult<TConfig> updateConfigById(@RequestBody TConfig config) + { + return AjaxResult.success(configService.updateById(config)); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCustomerServiceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCustomerServiceController.java new file mode 100644 index 0000000..af0e59d --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCustomerServiceController.java @@ -0,0 +1,67 @@ +package com.ruoyi.web.controller.api; + + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain.TAdvertisementConfig; +import com.ruoyi.system.domain.TCustomerService; +import com.ruoyi.system.service.TConfigService; +import com.ruoyi.system.service.TCustomerServiceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * <p> + * 客服配置表 前端控制器 + * </p> + * + * @author xiaochen + * @since 2024-02-29 + */ +@Api(tags = "客服配置") +@RestController +@RequestMapping("/tCustomerService") +public class TCustomerServiceController { + + private final TCustomerServiceService customerServiceService; + + @Autowired + public TCustomerServiceController(TCustomerServiceService customerServiceService) { + this.customerServiceService = customerServiceService; + } + + /** + * 查询客服配置 + */ + @ApiOperation(value = "查询客服配置") + @GetMapping("/getCustomerServiceList") + public AjaxResult<List<TCustomerService>> getCustomerServiceList() + { + return AjaxResult.success(customerServiceService.list()); + } + + /** + * 添加客服配置 + */ + @ApiOperation(value = "添加客服配置") + @PostMapping("/addCustomerService") + public AjaxResult addCustomerService(@RequestBody TCustomerService customerService) + { + return AjaxResult.success(customerServiceService.save(customerService)); + } + + /** + * 删除客服配置 + */ + @ApiOperation(value = "删除客服配置") + @DeleteMapping("/deleteCustomerService") + public AjaxResult deleteCustomerService(@RequestParam Long serviceId) + { + return AjaxResult.success(customerServiceService.removeById(serviceId)); + } + +} + diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 21ff250..b307fe3 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -1,5 +1,6 @@ package com.ruoyi.common.core.domain.entity; +import java.math.BigDecimal; import java.util.Date; import java.util.List; import javax.validation.constraints.*; @@ -118,10 +119,21 @@ private Integer ifBlack; /** - * 区县id + * 会员类型 1=个人会员 2=企业会员 3=普通用户 */ - @ApiModelProperty(value = "区县id") - private Integer districtId; + @ApiModelProperty(value = "会员类型 1=个人会员 2=企业会员 3=普通用户") + private Integer vipType; + + @ApiModelProperty(value = "注册时间") + private Date insertTime; + @ApiModelProperty(value = "首次成为会员时间") + private Integer firstVipTime; + @ApiModelProperty(value = "会员开始时间") + private Integer startTime; + @ApiModelProperty(value = "会员到期时间") + private Integer endTime; + @ApiModelProperty(value = "已消费金额") + private BigDecimal consumptionAmount; @TableField(exist = false) private String roleName; @@ -134,14 +146,6 @@ public void setRoleName(String roleName) { this.roleName = roleName; - } - - public Integer getDistrictId() { - return districtId; - } - - public void setDistrictId(Integer districtId) { - this.districtId = districtId; } public SysUser() diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TConfig.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TConfig.java index 20fb998..20d719f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TConfig.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TConfig.java @@ -30,7 +30,7 @@ @TableId(value = "id", type = IdType.AUTO) private Long id; - @ApiModelProperty(value = "内容 1=创业合伙人配置 2=会员说明 3=剧本出售说明 4=短剧出售说明") + @ApiModelProperty(value = "内容 1=创业合伙人配置 2=会员说明 3=剧本出售说明 4=短剧出售说明 5=用户协议 6=隐私协议 7=注销协议") @TableField("content") private String content; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TCustomerService.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TCustomerService.java new file mode 100644 index 0000000..2e50fd0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TCustomerService.java @@ -0,0 +1,38 @@ +package com.ruoyi.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.core.domain.BaseModel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * <p> + * t_customer_service表 + * </p> + * + * @author xiaochen + * @since 2024-02-29 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("t_customer_service") +@ApiModel(value="tCustomerService对象", description="t_customer_service表") +public class TCustomerService implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "客服电话") + @TableField("servicePhone") + private String servicePhone; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TCustomerServiceMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TCustomerServiceMapper.java new file mode 100644 index 0000000..c17a105 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TCustomerServiceMapper.java @@ -0,0 +1,19 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.TBanner; +import com.ruoyi.system.domain.TCustomerService; +import org.apache.ibatis.annotations.Mapper; + +/** + * <p> + * TCustomerService表 Mapper 接口 + * </p> + * + * @author xiaochen + * @since 2024-02-29 + */ +@Mapper +public interface TCustomerServiceMapper extends BaseMapper<TCustomerService> { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/TCustomerServiceService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/TCustomerServiceService.java new file mode 100644 index 0000000..541fd00 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/TCustomerServiceService.java @@ -0,0 +1,17 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.TConfig; +import com.ruoyi.system.domain.TCustomerService; + +/** + * <p> + * 客服配置表 服务类 + * </p> + * + * @author xiaochen + * @since 2024-02-29 + */ +public interface TCustomerServiceService extends IService<TCustomerService> { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCustomerServiceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCustomerServiceServiceImpl.java new file mode 100644 index 0000000..df708b1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCustomerServiceServiceImpl.java @@ -0,0 +1,23 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.TConfig; +import com.ruoyi.system.domain.TCustomerService; +import com.ruoyi.system.mapper.TConfigMapper; +import com.ruoyi.system.mapper.TCustomerServiceMapper; +import com.ruoyi.system.service.TConfigService; +import com.ruoyi.system.service.TCustomerServiceService; +import org.springframework.stereotype.Service; + +/** + * <p> + * 客服配置表 服务实现类 + * </p> + * + * @author xiaochen + * @since 2024-02-29 + */ +@Service +public class TCustomerServiceServiceImpl extends ServiceImpl<TCustomerServiceMapper, TCustomerService> implements TCustomerServiceService { + +} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index c0b58fa..12ec43b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -24,7 +24,12 @@ <result property="updateTime" column="update_time" /> <result property="remark" column="remark" /> <result property="ifBlack" column="ifBlack" /> - <result property="districtId" column="districtId" /> + <result property="vipType" column="vipType" /> + <result property="insertTime" column="insertTime" /> + <result property="firstVipTime" column="firstVipTime" /> + <result property="startTime" column="startTime" /> + <result property="endTime" column="endTime" /> + <result property="consumptionAmount" column="consumptionAmount" /> <association property="dept" javaType="SysDept" resultMap="deptResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> </resultMap> diff --git a/ruoyi-system/src/main/resources/mapper/system/TCustomerServiceMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TCustomerServiceMapper.xml new file mode 100644 index 0000000..0329b74 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/TCustomerServiceMapper.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.system.mapper.TCustomerServiceMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.TCustomerService"> + <id column="id" property="id" /> + <result column="servicePhone" property="servicePhone" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, servicePhone + </sql> + +</mapper> -- Gitblit v1.7.1