Browse Source

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

release_toaliyun_real
luozukai 6 years ago
parent
commit
271f6665d7
3 changed files with 29 additions and 19 deletions
  1. +0
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java
  3. +26
    -18
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java

+ 0
- 1
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java View File

@@ -97,7 +97,6 @@ public class WxBillAllController extends BaseController {
return new ResultData(result);
}


/**
* 应收、承付商户列表
* @param wxBillAll


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

@@ -137,4 +137,7 @@ public class WxBillAll extends BaseEntity {
@SortColumn(column = "payOut")
private Integer payOut;

@Transient
private Integer balance;

}

+ 26
- 18
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java View File

@@ -1532,17 +1532,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
public Map<String, Object> getReceiveAndPayBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) {
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBillAllMapper.getReceiveAndPayBillAsPage(record));
Map<String, Object> result = new HashMap<>();
pageInfo.getList().stream().forEach(e ->{
if(e.get("receivePay")==null){
e.put("receivePay",0);
}
if(e.get("payOut")==null){
e.put("payOut",0);
}
BigDecimal r = new BigDecimal(e.get("receivePay")==null?"0":e.get("receivePay").toString());
BigDecimal p = new BigDecimal(e.get("payOut")==null?"0":e.get("payOut").toString());
e.put("balance",r.subtract(p));
});
initBalance(pageInfo.getList());
result.put("pageInfo", pageInfo);
return result;
}
@@ -1582,22 +1572,40 @@ public class WxBillAllServiceImpl implements WxBillAllService {
excelService.exportExcel(list, null, name, OweMerchantVo.class, name + ".xlsx", response, false);
}

public void initBalance(List<Map<String, Object>> data){
data.stream().forEach(e ->{
if(e.get("receivePay")==null){
e.put("receivePay",0);
}
if(e.get("payOut")==null){
e.put("payOut",0);
}
BigDecimal r = new BigDecimal(e.get("receivePay")==null?"0":e.get("receivePay").toString());
BigDecimal p = new BigDecimal(e.get("payOut")==null?"0":e.get("payOut").toString());
e.put("balance",r.subtract(p));
});
}

@Override
public void exportReceiveAndPayBillAsPage(WxBillAll record, HttpServletRequest request, HttpServletResponse response) {
List<Map<String, Object>> data = wxBillAllMapper.getReceiveAndPayBillAsPage(record);
initBalance(data);

List<ReceivedAndPayVo> list = new ArrayList<>();
for (Map<String, Object> map : data) {
ReceivedAndPayVo oweMerchantVo = new ReceivedAndPayVo();
oweMerchantVo.setLinkPerson((String) map.get("linkPerson"));
oweMerchantVo.setName((String) map.get("merchantName"));
oweMerchantVo.setName((String) map.get("name"));
oweMerchantVo.setLinkPhone((String) map.get("linkPhone"));
oweMerchantVo.setShopNumber((String) map.get("shopNumber"));
//
// oweMerchantVo.setShopNumber(new BigDecimal(subZeroAndDot(map.get("rentReceivePay").toString())));
// oweMerchantVo.setPropertyReceivePay(new BigDecimal(subZeroAndDot(map.get("propertyReceivePay").toString())));
// oweMerchantVo.setDepositReceivePay(new BigDecimal(subZeroAndDot(map.get("depositReceivePay").toString())));
// oweMerchantVo.setOtherReceivePay(new BigDecimal(subZeroAndDot(map.get("otherReceivePay").toString())));
// oweMerchantVo.setTotalReceivePay(new BigDecimal(subZeroAndDot(map.get("totalReceivePay").toString())));
if(EnumRentShopType.POINT.getCode().equals(map.get("type"))){
oweMerchantVo.setShopType("多经点位");
}else if(EnumRentShopType.SHOP.getCode().equals(map.get("type"))){
oweMerchantVo.setShopType("商铺");
}
oweMerchantVo.setReceivePay(map.get("receivePay")==null?"0":map.get("receivePay").toString());
oweMerchantVo.setPayOut(map.get("payOut")==null?"0":map.get("payOut").toString());
oweMerchantVo.setBalance(map.get("balance")==null?"0":map.get("balance").toString());
list.add(oweMerchantVo);
}
String name = "商户列表";


Loading…
Cancel
Save