账单相关查询接口修改
This commit is contained in:
parent
2602b66a79
commit
35d5697e03
|
|
@ -44,7 +44,7 @@ public class FinancialDetailController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult count(@RequestBody FinancialCountRequest request){
|
public AjaxResult count(@RequestBody FinancialCountRequest request){
|
||||||
try {
|
try {
|
||||||
return AjaxResult.success(financialDetailService.count(request.getCountTime()));
|
return AjaxResult.success(financialDetailService.count(request.getCountTime(), request.getFinancialDetailTypes(), request.getWorkerId()));
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return AjaxResult.error(ExceptionUtil.getExceptionMessage(e));
|
return AjaxResult.error(ExceptionUtil.getExceptionMessage(e));
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,14 @@ package com.ghy.web.pojo.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class FinancialCountRequest {
|
public class FinancialCountRequest {
|
||||||
|
|
||||||
private String countTime;
|
private String countTime;
|
||||||
|
|
||||||
|
private List<Integer> financialDetailTypes;
|
||||||
|
|
||||||
|
private Integer workerId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author clunt
|
* @author clunt
|
||||||
|
|
@ -79,6 +80,8 @@ public class FinancialDetail extends BaseEntity {
|
||||||
|
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
|
private List<Integer> financialDetailTypes;
|
||||||
|
|
||||||
public FinancialDetail() {
|
public FinancialDetail() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.ghy.payment.response;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class FinancialCountResponse {
|
public class FinancialCountResponse {
|
||||||
|
|
||||||
|
|
@ -12,4 +14,8 @@ public class FinancialCountResponse {
|
||||||
private String incomeCount;
|
private String incomeCount;
|
||||||
|
|
||||||
private String flag;
|
private String flag;
|
||||||
|
|
||||||
|
private Integer payeeId;
|
||||||
|
|
||||||
|
private List<Integer> financialDetailTypes;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,11 @@ public interface FinancialDetailService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param countTime 是否查询准确时间
|
* @param countTime 是否查询准确时间
|
||||||
|
* @param financialDetailTypes 子财务单类型
|
||||||
|
* @param payeeId 收款人id
|
||||||
* @return 月份集合
|
* @return 月份集合
|
||||||
*/
|
*/
|
||||||
List<FinancialCountResponse> count(String countTime);
|
List<FinancialCountResponse> count(String countTime, List<Integer> financialDetailTypes, Integer payeeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param orderDetailId 细单id
|
* @param orderDetailId 细单id
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,12 @@ public class FinancialDetailServiceImpl implements FinancialDetailService {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FinancialCountResponse> count(String countTime) {
|
public List<FinancialCountResponse> count(String countTime, List<Integer> financialDetailTypes, Integer payeeId) {
|
||||||
FinancialCountResponse request = new FinancialCountResponse();
|
FinancialCountResponse request = new FinancialCountResponse();
|
||||||
request.setCreateTime(countTime);
|
request.setCreateTime(countTime);
|
||||||
request.setFlag("true");
|
request.setFlag("true");
|
||||||
|
request.setFinancialDetailTypes(financialDetailTypes);
|
||||||
|
request.setPayeeId(payeeId);
|
||||||
// 查询各月含有收入的费用
|
// 查询各月含有收入的费用
|
||||||
List<FinancialCountResponse> list = financialDetailMapper.count(request);
|
List<FinancialCountResponse> list = financialDetailMapper.count(request);
|
||||||
list.forEach(financialCountResponse -> {
|
list.forEach(financialCountResponse -> {
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,17 @@
|
||||||
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
|
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
|
||||||
and date_format(create_time,'%y%m%d') < date_format(#{endTime},'%y%m%d')
|
and date_format(create_time,'%y%m%d') < date_format(#{endTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="payeeId != null">
|
||||||
|
and payee_id = #{payeeId}
|
||||||
|
</if>
|
||||||
|
<if test="financialDetailTypes != null and financialDetailTypes.size > 0">
|
||||||
|
and financial_detail_type in
|
||||||
|
<foreach item="item" collection="financialDetailTypes" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectById" parameterType="long" resultMap="FinancialDetailResult">
|
<select id="selectById" parameterType="long" resultMap="FinancialDetailResult">
|
||||||
|
|
@ -146,6 +156,15 @@
|
||||||
<if test="flag == 'false'">
|
<if test="flag == 'false'">
|
||||||
and pay_money <= 0
|
and pay_money <= 0
|
||||||
</if>
|
</if>
|
||||||
|
<if test="payeeId != null">
|
||||||
|
and payee_id = #{payeeId}
|
||||||
|
</if>
|
||||||
|
<if test="financialDetailTypes != null and financialDetailTypes.size > 0">
|
||||||
|
and financial_detail_type in
|
||||||
|
<foreach item="item" collection="financialDetailTypes" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
group by DATE_FORMAT(create_time,'%Y-%m') order by create_time desc
|
group by DATE_FORMAT(create_time,'%Y-%m') order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue