zyy
2025-07-15 a14adcad31cbd3159f0055dbf1d234ca79f62071
基金修改
6 files modified
1 files added
111 ■■■■ changed files
src/main/java/com/nq/dao/UserStockSubscribeMapper.java 5 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/pojo/MoneyLog.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/nq/pojo/OrderEchoOut.java 16 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java 23 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/vo/subscribe/UserStockSubscribeVo.java 23 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/OrderEchoMapper.xml 2 ●●● patch | view | raw | blame | history
src/main/resources/mapper/UserStockSubscribeMapper.xml 40 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/dao/UserStockSubscribeMapper.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nq.pojo.UserStockSubscribe;
import com.nq.vo.subscribe.UserStockSubscribeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@@ -67,6 +68,8 @@
     **/
    List<UserStockSubscribe> getOneSubscribeByUserId(String phone);
    List<UserStockSubscribeVo> getListByParam(@Param("userId") Integer userId,
                                              @Param("type")String type,
                                              @Param("status")Integer status);
}
src/main/java/com/nq/pojo/MoneyLog.java
@@ -11,7 +11,7 @@
public class MoneyLog {
    @TableId(value = "id",type = IdType.AUTO)
    private int id;
    private Integer id;
    private String type;
    private String amount;
    private String descs;
src/main/java/com/nq/pojo/OrderEchoOut.java
@@ -19,29 +19,39 @@
    private Integer id;
    //基金id
    private String eid;
    //回报率
    private String returnOfRate;
    //买入时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Kolkata")
    private Date buyTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Kolkata")
    private Date endTime;
    //用户id
    private String userId;
    //买入金额
    private String money;
    //状态 1.进行中  2.已赎回
    private String state;
    //收益
    private String earnings;
    /**
     * 周期时间
     * */
    private String returnTime;
    /**
     * 标题
     * */
    private String title;
}
src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java
@@ -17,11 +17,8 @@
import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.KeyUtils;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.redis.JsonUtil;
import com.nq.utils.redis.RedisShardedPoolUtils;
import com.nq.utils.stock.BuyAndSellUtils;
import com.nq.vo.stock.UserStockSubscribeAddIn;
import com.sun.org.apache.bcel.internal.generic.RETURN;
import com.nq.vo.subscribe.UserStockSubscribeVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -457,28 +454,16 @@
        String header = request.getHeader(property);
        if (header != null) {
             User user = iUserService.getCurrentRefreshUser(request);
            List<UserStockSubscribe> userStockSubscribe = null;
            QueryWrapper<UserStockSubscribe> queryWrapper = new QueryWrapper();
            queryWrapper.eq("user_id", user.getId());
            if (type != null && !type.isEmpty()){
                queryWrapper.eq("type", type);
            }
            if (status != null){
                queryWrapper.eq("status", status);
            }
            queryWrapper.orderByDesc("add_time");
            userStockSubscribe = this.userStockSubscribeMapper.selectList(queryWrapper);
            List<UserStockSubscribeVo> userStockSubscribe = this.userStockSubscribeMapper.getListByParam(user.getId(), type, status);
            /*if (type==null||type.equals("")){
                userStockSubscribe = this.userStockSubscribeMapper.selectList(new QueryWrapper<>(new UserStockSubscribe()).eq("user_id", user.getId()).orderByDesc("add_time"));
            }else{
                userStockSubscribe = this.userStockSubscribeMapper.selectList(new QueryWrapper<>(new UserStockSubscribe()).eq("user_id", user.getId()).eq("type", type).orderByDesc("add_time"));
            }*/
            List<UserStockSubscribe> list = new ArrayList<>();
            for (UserStockSubscribe userStockSubscribe1 : userStockSubscribe) {
            List<UserStockSubscribeVo> list = new ArrayList<>();
            for (UserStockSubscribeVo userStockSubscribe1 : userStockSubscribe) {
                StockSubscribe stockSubscribe = stockSubscribeMapper.selectOne(new QueryWrapper<>(new StockSubscribe())
                        .eq("newlist_id", userStockSubscribe1.getNewStockId()));
                if (stockSubscribe != null) {
src/main/java/com/nq/vo/subscribe/UserStockSubscribeVo.java
New file
@@ -0,0 +1,23 @@
package com.nq.vo.subscribe;
import com.nq.pojo.UserStockSubscribe;
import lombok.Data;
import java.util.Date;
@Data
public class UserStockSubscribeVo extends UserStockSubscribe {
    //股票类型
    private String stockType;
    /**
     * 上市时间
     */
    private Date listDate;
    /**
     发行时间
     */
    private Date subscriptionTime;
}
src/main/resources/mapper/OrderEchoMapper.xml
@@ -35,7 +35,7 @@
        from order_echo  o
                 join echo e
                      on o.eid = e.id
        where user_id = #{id} GROUP BY o.buy_time desc
        where user_id = #{id} ORDER BY o.buy_time desc
    </select>
    <select id="queryAll" resultType="com.nq.pojo.reponse.OrderEChoReponse">
src/main/resources/mapper/UserStockSubscribeMapper.xml
@@ -231,4 +231,44 @@
        WHERE phone = #{phone}  order by id
    </select>
    <select id="getListByParam" resultType="com.nq.vo.subscribe.UserStockSubscribeVo">
        SELECT id,
        order_no,
        user_id,
        real_name,
        phone,
        agent_id,
        agent_name,
        new_code,
        new_name,
        bond,
        buy_price,
        apply_nums,
        apply_number,
        status,
        add_time,
        submit_time,
        end_time,
        fix_time,
        remarks,
        u.type,
        db_money,
        new_stock_id
        ,s.stock_type,s.list_date,s.subscription_time
        FROM user_stock_subscribe u
        LEFT JOIN stock_subscribe s on s.newlist_id = u.new_stock_id
        WHERE 1=1
            <if test="userId != null">
                and u.user_id = #{userId}
            </if>
            <if test="type != null and type != ''">
                and u.type = #{type}
            </if>
            <if test="status != null">
                and u.status = #{status}
            </if>
        order by u.add_time desc
    </select>
</mapper>