Browse Source

[修改][手续费][开发]

release_toaliyun_real
luozukai 6 years ago
parent
commit
8a6811886d
4 changed files with 57 additions and 24 deletions
  1. +9
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java
  2. +29
    -12
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  3. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java
  4. +17
    -10
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml

+ 9
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java View File

@@ -152,4 +152,13 @@ public class WxBillAll extends BaseEntity {
@io.swagger.annotations.ApiModelProperty(value = "多个类型", name = "typeStr")
private String typeStr;


@TableField(exist = false)
private Integer servicePayRate;

@TableField(exist = false)
private Integer limitStart;
@TableField(exist = false)
private Integer limitEnd;

}

+ 29
- 12
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java View File

@@ -1719,19 +1719,36 @@ public class WxBillAllServiceImpl implements WxBillAllService {

@Override
public Map<String, Object> getReceiveAndPayBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) {
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBillAllMapper.getReceiveAndPayBillAsPage(record));
pageInfo.getList().stream().forEach(e->{
if(e.get("receivePay") == null){
e.put("receivePay",0);
}
if(e.get("payOut") == null){
e.put("payOut",0);
}
if(e.get("balance") == null){
e.put("balance",0);
}
});
Map<String, Object> result = new HashMap<>();
record.setLimitStart(0);
record.setLimitEnd(Integer.MAX_VALUE);
List totalList = wxBillAllMapper.getReceiveAndPayBillAsPage(record);
if(CollectionUtils.isEmpty(totalList)){
PageHelper.startPage(pageNum, pageSize);
PageInfo<Map<String, Object>> pageInfo = new PageInfo(new ArrayList());
pageInfo.setPages(0);
pageInfo.setTotal(0);
PageHelper.clearPage();
result.put("pageInfo", pageInfo);
return result;
}

int total = totalList.size();
int pages;
if(total % pageSize == 0){
pages = total / pageSize;
}else{
pages = total / pageSize +1;
}
record.setLimitStart((pageNum -1) * pageSize);
record.setLimitEnd(pageSize);
List<Map<String, Object>> list = wxBillAllMapper.getReceiveAndPayBillAsPage(record);

PageHelper.startPage(pageNum, pageSize);
PageInfo<Map<String, Object>> pageInfo = new PageInfo(list);
pageInfo.setPages(pages);
pageInfo.setTotal(total);
PageHelper.clearPage();
result.put("pageInfo", pageInfo);
return result;
}


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java View File

@@ -141,8 +141,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {

@Override
public ResultData saveOrUpdate(WxBillDaily record, MallUserInfo user) {
int receivepay = record.getReceivePay().intValue();
int pay = record.getPay().intValue();
int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue();
int pay = record.getPay()==null?0:record.getPay().intValue();
if(pay>receivepay){
return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(),"实收金额不能大于实际应收金额");
}


+ 17
- 10
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml View File

@@ -739,26 +739,28 @@
</select>

<select id="getReceiveAndPayBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">

select tt.* from (
select m.tenant_id,m.id,m.name,ws.shop_number shopNumber,ws.type,m.link_person linkPerson,m.link_phone linkPhone,
xb.title business,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.rent_shop_type,
ifnull(round(
(select sum(bill.receive_pay) from (
select merchant_id,receive_pay from wx_bill_rent where is_preview = 0 and status not in(3,6)
(select sum(bill.receive_pay)+sum(bill.late_pay_price)+bill.receivePay from (
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,late_pay_price from wx_bill_rent where is_preview = 0 and status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_rent_deposit where status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_rent_deposit where status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_property where is_preview = 0 and status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,late_pay_price from wx_bill_property where is_preview = 0 and status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_property_deposit where status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_property_deposit where status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_daily where type in(1,2,3) and status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_daily where type in(1,2,3) and status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_other where status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_other where status not in(3,6)
union all
select merchant_id,receive_pay from wx_bill_other_deposit where status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_other_deposit where status not in(3,6)
) bill where bill.merchant_id = m.id
)/100,2),0) receivePay,

ifnull(round(
(select sum(ss.money) from (
select ms.subsidy money,mm.id
@@ -777,7 +779,7 @@
select receive_pay money,merchant_id id from wx_bill_other_deposit where status = 3
)ss where ss.id = m.id
)/100,2),0) payOut,
(ifnull(round(
(select sum(bill.receive_pay) from (
select merchant_id,receive_pay from wx_bill_rent where is_preview = 0 and status not in(3,6)
@@ -813,7 +815,7 @@
select receive_pay money,merchant_id id from wx_bill_other_deposit where status = 3
)ss where ss.id = m.id
)/100,2),0)) balance
from wx_merchant m
left join (select ms.merchant_id,s.type,GROUP_CONCAT(s.shop_number) as shop_number
from wx_merchant_shop ms inner join wx_shop s on ms.shop_id=s.id where ms.is_del=0
@@ -822,6 +824,7 @@
left join wx_rent_contract rc on(rc.merchant_id = m.id)
where m.status=1
) tt where 1=1

<if test=" null != tenantId"> and tt.tenant_id = #{tenantId} </if>
<if test=" null != merchantId"> and tt.id = #{merchantId} </if>
<if test=" null != merchantName and ''!=merchantName">and tt.name like concat('%', #{merchantName},'%')</if>
@@ -829,6 +832,10 @@
and (receivePay >0 or payOut>0)
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by tt.id desc </if>

<if test="null != limitStart and null != limitEnd">
limit #{limitStart},#{limitEnd}
</if>
</select>

<select id="allDepositList" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">


Loading…
Cancel
Save