2024-04 新增足球场馆邀请链接逻辑-免责声明

This commit is contained in:
2024-04-28 18:03:48 +08:00
parent 3e128bf2e2
commit e8c119b096
9 changed files with 454 additions and 3 deletions

View File

@@ -0,0 +1,34 @@
package com.sv.api.controller;
import com.sv.service.oms.DisclaimersService;
import com.ydd.framework.core.common.dto.ResponseDTO;
import com.ydd.framework.core.controller.BaseApiController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* Controller - 免责声明
*
* @author limqsh
* @since 2018-08-06
*/
@RestController
public class DisclaimersController extends BaseApiController {
private final Logger logger = LoggerFactory.getLogger(DisclaimersController.class);
@Resource
private DisclaimersService disclaimersService;
/**
* 查询免责声明信息
*/
@RequestMapping(value = "/notice/disclaimers", method = RequestMethod.POST)
public ResponseDTO findById() {
return ResponseDTO.ok()
.addAttribute("disclaimers", disclaimersService.findById(1));
}
}

View File

@@ -0,0 +1,100 @@
package com.sv.entity;
import java.util.Date;
public class Disclaimers {
private Integer id;
private Integer platformId;
private Integer createdId;
private Integer modifiedId;
private Date createdTime;
private Date modifiedTime;
private Integer deleted;
private String description;
public Disclaimers(Integer id, Integer platformId, Integer createdId, Integer modifiedId, Date createdTime, Date modifiedTime, Integer deleted, String description) {
this.id = id;
this.platformId = platformId;
this.createdId = createdId;
this.modifiedId = modifiedId;
this.createdTime = createdTime;
this.modifiedTime = modifiedTime;
this.deleted = deleted;
this.description = description;
}
public Disclaimers() {
super();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getPlatformId() {
return platformId;
}
public void setPlatformId(Integer platformId) {
this.platformId = platformId;
}
public Integer getCreatedId() {
return createdId;
}
public void setCreatedId(Integer createdId) {
this.createdId = createdId;
}
public Integer getModifiedId() {
return modifiedId;
}
public void setModifiedId(Integer modifiedId) {
this.modifiedId = modifiedId;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
public Integer getDeleted() {
return deleted;
}
public void setDeleted(Integer deleted) {
this.deleted = deleted;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
}

View File

@@ -0,0 +1,48 @@
package com.sv.oms.controller;
import com.sv.entity.AboutUs;
import com.sv.entity.Disclaimers;
import com.sv.service.oms.AboutUsService;
import com.sv.service.oms.DisclaimersService;
import com.ydd.framework.core.common.Pagination;
import com.ydd.framework.core.common.dto.ResponseDTO;
import com.ydd.oms.controller.OmsController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* Controller - 关于我们
*
* @author lihong
* @since 2018-08-15
*/
@RestController
public class DisclaimersController extends OmsController {
private final Logger logger = LoggerFactory.getLogger(DisclaimersController.class);
@Resource
private DisclaimersService disclaimersService;
/**
* 查询关于我们信息
*/
@RequestMapping(value = "/notice/disclaimers", method = RequestMethod.GET)
public ResponseDTO findById() {
return ResponseDTO.ok()
.addAttribute("aboutUs", disclaimersService.findById(1));
}
/**
* 保存关于我们
*/
@RequestMapping(value = "/notice/disclaimers/save", method = RequestMethod.POST)
public ResponseDTO save(Disclaimers disclaimers) {
disclaimersService.save(disclaimers);
return ResponseDTO.ok("保存成功");
}
}

34
other/sql/202404.sql Normal file
View File

@@ -0,0 +1,34 @@
-- ----------------------------
-- Table structure for sv_member_lesson_ticket_invite
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_lesson_ticket_invite`;
CREATE TABLE `sv_member_lesson_ticket_invite` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`owner_id` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
`member_id` int(11) NOT NULL,
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态0-未选中 1-已选中',
`platform_id` int(11) NOT NULL COMMENT '平台来源ID',
`created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
`modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
`created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
PRIMARY KEY (`id`),
KEY `lesson_id` (`deleted`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='场馆课程预订信息';
-- ----------------------------
-- Table structure for sv_disclaimers
-- ----------------------------
DROP TABLE IF EXISTS `sv_disclaimers`;
CREATE TABLE `sv_disclaimers` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` longtext CHARACTER SET utf8mb4 NOT NULL COMMENT '简介',
`platform_id` int(11) NOT NULL COMMENT '平台来源ID',
`created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
`modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
`created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` int(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='免责声明';

View File

@@ -0,0 +1,19 @@
package com.sv.mapper;
import com.sv.entity.Disclaimers;
public interface DisclaimersMapper {
int deleteByPrimaryKey(Integer id);
int insert(Disclaimers record);
int insertSelective(Disclaimers record);
Disclaimers selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Disclaimers record);
int updateByPrimaryKeyWithBLOBs(Disclaimers record);
int updateByPrimaryKey(Disclaimers record);
}

View File

@@ -0,0 +1,58 @@
package com.sv.service.oms;
import com.sv.entity.Disclaimers;
import com.sv.mapper.DisclaimersMapper;
import com.ydd.framework.core.service.impl.BaseServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* Service - 免责声明
*
* @author limqsh
* @since 2024-04-28
*/
@Service
@Transactional(readOnly = true)
public class DisclaimersService extends BaseServiceImpl {
private final Logger logger = LoggerFactory.getLogger(DisclaimersService.class);
@Resource
private DisclaimersMapper disclaimersMapper;
/**
* 创建免责声明
*
* @param disclaimers 免责声明
*/
@Transactional
public void save(Disclaimers disclaimers) {
// 需要更新或者创建
if (disclaimers.getId() != null && disclaimers.getId() > 0) {
// 更新
disclaimersMapper.updateByPrimaryKey(disclaimers);
} else {
// 新建
disclaimers.setPlatformId(1);
disclaimers.setId(1);
disclaimersMapper.insert(disclaimers);
}
}
/**
* 查询免责声明
*
* @param id 编号
* @return 免责声明
*/
public Disclaimers findById(Integer id) {
return disclaimersMapper.selectByPrimaryKey(id);
}
}

View File

@@ -306,8 +306,10 @@
m.nickname,
m.mobile,
(select IFNULL(sum(ot.price),0) from sv_order ot
where ot.member_id = t.member_id and (ot.order_sn = t.order_sn or ot.order_sn = t.order_add_sn)
) as price,
where ot.member_id = t.member_id and ot.order_sn = t.order_sn
) + (select IFNULL(sum(ot.price),0) from sv_order ot
where ot.member_id = t.member_id and ot.order_sn = t.order_add_sn
) as price,
t.paying,
IFNULL(t.sum_pay_money,0) as payMoney,
t.order_sn as orderSn,

View File

@@ -0,0 +1,156 @@
<?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.sv.mapper.DisclaimersMapper" >
<resultMap id="BaseResultMap" type="com.sv.entity.Disclaimers" >
<constructor >
<idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="platform_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="created_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="modified_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="created_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
<arg column="modified_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
<arg column="deleted" jdbcType="INTEGER" javaType="java.lang.Integer" />
</constructor>
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.sv.entity.Disclaimers" >
<constructor >
<idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="platform_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="created_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="modified_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="created_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
<arg column="modified_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
<arg column="deleted" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="description" jdbcType="LONGVARCHAR" javaType="java.lang.String" />
</constructor>
</resultMap>
<sql id="Base_Column_List" >
id, platform_id, created_id, modified_id, created_time, modified_time, deleted
</sql>
<sql id="Blob_Column_List" >
description
</sql>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sv_disclaimers
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from sv_disclaimers
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sv.entity.Disclaimers" >
insert into sv_disclaimers (id, platform_id, created_id,
modified_id, created_time, modified_time,
deleted, description)
values (#{id,jdbcType=INTEGER}, #{platformId,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER},
#{modifiedId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP},
#{deleted,jdbcType=INTEGER}, #{description,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sv.entity.Disclaimers" >
insert into sv_disclaimers
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="platformId != null" >
platform_id,
</if>
<if test="createdId != null" >
created_id,
</if>
<if test="modifiedId != null" >
modified_id,
</if>
<if test="createdTime != null" >
created_time,
</if>
<if test="modifiedTime != null" >
modified_time,
</if>
<if test="deleted != null" >
deleted,
</if>
<if test="description != null" >
description,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="platformId != null" >
#{platformId,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
#{createdId,jdbcType=INTEGER},
</if>
<if test="modifiedId != null" >
#{modifiedId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedTime != null" >
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null" >
#{deleted,jdbcType=INTEGER},
</if>
<if test="description != null" >
#{description,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sv.entity.Disclaimers" >
update sv_disclaimers
<set >
<if test="platformId != null" >
platform_id = #{platformId,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
created_id = #{createdId,jdbcType=INTEGER},
</if>
<if test="modifiedId != null" >
modified_id = #{modifiedId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedTime != null" >
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null" >
deleted = #{deleted,jdbcType=INTEGER},
</if>
<if test="description != null" >
description = #{description,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sv.entity.Disclaimers" >
update sv_disclaimers
set platform_id = #{platformId,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER},
modified_id = #{modifiedId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=INTEGER},
description = #{description,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sv.entity.Disclaimers" >
update sv_disclaimers
set platform_id = #{platformId,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER},
modified_id = #{modifiedId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -90,7 +90,7 @@
domainObjectName 给表对应的 model 起名字
注意:大小写敏感问题。
-->
<table tableName="sv_member_lesson_ticket_invite" domainObjectName="MemberTicketInvite"
<table tableName="sv_disclaimers" domainObjectName="Disclaimers"
enableInsert="true"
enableDeleteByPrimaryKey="true"
enableSelectByPrimaryKey="true"