Просмотр исходного кода

[合同][修改][开发结算单]

release_toaliyun_real
luozukai 6 лет назад
Родитель
Сommit
d7a4f81bfc
3 измененных файлов: 27 добавлений и 13 удалений
  1. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBillSettle.java
  2. +1
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java
  3. +21
    -8
      mallinkService/src/main/resources/mapper/WxBillSettleMapper.xml

+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBillSettle.java Просмотреть файл

@@ -87,4 +87,9 @@ public class WxBillSettle extends BaseEntity {
@Transient
@io.swagger.annotations.ApiModelProperty(value="清算方向 1商场结款 2商户结款",name="settleWay")
private Integer settleWay;

@Transient
@io.swagger.annotations.ApiModelProperty(value="流向 0流入 1流出",name="direction")
private Integer direction;

}

+ 1
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java Просмотреть файл

@@ -60,11 +60,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {

@Override
public PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) {
PageInfo<WxBillSettle> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillSettleMapper.findList(record));
pageInfo.getList().stream().forEach(e->{
e.setBalance(e.getReceiveMoney() - e.getPayMoney());
});
return pageInfo;
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillSettleMapper.findList(record));
}

@Override


+ 21
- 8
mallinkService/src/main/resources/mapper/WxBillSettleMapper.xml Просмотреть файл

@@ -24,23 +24,32 @@

<sql id="dynamicWhereConditions">
where 1=1
<if test=" null != id ">and s.`id` = #{id}</if>
<if test=" null != tenantId ">and s.`tenant_id` = #{tenantId}</if>
<if test=" null != merchantName and merchantName !='' ">and m.name like concat('%', #{merchantName},'%')</if>
<if test=" null != id ">and tt.`id` = #{id}</if>
<if test=" null != tenantId ">and tt.`tenant_id` = #{tenantId}</if>
<if test=" null != merchantName and merchantName !='' ">and tt.merchantName like concat('%', #{merchantName},'%')</if>
<if test="startTime != null and startTime !=''">
and createtime &gt;= #{startTime}
and tt.createtime &gt;= #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and createtime &lt;= #{endTime}
and tt.createtime &lt;= #{endTime}
</if>
<if test=" null != settleNumber and settleNumber !='' ">and tt.`settle_number` = #{settleNumber}</if>
<if test=" null != status and status !=''">and tt.`status` = #{status}</if>
<if test=" null != applyStatus and applyStatus !=''">and tt.`apply_status` = #{applyStatus}</if>
<if test=" null != direction and direction !=''">
<if test="0 == direction">
balance >0
</if>
<if test="1 == direction">
balance &lt;0
</if>
</if>
<if test=" null != settleNumber and settleNumber !='' ">and s.`settle_number` = #{settleNumber}</if>
<if test=" null != status and status !=''">and s.`status` = #{status}</if>
<if test=" null != applyStatus and applyStatus !=''">and s.`apply_status` = #{applyStatus}</if>

<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxBillSettle" resultMap="BaseResultMap">
select tt.*,(tt.receiveMoney-tt.payMoney) balance from (
select s.*,m.name merchantName,
(select IFNULL(sum(bill.receive_pay),0) from wx_bill_settle_bill bb left join
(select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金'
@@ -115,6 +124,10 @@
on(bb.bill_id=bill.id) where bb.settle_id = s.id and bb.type=1
) payMoney
from wx_bill_settle s left JOIN wx_merchant m on(s.merchant_id=m.id)
) tt




<include refid="dynamicWhereConditions"/>
</select>


Загрузка…
Отмена
Сохранить