linhw 2024-04-30 11:06:53 +08:00
parent 1fb28091c5
commit 42ecdcec04
7 changed files with 78 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.vo.AppTopicVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,6 +53,14 @@ public class AppTopicController extends BaseController
return getDataTable(list);
}
@GetMapping("/topicList")
@ApiOperation(value = "组装过查询话题信息列表", notes = "组装过查询话题信息列表", httpMethod = "GET")
public TableDataInfo topicList(AppTopic appTopic)
{
List<AppTopicVo> list = appTopicService.topicList(appTopic);
return getDataTable(list);
}
/**
*
*/

View File

@ -1,5 +1,6 @@
package com.ruoyi.app.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
@ -11,6 +12,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
* @author wyh
* @date 2024-04-23
*/
@Data
public class AppTopic extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -22,6 +24,13 @@ public class AppTopic extends BaseEntity
@Excel(name = "学校名称")
private String name;
@Excel(name = "父级id")
private Long parentId;
/** 类型0-话题分类1-话题数据 */
@Excel(name = "类型0-话题分类1-话题数据")
private Long type;
public void setId(Long id)
{
this.id = id;

View File

@ -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<>();
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.app.service;
import java.util.List;
import com.ruoyi.app.domain.AppTopic;
import com.ruoyi.app.domain.vo.AppTopicVo;
/**
* Service
@ -26,6 +27,7 @@ public interface IAppTopicService
* @return
*/
public List<AppTopic> selectAppTopicList(AppTopic appTopic);
public List<AppTopicVo> topicList(AppTopic appTopic);
/**
*

View File

@ -1,7 +1,11 @@
package com.ruoyi.app.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.app.domain.vo.AppTopicVo;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppTopicMapper;
@ -44,6 +48,22 @@ public class AppTopicServiceImpl implements IAppTopicService
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;
}
/**
*
*

View File

@ -35,6 +35,7 @@ public class PayServiceImpl implements IPayService {
parameterMap.put("spbill_create_ip","127.0.0.1");
parameterMap.put("notify_url", weChatConfig.getWechat_notify_url());
parameterMap.put("trade_type", "JSAPI");
//parameterMap.put("trade_type", "APP");
//parameterMap.put("trade_type", "MWEB");
//parameterMap.put("openid", openId);
String sign = PayUtils.createSign(weChatConfig.getAPP_KEY(), parameterMap);

View File

@ -12,10 +12,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createBy" column="create_by" />
<result property="updateBy" column="updateBy" />
<result property="remark" column="remark" />
<result property="parentId" column="parent_id" />
<result property="type" column="type" />
</resultMap>
<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>
<select id="selectAppTopicList" parameterType="AppTopic" resultMap="AppTopicResult">
@ -23,6 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</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>
</select>
@ -52,6 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">updateBy,</if>
<if test="remark != null">remark,</if>
<if test="parentId != null">parent_id,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<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="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
<if test="parentId != null">#{parentId},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
@ -72,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="type != null">type = #{type},</if>
</trim>
where id = #{id}
</update>