Commit 42c89eef04bef6b46c718f6378ef533afee1867f

Authored by yeqianyong
1 parent 2915433b

楚江erp:台账报表相关接口开发

... ... @@ -4,17 +4,14 @@ import com.lframework.xingyun.sc.bo.ledger.receipt.GetReceiptLedgerInfoBo;
4 4 import com.lframework.xingyun.sc.bo.ledger.receipt.QueryReceiptLedgerInfoBo;
5 5 import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo;
6 6 import com.lframework.xingyun.sc.utils.CommonUtil;
7   -import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
  7 +import com.lframework.xingyun.sc.vo.ledger.receipt.*;
8 8 import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService;
9   -import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo;
10 9 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
11 10 import com.lframework.starter.web.core.utils.PageResultUtil;
12 11
13 12 import javax.annotation.Resource;
14 13 import javax.validation.constraints.NotBlank;
15 14 import com.lframework.starter.common.exceptions.impl.DefaultClientException;
16   -import com.lframework.xingyun.sc.vo.ledger.receipt.ReceiptLedgerInfoSplitVo;
17   -import com.lframework.xingyun.sc.vo.ledger.receipt.UpdateReceiptLedgerInfoVo;
18 15 import io.swagger.annotations.ApiOperation;
19 16 import com.lframework.starter.common.utils.CollectionUtil;
20 17 import io.swagger.annotations.Api;
... ... @@ -138,7 +135,7 @@ public class ReceiptLedgerInfoController extends DefaultBaseController {
138 135 @ApiOperation("台账报表")
139 136 @HasPermission({"account-manage:ledger-detail:query"})
140 137 @GetMapping("/report")
141   - public InvokeResult<PageResult<ReceiptLedgerReportBo>> report(@Valid QueryReceiptLedgerInfoVo vo) {
  138 + public InvokeResult<PageResult<ReceiptLedgerReportBo>> report(@Valid ReceiptLedgerReportVo vo) {
142 139 PageResult<ReceiptLedgerReportBo> pageResult = receiptLedgerInfoService.report(getPageIndex(vo), getPageSize(vo), vo);
143 140 return InvokeResultBuilder.success(pageResult);
144 141 }
... ...
... ... @@ -29,14 +29,11 @@ import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
29 29 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
30 30 import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
31 31 import com.lframework.xingyun.sc.utils.CommonUtil;
32   -import com.lframework.xingyun.sc.vo.ledger.receipt.ReceiptLedgerInfoSplitVo;
33   -import com.lframework.xingyun.sc.vo.ledger.receipt.UpdateReceiptLedgerInfoVo;
  32 +import com.lframework.xingyun.sc.vo.ledger.receipt.*;
34 33 import org.apache.commons.collections4.CollectionUtils;
35 34 import org.springframework.transaction.annotation.Transactional;
36 35 import com.lframework.xingyun.sc.mappers.ReceiptLedgerInfoMapper;
37 36 import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService;
38   -import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo;
39   -import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
40 37 import org.springframework.stereotype.Service;
41 38
42 39 import javax.annotation.Resource;
... ... @@ -391,7 +388,7 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge
391 388 }
392 389
393 390 @Override
394   - public PageResult<ReceiptLedgerReportBo> report(Integer pageIndex, Integer pageSize, QueryReceiptLedgerInfoVo vo) {
  391 + public PageResult<ReceiptLedgerReportBo> report(Integer pageIndex, Integer pageSize, ReceiptLedgerReportVo vo) {
395 392 Assert.greaterThanZero(pageIndex);
396 393 Assert.greaterThanZero(pageSize);
397 394 // 开启分页
... ...
... ... @@ -4,6 +4,7 @@ import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo;
4 4 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
5 5 import com.lframework.starter.web.core.mapper.BaseMapper;
6 6 import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
  7 +import com.lframework.xingyun.sc.vo.ledger.receipt.ReceiptLedgerReportVo;
7 8 import org.apache.ibatis.annotations.Param;
8 9
9 10 import java.util.List;
... ... @@ -47,7 +48,7 @@ public interface ReceiptLedgerInfoMapper extends BaseMapper<ReceiptLedgerInfo> {
47 48 * @param vo 查询条件
48 49 * @return List<ReceiptLedgerReportBo>
49 50 */
50   - List<ReceiptLedgerReportBo> report(@Param("vo") QueryReceiptLedgerInfoVo vo);
  51 + List<ReceiptLedgerReportBo> report(@Param("vo") ReceiptLedgerReportVo vo);
51 52
52 53 /**
53 54 * 根据客户简称统计欠款金额
... ...
... ... @@ -2,13 +2,11 @@ package com.lframework.xingyun.sc.service.ledger;
2 2
3 3 import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo;
4 4 import com.lframework.xingyun.sc.entity.ShipmentsOrderInfo;
5   -import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo;
6   -import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
  5 +import com.lframework.xingyun.sc.vo.ledger.receipt.*;
7 6 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
8 7 import com.lframework.starter.web.core.service.BaseMpService;
9 8 import com.lframework.starter.web.core.components.resp.PageResult;
10   -import com.lframework.xingyun.sc.vo.ledger.receipt.ReceiptLedgerInfoSplitVo;
11   -import com.lframework.xingyun.sc.vo.ledger.receipt.UpdateReceiptLedgerInfoVo;
  9 +
12 10 import java.util.List;
13 11
14 12 /**
... ... @@ -96,5 +94,5 @@ public interface ReceiptLedgerInfoService extends BaseMpService<ReceiptLedgerInf
96 94 * @param vo 查询条件
97 95 * @return PageResult<ReceiptLedgerReportBo>
98 96 */
99   - PageResult<ReceiptLedgerReportBo> report(Integer pageIndex, Integer pageSize, QueryReceiptLedgerInfoVo vo);
  97 + PageResult<ReceiptLedgerReportBo> report(Integer pageIndex, Integer pageSize, ReceiptLedgerReportVo vo);
100 98 }
... ...
  1 +package com.lframework.xingyun.sc.vo.ledger.receipt;
  2 +
  3 +import com.lframework.starter.web.core.vo.BaseVo;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +import java.io.Serializable;
  9 +import java.math.BigDecimal;
  10 +
  11 +@Data
  12 +public class ReceiptLedgerReportVo extends PageVo implements BaseVo, Serializable {
  13 +
  14 + private static final long serialVersionUID = 1L;
  15 +
  16 + /**
  17 + * 办事处名称
  18 + */
  19 + @ApiModelProperty("办事处名称")
  20 + private String deptName;
  21 +
  22 + /**
  23 + * 欠款金额范围
  24 + */
  25 + @ApiModelProperty("欠款金额范围")
  26 + private String debtAmountScope;
  27 +
  28 + /**
  29 + * 欠款起始值
  30 + */
  31 + @ApiModelProperty("欠款金额")
  32 + private BigDecimal debtStartValue;
  33 +
  34 + /**
  35 + * 欠款结束值
  36 + */
  37 + @ApiModelProperty("欠款结束值")
  38 + private BigDecimal debtEndValue;
  39 +
  40 + /**
  41 + * 客户类型
  42 + */
  43 + @ApiModelProperty("客户类型")
  44 + private String customerType;
  45 +
  46 + /**
  47 + * 欠款状态
  48 + */
  49 + @ApiModelProperty("欠款状态")
  50 + private String debtStatus;
  51 +}
... ...
... ... @@ -208,12 +208,32 @@
208 208 d.name as dept_name,
209 209 tb.region,
210 210 r.name as region_name,
211   - max(cc.company_credit_limit) as quota
  211 + max(cc.company_credit_limit) as quota,
  212 + sum(rl.end_account_receivable) as debtTotal
212 213 from base_data_customer_short tb
213 214 left join sys_dept d on tb.dept_id = d.id
214 215 left join sys_dept r on tb.region = r.id
215 216 left join customer_credit cc on tb.customer_id = cc.company_id
  217 + left join receipt_ledger_info rl on tb.id = rl.customer_short_id
  218 + <where>
  219 + <if test="vo.customerType != null and vo.customerType != ''">
  220 + and tb.type = #{vo.customerType}
  221 + </if>
  222 + <if test="vo.debtStatus != null and vo.debtStatus != ''">
  223 + and rl.debt_status = #{vo.debtStatus}
  224 + </if>
  225 + <if test="vo.deptName != null and vo.deptName != ''">
  226 + and d.name like concat('%', #{vo.deptName}, '%')
  227 + </if>
  228 + </where>
216 229 group by tb.short_name,tb.type,tb.dept_id,tb.region
  230 + having 1=1
  231 + <if test="vo.debtStartValue != null">
  232 + and sum(rl.end_account_receivable) >= #{debtStartValue}
  233 + </if>
  234 + <if test="vo.debtEndValue != null">
  235 + and sum(rl.end_account_receivable) &lt;= #{debtEndValue}
  236 + </if>
217 237 </select>
218 238
219 239 <select id="statisticsDeptByShortName" resultType="java.util.Map">
... ...