27 changed files with 429 additions and 41 deletions
@ -0,0 +1,61 @@ |
|||||
|
package com.qs.serve.modules.wx.controller.my; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.common.util.StringUtils; |
||||
|
import com.qs.serve.modules.wx.entity.WxFormPush; |
||||
|
import com.qs.serve.modules.wx.entity.WxFormPushUser; |
||||
|
import com.qs.serve.modules.wx.entity.bo.WxFormPushBo; |
||||
|
import com.qs.serve.modules.wx.service.WxFormPushService; |
||||
|
import com.qs.serve.modules.wx.service.WxFormPushUserService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 微信 表单推送(我的) |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-19 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("my/formPush") |
||||
|
public class WxFormPushMyController { |
||||
|
|
||||
|
private WxFormPushService wxFormPushService; |
||||
|
|
||||
|
private WxFormPushUserService wxFormPushUserService; |
||||
|
|
||||
|
/** |
||||
|
* 列表 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
public R<List<WxFormPush>> getList(WxFormPushUser param){ |
||||
|
LambdaQueryWrapper<WxFormPushUser> lqw = new LambdaQueryWrapper<>(param); |
||||
|
PageUtil.startPage(); |
||||
|
List<WxFormPushUser> list = wxFormPushUserService.list(lqw); |
||||
|
List<WxFormPush> result = new ArrayList<>(); |
||||
|
for (WxFormPushUser pushUser : list) { |
||||
|
WxFormPush formPush = wxFormPushService.getById(pushUser.getFormPushId()); |
||||
|
formPush.setReadFlag(pushUser.getReadFlag()); |
||||
|
result.add(formPush); |
||||
|
} |
||||
|
return R.ok(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,75 @@ |
|||||
|
<?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.qs.serve.modules.his.mapper.HisUserChannelPointMapper"> |
||||
|
|
||||
|
<resultMap id="hisUserChannelPointMap" type="com.qs.serve.modules.his.entity.HisUserChannelPoint" > |
||||
|
<result property="id" column="id"/> |
||||
|
<result property="userId" column="user_id"/> |
||||
|
<result property="pointId" column="point_id"/> |
||||
|
<result property="sourceType" column="source_type"/> |
||||
|
<result property="sourceIds" column="source_ids"/> |
||||
|
<result property="remark" column="remark"/> |
||||
|
<result property="createTime" column="create_time"/> |
||||
|
<result property="updateTime" column="update_time"/> |
||||
|
<result property="tenantId" column="tenant_id"/> |
||||
|
<result property="delFlag" column="del_flag"/> |
||||
|
<result property="createBy" column="create_by"/> |
||||
|
<result property="updateBy" column="update_by"/> |
||||
|
<result property="costFlag" column="cost_flag"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="hisUserChannelPointSql"> |
||||
|
his_user_channel_point.`id`, |
||||
|
his_user_channel_point.`user_id`, |
||||
|
his_user_channel_point.`point_id`, |
||||
|
his_user_channel_point.`source_type`, |
||||
|
his_user_channel_point.`source_ids`, |
||||
|
his_user_channel_point.`remark`, |
||||
|
his_user_channel_point.`create_time`, |
||||
|
his_user_channel_point.`update_time`, |
||||
|
his_user_channel_point.`tenant_id`, |
||||
|
his_user_channel_point.`del_flag`, |
||||
|
his_user_channel_point.`create_by`, |
||||
|
his_user_channel_point.`update_by`, |
||||
|
his_user_channel_point.`cost_flag` </sql> |
||||
|
|
||||
|
<select id="selectHisUserChannelPointList" parameterType="com.qs.serve.modules.his.entity.HisUserChannelPoint" resultMap="hisUserChannelPointMap"> |
||||
|
SELECT <include refid="hisUserChannelPointSql"/> FROM `his_user_channel_point` `his_user_channel_point` |
||||
|
<where> |
||||
|
and `his_user_channel_point`.`cost_flag` = 0 |
||||
|
<if test="query.id != null"> and `his_user_channel_point`.`id` = #{query.id}</if> |
||||
|
<if test="query.userId != null and query.userId != ''"> and `his_user_channel_point`.`user_id` = #{query.userId}</if> |
||||
|
<if test="query.pointId != null"> and `his_user_channel_point`.`point_id` = #{query.pointId}</if> |
||||
|
<if test="query.sourceType != null"> and `his_user_channel_point`.`source_type` = #{query.sourceType}</if> |
||||
|
<if test="query.sourceIds != null and query.sourceIds != ''"> and `his_user_channel_point`.`source_ids` = #{query.sourceIds}</if> |
||||
|
<if test="query.remark != null and query.remark != ''"> and `his_user_channel_point`.`remark` = #{query.remark}</if> |
||||
|
<if test="query.createTime != null"> and `his_user_channel_point`.`create_time` = #{query.createTime}</if> |
||||
|
<if test="query.updateTime != null"> and `his_user_channel_point`.`update_time` = #{query.updateTime}</if> |
||||
|
<if test="query.tenantId != null and query.tenantId != ''"> and `his_user_channel_point`.`tenant_id` = #{query.tenantId}</if> |
||||
|
<if test="query.createBy != null and query.createBy != ''"> and `his_user_channel_point`.`create_by` = #{query.createBy}</if> |
||||
|
<if test="query.updateBy != null and query.updateBy != ''"> and `his_user_channel_point`.`update_by` = #{query.updateBy}</if> |
||||
|
<if test="query.costFlag != null"> and `his_user_channel_point`.`cost_flag` = #{query.costFlag}</if> |
||||
|
|
||||
|
<if test="query.sourceIdsList!=null and query.sourceIdsList.size > 0"> |
||||
|
and |
||||
|
<foreach collection="query.sourceIdsList" item="selectId" index="i" open="(" close=")" separator=","> |
||||
|
<if test="idx!=0"> |
||||
|
or |
||||
|
</if> |
||||
|
`his_user_channel_point`.`source_ids` like concat(#{selectId},"_") |
||||
|
</foreach> |
||||
|
</if> |
||||
|
<if test="query.userIdList!=null and query.userIdList.size > 0"> |
||||
|
and `his_user_channel_point`.`user_id` in |
||||
|
<foreach collection="query.userIdList" item="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
|
||||
|
|
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue