jsk 交易流水
This commit is contained in:
parent
411e376d79
commit
da0defe6a0
|
|
@ -3,6 +3,8 @@ package com.bonus.canteen.core.account.controller;
|
|||
import com.bonus.canteen.core.account.domain.AccountTrade;
|
||||
import com.bonus.canteen.core.account.domain.param.AccConsumeDetailQueryParam;
|
||||
import com.bonus.canteen.core.account.service.IAccTradeService;
|
||||
import com.bonus.canteen.core.report.domain.TradeFlowVO;
|
||||
import com.bonus.canteen.core.report.service.TradeReportService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -19,7 +21,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 账户交易记录Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-04-05
|
||||
*/
|
||||
|
|
@ -30,6 +32,19 @@ public class AccTradeController extends BaseController {
|
|||
@Autowired
|
||||
private IAccTradeService accTradeService;
|
||||
|
||||
@Autowired
|
||||
private TradeReportService tradeReportService;
|
||||
|
||||
@ApiOperation(value = "交易流水")
|
||||
//@RequiresPermissions("health:info:list")
|
||||
@GetMapping("/acct")
|
||||
public TableDataInfo acct(TradeFlowVO param) {
|
||||
startPage();
|
||||
List<TradeFlowVO> list = tradeReportService.selectTradeFlow(param);
|
||||
System.out.println(list.size());
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账户交易记录列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ package com.bonus.canteen.core.health.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.canteen.core.report.domain.TradeFlowVO;
|
||||
import com.bonus.canteen.core.report.service.TradeReportService;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
//import com.bonus.canteen.core.health.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -37,6 +40,9 @@ public class HealthPersonInfoController extends BaseController {
|
|||
@Autowired
|
||||
private IHealthPersonInfoService healthPersonInfoService;
|
||||
|
||||
@Autowired
|
||||
private TradeReportService tradeReportService;
|
||||
|
||||
/**
|
||||
* 查询人员健康情况列表
|
||||
*/
|
||||
|
|
@ -49,7 +55,15 @@ public class HealthPersonInfoController extends BaseController {
|
|||
List<HealthPersonInfo> list = healthPersonInfoService.selectHealthPersonInfoList(healthPersonInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "交易流水")
|
||||
//@RequiresPermissions("health:info:list")
|
||||
@GetMapping("/acct")
|
||||
public TableDataInfo acct(TradeFlowVO param) {
|
||||
startPage();
|
||||
List<TradeFlowVO> list = tradeReportService.selectTradeFlow(param);
|
||||
System.out.println(list.size());
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出人员健康情况列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,10 +5,13 @@ import java.math.RoundingMode;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.canteen.core.report.domain.TradeFlowVO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.health.mapper.HealthPersonInfoMapper;
|
||||
|
|
@ -45,7 +48,13 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<HealthPersonInfo> selectHealthPersonInfoList(HealthPersonInfo healthPersonInfo) {
|
||||
return healthPersonInfoMapper.selectHealthPersonInfoList(healthPersonInfo);
|
||||
List<HealthPersonInfo> list=healthPersonInfoMapper.selectHealthPersonInfoList(healthPersonInfo);
|
||||
if(CollUtil.isNotEmpty(list)) {
|
||||
for(HealthPersonInfo vo : list) {
|
||||
vo.setMobile(SM4EncryptUtils.sm4Decrypt(vo.getMobile()));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.bonus.canteen.core.report.controller;
|
||||
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonInfo;
|
||||
import com.bonus.canteen.core.health.service.IHealthPersonInfoService;
|
||||
import com.bonus.canteen.core.report.domain.*;
|
||||
import com.bonus.canteen.core.report.service.TradeReportService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 交易报表
|
||||
*
|
||||
* @author jsk
|
||||
* @date 2025-06-06
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/reportTrade")
|
||||
public class TradeReportController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private TradeReportService tradeReportService;
|
||||
|
||||
@Autowired
|
||||
private IHealthPersonInfoService healthPersonInfoService;
|
||||
|
||||
@ApiOperation(value = "交易流水")
|
||||
//@RequiresPermissions("report:trade:flow")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TradeFlowVO param) {
|
||||
startPage();
|
||||
List<TradeFlowVO> list = tradeReportService.selectTradeFlow(param);
|
||||
System.out.println(list.size());
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.canteen.core.report.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TradeFlowVO extends BaseEntity {
|
||||
private Long userId;
|
||||
private String userName;
|
||||
private Integer userType;
|
||||
private String phonenumber;
|
||||
private Long deptId;
|
||||
private String deptName;
|
||||
private String deptFullName;
|
||||
private BigDecimal accountAllBal;
|
||||
private LocalDateTime tradeTime;
|
||||
private Integer tradeType;
|
||||
private Integer payType;
|
||||
private String machineSn;
|
||||
private String deviceName;
|
||||
private String createBy;
|
||||
private BigDecimal income;
|
||||
private BigDecimal outcome;
|
||||
|
||||
private String searchValue;
|
||||
private List<Long> deptIdList;
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startDateTime;
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endDateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.bonus.canteen.core.report.mapper;
|
||||
|
||||
import com.bonus.canteen.core.report.domain.TradeFlowVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TradeReportMapper {
|
||||
public List<TradeFlowVO> selectTradeFlow(@Param("param") TradeFlowVO param,@Param("encryptedSearchValue") String encryptedSearchValue);
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.bonus.canteen.core.report.service;
|
||||
|
||||
|
||||
import com.bonus.canteen.core.report.domain.TradeFlowVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TradeReportService {
|
||||
List<TradeFlowVO> selectTradeFlow(TradeFlowVO param);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.bonus.canteen.core.report.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.canteen.core.report.domain.TradeFlowVO;
|
||||
import com.bonus.canteen.core.report.mapper.TradeReportMapper;
|
||||
import com.bonus.canteen.core.report.service.TradeReportService;
|
||||
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class TradeReportServiceImpl implements TradeReportService {
|
||||
@Resource
|
||||
TradeReportMapper tradeReportMapper;
|
||||
|
||||
@Override
|
||||
public List<TradeFlowVO> selectTradeFlow(TradeFlowVO param) {
|
||||
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(param.getSearchValue());
|
||||
List<TradeFlowVO> tradeFlowVOList = tradeReportMapper.selectTradeFlow(param,encryptedSearchValue);
|
||||
if(CollUtil.isNotEmpty(tradeFlowVOList)) {
|
||||
for(TradeFlowVO vo : tradeFlowVOList) {
|
||||
vo.setPhonenumber(SM4EncryptUtils.sm4Decrypt(vo.getPhonenumber()));
|
||||
}
|
||||
}
|
||||
return tradeFlowVOList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?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.bonus.canteen.core.report.mapper.TradeReportMapper">
|
||||
<select id="selectTradeFlow" resultType="com.bonus.canteen.core.report.domain.TradeFlowVO">
|
||||
select
|
||||
su.user_id,
|
||||
su.user_name,
|
||||
su.user_type,
|
||||
su.phonenumber,
|
||||
sd.dept_id,
|
||||
sd.dept_name,
|
||||
sd.dept_full_name,
|
||||
at2.account_all_bal,
|
||||
at2.trade_time,
|
||||
at2.trade_type,
|
||||
at2.pay_type,
|
||||
at2.machine_sn,
|
||||
di.device_name,
|
||||
at2.create_by,
|
||||
IFNULL(CASE
|
||||
WHEN at2.trade_type in (10, 20, 130) then
|
||||
at2.actual_amount
|
||||
end, 0)as income,
|
||||
IFNULL(CASE
|
||||
WHEN at2.trade_type in (30, 100, 110) then
|
||||
at2.actual_amount
|
||||
end, 0) as outcome
|
||||
from
|
||||
account_trade at2
|
||||
left join sys_user su on
|
||||
at2.user_id = su.user_id
|
||||
left join sys_dept sd on
|
||||
su.dept_id = sd.dept_id
|
||||
left join device_info di on
|
||||
at2.machine_sn = di.device_sn
|
||||
where
|
||||
at2.pay_state = 3
|
||||
and at2.trade_time <![CDATA[ >= ]]> #{param.startDateTime}
|
||||
and at2.trade_time <![CDATA[ <= ]]> #{param.endDateTime}
|
||||
<if test="param.deptIdList != null and param.deptIdList.size() > 0">
|
||||
and su.dept_id IN
|
||||
<foreach collection="param.deptIdList" item="deptId" separator="," open="(" close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.searchValue != null and param.searchValue != ''">
|
||||
and (
|
||||
su.nick_name like CONCAT('%',#{param.searchValue},'%')
|
||||
or su.phonenumber = #{encryptedSearchValue}
|
||||
or su.user_id like concat('%', #{param.searchValue}, '%')
|
||||
)
|
||||
</if>
|
||||
order by at2.trade_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue