wjj 20 часов назад
Родитель
Сommit
9f2cb574f9

+ 103 - 0
fs-company/src/main/java/com/fs/company/controller/qw/BindPhoneRedPacketRecordController.java

@@ -0,0 +1,103 @@
+package com.fs.company.controller.qw;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.qw.domain.BindPhoneRedPacketRecord;
+import com.fs.qw.service.IBindPhoneRedPacketRecordService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 绑定手机号红包领取记录Controller
+ * 
+ * @author fs
+ * @date 2026-03-17
+ */
+@RestController
+@RequestMapping("/qw/record")
+public class BindPhoneRedPacketRecordController extends BaseController
+{
+    @Autowired
+    private IBindPhoneRedPacketRecordService bindPhoneRedPacketRecordService;
+
+    /**
+     * 查询绑定手机号红包领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('qw:record:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BindPhoneRedPacketRecord bindPhoneRedPacketRecord)
+    {
+        startPage();
+        List<BindPhoneRedPacketRecord> list = bindPhoneRedPacketRecordService.selectBindPhoneRedPacketRecordList(bindPhoneRedPacketRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出绑定手机号红包领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('qw:record:export')")
+    @Log(title = "绑定手机号红包领取记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(BindPhoneRedPacketRecord bindPhoneRedPacketRecord)
+    {
+        List<BindPhoneRedPacketRecord> list = bindPhoneRedPacketRecordService.selectBindPhoneRedPacketRecordList(bindPhoneRedPacketRecord);
+        ExcelUtil<BindPhoneRedPacketRecord> util = new ExcelUtil<BindPhoneRedPacketRecord>(BindPhoneRedPacketRecord.class);
+        return util.exportExcel(list, "绑定手机号红包领取记录数据");
+    }
+
+    /**
+     * 获取绑定手机号红包领取记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qw:record:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(bindPhoneRedPacketRecordService.selectBindPhoneRedPacketRecordById(id));
+    }
+
+    /**
+     * 新增绑定手机号红包领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('qw:record:add')")
+    @Log(title = "绑定手机号红包领取记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BindPhoneRedPacketRecord bindPhoneRedPacketRecord)
+    {
+        return toAjax(bindPhoneRedPacketRecordService.insertBindPhoneRedPacketRecord(bindPhoneRedPacketRecord));
+    }
+
+    /**
+     * 修改绑定手机号红包领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('qw:record:edit')")
+    @Log(title = "绑定手机号红包领取记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BindPhoneRedPacketRecord bindPhoneRedPacketRecord)
+    {
+        return toAjax(bindPhoneRedPacketRecordService.updateBindPhoneRedPacketRecord(bindPhoneRedPacketRecord));
+    }
+
+    /**
+     * 删除绑定手机号红包领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('qw:record:remove')")
+    @Log(title = "绑定手机号红包领取记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(bindPhoneRedPacketRecordService.deleteBindPhoneRedPacketRecordByIds(ids));
+    }
+}

+ 94 - 0
fs-service/src/main/java/com/fs/qw/domain/BindPhoneRedPacketRecord.java

@@ -0,0 +1,94 @@
+package com.fs.qw.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 绑定手机号红包领取记录对象 bind_phone_red_packet_record
+ *
+ * @author fs
+ * @date 2026-03-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class BindPhoneRedPacketRecord extends BaseEntity{
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 领取用户id */
+    @Excel(name = "领取用户id")
+    private Long userId;
+
+    /** 领取用户名称 */
+    @Excel(name = "领取用户名称")
+    private String userName;
+
+    /** 授权手机号红包id */
+    @Excel(name = "授权手机号红包id")
+    private Long redPacketId;
+
+    /** 销售ID */
+    @Excel(name = "销售ID")
+    private Long companyUserId;
+
+    /** 公司ID */
+    @Excel(name = "公司ID")
+    private Long companyId;
+
+    /** 公司名称 */
+    @Excel(name = "公司名称")
+    private String companyName;
+
+    /** 红包金额 */
+    @Excel(name = "红包金额")
+    private BigDecimal amount;
+
+    /** 发放时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "发放时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date sendTime;
+
+    /** 领取时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "领取时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date collectTime;
+
+    /** 领取状态(0-已发放 1-已领取 2-已失效 3-待发放) */
+    @Excel(name = "领取状态(0-已发放 1-已领取 2-已失效 3-待发放)")
+    private String collectType;
+
+    /** 发送链接 */
+    @Excel(name = "发送链接")
+    private String sendLink;
+
+    /** 销售企微用户id */
+    @Excel(name = "销售企微用户id")
+    private String qwUserId;
+
+    /** 销售企微用户名 */
+    @Excel(name = "销售企微用户名")
+    private String qwUserName;
+
+    /** 领取手机号 */
+    @Excel(name = "领取手机号")
+    private String phone;
+
+    /** 业务类型:1-群福袋 2-个人福袋 */
+    private Long rewardType;
+
+    /** 群聊会话id */
+    private String chatId;
+
+    /** 群聊名称 */
+    @Excel(name = "群聊名称")
+    private String externalUserName;
+
+
+}

+ 61 - 0
fs-service/src/main/java/com/fs/qw/mapper/BindPhoneRedPacketRecordMapper.java

@@ -0,0 +1,61 @@
+package com.fs.qw.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.qw.domain.BindPhoneRedPacketRecord;
+
+/**
+ * 绑定手机号红包领取记录Mapper接口
+ * 
+ * @author fs
+ * @date 2026-03-17
+ */
+public interface BindPhoneRedPacketRecordMapper extends BaseMapper<BindPhoneRedPacketRecord>{
+    /**
+     * 查询绑定手机号红包领取记录
+     * 
+     * @param id 绑定手机号红包领取记录主键
+     * @return 绑定手机号红包领取记录
+     */
+    BindPhoneRedPacketRecord selectBindPhoneRedPacketRecordById(Long id);
+
+    /**
+     * 查询绑定手机号红包领取记录列表
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 绑定手机号红包领取记录集合
+     */
+    List<BindPhoneRedPacketRecord> selectBindPhoneRedPacketRecordList(BindPhoneRedPacketRecord bindPhoneRedPacketRecord);
+
+    /**
+     * 新增绑定手机号红包领取记录
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 结果
+     */
+    int insertBindPhoneRedPacketRecord(BindPhoneRedPacketRecord bindPhoneRedPacketRecord);
+
+    /**
+     * 修改绑定手机号红包领取记录
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 结果
+     */
+    int updateBindPhoneRedPacketRecord(BindPhoneRedPacketRecord bindPhoneRedPacketRecord);
+
+    /**
+     * 删除绑定手机号红包领取记录
+     * 
+     * @param id 绑定手机号红包领取记录主键
+     * @return 结果
+     */
+    int deleteBindPhoneRedPacketRecordById(Long id);
+
+    /**
+     * 批量删除绑定手机号红包领取记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteBindPhoneRedPacketRecordByIds(Long[] ids);
+}

+ 61 - 0
fs-service/src/main/java/com/fs/qw/service/IBindPhoneRedPacketRecordService.java

@@ -0,0 +1,61 @@
+package com.fs.qw.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.qw.domain.BindPhoneRedPacketRecord;
+
+/**
+ * 绑定手机号红包领取记录Service接口
+ * 
+ * @author fs
+ * @date 2026-03-17
+ */
+public interface IBindPhoneRedPacketRecordService extends IService<BindPhoneRedPacketRecord>{
+    /**
+     * 查询绑定手机号红包领取记录
+     * 
+     * @param id 绑定手机号红包领取记录主键
+     * @return 绑定手机号红包领取记录
+     */
+    BindPhoneRedPacketRecord selectBindPhoneRedPacketRecordById(Long id);
+
+    /**
+     * 查询绑定手机号红包领取记录列表
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 绑定手机号红包领取记录集合
+     */
+    List<BindPhoneRedPacketRecord> selectBindPhoneRedPacketRecordList(BindPhoneRedPacketRecord bindPhoneRedPacketRecord);
+
+    /**
+     * 新增绑定手机号红包领取记录
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 结果
+     */
+    int insertBindPhoneRedPacketRecord(BindPhoneRedPacketRecord bindPhoneRedPacketRecord);
+
+    /**
+     * 修改绑定手机号红包领取记录
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 结果
+     */
+    int updateBindPhoneRedPacketRecord(BindPhoneRedPacketRecord bindPhoneRedPacketRecord);
+
+    /**
+     * 批量删除绑定手机号红包领取记录
+     * 
+     * @param ids 需要删除的绑定手机号红包领取记录主键集合
+     * @return 结果
+     */
+    int deleteBindPhoneRedPacketRecordByIds(Long[] ids);
+
+    /**
+     * 删除绑定手机号红包领取记录信息
+     * 
+     * @param id 绑定手机号红包领取记录主键
+     * @return 结果
+     */
+    int deleteBindPhoneRedPacketRecordById(Long id);
+}

+ 94 - 0
fs-service/src/main/java/com/fs/qw/service/impl/BindPhoneRedPacketRecordServiceImpl.java

@@ -0,0 +1,94 @@
+package com.fs.qw.service.impl;
+
+import java.util.List;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.fs.qw.mapper.BindPhoneRedPacketRecordMapper;
+import com.fs.qw.domain.BindPhoneRedPacketRecord;
+import com.fs.qw.service.IBindPhoneRedPacketRecordService;
+
+/**
+ * 绑定手机号红包领取记录Service业务层处理
+ * 
+ * @author fs
+ * @date 2026-03-17
+ */
+@Service
+public class BindPhoneRedPacketRecordServiceImpl extends ServiceImpl<BindPhoneRedPacketRecordMapper, BindPhoneRedPacketRecord> implements IBindPhoneRedPacketRecordService {
+
+    /**
+     * 查询绑定手机号红包领取记录
+     * 
+     * @param id 绑定手机号红包领取记录主键
+     * @return 绑定手机号红包领取记录
+     */
+    @Override
+    public BindPhoneRedPacketRecord selectBindPhoneRedPacketRecordById(Long id)
+    {
+        return baseMapper.selectBindPhoneRedPacketRecordById(id);
+    }
+
+    /**
+     * 查询绑定手机号红包领取记录列表
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 绑定手机号红包领取记录
+     */
+    @Override
+    public List<BindPhoneRedPacketRecord> selectBindPhoneRedPacketRecordList(BindPhoneRedPacketRecord bindPhoneRedPacketRecord)
+    {
+        return baseMapper.selectBindPhoneRedPacketRecordList(bindPhoneRedPacketRecord);
+    }
+
+    /**
+     * 新增绑定手机号红包领取记录
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 结果
+     */
+    @Override
+    public int insertBindPhoneRedPacketRecord(BindPhoneRedPacketRecord bindPhoneRedPacketRecord)
+    {
+        bindPhoneRedPacketRecord.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertBindPhoneRedPacketRecord(bindPhoneRedPacketRecord);
+    }
+
+    /**
+     * 修改绑定手机号红包领取记录
+     * 
+     * @param bindPhoneRedPacketRecord 绑定手机号红包领取记录
+     * @return 结果
+     */
+    @Override
+    public int updateBindPhoneRedPacketRecord(BindPhoneRedPacketRecord bindPhoneRedPacketRecord)
+    {
+        bindPhoneRedPacketRecord.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateBindPhoneRedPacketRecord(bindPhoneRedPacketRecord);
+    }
+
+    /**
+     * 批量删除绑定手机号红包领取记录
+     * 
+     * @param ids 需要删除的绑定手机号红包领取记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBindPhoneRedPacketRecordByIds(Long[] ids)
+    {
+        return baseMapper.deleteBindPhoneRedPacketRecordByIds(ids);
+    }
+
+    /**
+     * 删除绑定手机号红包领取记录信息
+     * 
+     * @param id 绑定手机号红包领取记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBindPhoneRedPacketRecordById(Long id)
+    {
+        return baseMapper.deleteBindPhoneRedPacketRecordById(id);
+    }
+}

+ 129 - 0
fs-service/src/main/resources/mapper/qw/BindPhoneRedPacketRecordMapper.xml

@@ -0,0 +1,129 @@
+<?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.fs.qw.mapper.BindPhoneRedPacketRecordMapper">
+    
+    <resultMap type="BindPhoneRedPacketRecord" id="BindPhoneRedPacketRecordResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="userName"    column="user_name"    />
+        <result property="redPacketId"    column="red_packet_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="companyName"    column="company_name"    />
+        <result property="amount"    column="amount"    />
+        <result property="sendTime"    column="send_time"    />
+        <result property="collectTime"    column="collect_time"    />
+        <result property="collectType"    column="collect_type"    />
+        <result property="sendLink"    column="send_link"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="qwUserId"    column="qw_user_id"    />
+        <result property="qwUserName"    column="qw_user_name"    />
+        <result property="phone"    column="phone"    />
+    </resultMap>
+
+    <sql id="selectBindPhoneRedPacketRecordVo">
+        select id, user_id, user_name, red_packet_id, company_user_id, company_id, company_name, amount, send_time, collect_time, collect_type, send_link, update_time, create_time, qw_user_id, qw_user_name, phone from bind_phone_red_packet_record
+    </sql>
+
+    <select id="selectBindPhoneRedPacketRecordList" parameterType="BindPhoneRedPacketRecord" resultMap="BindPhoneRedPacketRecordResult">
+        <include refid="selectBindPhoneRedPacketRecordVo"/>
+        <where>  
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="redPacketId != null "> and red_packet_id = #{redPacketId}</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="companyName != null  and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
+            <if test="amount != null "> and amount = #{amount}</if>
+            <if test="sendTime != null "> and send_time = #{sendTime}</if>
+            <if test="collectTime != null "> and collect_time = #{collectTime}</if>
+            <if test="collectType != null  and collectType != ''"> and collect_type = #{collectType}</if>
+            <if test="sendLink != null  and sendLink != ''"> and send_link = #{sendLink}</if>
+            <if test="qwUserId != null  and qwUserId != ''"> and qw_user_id = #{qwUserId}</if>
+            <if test="qwUserName != null  and qwUserName != ''"> and qw_user_name like concat('%', #{qwUserName}, '%')</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
+        </where>
+    </select>
+    
+    <select id="selectBindPhoneRedPacketRecordById" parameterType="Long" resultMap="BindPhoneRedPacketRecordResult">
+        <include refid="selectBindPhoneRedPacketRecordVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertBindPhoneRedPacketRecord" parameterType="BindPhoneRedPacketRecord" useGeneratedKeys="true" keyProperty="id">
+        insert into bind_phone_red_packet_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="redPacketId != null">red_packet_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="companyName != null">company_name,</if>
+            <if test="amount != null">amount,</if>
+            <if test="sendTime != null">send_time,</if>
+            <if test="collectTime != null">collect_time,</if>
+            <if test="collectType != null">collect_type,</if>
+            <if test="sendLink != null">send_link,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="qwUserId != null">qw_user_id,</if>
+            <if test="qwUserName != null">qw_user_name,</if>
+            <if test="phone != null">phone,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="redPacketId != null">#{redPacketId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="companyName != null">#{companyName},</if>
+            <if test="amount != null">#{amount},</if>
+            <if test="sendTime != null">#{sendTime},</if>
+            <if test="collectTime != null">#{collectTime},</if>
+            <if test="collectType != null">#{collectType},</if>
+            <if test="sendLink != null">#{sendLink},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="qwUserId != null">#{qwUserId},</if>
+            <if test="qwUserName != null">#{qwUserName},</if>
+            <if test="phone != null">#{phone},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBindPhoneRedPacketRecord" parameterType="BindPhoneRedPacketRecord">
+        update bind_phone_red_packet_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="redPacketId != null">red_packet_id = #{redPacketId},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="companyName != null">company_name = #{companyName},</if>
+            <if test="amount != null">amount = #{amount},</if>
+            <if test="sendTime != null">send_time = #{sendTime},</if>
+            <if test="collectTime != null">collect_time = #{collectTime},</if>
+            <if test="collectType != null">collect_type = #{collectType},</if>
+            <if test="sendLink != null">send_link = #{sendLink},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
+            <if test="qwUserName != null">qw_user_name = #{qwUserName},</if>
+            <if test="phone != null">phone = #{phone},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBindPhoneRedPacketRecordById" parameterType="Long">
+        delete from bind_phone_red_packet_record where id = #{id}
+    </delete>
+
+    <delete id="deleteBindPhoneRedPacketRecordByIds" parameterType="String">
+        delete from bind_phone_red_packet_record where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>