“mitao”
2025-12-22 bef045d5b14b246bc0b7afaca19c8ec1020aeb1d
Merge remote-tracking branch 'origin/master'
4个文件已添加
16个文件已修改
460 ■■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppUserController.java 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBigGiftPackageOrderController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/dto/GoldChangeDto.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TAppUserMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TBigGiftPackageOrderMapper.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TIntegralChangeRecordMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TGoldChangeRecord.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/BigGiftPackageOrderQuery.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/GoldChangeRecordQuery.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/IntegralChangeRecordQuery.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/TAppUserService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/TBigGiftPackageOrderService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/TIntegralChangeRecordService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TAppUserServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBigGiftPackageOrderServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TIntegralChangeRecordServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/IntegralChangeRecordVo.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TAppUserMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TBigGiftPackageOrderMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TIntegralChangeRecordMapper.xml 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppUserController.java
@@ -9,25 +9,26 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.WebUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.BatchUpdateIntegralDto;
import com.ruoyi.system.dto.GoldChangeDto;
import com.ruoyi.system.dto.UpdateAppUserDto;
import com.ruoyi.system.export.AppUserGoldImport;
import com.ruoyi.system.export.AppUserImport;
import com.ruoyi.system.export.BigGiftPackageImport;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.model.*;
import com.ruoyi.system.query.AppUserListQuery;
import com.ruoyi.system.query.BigGiftPackageQuery;
import com.ruoyi.system.service.TAppUserService;
import com.ruoyi.system.service.TCompanyService;
import com.ruoyi.system.service.TGoldChangeRecordService;
import com.ruoyi.system.service.TIntegralChangeRecordService;
import com.ruoyi.system.query.*;
import com.ruoyi.system.service.*;
import com.ruoyi.system.vo.IntegralChangeRecordVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Workbook;
@@ -53,6 +54,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
 * <p>
@@ -86,6 +88,12 @@
    @Autowired
    private TIntegralChangeRecordService integralChangeRecordService;
    @Autowired
    private SysUserMapper sysUserMapper;
    @Autowired
    private TBigGiftPackageOrderService bigGiftPackageOrderService;
    @ApiOperation(value = "用户管理分页列表")
@@ -428,5 +436,136 @@
    }
    @ApiOperation(value = "积分修改记录")
    @PostMapping(value = "/integralChangeRecord")
    public R<PageInfo<IntegralChangeRecordVo>> integralChangeRecord(@RequestBody IntegralChangeRecordQuery query) {
        return R.ok(integralChangeRecordService.integralChangeRecord(query));
    }
    @ApiOperation(value = "积分修改记录导出")
    @PostMapping(value = "/exportIntegralChangeRecord")
    @Log(title = "积分修改记录-导出", businessType = BusinessType.EXPORT)
    public void exportIntegralChangeRecord(@RequestBody IntegralChangeRecordQuery query) {
        List<IntegralChangeRecordVo> list = integralChangeRecordService.integralChangeRecordExport(query);
        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TAppUser.class, list);
        HttpServletResponse response = WebUtils.response();
        assert response != null;
        response.setContentType("application/vnd.ms-excel");
        response.setCharacterEncoding("utf-8");
        ServletOutputStream outputStream = null;
        try {
            String fileName = URLEncoder.encode("小程序用户导出信息.xls", "utf-8");
            response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
            response.setHeader("Pragma", "no-cache");
            response.setHeader("Cache-Control", "no-cache");
            outputStream = response.getOutputStream();
            workbook.write(outputStream);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                outputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    @ApiOperation(value = "金币记录")
    @PostMapping(value = "/goldChangeRecord")
    public R<Page<TGoldChangeRecord>> goldChangeRecord(@RequestBody GoldChangeRecordQuery query) {
        Page<TGoldChangeRecord> tGoldChangeRecordPage = new Page<>(query.getPageNum(), query.getPageSize());
        Page<TGoldChangeRecord> page = goldChangeRecordService.page(tGoldChangeRecordPage, new LambdaQueryWrapper<TGoldChangeRecord>()
                .eq(TGoldChangeRecord::getAppUserId, query.getUserId())
                .orderByDesc(TGoldChangeRecord::getCreateTime));
        List<TGoldChangeRecord> records = page.getRecords();
        if(!records.isEmpty()){
            records.forEach(record -> {
                Long createUserId = record.getCreateUserId();
                if(createUserId!=null){
                    SysUser sysUser = sysUserMapper.selectUserById(createUserId);
                    if(sysUser!=null){
                        record.setCreateUserName(sysUser.getUserName());
                    }
                }
            });
        }
        page.setRecords( records);
        return R.ok(page);
    }
    @ApiOperation(value = "金币充值")
    @PostMapping(value = "/goldAdd")
    @Log(title = "小程序用户-金币充值", businessType = BusinessType.UPDATE)
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
    public R goldChange(@RequestBody GoldChangeDto dto) {
        Long userId = tokenService.getLoginUser().getUserId();
        if(dto.getChangeNum()<=0){
            return R.fail("充值数不能小于等于0");
        }
        TAppUser appUser = appUserService.getById(dto.getUserId());
        TGoldChangeRecord tGoldChangeRecord = new TGoldChangeRecord();
        tGoldChangeRecord.setAppUserId(appUser.getId());
        tGoldChangeRecord.setType(1);
        tGoldChangeRecord.setPrice(new BigDecimal(dto.getChangeNum()));
        tGoldChangeRecord.setBalance(appUser.getGoldBalance().add(new BigDecimal(dto.getChangeNum())).setScale(0, BigDecimal.ROUND_HALF_UP));
        tGoldChangeRecord.setCreateUserId(userId);
        appUser.setGoldBalance(tGoldChangeRecord.getBalance());
        goldChangeRecordService.save(tGoldChangeRecord);
        appUserService.updateById(appUser);
        return R.ok();
    }
    @ApiOperation(value = "金币扣除")
    @PostMapping(value = "/goldSub")
    @Log(title = "小程序用户-金币扣除", businessType = BusinessType.UPDATE)
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
    public R goldSub(@RequestBody GoldChangeDto dto) {
        Long userId = tokenService.getLoginUser().getUserId();
        if(dto.getChangeNum()<=0){
            return R.fail("扣除数不能小于等于0");
        }
        TAppUser appUser = appUserService.getById(dto.getUserId());
        if(appUser.getGoldBalance().compareTo(new BigDecimal(dto.getChangeNum()))<0){
            return R.fail("用户金币不足");
        }
        TGoldChangeRecord tGoldChangeRecord = new TGoldChangeRecord();
        tGoldChangeRecord.setAppUserId(appUser.getId());
        tGoldChangeRecord.setType(2);
        tGoldChangeRecord.setPrice(new BigDecimal(dto.getChangeNum()));
        tGoldChangeRecord.setBalance(appUser.getGoldBalance().subtract(new BigDecimal(dto.getChangeNum())).setScale(0, BigDecimal.ROUND_HALF_UP));
        tGoldChangeRecord.setCreateUserId(userId);
        appUser.setGoldBalance(tGoldChangeRecord.getBalance());
        goldChangeRecordService.save(tGoldChangeRecord);
        appUserService.updateById(appUser);
        return R.ok();
    }
    @ApiOperation(value = "购买记录")
    @PostMapping(value = "/pageOrderList")
    public R<Page<TBigGiftPackageOrder>> pageOrderList(@RequestBody GoldChangeRecordQuery query) {
        Page<TBigGiftPackageOrder> tBigGiftPackageOrderPage = new Page<>(query.getPageNum(), query.getPageSize());
        List<TBigGiftPackageOrder> list = bigGiftPackageOrderService.pageOrderList(tBigGiftPackageOrderPage,query);
        tBigGiftPackageOrderPage.setRecords(list);
        return R.ok(tBigGiftPackageOrderPage);
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBigGiftPackageOrderController.java
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.BusinessType;
@@ -16,6 +17,7 @@
import com.ruoyi.system.export.BigGiftPackageImport;
import com.ruoyi.system.export.TBigGiftPackageOrderExport;
import com.ruoyi.system.model.*;
import com.ruoyi.system.query.AppUserListQuery;
import com.ruoyi.system.query.BigGiftPackageOrderQuery;
import com.ruoyi.system.query.OrderTransferQuery;
import com.ruoyi.system.service.*;
@@ -315,6 +317,28 @@
        return R.ok(tOrderTransferVo);
    }
    @ApiOperation(value = "订单转让删除")
    @DeleteMapping(value = "/transferDelete/{id}")
    @Log(title = "订单转让-删除", businessType = BusinessType.DELETE)
    public R<String> transferDelete(@PathVariable Integer id) {
        TOrderTransfer orderTransfer = tOrderTransferService.getById(id);
        if (orderTransfer == null) {
            return R.fail("订单转让不存在");
        }
        orderTransfer.setDelFlag(1);
       tOrderTransferService.updateById(orderTransfer);
        return R.ok() ;
    }
    @ApiOperation(value = "用户管理分页列表")
    @PostMapping(value = "/transferPageUserList")
    public R<PageInfo<TAppUser>> transferPageUserList(@RequestBody AppUserListQuery query) {
        return R.ok(tAppUserService.transferPageUserList(query));
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/dto/GoldChangeDto.java
New file
@@ -0,0 +1,16 @@
package com.ruoyi.system.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("金币变化")
public class GoldChangeDto
{
    @ApiModelProperty("用户id")
    private Integer userId;
    @ApiModelProperty("变化数量")
    private Integer changeNum;
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TAppUserMapper.java
@@ -30,4 +30,7 @@
    List<TAppUser> exportAppUser(@Param("query") AppUserListQuery query);
    List<TAppUser> transferPageUserList(@Param("query") AppUserListQuery query, @Param("pageInfo") PageInfo<TAppUser> pageInfo);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TBigGiftPackageOrderMapper.java
@@ -4,6 +4,7 @@
import com.ruoyi.system.model.TBigGiftPackageOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.query.BigGiftPackageOrderQuery;
import com.ruoyi.system.query.GoldChangeRecordQuery;
import com.ruoyi.system.query.ProfitPageListQuery;
import com.ruoyi.system.vo.ProfitPageListVo;
import org.apache.ibatis.annotations.Param;
@@ -28,4 +29,7 @@
    List<ProfitPageListVo> profitPageListExport(@Param("query") ProfitPageListQuery query, @Param("sTime") String sTime, @Param("eTime") String eTime);
    List<TBigGiftPackageOrder> pageOrderList(@Param("tBigGiftPackageOrderPage") Page<TBigGiftPackageOrder> tBigGiftPackageOrderPage, @Param("query") GoldChangeRecordQuery query);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TIntegralChangeRecordMapper.java
@@ -1,7 +1,13 @@
package com.ruoyi.system.mapper;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.TIntegralChangeRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.query.IntegralChangeRecordQuery;
import com.ruoyi.system.vo.IntegralChangeRecordVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +19,9 @@
 */
public interface TIntegralChangeRecordMapper extends BaseMapper<TIntegralChangeRecord> {
    List<IntegralChangeRecordVo> integralChangeRecord(@Param("pageInfo") PageInfo<IntegralChangeRecordVo> pageInfo, @Param("query") IntegralChangeRecordQuery query);
    List<IntegralChangeRecordVo> integralChangeRecordExport(@Param("query") IntegralChangeRecordQuery query);
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TGoldChangeRecord.java
@@ -56,5 +56,9 @@
    @TableField("create_user_id")
    private Long createUserId;
    @ApiModelProperty(value = "操作人名称")
    @TableField(exist = false)
    private String createUserName;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/BigGiftPackageOrderQuery.java
@@ -22,4 +22,6 @@
    @ApiModelProperty(value = "1=待付款,2=已付订金,3=完成支付,4=确认收货,5=已退款")
    private Integer status;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/GoldChangeRecordQuery.java
New file
@@ -0,0 +1,13 @@
package com.ruoyi.system.query;
import com.ruoyi.common.core.domain.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("金币记录query")
public class GoldChangeRecordQuery extends BasePage {
    @ApiModelProperty("用户id")
    private Integer userId;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/IntegralChangeRecordQuery.java
New file
@@ -0,0 +1,19 @@
package com.ruoyi.system.query;
import com.ruoyi.common.core.domain.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("积分变更记录查询参数")
public class IntegralChangeRecordQuery extends BasePage {
    @ApiModelProperty("姓名")
    private String name;
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("推广号")
    private String code;
}
ruoyi-system/src/main/java/com/ruoyi/system/service/TAppUserService.java
@@ -44,4 +44,7 @@
    List<TAppUser> exportAppUser(AppUserListQuery query);
    PageInfo<TAppUser> transferPageUserList(AppUserListQuery query);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/TBigGiftPackageOrderService.java
@@ -5,6 +5,7 @@
import com.ruoyi.system.dto.BigGiftPlaceOrderDTO;
import com.ruoyi.system.model.TBigGiftPackageOrder;
import com.ruoyi.system.query.BigGiftPackageOrderQuery;
import com.ruoyi.system.query.GoldChangeRecordQuery;
import com.ruoyi.system.query.ProfitPageListQuery;
import com.ruoyi.system.vo.ProfitPageListVo;
import com.ruoyi.system.vo.PlaceOrderVO;
@@ -52,5 +53,6 @@
    List<ProfitPageListVo> profitPageListExport(@Valid ProfitPageListQuery query);
    List<TBigGiftPackageOrder> pageOrderList(Page<TBigGiftPackageOrder> tBigGiftPackageOrderPage, GoldChangeRecordQuery query);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/TIntegralChangeRecordService.java
@@ -1,7 +1,12 @@
package com.ruoyi.system.service;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.TIntegralChangeRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.query.IntegralChangeRecordQuery;
import com.ruoyi.system.vo.IntegralChangeRecordVo;
import java.util.List;
/**
 * <p>
@@ -13,4 +18,9 @@
 */
public interface TIntegralChangeRecordService extends IService<TIntegralChangeRecord> {
    PageInfo<IntegralChangeRecordVo> integralChangeRecord(IntegralChangeRecordQuery query);
    List<IntegralChangeRecordVo> integralChangeRecordExport(IntegralChangeRecordQuery query);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TAppUserServiceImpl.java
@@ -59,6 +59,13 @@
        pageInfo.setRecords( list);
        return pageInfo;
    }
    @Override
    public PageInfo<TAppUser> transferPageUserList(AppUserListQuery query) {
        PageInfo<TAppUser> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TAppUser> list = this.baseMapper.transferPageUserList(query,pageInfo);
        pageInfo.setRecords( list);
        return pageInfo;
    }
    @Override
    public void confirmSuperior(Integer superiorType, Integer superiorId, LoginUserApplet loginUserApplet) {
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBigGiftPackageOrderServiceImpl.java
@@ -19,6 +19,7 @@
import com.ruoyi.system.model.TCommissionTransactionFlow;
import com.ruoyi.system.model.TCompany;
import com.ruoyi.system.query.BigGiftPackageOrderQuery;
import com.ruoyi.system.query.GoldChangeRecordQuery;
import com.ruoyi.system.query.ProfitPageListQuery;
import com.ruoyi.system.service.TBigGiftPackageOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -194,6 +195,32 @@
    }
    @Override
    public List<TBigGiftPackageOrder> pageOrderList(Page<TBigGiftPackageOrder> tBigGiftPackageOrderPage, GoldChangeRecordQuery query) {
        List<TBigGiftPackageOrder> tBigGiftPackageOrders =  this.baseMapper.pageOrderList(tBigGiftPackageOrderPage, query);
        if(!tBigGiftPackageOrders.isEmpty()){
            List<Integer> companyId = tBigGiftPackageOrders.stream().map(TBigGiftPackageOrder::getCompanyId).collect(Collectors.toList());
            List<TCompany> tCompanies = companyMapper.selectBatchIds(companyId);
            tBigGiftPackageOrders.forEach(tBigGiftPackageOrder -> {
                TCompany tCompany1 = tCompanies.stream().filter(tCompany -> tCompany.getId().equals(tBigGiftPackageOrder.getCompanyId())).findFirst().orElse(null);
                if(tCompany1!=null){
                    tBigGiftPackageOrder.setCompanyName(tCompany1.getName());
                }
            });
            List<Integer> goodsIds = tBigGiftPackageOrders.stream().map(TBigGiftPackageOrder::getBigGiftPackageId).collect(Collectors.toList());
            List<TBigGiftPackage> bigGiftPackages = bigGiftPackageMapper.selectBatchIds(goodsIds);
            tBigGiftPackageOrders.forEach(tBigGiftPackageOrder -> {
                TBigGiftPackage bigGiftPackage = bigGiftPackages.stream().filter(tBigGiftPackage -> tBigGiftPackage.getId().equals(tBigGiftPackageOrder.getBigGiftPackageId())).findFirst().orElse(null);
                if(bigGiftPackage!=null){
                    tBigGiftPackageOrder.setBigGiftPackageName(bigGiftPackage.getName());
                }
            });
        }
        return tBigGiftPackageOrders;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public PlaceOrderVO placeOrder(BigGiftPlaceOrderDTO dto, Integer appUserId, String openid) {
        // 1. 校验商品是否存在
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TIntegralChangeRecordServiceImpl.java
@@ -1,10 +1,16 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.TIntegralChangeRecord;
import com.ruoyi.system.mapper.TIntegralChangeRecordMapper;
import com.ruoyi.system.query.IntegralChangeRecordQuery;
import com.ruoyi.system.service.TIntegralChangeRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.vo.IntegralChangeRecordVo;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
 * <p>
@@ -17,4 +23,16 @@
@Service
public class TIntegralChangeRecordServiceImpl extends ServiceImpl<TIntegralChangeRecordMapper, TIntegralChangeRecord> implements TIntegralChangeRecordService {
    @Override
    public PageInfo<IntegralChangeRecordVo> integralChangeRecord(IntegralChangeRecordQuery query) {
        PageInfo<IntegralChangeRecordVo> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<IntegralChangeRecordVo>  list = this.baseMapper.integralChangeRecord(pageInfo,query);
        pageInfo.setRecords(list);
        return pageInfo;
    }
    @Override
    public List<IntegralChangeRecordVo> integralChangeRecordExport(IntegralChangeRecordQuery query) {
        return this.baseMapper.integralChangeRecordExport(query);
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/IntegralChangeRecordVo.java
New file
@@ -0,0 +1,50 @@
package com.ruoyi.system.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@Data
@ApiModel("积分变动记录Vo")
public class IntegralChangeRecordVo {
    @ApiModelProperty("id")
    private Integer id;
    @ApiModelProperty("头像")
    @Excel(name = "头像", width = 20,imageType = 1,type = 2)
    private String profilePhoto;
    @ApiModelProperty("用户名")
    @Excel(name = "用户名", width = 20)
    private String name;
    @ApiModelProperty("推广号")
    @Excel(name = "推广号", width = 20)
    private String code;
    @ApiModelProperty("联系电话")
    @Excel(name = "联系电话", width = 20)
    private String phone;
    @ApiModelProperty("修改前积分")
    @Excel(name = "修改前积分", width = 20)
    private Integer oldIntegral;
    @ApiModelProperty("修改后积分")
    @Excel(name = "修改后积分", width = 20)
    private Integer newIntegral;
    @ApiModelProperty("修改时间")
    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @ApiModelProperty("操作人")
    @Excel(name = "操作人", width = 20)
    private String  operatorName;
}
ruoyi-system/src/main/resources/mapper/system/TAppUserMapper.xml
@@ -27,11 +27,11 @@
        select t1.* from t_app_user t1
        where    t1.status != 3
        <if test="query.nickName != null and query.nickName != ''">
            and t1.nick_name like concat('%',#{query.nickName},'%')
            and t1.name like concat('%',#{query.nickName},'%')
        </if>
        <if test="query.phoneNumber != null and query.phoneNumber != ''">
            and t1.phone_number like concat('%',#{query.phoneNumber},'%')
            and t1.phone like concat('%',#{query.phoneNumber},'%')
        </if>
        <if test="query.status != null">
            and t1.status = #{query.status}
@@ -87,11 +87,27 @@
        select t1.* from t_app_user t1
        where    t1.status != 3
        <if test="query.nickName != null and query.nickName != ''">
            and t1.nick_name like concat('%',#{query.nickName},'%')
            and t1.name like concat('%',#{query.nickName},'%')
        </if>
        <if test="query.phoneNumber != null and query.phoneNumber != ''">
            and t1.phone_number like concat('%',#{query.phoneNumber},'%')
            and t1.phone like concat('%',#{query.phoneNumber},'%')
        </if>
        <if test="query.status != null">
            and t1.status = #{query.status}
        </if>
        order by t1.create_time desc
    </select>
    <select id="transferPageUserList" resultType="com.ruoyi.system.model.TAppUser">
        select t1.* from t_app_user t1
        where    t1.status != 3
        <if test="query.nickName != null and query.nickName != ''">
            and t1.name like concat('%',#{query.nickName},'%')
        </if>
        <if test="query.phoneNumber != null and query.phoneNumber != ''">
            and( t1.phone like concat('%',#{query.phoneNumber},'%') or t1.code like concat('%',#{query.phoneNumber},'%') )
        </if>
        <if test="query.status != null">
            and t1.status = #{query.status}
ruoyi-system/src/main/resources/mapper/system/TBigGiftPackageOrderMapper.xml
@@ -116,5 +116,17 @@
        </if>
        order by t1.create_time desc
    </select>
    <select id="pageOrderList" resultType="com.ruoyi.system.model.TBigGiftPackageOrder">
        SELECT
        t1.id, t1.code, t1.company_id, t1.app_user_id, t1.create_time, t1.big_gift_package_id, t1.big_gift_package,
        t1.order_price, t1.deposit, t1.final_payment, t1.payment_price,
        t1.status, t1.delivery_time, t1.payment_type, t1.deposit_time, t1.deposit_payment_method,
        t1.deposit_payment_serial_number, t1.final_payment_time, t1.final_payment_method,
        t1.final_payment_serial_number, t1.del_flag, t1.remark,t2.phone,t2.name userName
        FROM t_big_gift_package_order t1 LEFT JOIN t_app_user t2 ON t1.app_user_id = t2.id
        WHERE t1.del_flag = 0 and t2.id = #{query.userId}
        order by t1.create_time desc
    </select>
</mapper>
ruoyi-system/src/main/resources/mapper/system/TIntegralChangeRecordMapper.xml
@@ -17,5 +17,65 @@
    <sql id="Base_Column_List">
        id, app_user_id, type, price, balance, create_time, create_user_id
    </sql>
    <select id="integralChangeRecord" resultType="com.ruoyi.system.vo.IntegralChangeRecordVo">
        SELECT
        t.id,
        t.app_user_id,
        t.balance AS newIntegral,
        t.old_balance AS oldIntegral,
        t.create_time,
        t.create_user_id,
        u.profile_photo,
        u.name,
        u.code,
        u.phone,
        su.nick_name AS operatorName
        FROM t_integral_change_record t
        LEFT JOIN t_app_user u ON t.app_user_id = u.id
        LEFT JOIN sys_user su ON su.user_id = t.create_user_id
        WHERE 1=1
        <if test="query.name != null and query.name != ''">
            AND u.name LIKE concat('%',#{query.name},'%')
        </if>
        <if test="query.phone != null and query.phone != ''">
            AND u.phone LIKE concat('%',#{query.phone},'%')
        </if>
        <if test="query.code != null and query.code != ''">
            AND u.code LIKE concat('%',#{query.code},'%')
        </if>
        order by t.create_time desc
    </select>
    <select id="integralChangeRecordExport" resultType="com.ruoyi.system.vo.IntegralChangeRecordVo">
        SELECT
        t.id,
        t.app_user_id,
        t.balance AS newIntegral,
        t.old_balance AS oldIntegral,
        t.create_time,
        t.create_user_id,
        u.profile_photo,
        u.name,
        u.code,
        u.phone,
        su.nick_name AS operatorName
        FROM t_integral_change_record t
        LEFT JOIN t_app_user u ON t.app_user_id = u.id
        LEFT JOIN sys_user su ON su.user_id = t.create_user_id
        WHERE 1=1
        <if test="query.name != null and query.name != ''">
            AND u.name LIKE concat('%',#{query.name},'%')
        </if>
        <if test="query.phone != null and query.phone != ''">
            AND u.phone LIKE concat('%',#{query.phone},'%')
        </if>
        <if test="query.code != null and query.code != ''">
            AND u.code LIKE concat('%',#{query.code},'%')
        </if>
        order by t.create_time desc
    </select>
</mapper>