| @ -1,17 +1,19 @@ | |||
| package org.jeecg.modules.studytourImageContent.mapper; | |||
| package org.jeecg.modules.studytourImage.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.studytourImageContent.entity.StudytourImageContent; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| /** | |||
| * @Description: 用户图片直播表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-25 | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface StudytourImageContentMapper extends BaseMapper<StudytourImageContent> { | |||
| public boolean deleteByMainId(@Param("mainId") String mainId); | |||
| public List<StudytourImageContent> selectByMainId(@Param("mainId") String mainId); | |||
| } | |||
| @ -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="org.jeecg.modules.studytourImage.mapper.StudytourImageContentMapper"> | |||
| <delete id="deleteByMainId" parameterType="java.lang.String"> | |||
| DELETE | |||
| FROM studytour_image_content | |||
| WHERE | |||
| image_id = #{mainId} </delete> | |||
| <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.studytourImage.entity.StudytourImageContent"> | |||
| SELECT * | |||
| FROM studytour_image_content | |||
| WHERE | |||
| image_id = #{mainId} </select> | |||
| </mapper> | |||
| @ -1,14 +1,16 @@ | |||
| package org.jeecg.modules.studytourImageContent.service; | |||
| package org.jeecg.modules.studytourImage.service; | |||
| import org.jeecg.modules.studytourImageContent.entity.StudytourImageContent; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import java.util.List; | |||
| /** | |||
| * @Description: 用户图片直播表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-25 | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IStudytourImageContentService extends IService<StudytourImageContent> { | |||
| public List<StudytourImageContent> selectByMainId(String mainId); | |||
| } | |||
| @ -1,14 +1,40 @@ | |||
| package org.jeecg.modules.studytourImage.service; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImage; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import java.io.Serializable; | |||
| import java.util.Collection; | |||
| import java.util.List; | |||
| /** | |||
| * @Description: 图片直播表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-25 | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IStudytourImageService extends IService<StudytourImage> { | |||
| /** | |||
| * 添加一对多 | |||
| * | |||
| */ | |||
| public void saveMain(StudytourImage studytourImage,List<StudytourImageContent> studytourImageContentList) ; | |||
| /** | |||
| * 修改一对多 | |||
| * | |||
| */ | |||
| public void updateMain(StudytourImage studytourImage,List<StudytourImageContent> studytourImageContentList); | |||
| /** | |||
| * 删除一对多 | |||
| */ | |||
| public void delMain (String id); | |||
| /** | |||
| * 批量删除一对多 | |||
| */ | |||
| public void delBatchMain (Collection<? extends Serializable> idList); | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| package org.jeecg.modules.studytourImage.service.impl; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import org.jeecg.modules.studytourImage.mapper.StudytourImageContentMapper; | |||
| import org.jeecg.modules.studytourImage.service.IStudytourImageContentService; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| /** | |||
| * @Description: 用户图片直播表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class StudytourImageContentServiceImpl extends ServiceImpl<StudytourImageContentMapper, StudytourImageContent> implements IStudytourImageContentService { | |||
| @Autowired | |||
| private StudytourImageContentMapper studytourImageContentMapper; | |||
| @Override | |||
| public List<StudytourImageContent> selectByMainId(String mainId) { | |||
| return studytourImageContentMapper.selectByMainId(mainId); | |||
| } | |||
| } | |||
| @ -1,19 +1,77 @@ | |||
| package org.jeecg.modules.studytourImage.service.impl; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImage; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import org.jeecg.modules.studytourImage.mapper.StudytourImageContentMapper; | |||
| import org.jeecg.modules.studytourImage.mapper.StudytourImageMapper; | |||
| import org.jeecg.modules.studytourImage.service.IStudytourImageService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| import java.util.Collection; | |||
| /** | |||
| * @Description: 图片直播表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-25 | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class StudytourImageServiceImpl extends ServiceImpl<StudytourImageMapper, StudytourImage> implements IStudytourImageService { | |||
| @Autowired | |||
| private StudytourImageMapper studytourImageMapper; | |||
| @Autowired | |||
| private StudytourImageContentMapper studytourImageContentMapper; | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void saveMain(StudytourImage studytourImage, List<StudytourImageContent> studytourImageContentList) { | |||
| studytourImageMapper.insert(studytourImage); | |||
| if(studytourImageContentList!=null && studytourImageContentList.size()>0) { | |||
| for(StudytourImageContent entity:studytourImageContentList) { | |||
| //外键设置 | |||
| entity.setImageId(studytourImage.getId()); | |||
| studytourImageContentMapper.insert(entity); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void updateMain(StudytourImage studytourImage,List<StudytourImageContent> studytourImageContentList) { | |||
| studytourImageMapper.updateById(studytourImage); | |||
| //1.先删除子表数据 | |||
| studytourImageContentMapper.deleteByMainId(studytourImage.getId()); | |||
| //2.子表数据重新插入 | |||
| if(studytourImageContentList!=null && studytourImageContentList.size()>0) { | |||
| for(StudytourImageContent entity:studytourImageContentList) { | |||
| //外键设置 | |||
| entity.setImageId(studytourImage.getId()); | |||
| studytourImageContentMapper.insert(entity); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void delMain(String id) { | |||
| studytourImageContentMapper.deleteByMainId(id); | |||
| studytourImageMapper.deleteById(id); | |||
| } | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void delBatchMain(Collection<? extends Serializable> idList) { | |||
| for(Serializable id:idList) { | |||
| studytourImageContentMapper.deleteByMainId(id.toString()); | |||
| studytourImageMapper.deleteById(id); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,65 @@ | |||
| package org.jeecg.modules.studytourImage.vo; | |||
| import java.util.List; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImage; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import lombok.Data; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecgframework.poi.excel.annotation.ExcelEntity; | |||
| import org.jeecgframework.poi.excel.annotation.ExcelCollection; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import java.util.Date; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| /** | |||
| * @Description: 图片直播表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @ApiModel(value="studytour_imagePage对象", description="图片直播表") | |||
| public class StudytourImagePage { | |||
| /**主键*/ | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**图片*/ | |||
| @Excel(name = "图片", width = 15) | |||
| @ApiModelProperty(value = "图片") | |||
| private java.lang.String image; | |||
| /**地址*/ | |||
| @Excel(name = "地址", width = 15) | |||
| @ApiModelProperty(value = "地址") | |||
| private java.lang.String address; | |||
| /**关联活动*/ | |||
| @Excel(name = "关联活动", width = 15, dictTable = "studytour_activity", dicText = "title", dicCode = "id") | |||
| @Dict(dictTable = "studytour_activity", dicText = "title", dicCode = "id") | |||
| @ApiModelProperty(value = "关联活动") | |||
| private java.lang.String activityId; | |||
| /**关联用户*/ | |||
| @Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @ApiModelProperty(value = "关联用户") | |||
| private java.lang.String userId; | |||
| @ExcelCollection(name="用户图片直播表") | |||
| @ApiModelProperty(value = "用户图片直播表") | |||
| private List<StudytourImageContent> studytourImageContentList; | |||
| } | |||
| @ -1,19 +0,0 @@ | |||
| package org.jeecg.modules.studytourImageContent.service.impl; | |||
| import org.jeecg.modules.studytourImageContent.entity.StudytourImageContent; | |||
| import org.jeecg.modules.studytourImageContent.mapper.StudytourImageContentMapper; | |||
| import org.jeecg.modules.studytourImageContent.service.IStudytourImageContentService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 用户图片直播表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-25 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class StudytourImageContentServiceImpl extends ServiceImpl<StudytourImageContentMapper, StudytourImageContent> implements IStudytourImageContentService { | |||
| } | |||
| @ -1,52 +0,0 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '图片', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| customRender:render.renderAvatar, | |||
| }, | |||
| { | |||
| title: '关联图片直播id', | |||
| align:"center", | |||
| dataIndex: 'imageId_dictText' | |||
| }, | |||
| { | |||
| title: '关联用户id', | |||
| align:"center", | |||
| dataIndex: 'userId_dictText' | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '图片', | |||
| field: 'image', | |||
| component: 'JImageUpload', | |||
| componentProps:{ | |||
| }, | |||
| }, | |||
| { | |||
| label: '关联图片直播id', | |||
| field: 'imageId', | |||
| component: 'JDictSelectTag', | |||
| componentProps:{ | |||
| dictCode:"studytour_image,id,id" | |||
| }, | |||
| }, | |||
| { | |||
| label: '关联用户id', | |||
| field: 'userId', | |||
| component: 'JDictSelectTag', | |||
| componentProps:{ | |||
| dictCode:"han_hai_member,nick_name,id" | |||
| }, | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,80 @@ | |||
| package org.jeecg.modules.studytourRecord.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.experimental.Accessors; | |||
| /** | |||
| * @Description: 成长档案表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("studytour_record") | |||
| @Accessors(chain = true) | |||
| @EqualsAndHashCode(callSuper = false) | |||
| @ApiModel(value="studytour_record对象", description="成长档案表") | |||
| public class StudytourRecord implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**行程分数*/ | |||
| @Excel(name = "行程分数", width = 15) | |||
| @ApiModelProperty(value = "行程分数") | |||
| private java.lang.Integer processScore; | |||
| /**景点分数*/ | |||
| @Excel(name = "景点分数", width = 15) | |||
| @ApiModelProperty(value = "景点分数") | |||
| private java.lang.Integer spotScore; | |||
| /**导师分数*/ | |||
| @Excel(name = "导师分数", width = 15) | |||
| @ApiModelProperty(value = "导师分数") | |||
| private java.lang.Integer teacherScore; | |||
| /**活动掠影*/ | |||
| @Excel(name = "活动掠影", width = 15) | |||
| @ApiModelProperty(value = "活动掠影") | |||
| private java.lang.String image; | |||
| /**学员心得*/ | |||
| @Excel(name = "学员心得", width = 15) | |||
| @ApiModelProperty(value = "学员心得") | |||
| private java.lang.String content; | |||
| /**关联活动*/ | |||
| @Excel(name = "关联活动", width = 15, dictTable = "studytour_activity", dicText = "title", dicCode = "id") | |||
| @Dict(dictTable = "studytour_activity", dicText = "title", dicCode = "id") | |||
| @ApiModelProperty(value = "关联活动") | |||
| private java.lang.String activityId; | |||
| /**关联用户*/ | |||
| @Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @ApiModelProperty(value = "关联用户") | |||
| private java.lang.String userId; | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.studytourRecord.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.studytourRecord.entity.StudytourRecord; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 成长档案表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface StudytourRecordMapper extends BaseMapper<StudytourRecord> { | |||
| } | |||
| @ -1,5 +1,5 @@ | |||
| <?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="org.jeecg.modules.studytourImageContent.mapper.StudytourImageContentMapper"> | |||
| <mapper namespace="org.jeecg.modules.studytourRecord.mapper.StudytourRecordMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,14 @@ | |||
| package org.jeecg.modules.studytourRecord.service; | |||
| import org.jeecg.modules.studytourRecord.entity.StudytourRecord; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| /** | |||
| * @Description: 成长档案表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IStudytourRecordService extends IService<StudytourRecord> { | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.studytourRecord.service.impl; | |||
| import org.jeecg.modules.studytourRecord.entity.StudytourRecord; | |||
| import org.jeecg.modules.studytourRecord.mapper.StudytourRecordMapper; | |||
| import org.jeecg.modules.studytourRecord.service.IStudytourRecordService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 成长档案表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-09-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class StudytourRecordServiceImpl extends ServiceImpl<StudytourRecordMapper, StudytourRecord> implements IStudytourRecordService { | |||
| } | |||
| @ -0,0 +1,92 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '行程分数', | |||
| align:"center", | |||
| dataIndex: 'processScore' | |||
| }, | |||
| { | |||
| title: '景点分数', | |||
| align:"center", | |||
| dataIndex: 'spotScore' | |||
| }, | |||
| { | |||
| title: '导师分数', | |||
| align:"center", | |||
| dataIndex: 'teacherScore' | |||
| }, | |||
| { | |||
| title: '活动掠影', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| customRender:render.renderAvatar, | |||
| }, | |||
| { | |||
| title: '学员心得', | |||
| align:"center", | |||
| dataIndex: 'content' | |||
| }, | |||
| { | |||
| title: '关联活动', | |||
| align:"center", | |||
| dataIndex: 'activityId_dictText' | |||
| }, | |||
| { | |||
| title: '关联用户', | |||
| align:"center", | |||
| dataIndex: 'userId_dictText' | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '行程分数', | |||
| field: 'processScore', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '景点分数', | |||
| field: 'spotScore', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '导师分数', | |||
| field: 'teacherScore', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '活动掠影', | |||
| field: 'image', | |||
| component: 'JImageUpload', | |||
| componentProps:{ | |||
| }, | |||
| }, | |||
| { | |||
| label: '学员心得', | |||
| field: 'content', | |||
| component: 'InputTextArea',//TODO 注意string转换问题 | |||
| }, | |||
| { | |||
| label: '关联活动', | |||
| field: 'activityId', | |||
| component: 'JDictSelectTag', | |||
| componentProps:{ | |||
| dictCode:"studytour_activity,title,id" | |||
| }, | |||
| }, | |||
| { | |||
| label: '关联用户', | |||
| field: 'userId', | |||
| component: 'JSearchSelect', | |||
| componentProps:{ | |||
| dict:"han_hai_member,nick_name,id" | |||
| }, | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,25 @@ | |||
| package org.jeecg.modules.api.service; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.studytourBindperson.entity.StudytourBindperson; | |||
| import org.springframework.web.bind.annotation.RequestHeader; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RequestMethod; | |||
| public interface BindService { | |||
| //成员管理-查询绑定人信息 | |||
| public Result<?> queryBindUser(String bindUserId); | |||
| //成员管理-查询绑定成员列表 | |||
| public Result<?> queryBindList(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson, PageBean pageBean); | |||
| //成员管理-绑定申请 | |||
| public Result<?> addBind(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson); | |||
| //成员管理-审批绑定申请 | |||
| public Result<?> updateBind(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson); | |||
| } | |||
| @ -0,0 +1,25 @@ | |||
| package org.jeecg.modules.api.service; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.studytourCouponUser.entity.StudytourCouponUser; | |||
| import org.springframework.web.bind.annotation.RequestHeader; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RequestMethod; | |||
| public interface CouponService { | |||
| //优惠券-优惠券列表 | |||
| public Result<?> queryCouponList(String token, StudytourCouponUser studytourCouponUser, PageBean pageBean); | |||
| //根据id查看优惠券详情 | |||
| public Result<?> queryCouponById(String token, String usercouponId); | |||
| //查看可领取的优惠券 | |||
| public Result<?> queryFetchCouponList(String token); | |||
| //领取优惠券 | |||
| public Result<?> fetchCoupon(String token, String couponId); | |||
| } | |||
| @ -1,4 +1,23 @@ | |||
| package org.jeecg.modules.api.service; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.studytourBindperson.entity.StudytourBindperson; | |||
| import org.jeecg.modules.studytourRecord.entity.StudytourRecord; | |||
| import org.springframework.web.bind.annotation.RequestHeader; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RequestMethod; | |||
| public interface ExperienceService { | |||
| //成长档案-查询成长档案列表 | |||
| public Result<?> queryExperienceList(@RequestHeader("X-Access-Token") String token, StudytourRecord studytourRecord, PageBean pageBean); | |||
| //成长档案-查询成长档案详情 | |||
| public Result<?> queryExperienceById(@RequestHeader("X-Access-Token") String token, String recordId); | |||
| //成长档案-新增成长档案 | |||
| public Result<?> addExperience(@RequestHeader("X-Access-Token") String token, StudytourRecord studytourRecord); | |||
| } | |||
| @ -1,4 +1,27 @@ | |||
| package org.jeecg.modules.api.service; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImage; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import org.springframework.web.bind.annotation.RequestHeader; | |||
| public interface ImageService { | |||
| //图片直播-查询图片直播列表 | |||
| public Result<?> queryImageList(PageBean pageBean); | |||
| //图片直播-新增图片直播信息 | |||
| public Result<?> addImage(@RequestHeader("X-Access-Token") String token, StudytourImage studytourImage); | |||
| //图片直播-查询图片直播内容列表 | |||
| public Result<?> queryImageContentList(String imageId, PageBean pageBean); | |||
| //图片直播-新增图片直播内容信息 | |||
| public Result<?> addImageContent(@RequestHeader("X-Access-Token") String token, StudytourImageContent studytourImageContent); | |||
| //图片直播-标记有我 | |||
| public Result<?> queryMarkmeList(@RequestHeader("X-Access-Token") String token, String imagePath); | |||
| } | |||
| @ -0,0 +1,177 @@ | |||
| package org.jeecg.modules.api.service.Impl; | |||
| import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang.StringUtils; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.config.shiro.ShiroRealm; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.api.service.BindService; | |||
| import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; | |||
| import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; | |||
| import org.jeecg.modules.studytourBindperson.entity.StudytourBindperson; | |||
| import org.jeecg.modules.studytourBindperson.service.IStudytourBindpersonService; | |||
| import org.jeecg.modules.studytourRecord.entity.StudytourRecord; | |||
| import org.jeecg.modules.studytourRecord.service.IStudytourRecordService; | |||
| import org.springframework.stereotype.Service; | |||
| import javax.annotation.Resource; | |||
| @Service | |||
| @Slf4j | |||
| public class BindServiceImpl implements BindService { | |||
| /******************************************************************************************************************/ | |||
| //权限验证 | |||
| @Resource | |||
| private ShiroRealm shiroRealm; | |||
| //权限验证 | |||
| @Resource | |||
| private IHanHaiMemberService hanHaiMemberService; | |||
| //权限验证 | |||
| @Resource | |||
| private IStudytourBindpersonService studytourBindpersonService; | |||
| /******************************************************************************************************************/ | |||
| //成员管理-查询绑定人信息 | |||
| @Override | |||
| public Result<?> queryBindUser(String bindUserId) { | |||
| log.info("开始查询绑定人信息"); | |||
| //返回信息 | |||
| String massege = ""; | |||
| try{ | |||
| //查询绑定人信息 | |||
| HanHaiMember userInfo = hanHaiMemberService.getById(bindUserId); | |||
| log.info("绑定人信息查询结束"); | |||
| return Result.OK("绑定人信息", userInfo); | |||
| }catch (Exception e){ | |||
| log.info("绑绑定人信息查询失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("绑定人信息查询失败"); | |||
| } | |||
| } | |||
| //成员管理-查询绑定成员列表 | |||
| @Override | |||
| public Result<?> queryBindList(String token, StudytourBindperson studytourBindperson, PageBean pageBean) { | |||
| log.info("开始查询绑定成员列表"); | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| //分页信息 | |||
| Page<StudytourBindperson> page = null; | |||
| //查询信息 | |||
| LambdaQueryChainWrapper<StudytourBindperson> query = null; | |||
| //返回信息 | |||
| Page<StudytourBindperson> pageList = null; | |||
| try{ | |||
| //分页 | |||
| page = new Page<StudytourBindperson>(pageBean.getPageNo(), pageBean.getPageSize()); | |||
| query = studytourBindpersonService | |||
| .lambdaQuery(); | |||
| //组装查询条件 | |||
| //主绑定人 | |||
| query.eq(StudytourBindperson::getBindId, hanHaiMember.getId()); | |||
| //绑定状态 | |||
| if(StringUtils.isNotEmpty(studytourBindperson.getStatus())){ | |||
| query.eq(StudytourBindperson::getStatus, studytourBindperson.getStatus()); | |||
| } | |||
| //按照创建时间降序排列 | |||
| query.orderByDesc(StudytourBindperson::getCreateTime); | |||
| //获取图片直播信息列表 | |||
| pageList = query.page(page); | |||
| log.info("绑定成员列表查询结束"); | |||
| return Result.OK("绑定成员列表", pageList); | |||
| }catch (Exception e){ | |||
| log.info("绑定成员列表查询失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("绑定成员列表查询失败"); | |||
| } | |||
| } | |||
| //成员管理-绑定申请 | |||
| @Override | |||
| public Result<?> addBind(String token, StudytourBindperson studytourBindperson) { | |||
| log.info("开始新增绑定申请"); | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| try{ | |||
| //1、新增绑定申请 | |||
| studytourBindperson.setUserId(hanHaiMember.getId()); | |||
| boolean result = studytourBindpersonService.save(studytourBindperson); | |||
| if(result){ | |||
| log.info("绑定申请新增成功"); | |||
| return Result.OK("绑定申请新增成功"); | |||
| }else { | |||
| log.info("绑定申请新增失败"); | |||
| return Result.error("绑定申请新增失败"); | |||
| } | |||
| }catch (Exception e){ | |||
| log.info("绑定申请新增失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("绑定申请新增失败"); | |||
| } | |||
| } | |||
| //成员管理-审批绑定申请 | |||
| @Override | |||
| public Result<?> updateBind(String token, StudytourBindperson studytourBindperson) { | |||
| log.info("开始审批绑定申请"); | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| try{ | |||
| //0、校验绑定信息 | |||
| if(StringUtils.isEmpty(studytourBindperson.getId())){ | |||
| return Result.error("绑定信息id为空,请传入id"); | |||
| } | |||
| StudytourBindperson bindperson = studytourBindpersonService.getById(studytourBindperson.getId()); | |||
| if(null == bindperson){ | |||
| return Result.error("绑定信息不存在,请检查id是否正确:"+ studytourBindperson.getId()); | |||
| }else if(!bindperson.getBindId().equals(hanHaiMember.getId())){ | |||
| return Result.error("该绑定信息与当前用户不匹配"); | |||
| } | |||
| //1、新增绑定申请 | |||
| studytourBindperson.setBindId(hanHaiMember.getId()); | |||
| studytourBindperson.setUserId(bindperson.getUserId()); | |||
| boolean result = studytourBindpersonService.updateById(studytourBindperson); | |||
| if(result){ | |||
| log.info("绑定申请已审批"); | |||
| return Result.OK("绑定申请已审批"); | |||
| }else { | |||
| log.info("绑定申请审批失败"); | |||
| return Result.error("绑定申请审批失败"); | |||
| } | |||
| }catch (Exception e){ | |||
| log.info("绑定申请审批失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("绑定申请审批失败"); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,210 @@ | |||
| package org.jeecg.modules.api.service.Impl; | |||
| import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang.StringUtils; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.config.shiro.ShiroRealm; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.api.service.CouponService; | |||
| import org.jeecg.modules.api.utils.CommonUtils; | |||
| import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; | |||
| import org.jeecg.modules.pay.MpWxPayService; | |||
| import org.jeecg.modules.studytourCoupon.entity.StudytourCoupon; | |||
| import org.jeecg.modules.studytourCoupon.service.IStudytourCouponService; | |||
| import org.jeecg.modules.studytourCouponUser.entity.StudytourCouponUser; | |||
| import org.jeecg.modules.studytourCouponUser.service.IStudytourCouponUserService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import javax.annotation.Resource; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| @Service | |||
| @Slf4j | |||
| public class CouponServiceImpl implements CouponService { | |||
| /******************************************************************************************************************/ | |||
| //权限验证 | |||
| @Resource | |||
| private ShiroRealm shiroRealm; | |||
| //优惠券信息 | |||
| @Resource | |||
| private IStudytourCouponService studytourCouponService; | |||
| //用户持有优惠券 | |||
| @Resource | |||
| private IStudytourCouponUserService studytourCouponUserService; | |||
| /******************************************************************************************************************/ | |||
| //优惠券-优惠券列表 | |||
| @Override | |||
| public Result<?> queryCouponList(String token, StudytourCouponUser studytourCouponUser, PageBean pageBean) { | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| //分页信息 | |||
| Page<StudytourCouponUser> page = null; | |||
| //查询信息 | |||
| LambdaQueryChainWrapper<StudytourCouponUser> query = null; | |||
| //返回信息 | |||
| Page<StudytourCouponUser> pageList = null; | |||
| try{ | |||
| //分页 | |||
| page = new Page<StudytourCouponUser>(pageBean.getPageNo(), pageBean.getPageSize()); | |||
| query = studytourCouponUserService | |||
| .lambdaQuery(); | |||
| //组装查询条件 | |||
| //优惠券使用状态:0-未使用 1-已使用 2-已失效 | |||
| if(StringUtils.isNotEmpty(studytourCouponUser.getStatus())){ | |||
| if("2".equals(studytourCouponUser.getStatus())){ | |||
| query.lt(StudytourCouponUser::getValidDate, CommonUtils.getCurrentTime());//已失效 | |||
| query.notIn(StudytourCouponUser::getStatus, "1"); | |||
| }else { | |||
| query.eq(StudytourCouponUser::getStatus, studytourCouponUser.getStatus()); | |||
| if("0".equals(studytourCouponUser.getStatus())){ | |||
| query.gt(StudytourCouponUser::getValidDate, CommonUtils.getCurrentTime());//未失效 | |||
| } | |||
| } | |||
| } | |||
| //优惠券所属 | |||
| query.eq(StudytourCouponUser::getUserId, hanHaiMember.getId()); | |||
| //按照创建时间降序排列 | |||
| query.orderByDesc(StudytourCouponUser::getCreateTime); | |||
| //获取优惠券信息 | |||
| pageList = query.page(page); | |||
| return Result.OK("优惠券列表", pageList); | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| return Result.error("优惠券列表查询失败"); | |||
| } | |||
| } | |||
| //根据id查看优惠券详情 | |||
| @Override | |||
| public Result<?> queryCouponById(String token, String usercouponId) { | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| try{ | |||
| StudytourCouponUser couponUser = studytourCouponUserService | |||
| .lambdaQuery() | |||
| .eq(StudytourCouponUser::getUserId, hanHaiMember.getId()) | |||
| .eq(StudytourCouponUser::getId, usercouponId) | |||
| .one(); | |||
| if(null == couponUser){ | |||
| return Result.error("优惠券不存在,请检查用户优惠券id:", usercouponId); | |||
| } | |||
| return Result.OK("优惠券详情", couponUser); | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| return Result.error("优惠券详情获取失败"); | |||
| } | |||
| } | |||
| //查看可领取的优惠券 | |||
| @Override | |||
| public Result<?> queryFetchCouponList(String token) { | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| try{ | |||
| //获取可领取的优惠券 | |||
| List<StudytourCoupon> pageList = studytourCouponService | |||
| .lambdaQuery() | |||
| .eq(StudytourCoupon::getIsFetch, "1") | |||
| .gt(StudytourCoupon::getValidTime, CommonUtils.getCurrentTime()) | |||
| .orderByDesc(StudytourCoupon::getCreateTime) | |||
| .list(); | |||
| //获取已领取的优惠券 | |||
| List<StudytourCouponUser> couponUserList = studytourCouponUserService | |||
| .lambdaQuery() | |||
| .eq(StudytourCouponUser::getUserId, hanHaiMember.getId()) | |||
| .list(); | |||
| //剔除已领取的优惠券信息 | |||
| //查询已领取的优惠券信息 | |||
| List<String> ids = new ArrayList<>(); | |||
| for (StudytourCoupon vouchers : pageList) { | |||
| for (StudytourCouponUser massageVouchersUser : couponUserList) { | |||
| String couponUserId = massageVouchersUser.getCouponId(); | |||
| if(vouchers.getId().equals(couponUserId)){ | |||
| ids.add(couponUserId); | |||
| break; | |||
| } | |||
| } | |||
| } | |||
| //剔除优惠券信息 | |||
| for (int i = 0; i < pageList.size(); i++) { | |||
| for (String id : ids) { | |||
| if(pageList.get(i).getId().equals(id)){ | |||
| pageList.remove(i); | |||
| } | |||
| } | |||
| } | |||
| return Result.OK("优惠券列表", pageList); | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| return Result.error("优惠券列表查询失败"); | |||
| } | |||
| } | |||
| //领取优惠券 | |||
| @Override | |||
| public Result<?> fetchCoupon(String token, String couponId) { | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| try{ | |||
| //查看优惠券是否存在 | |||
| StudytourCoupon coupon = studytourCouponService.getById(couponId); | |||
| if(null == coupon){ | |||
| return Result.error("优惠券不存在,请检查优惠券id:"+couponId); | |||
| } | |||
| //查看用户是否领取过优惠券 | |||
| StudytourCouponUser studytourCouponUser = studytourCouponUserService | |||
| .lambdaQuery() | |||
| .eq(StudytourCouponUser::getCouponId, couponId) | |||
| .eq(StudytourCouponUser::getUserId, hanHaiMember.getId()) | |||
| .one(); | |||
| if(null != studytourCouponUser){ | |||
| return Result.error("已领取过优惠券,不可重复领取"); | |||
| } | |||
| //添加用户优惠券信息 | |||
| StudytourCouponUser couponUser = new StudytourCouponUser(); | |||
| couponUser.setUserId(hanHaiMember.getId()); | |||
| couponUser.setCouponId(coupon.getId()); | |||
| couponUser.setDiscountAmount(coupon.getAmount()); | |||
| couponUser.setStatus("0"); | |||
| couponUser.setValidDate(coupon.getValidTime()); | |||
| boolean result = studytourCouponUserService.save(couponUser); | |||
| if(result){ | |||
| return Result.error("优惠券领取成功"); | |||
| }else { | |||
| return Result.error("优惠券领取失败"); | |||
| } | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| return Result.error("优惠券领取失败"); | |||
| } | |||
| } | |||
| } | |||
| @ -1,6 +1,140 @@ | |||
| package org.jeecg.modules.api.service.Impl; | |||
| import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang.StringUtils; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.config.shiro.ShiroRealm; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.api.service.ExperienceService; | |||
| import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; | |||
| import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; | |||
| import org.jeecg.modules.studytourBindperson.entity.StudytourBindperson; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import org.jeecg.modules.studytourRecord.entity.StudytourRecord; | |||
| import org.jeecg.modules.studytourRecord.service.IStudytourRecordService; | |||
| import org.springframework.stereotype.Service; | |||
| import javax.annotation.Resource; | |||
| import java.util.List; | |||
| @Service | |||
| @Slf4j | |||
| public class ExperienceServiceImpl implements ExperienceService { | |||
| /******************************************************************************************************************/ | |||
| //权限验证 | |||
| @Resource | |||
| private ShiroRealm shiroRealm; | |||
| //权限验证 | |||
| @Resource | |||
| private IHanHaiMemberService hanHaiMemberService; | |||
| //权限验证 | |||
| @Resource | |||
| private IStudytourRecordService studytourRecordService; | |||
| /******************************************************************************************************************/ | |||
| //成长档案-查询成长档案列表 | |||
| @Override | |||
| public Result<?> queryExperienceList(String token, StudytourRecord studytourRecord, PageBean pageBean) { | |||
| log.info("开始查询成长档案信息列表"); | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| //分页信息 | |||
| Page<StudytourRecord> page = null; | |||
| //查询信息 | |||
| LambdaQueryChainWrapper<StudytourRecord> query = null; | |||
| //返回信息 | |||
| Page<StudytourRecord> pageList = null; | |||
| try{ | |||
| //分页 | |||
| page = new Page<StudytourRecord>(pageBean.getPageNo(), pageBean.getPageSize()); | |||
| query = studytourRecordService | |||
| .lambdaQuery(); | |||
| //组装查询条件 | |||
| // if(StringUtils.isNotEmpty(studytourRecord)){ | |||
| // query.eq(StudytourRecord::getImageId, imageId); | |||
| // } | |||
| //所属用户 | |||
| query.eq(StudytourRecord::getUserId, hanHaiMember.getId()); | |||
| //按照创建时间降序排列 | |||
| query.orderByDesc(StudytourRecord::getCreateTime); | |||
| //获取图片直播信息列表 | |||
| pageList = query.page(page); | |||
| log.info("成长档案信息列表查询结束"); | |||
| return Result.OK("成长档案信息列表", pageList); | |||
| }catch (Exception e){ | |||
| log.info("成长档案信息列表查询失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("成长档案信息列表查询失败"); | |||
| } | |||
| } | |||
| //成长档案-查询成长档案详情 | |||
| @Override | |||
| public Result<?> queryExperienceById(String token, String recordId) { | |||
| log.info("开始查询成长档案详情"); | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| try{ | |||
| //成长档案详情 | |||
| StudytourRecord one = studytourRecordService | |||
| .lambdaQuery() | |||
| .eq(StudytourRecord::getId, recordId) | |||
| .eq(StudytourRecord::getUserId, hanHaiMember.getId()) | |||
| .one(); | |||
| log.info("成长档案详情查询结束"); | |||
| return Result.OK("成长档案详情", one); | |||
| }catch (Exception e){ | |||
| log.info("成长档案详情查询失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("成长档案详情查询失败"); | |||
| } | |||
| } | |||
| //成长档案-新增成长档案 | |||
| @Override | |||
| public Result<?> addExperience(String token, StudytourRecord studytourRecord) { | |||
| log.info("开始新增成长档案信息"); | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| try{ | |||
| //1、新增成长档案信息 | |||
| studytourRecord.setUserId(hanHaiMember.getId()); | |||
| boolean result = studytourRecordService.save(studytourRecord); | |||
| if(result){ | |||
| log.info("成长档案信息新增成功"); | |||
| return Result.OK("成长档案信息新增成功"); | |||
| }else { | |||
| log.info("成长档案信息新增失败"); | |||
| return Result.error("成长档案信息新增失败"); | |||
| } | |||
| }catch (Exception e){ | |||
| log.info("成长档案信息新增失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("成长档案信息新增失败"); | |||
| } | |||
| } | |||
| } | |||
| @ -1,6 +1,179 @@ | |||
| package org.jeecg.modules.api.service.Impl; | |||
| import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang.StringUtils; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.config.shiro.ShiroRealm; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.api.service.ImageService; | |||
| import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImage; | |||
| import org.jeecg.modules.studytourImage.entity.StudytourImageContent; | |||
| import org.jeecg.modules.studytourImage.service.IStudytourImageContentService; | |||
| import org.jeecg.modules.studytourImage.service.IStudytourImageService; | |||
| import org.springframework.stereotype.Service; | |||
| import javax.annotation.Resource; | |||
| @Service | |||
| @Slf4j | |||
| public class ImageServiceImpl implements ImageService { | |||
| /******************************************************************************************************************/ | |||
| //权限验证 | |||
| @Resource | |||
| private ShiroRealm shiroRealm; | |||
| //图片直播信息 | |||
| @Resource | |||
| private IStudytourImageService studytourImageService; | |||
| //图片直播内容信息 | |||
| @Resource | |||
| private IStudytourImageContentService studytourImageContentService; | |||
| /******************************************************************************************************************/ | |||
| //图片直播-查询图片直播列表 | |||
| @Override | |||
| public Result<?> queryImageList(PageBean pageBean) { | |||
| log.info("开始查询图片直播信息列表"); | |||
| //返回信息 | |||
| String massege = ""; | |||
| //分页信息 | |||
| Page<StudytourImage> page = null; | |||
| //查询信息 | |||
| LambdaQueryChainWrapper<StudytourImage> query = null; | |||
| //返回信息 | |||
| Page<StudytourImage> pageList = null; | |||
| try{ | |||
| //分页 | |||
| page = new Page<StudytourImage>(pageBean.getPageNo(), pageBean.getPageSize()); | |||
| query = studytourImageService | |||
| .lambdaQuery(); | |||
| //组装查询条件 | |||
| //按照创建时间降序排列 | |||
| query.orderByDesc(StudytourImage::getCreateTime); | |||
| //获取图片直播信息列表 | |||
| pageList = query.page(page); | |||
| log.info("图片直播信息列表查询结束"); | |||
| return Result.OK("图片直播信息列表", pageList); | |||
| }catch (Exception e){ | |||
| log.info("图片直播信息列表查询失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("图片直播信息列表查询失败"); | |||
| } | |||
| } | |||
| //图片直播-新增图片直播信息 | |||
| @Override | |||
| public Result<?> addImage(String token, StudytourImage studytourImage) { | |||
| log.info("开始新增图片直播信息"); | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| try{ | |||
| //1、新增图片直播信息 | |||
| studytourImage.setUserId(hanHaiMember.getId()); | |||
| boolean result = studytourImageService.save(studytourImage); | |||
| if(result){ | |||
| log.info("图片直播信息新增成功"); | |||
| return Result.OK("图片直播信息新增成功"); | |||
| }else { | |||
| log.info("图片直播信息新增失败"); | |||
| return Result.error("图片直播信息新增失败"); | |||
| } | |||
| }catch (Exception e){ | |||
| log.info("图片直播信息新增失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("图片直播信息新增失败"); | |||
| } | |||
| } | |||
| //图片直播-查询图片直播内容列表 | |||
| @Override | |||
| public Result<?> queryImageContentList(String imageId, PageBean pageBean) { | |||
| log.info("开始查询图片直播内容信息列表"); | |||
| //返回信息 | |||
| String massege = ""; | |||
| //分页信息 | |||
| Page<StudytourImageContent> page = null; | |||
| //查询信息 | |||
| LambdaQueryChainWrapper<StudytourImageContent> query = null; | |||
| //返回信息 | |||
| Page<StudytourImageContent> pageList = null; | |||
| try{ | |||
| //分页 | |||
| page = new Page<StudytourImageContent>(pageBean.getPageNo(), pageBean.getPageSize()); | |||
| query = studytourImageContentService | |||
| .lambdaQuery(); | |||
| //组装查询条件 | |||
| if(StringUtils.isNotEmpty(imageId)){ | |||
| query.eq(StudytourImageContent::getImageId, imageId); | |||
| } | |||
| //按照创建时间降序排列 | |||
| query.orderByDesc(StudytourImageContent::getCreateTime); | |||
| //获取图片直播信息列表 | |||
| pageList = query.page(page); | |||
| log.info("图片直播内容信息列表查询结束"); | |||
| return Result.OK("图片直播内容信息列表", pageList); | |||
| }catch (Exception e){ | |||
| log.info("图片直播内容信息列表查询失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("图片直播内容信息列表查询失败"); | |||
| } | |||
| } | |||
| //图片直播-新增图片直播内容信息 | |||
| @Override | |||
| public Result<?> addImageContent(String token, StudytourImageContent studytourImageContent) { | |||
| log.info("开始新增图片直播内容信息"); | |||
| //权限验证 | |||
| HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); | |||
| //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); | |||
| //返回信息 | |||
| String massege = ""; | |||
| try{ | |||
| //1、新增图片直播信息 | |||
| studytourImageContent.setUserId(hanHaiMember.getId()); | |||
| boolean result = studytourImageContentService.save(studytourImageContent); | |||
| if(result){ | |||
| log.info("图片直播内容信息新增成功"); | |||
| return Result.OK("图片直播内容信息新增成功"); | |||
| }else { | |||
| log.info("图片直播内容信息新增失败"); | |||
| return Result.error("图片直播内容信息新增失败"); | |||
| } | |||
| }catch (Exception e){ | |||
| log.info("图片直播内容信息新增失败"); | |||
| e.printStackTrace(); | |||
| return Result.error("图片直播内容信息新增失败"); | |||
| } | |||
| } | |||
| //图片直播-标记有我 | |||
| @Override | |||
| public Result<?> queryMarkmeList(String token, String imagePath) { | |||
| return null; | |||
| } | |||
| } | |||
| @ -0,0 +1,54 @@ | |||
| package org.jeecg.modules.api.studytourController; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.api.service.BindService; | |||
| import org.jeecg.modules.api.service.ExperienceService; | |||
| import org.jeecg.modules.studytourBindperson.entity.StudytourBindperson; | |||
| import org.springframework.web.bind.annotation.RequestHeader; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RequestMethod; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import javax.annotation.Resource; | |||
| @Api(tags="学员管理-相关接口") | |||
| @RestController | |||
| @RequestMapping("/studytour/bind") | |||
| @Slf4j | |||
| public class BindController { | |||
| /******************************************************************************************************************/ | |||
| //配置信息 | |||
| @Resource | |||
| private BindService bindService; | |||
| /******************************************************************************************************************/ | |||
| @ApiOperation(value="成员管理-查询绑定人信息", notes="成员管理-查询绑定人信息") | |||
| @RequestMapping(value = "/queryBindUser", method = {RequestMethod.GET}) | |||
| public Result<?> queryBindUser(String bindUserId){ | |||
| return bindService.queryBindUser(bindUserId); | |||
| } | |||
| @ApiOperation(value="成员管理-查询绑定成员列表", notes="绑定状态(status):0-确认中 1-已绑定 2-已拒绝") | |||
| @RequestMapping(value = "/queryBindList", method = {RequestMethod.GET}) | |||
| public Result<?> queryBindList(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson, PageBean pageBean){ | |||
| return bindService.queryBindList(token, studytourBindperson, pageBean); | |||
| } | |||
| @ApiOperation(value="成员管理-绑定申请", notes="成长档案-绑定申请") | |||
| @RequestMapping(value = "/addBind", method = {RequestMethod.POST}) | |||
| public Result<?> addBind(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson){ | |||
| return bindService.addBind(token, studytourBindperson); | |||
| } | |||
| @ApiOperation(value="成员管理-审批绑定申请", notes="成长档案-审批绑定申请") | |||
| @RequestMapping(value = "/updateBind", method = {RequestMethod.POST}) | |||
| public Result<?> updateBind(@RequestHeader("X-Access-Token") String token, StudytourBindperson studytourBindperson){ | |||
| return bindService.updateBind(token, studytourBindperson); | |||
| } | |||
| } | |||
| @ -0,0 +1,57 @@ | |||
| package org.jeecg.modules.api.studytourController; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.modules.api.bean.PageBean; | |||
| import org.jeecg.modules.api.service.CouponService; | |||
| import org.jeecg.modules.studytourCouponUser.entity.StudytourCouponUser; | |||
| import org.springframework.web.bind.annotation.RequestHeader; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RequestMethod; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import javax.annotation.Resource; | |||
| @Api(tags="优惠券-相关接口") | |||
| @RestController | |||
| @RequestMapping("/studytour/coupon") | |||
| @Slf4j | |||
| public class CouponController { | |||
| /******************************************************************************************************************/ | |||
| //优惠券信息 | |||
| @Resource | |||
| private CouponService couponService; | |||
| /******************************************************************************************************************/ | |||
| //优惠券-优惠券列表 | |||
| @ApiOperation(value="优惠券-我的优惠券列表", notes="status:0-未使用 1-已使用 2-已失效") | |||
| @RequestMapping(value = "/queryCouponList", method = {RequestMethod.GET}) | |||
| public Result<?> queryCouponList(@RequestHeader("X-Access-Token") String token, StudytourCouponUser studytourCouponUser, PageBean pageBean){ | |||
| return couponService.queryCouponList(token, studytourCouponUser, pageBean); | |||
| } | |||
| //根据id查看优惠券详情 | |||
| @ApiOperation(value="优惠券-根据id查看优惠券详情", notes="优惠券-根据id查看优惠券详情") | |||
| @RequestMapping(value = "/queryCouponById", method = {RequestMethod.GET}) | |||
| public Result<?> queryCouponById(@RequestHeader("X-Access-Token") String token, String usercouponId){ | |||
| return couponService.queryCouponById(token, usercouponId); | |||
| } | |||
| //查看可领取的优惠券 | |||
| @ApiOperation(value="优惠券-查看可领取的优惠券", notes="优惠券-查看可领取的优惠券") | |||
| @RequestMapping(value = "/queryFetchCouponList", method = {RequestMethod.GET}) | |||
| public Result<?> queryFetchCouponList(@RequestHeader("X-Access-Token") String token){ | |||
| return couponService.queryFetchCouponList(token); | |||
| } | |||
| //领取优惠券 | |||
| @ApiOperation(value="优惠券-领取优惠券", notes="优惠券-领取优惠券") | |||
| @RequestMapping(value = "/fetchCoupon", method = {RequestMethod.POST}) | |||
| public Result<?> fetchCoupon(@RequestHeader("X-Access-Token") String token, String couponId){ | |||
| return couponService.fetchCoupon(token, couponId); | |||
| } | |||
| } | |||