main
parent
1fb28091c5
commit
42ecdcec04
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.app.domain.vo.AppTopicVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -52,6 +53,14 @@ public class AppTopicController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/topicList")
|
||||||
|
@ApiOperation(value = "组装过查询话题信息列表", notes = "组装过查询话题信息列表", httpMethod = "GET")
|
||||||
|
public TableDataInfo topicList(AppTopic appTopic)
|
||||||
|
{
|
||||||
|
List<AppTopicVo> list = appTopicService.topicList(appTopic);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出话题信息列表
|
* 导出话题信息列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.app.domain;
|
package com.ruoyi.app.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
|
@ -11,6 +12,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
* @author wyh
|
* @author wyh
|
||||||
* @date 2024-04-23
|
* @date 2024-04-23
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class AppTopic extends BaseEntity
|
public class AppTopic extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
@ -22,6 +24,13 @@ public class AppTopic extends BaseEntity
|
||||||
@Excel(name = "学校名称")
|
@Excel(name = "学校名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
@Excel(name = "父级id")
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/** 类型:0-话题分类,1-话题数据 */
|
||||||
|
@Excel(name = "类型:0-话题分类,1-话题数据")
|
||||||
|
private Long type;
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.ruoyi.app.domain.vo;
|
||||||
|
|
||||||
|
import com.ruoyi.app.domain.AppTopic;
|
||||||
|
import com.ruoyi.app.domain.AppUser;
|
||||||
|
import com.ruoyi.app.domain.UserSkill;
|
||||||
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app用户对象 app_user
|
||||||
|
*
|
||||||
|
* @author wyh
|
||||||
|
* @date 2024-04-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppTopicVo extends AppTopic
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private List<AppTopic> children = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.app.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.app.domain.AppTopic;
|
import com.ruoyi.app.domain.AppTopic;
|
||||||
|
import com.ruoyi.app.domain.vo.AppTopicVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 话题信息Service接口
|
* 话题信息Service接口
|
||||||
|
|
@ -26,6 +27,7 @@ public interface IAppTopicService
|
||||||
* @return 话题信息集合
|
* @return 话题信息集合
|
||||||
*/
|
*/
|
||||||
public List<AppTopic> selectAppTopicList(AppTopic appTopic);
|
public List<AppTopic> selectAppTopicList(AppTopic appTopic);
|
||||||
|
public List<AppTopicVo> topicList(AppTopic appTopic);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增话题信息
|
* 新增话题信息
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
package com.ruoyi.app.service.impl;
|
package com.ruoyi.app.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.app.domain.vo.AppTopicVo;
|
||||||
import com.ruoyi.common.core.utils.DateUtils;
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.app.mapper.AppTopicMapper;
|
import com.ruoyi.app.mapper.AppTopicMapper;
|
||||||
|
|
@ -44,6 +48,22 @@ public class AppTopicServiceImpl implements IAppTopicService
|
||||||
return appTopicMapper.selectAppTopicList(appTopic);
|
return appTopicMapper.selectAppTopicList(appTopic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AppTopicVo> topicList(AppTopic appTopic) {
|
||||||
|
appTopic.setType(0l);
|
||||||
|
List<AppTopic> list = appTopicMapper.selectAppTopicList(appTopic);
|
||||||
|
List<AppTopicVo> appTopicVos = new ArrayList<>();
|
||||||
|
for (AppTopic topic : list) {
|
||||||
|
AppTopicVo appTopicVo = new AppTopicVo();
|
||||||
|
BeanUtils.copyProperties(topic,appTopicVo);
|
||||||
|
appTopic = new AppTopic();
|
||||||
|
appTopic.setParentId(appTopicVo.getId());
|
||||||
|
appTopicVo.setChildren(appTopicMapper.selectAppTopicList(appTopic));
|
||||||
|
appTopicVos.add(appTopicVo);
|
||||||
|
}
|
||||||
|
return appTopicVos;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增话题信息
|
* 新增话题信息
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ public class PayServiceImpl implements IPayService {
|
||||||
parameterMap.put("spbill_create_ip","127.0.0.1");
|
parameterMap.put("spbill_create_ip","127.0.0.1");
|
||||||
parameterMap.put("notify_url", weChatConfig.getWechat_notify_url());
|
parameterMap.put("notify_url", weChatConfig.getWechat_notify_url());
|
||||||
parameterMap.put("trade_type", "JSAPI");
|
parameterMap.put("trade_type", "JSAPI");
|
||||||
|
//parameterMap.put("trade_type", "APP");
|
||||||
//parameterMap.put("trade_type", "MWEB");
|
//parameterMap.put("trade_type", "MWEB");
|
||||||
//parameterMap.put("openid", openId);
|
//parameterMap.put("openid", openId);
|
||||||
String sign = PayUtils.createSign(weChatConfig.getAPP_KEY(), parameterMap);
|
String sign = PayUtils.createSign(weChatConfig.getAPP_KEY(), parameterMap);
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="updateBy" column="updateBy" />
|
<result property="updateBy" column="updateBy" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
|
<result property="parentId" column="parent_id" />
|
||||||
|
<result property="type" column="type" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectAppTopicVo">
|
<sql id="selectAppTopicVo">
|
||||||
select id, name, create_time, update_time, create_by, updateBy, remark from app_topic
|
select id, name, create_time, update_time, create_by, updateBy, remark,parent_id, type from app_topic
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectAppTopicList" parameterType="AppTopic" resultMap="AppTopicResult">
|
<select id="selectAppTopicList" parameterType="AppTopic" resultMap="AppTopicResult">
|
||||||
|
|
@ -23,6 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<where>
|
<where>
|
||||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
|
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
|
||||||
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||||
|
<if test="type != null "> and type = #{type}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -52,6 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="updateBy != null">updateBy,</if>
|
<if test="updateBy != null">updateBy,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="name != null">#{name},</if>
|
<if test="name != null">#{name},</if>
|
||||||
|
|
@ -60,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="parentId != null">#{parentId},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -72,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="updateBy != null">updateBy = #{updateBy},</if>
|
<if test="updateBy != null">updateBy = #{updateBy},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
|
<if test="type != null">type = #{type},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue