From 4f70cd391d6757db86b45551860d5e69e679956e Mon Sep 17 00:00:00 2001 From: luozukai Date: Sun, 1 Sep 2019 14:04:25 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=B4=A6=E5=8D=95=E7=BB=93=E7=AE=97]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/domain/po/WxBillSettle.java | 11 +++ .../mapper/WxBillSettleRecordMapper.java | 1 + .../service/impl/WxBillSettleServiceImpl.java | 10 +- .../impl/WxRentContractServiceImpl.java | 4 +- .../resources/mapper/WxBillSettleMapper.xml | 96 ++++++++++++++++--- .../mapper/WxBillSettleRecordMapper.xml | 4 + 6 files changed, 107 insertions(+), 19 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillSettle.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillSettle.java index b0769f873..029243497 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillSettle.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillSettle.java @@ -31,19 +31,28 @@ public class WxBillSettle extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="结算单号",name="settleNumber") @Excel(name="结算单号",width = 20,orderNum = "1") private String settleNumber; + @Transient + @Excel(name="结算商户",width = 20,orderNum = "2") + private String merchantName; @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") private Long merchantId; @io.swagger.annotations.ApiModelProperty(value="0待确认1未清算结余金额2结算完成",name="status") + @Excel(name="结算状态",width = 20,orderNum = "8") private Integer status; @io.swagger.annotations.ApiModelProperty(value="审核状态0未审核1审核中2审核完成3驳回4异常终止5撤回",name="applyStatus") + @Excel(name="审批状态",width = 20,orderNum = "9") private Integer applyStatus; + @Excel(name="收款(元)",width = 20,orderNum = "4") @io.swagger.annotations.ApiModelProperty(value="收款",name="receiveMoney") private Long receiveMoney; @io.swagger.annotations.ApiModelProperty(value="承付",name="payMoney") + @Excel(name="承付(元)",width = 20,orderNum = "5") private Long payMoney; @io.swagger.annotations.ApiModelProperty(value="结算时间",name="settletime") + @Excel(name="结算时间",width = 20,orderNum = "7") private Date settletime; + @Excel(name="创建时间",width = 20,orderNum = "3") @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") private Date createtime; @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") @@ -55,6 +64,7 @@ public class WxBillSettle extends BaseEntity { //结余金额 @Transient + @Excel(name="结算金额(元)",width = 20,orderNum = "6") private Long balance; @Transient @@ -66,4 +76,5 @@ public class WxBillSettle extends BaseEntity { @Transient @io.swagger.annotations.ApiModelProperty(value = "结单记录", name = "settleRecordList") private List settleRecordList; + } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxBillSettleRecordMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxBillSettleRecordMapper.java index a602d439a..af9ed274b 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxBillSettleRecordMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxBillSettleRecordMapper.java @@ -15,5 +15,6 @@ public interface WxBillSettleRecordMapper extends CommonMapper listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillSettleMapper.findList(record)); + PageInfo pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillSettleMapper.findList(record)); + pageInfo.getList().stream().forEach(e->{ + e.setBalance(e.getReceiveMoney() - e.getPayMoney()); + }); + return pageInfo; } @Override @@ -79,8 +83,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { billSettle.setSettleRecordList(wxBillSettleRecordMapper.findList(wxBillSettleRecord)); //计算结余金额 - //todo: - + Long sumSettleMoney = wxBillSettleRecordMapper.getSumMoneyBySettleId(billSettle); + billSettle.setBalance(billSettle.getReceiveMoney() - (billSettle.getPayMoney()+sumSettleMoney)); } return billSettle; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 137a7a8e6..48a71feae 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -373,7 +373,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { } } } - ratioVo.setUseRatio(ratioVo.getUseRatio().substring(0,ratioVo.getUseRatio().lastIndexOf(","))+"]"); + if(!"[".equals(ratioVo.getUseRatio())) { + ratioVo.setUseRatio(ratioVo.getUseRatio().substring(0, ratioVo.getUseRatio().lastIndexOf(",")) + "]"); + } return ratioVo; } diff --git a/mallinkService/src/main/resources/mapper/WxBillSettleMapper.xml b/mallinkService/src/main/resources/mapper/WxBillSettleMapper.xml index a4a9fb450..d33905470 100644 --- a/mallinkService/src/main/resources/mapper/WxBillSettleMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillSettleMapper.xml @@ -8,12 +8,12 @@ - - + + - + @@ -24,22 +24,88 @@ where 1=1 - and `id` = #{id} - and `tenant_id` = #{tenantId} - - - and id in - - #{idItem} - - + and s.`id` = #{id} + and s.`tenant_id` = #{tenantId} + order by ${sortColumns} diff --git a/mallinkService/src/main/resources/mapper/WxBillSettleRecordMapper.xml b/mallinkService/src/main/resources/mapper/WxBillSettleRecordMapper.xml index 7356c8181..55436f141 100644 --- a/mallinkService/src/main/resources/mapper/WxBillSettleRecordMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillSettleRecordMapper.xml @@ -45,6 +45,10 @@ + +