Commit 42c89eef04bef6b46c718f6378ef533afee1867f

Authored by yeqianyong
1 parent 2915433b

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

@@ -4,17 +4,14 @@ import com.lframework.xingyun.sc.bo.ledger.receipt.GetReceiptLedgerInfoBo; @@ -4,17 +4,14 @@ import com.lframework.xingyun.sc.bo.ledger.receipt.GetReceiptLedgerInfoBo;
4 import com.lframework.xingyun.sc.bo.ledger.receipt.QueryReceiptLedgerInfoBo; 4 import com.lframework.xingyun.sc.bo.ledger.receipt.QueryReceiptLedgerInfoBo;
5 import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo; 5 import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo;
6 import com.lframework.xingyun.sc.utils.CommonUtil; 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 import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService; 8 import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService;
9 -import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo;  
10 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo; 9 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
11 import com.lframework.starter.web.core.utils.PageResultUtil; 10 import com.lframework.starter.web.core.utils.PageResultUtil;
12 11
13 import javax.annotation.Resource; 12 import javax.annotation.Resource;
14 import javax.validation.constraints.NotBlank; 13 import javax.validation.constraints.NotBlank;
15 import com.lframework.starter.common.exceptions.impl.DefaultClientException; 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 import io.swagger.annotations.ApiOperation; 15 import io.swagger.annotations.ApiOperation;
19 import com.lframework.starter.common.utils.CollectionUtil; 16 import com.lframework.starter.common.utils.CollectionUtil;
20 import io.swagger.annotations.Api; 17 import io.swagger.annotations.Api;
@@ -138,7 +135,7 @@ public class ReceiptLedgerInfoController extends DefaultBaseController { @@ -138,7 +135,7 @@ public class ReceiptLedgerInfoController extends DefaultBaseController {
138 @ApiOperation("台账报表") 135 @ApiOperation("台账报表")
139 @HasPermission({"account-manage:ledger-detail:query"}) 136 @HasPermission({"account-manage:ledger-detail:query"})
140 @GetMapping("/report") 137 @GetMapping("/report")
141 - public InvokeResult<PageResult<ReceiptLedgerReportBo>> report(@Valid QueryReceiptLedgerInfoVo vo) { 138 + public InvokeResult<PageResult<ReceiptLedgerReportBo>> report(@Valid ReceiptLedgerReportVo vo) {
142 PageResult<ReceiptLedgerReportBo> pageResult = receiptLedgerInfoService.report(getPageIndex(vo), getPageSize(vo), vo); 139 PageResult<ReceiptLedgerReportBo> pageResult = receiptLedgerInfoService.report(getPageIndex(vo), getPageSize(vo), vo);
143 return InvokeResultBuilder.success(pageResult); 140 return InvokeResultBuilder.success(pageResult);
144 } 141 }
@@ -29,14 +29,11 @@ import com.lframework.xingyun.sc.service.customer.CustomerCreditService; @@ -29,14 +29,11 @@ import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
29 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService; 29 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
30 import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService; 30 import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
31 import com.lframework.xingyun.sc.utils.CommonUtil; 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 import org.apache.commons.collections4.CollectionUtils; 33 import org.apache.commons.collections4.CollectionUtils;
35 import org.springframework.transaction.annotation.Transactional; 34 import org.springframework.transaction.annotation.Transactional;
36 import com.lframework.xingyun.sc.mappers.ReceiptLedgerInfoMapper; 35 import com.lframework.xingyun.sc.mappers.ReceiptLedgerInfoMapper;
37 import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService; 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 import org.springframework.stereotype.Service; 37 import org.springframework.stereotype.Service;
41 38
42 import javax.annotation.Resource; 39 import javax.annotation.Resource;
@@ -391,7 +388,7 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge @@ -391,7 +388,7 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge
391 } 388 }
392 389
393 @Override 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 Assert.greaterThanZero(pageIndex); 392 Assert.greaterThanZero(pageIndex);
396 Assert.greaterThanZero(pageSize); 393 Assert.greaterThanZero(pageSize);
397 // 开启分页 394 // 开启分页
@@ -4,6 +4,7 @@ import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo; @@ -4,6 +4,7 @@ import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo;
4 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo; 4 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
5 import com.lframework.starter.web.core.mapper.BaseMapper; 5 import com.lframework.starter.web.core.mapper.BaseMapper;
6 import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo; 6 import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
  7 +import com.lframework.xingyun.sc.vo.ledger.receipt.ReceiptLedgerReportVo;
7 import org.apache.ibatis.annotations.Param; 8 import org.apache.ibatis.annotations.Param;
8 9
9 import java.util.List; 10 import java.util.List;
@@ -47,7 +48,7 @@ public interface ReceiptLedgerInfoMapper extends BaseMapper<ReceiptLedgerInfo> { @@ -47,7 +48,7 @@ public interface ReceiptLedgerInfoMapper extends BaseMapper<ReceiptLedgerInfo> {
47 * @param vo 查询条件 48 * @param vo 查询条件
48 * @return List<ReceiptLedgerReportBo> 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,13 +2,11 @@ package com.lframework.xingyun.sc.service.ledger;
2 2
3 import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo; 3 import com.lframework.xingyun.sc.bo.ledger.receipt.ReceiptLedgerReportBo;
4 import com.lframework.xingyun.sc.entity.ShipmentsOrderInfo; 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 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo; 6 import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
8 import com.lframework.starter.web.core.service.BaseMpService; 7 import com.lframework.starter.web.core.service.BaseMpService;
9 import com.lframework.starter.web.core.components.resp.PageResult; 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 import java.util.List; 10 import java.util.List;
13 11
14 /** 12 /**
@@ -96,5 +94,5 @@ public interface ReceiptLedgerInfoService extends BaseMpService<ReceiptLedgerInf @@ -96,5 +94,5 @@ public interface ReceiptLedgerInfoService extends BaseMpService<ReceiptLedgerInf
96 * @param vo 查询条件 94 * @param vo 查询条件
97 * @return PageResult<ReceiptLedgerReportBo> 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,12 +208,32 @@
208 d.name as dept_name, 208 d.name as dept_name,
209 tb.region, 209 tb.region,
210 r.name as region_name, 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 from base_data_customer_short tb 213 from base_data_customer_short tb
213 left join sys_dept d on tb.dept_id = d.id 214 left join sys_dept d on tb.dept_id = d.id
214 left join sys_dept r on tb.region = r.id 215 left join sys_dept r on tb.region = r.id
215 left join customer_credit cc on tb.customer_id = cc.company_id 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 group by tb.short_name,tb.type,tb.dept_id,tb.region 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 </select> 237 </select>
218 238
219 <select id="statisticsDeptByShortName" resultType="java.util.Map"> 239 <select id="statisticsDeptByShortName" resultType="java.util.Map">