Kaynağa Gözat

[账单][修改][手续费]

release_toaliyun_real
gongbiao 6 yıl önce
ebeveyn
işleme
2b82fad89b
18 değiştirilmiş dosya ile 310 ekleme ve 346 silme
  1. +1
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillDepositController.java
  2. +1
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyDepositController.java
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java
  4. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java
  5. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxBillDepositMapper.java
  6. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyDepositMapper.java
  7. +6
    -4
      mallinkService/src/main/java/com/iformall/service/WxBillDepositService.java
  8. +4
    -2
      mallinkService/src/main/java/com/iformall/service/WxBillPropertyDepositService.java
  9. +76
    -67
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  10. +20
    -26
      mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java
  11. +21
    -17
      mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java
  12. +20
    -25
      mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java
  13. +20
    -26
      mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java
  14. +21
    -17
      mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java
  15. +58
    -79
      mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java
  16. +35
    -60
      mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java
  17. +10
    -9
      mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml
  18. +9
    -6
      mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml

+ 1
- 3
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillDepositController.java Dosyayı Görüntüle

@@ -14,8 +14,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;


import java.util.Map;

/** /**
* @author gongbiao * @author gongbiao
*/ */
@@ -38,7 +36,7 @@ public class WxBillDepositController extends BaseController {
wxBillDeposit = new WxBillDeposit(); wxBillDeposit = new WxBillDeposit();
} }
wxBillDeposit.setTenantId(getTenantId()); wxBillDeposit.setTenantId(getTenantId());
final PageInfo<Map<String, Object>> page = wxBillDepositService.listAsPage(wxBillDeposit, pageNum, pageSize);
final PageInfo<WxBillDeposit> page = wxBillDepositService.listAsPage(wxBillDeposit, pageNum, pageSize);
return new ResultData(page); return new ResultData(page);
} }




+ 1
- 3
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyDepositController.java Dosyayı Görüntüle

@@ -14,8 +14,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;


import java.util.Map;

/** /**
* @author gongbiao * @author gongbiao
*/ */
@@ -38,7 +36,7 @@ public class WxBillPropertyDepositController extends BaseController {
wxBillPropertyDeposit = new WxBillPropertyDeposit(); wxBillPropertyDeposit = new WxBillPropertyDeposit();
} }
wxBillPropertyDeposit.setTenantId(getTenantId()); wxBillPropertyDeposit.setTenantId(getTenantId());
PageInfo<Map<String, Object>> result = wxBillPropertyDepositService.listAsPage(wxBillPropertyDeposit, pageNum, pageSize);
PageInfo<WxBillPropertyDeposit> result = wxBillPropertyDepositService.listAsPage(wxBillPropertyDeposit, pageNum, pageSize);
return new ResultData(result); return new ResultData(result);
} }




+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java Dosyayı Görüntüle

@@ -23,6 +23,9 @@ public class WxBillDeposit extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String merchantName; private String merchantName;


@TableField(exist = false)
private String shopNumber;

@io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId")
private Long rentContractId; private Long rentContractId;
@io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay") @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay")


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java Dosyayı Görüntüle

@@ -21,6 +21,9 @@ public class WxBillPropertyDeposit extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String merchantName; private String merchantName;


@TableField(exist = false)
private String shopNumber;

@io.swagger.annotations.ApiModelProperty(value="物业合同ID",name="propertyContractId") @io.swagger.annotations.ApiModelProperty(value="物业合同ID",name="propertyContractId")
private Long propertyContractId; private Long propertyContractId;
@io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay") @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay")


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxBillDepositMapper.java Dosyayı Görüntüle

@@ -14,7 +14,7 @@ public interface WxBillDepositMapper extends CommonMapper<WxBillDeposit, Long> {


List<WxBillDeposit> findList(WxBillDeposit wxBillDeposit); List<WxBillDeposit> findList(WxBillDeposit wxBillDeposit);


List<Map<String,Object>> queryBillDepositList(WxBillDeposit record);
List<WxBillDeposit> queryBillDepositList(WxBillDeposit record);


Map<String,Object> queryPayInfo(Map<String,Object> params); Map<String,Object> queryPayInfo(Map<String,Object> params);




+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyDepositMapper.java Dosyayı Görüntüle

@@ -14,7 +14,7 @@ public interface WxBillPropertyDepositMapper extends CommonMapper<WxBillProperty


List<WxBillPropertyDeposit> findList(WxBillPropertyDeposit wxBillPropertyDeposit); List<WxBillPropertyDeposit> findList(WxBillPropertyDeposit wxBillPropertyDeposit);


List<Map<String,Object>> queryBillDepositList(WxBillPropertyDeposit record);
List<WxBillPropertyDeposit> queryBillDepositList(WxBillPropertyDeposit record);


Map<String,Object> queryPayInfo(Map<String,Object> params); Map<String,Object> queryPayInfo(Map<String,Object> params);




+ 6
- 4
mallinkService/src/main/java/com/iformall/service/WxBillDepositService.java Dosyayı Görüntüle

@@ -4,8 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillDeposit; import com.iformall.domain.po.WxBillDeposit;

import java.util.Map;
import com.iformall.domain.po.WxPayAccountBill;


public interface WxBillDepositService { public interface WxBillDepositService {


@@ -17,7 +16,7 @@ public interface WxBillDepositService {
* @param record * @param record
* @return * @return
*/ */
PageInfo<Map<String, Object>> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize);
PageInfo<WxBillDeposit> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize);


void updateBillStatus(WxBillDeposit record); void updateBillStatus(WxBillDeposit record);


@@ -27,7 +26,7 @@ public interface WxBillDepositService {
* @param id * @param id
* @return * @return
*/ */
Map<String, Object> getById(Long id);
WxBillDeposit getById(Long id);
/** /**
* 保存或更新实体 * 保存或更新实体
@@ -50,4 +49,7 @@ public interface WxBillDepositService {
ResultData returnDeposit(WxBillDeposit wxBillDeposit, MallUserInfo user); ResultData returnDeposit(WxBillDeposit wxBillDeposit, MallUserInfo user);


ResultData adjustDeposit(WxBillDeposit wxBillDeposit); ResultData adjustDeposit(WxBillDeposit wxBillDeposit);

void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillDeposit deposit);

} }

+ 4
- 2
mallinkService/src/main/java/com/iformall/service/WxBillPropertyDepositService.java Dosyayı Görüntüle

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillPropertyDeposit; import com.iformall.domain.po.WxBillPropertyDeposit;
import com.iformall.domain.po.WxPayAccountBill;


import java.util.Map; import java.util.Map;


@@ -20,7 +21,7 @@ public interface WxBillPropertyDepositService {
* @param record * @param record
* @return * @return
*/ */
PageInfo<Map<String, Object>> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize);
PageInfo<WxBillPropertyDeposit> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize);


void updateBillStatus(WxBillPropertyDeposit record); void updateBillStatus(WxBillPropertyDeposit record);


@@ -30,7 +31,7 @@ public interface WxBillPropertyDepositService {
* @param id * @param id
* @return * @return
*/ */
Map<String, Object> getById(Long id);
WxBillPropertyDeposit getById(Long id);


/** /**
* 保存或更新实体 * 保存或更新实体
@@ -54,4 +55,5 @@ public interface WxBillPropertyDepositService {


ResultData adjustDeposit(WxBillPropertyDeposit wxBillPropertyDeposit); ResultData adjustDeposit(WxBillPropertyDeposit wxBillPropertyDeposit);


void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillPropertyDeposit deposit);
} }

+ 76
- 67
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Dosyayı Görüntüle

@@ -147,26 +147,31 @@ public class WxBillAllServiceImpl implements WxBillAllService {
PageInfo<WxBillAllVo> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillAllMapper.list(record)); PageInfo<WxBillAllVo> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillAllMapper.list(record));


//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
pageInfo.getList().stream().forEach(e->{
pageInfo.getList().stream().forEach(e -> {
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
cmputeTotalMoney(wxPayAccountBill, e);
}); });


Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put("pageInfo", pageInfo); result.put("pageInfo", pageInfo);
return result; return result;
} }

public void cmputeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillAllVo e) {
if (e.getReceivePay() != null) {
if (e.getLatePayPrice() == null) e.setLatePayPrice(0L);
BigDecimal servicePay;
if (e.getServiceChargePay() != null) {
servicePay = new BigDecimal(e.getServiceChargePay());
} else {
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
}

@Override @Override
public List<Map<String, Object>> listBillOweAndWaitPay(WxBillAll wxBillAll) { public List<Map<String, Object>> listBillOweAndWaitPay(WxBillAll wxBillAll) {
//更新各账单状态 //更新各账单状态
@@ -203,7 +208,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillAll.setBillTypeValue(EnumBillTypeParam.ROUTINE.getCode()); wxBillAll.setBillTypeValue(EnumBillTypeParam.ROUTINE.getCode());
} else if (wxBillAll.getBillTypeValue().equals(EnumBillType.AIR_CONDITIONING.getCode())) { } else if (wxBillAll.getBillTypeValue().equals(EnumBillType.AIR_CONDITIONING.getCode())) {
wxBillAll.setBillTypeValue(EnumBillTypeParam.AIR_CONDITIONING.getCode()); wxBillAll.setBillTypeValue(EnumBillTypeParam.AIR_CONDITIONING.getCode());
}else if (wxBillAll.getBillTypeValue().equals(EnumBillType.SETTLE.getCode())) {
} else if (wxBillAll.getBillTypeValue().equals(EnumBillType.SETTLE.getCode())) {
wxBillAll.setBillTypeValue(EnumBillTypeParam.SETTLE.getCode()); wxBillAll.setBillTypeValue(EnumBillTypeParam.SETTLE.getCode());
} else { } else {
logger.info("账单不存在"); logger.info("账单不存在");
@@ -213,28 +218,28 @@ public class WxBillAllServiceImpl implements WxBillAllService {
if (wxBillAll.getPageIndex() != null && wxBillAll.getPageIndex() != null) { if (wxBillAll.getPageIndex() != null && wxBillAll.getPageIndex() != null) {
PageHelper.startPage(wxBillAll.getPageIndex(), wxBillAll.getPageSize()); PageHelper.startPage(wxBillAll.getPageIndex(), wxBillAll.getPageSize());
List<Map<String, Object>> maps = wxBillAllMapper.listData(wxBillAll); List<Map<String, Object>> maps = wxBillAllMapper.listData(wxBillAll);
for (Map<String, Object> map:maps) {
Integer billType = ((Long)map.get("billTypeValue")).intValue();
if(EnumBillType.SETTLE.getCode().equals(billType)){
Long id = (Long)map.get("id");
WxBillSettle settle = wxBillSettleService.getById(id,EnumFilterSettle.YES.getCode());
map.put("owe",settle.getBalance());
settle = wxBillSettleService.getById(id,EnumFilterSettle.NO.getCode());
map.put("receivePay",settle.getBalance());
for (Map<String, Object> map : maps) {
Integer billType = ((Long) map.get("billTypeValue")).intValue();
if (EnumBillType.SETTLE.getCode().equals(billType)) {
Long id = (Long) map.get("id");
WxBillSettle settle = wxBillSettleService.getById(id, EnumFilterSettle.YES.getCode());
map.put("owe", settle.getBalance());
settle = wxBillSettleService.getById(id, EnumFilterSettle.NO.getCode());
map.put("receivePay", settle.getBalance());
} }
} }
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(maps); PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(maps);
return new ResultData(pageInfo); return new ResultData(pageInfo);
} }
List<Map<String, Object>> maps = wxBillAllMapper.listData(wxBillAll); List<Map<String, Object>> maps = wxBillAllMapper.listData(wxBillAll);
for (Map<String, Object> map:maps) {
Integer billType = ((Long)map.get("billTypeValue")).intValue();
if(EnumBillType.SETTLE.getCode().equals(billType)){
Long id = (Long)map.get("id");
WxBillSettle settle = wxBillSettleService.getById(id,EnumFilterSettle.YES.getCode());
map.put("owe",settle.getBalance());
settle = wxBillSettleService.getById(id,EnumFilterSettle.NO.getCode());
map.put("receivePay",settle.getBalance());
for (Map<String, Object> map : maps) {
Integer billType = ((Long) map.get("billTypeValue")).intValue();
if (EnumBillType.SETTLE.getCode().equals(billType)) {
Long id = (Long) map.get("id");
WxBillSettle settle = wxBillSettleService.getById(id, EnumFilterSettle.YES.getCode());
map.put("owe", settle.getBalance());
settle = wxBillSettleService.getById(id, EnumFilterSettle.NO.getCode());
map.put("receivePay", settle.getBalance());
} }
} }
return new ResultData(maps); return new ResultData(maps);
@@ -302,30 +307,30 @@ public class WxBillAllServiceImpl implements WxBillAllService {
try { try {
logger.info("更新结算单id:{}", JsonUtil.obj2Json(bill)); logger.info("更新结算单id:{}", JsonUtil.obj2Json(bill));


WxBillSettle wxBillSettle = wxBillSettleService.getById((Long)bill.get("id"), EnumFilterSettle.YES.getCode());
WxBillSettle wxBillSettle = wxBillSettleService.getById((Long) bill.get("id"), EnumFilterSettle.YES.getCode());


WxBillSettleRecord settleRecord = new WxBillSettleRecord(); WxBillSettleRecord settleRecord = new WxBillSettleRecord();
settleRecord.setSettleId((Long)bill.get("id"));
settleRecord.setSettleId((Long) bill.get("id"));
settleRecord.setSettleMoney(wxBillSettle.getBalance()); settleRecord.setSettleMoney(wxBillSettle.getBalance());
settleRecord.setSettleTime(new Date()); settleRecord.setSettleTime(new Date());
settleRecord.setSettleWay(EnumSettleRecordWay.WEBCAT.getCode()); settleRecord.setSettleWay(EnumSettleRecordWay.WEBCAT.getCode());
settleRecord.setTenantId(wxBillSettle.getTenantId()); settleRecord.setTenantId(wxBillSettle.getTenantId());


BigDecimal money = new BigDecimal(settleRecord.getSettleMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); BigDecimal money = new BigDecimal(settleRecord.getSettleMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
settleRecord.setDetail(EnumSettleRecordWay.getEnum(settleRecord.getSettleWay()).getMessage()+"收款"+money.toString()+"元");
wxBillSettleRecordService.saveOrUpdate(settleRecord,null,(Long)bill.get("userId"));
settleRecord.setDetail(EnumSettleRecordWay.getEnum(settleRecord.getSettleWay()).getMessage() + "收款" + money.toString() + "元");
wxBillSettleRecordService.saveOrUpdate(settleRecord, null, (Long) bill.get("userId"));


wxBillSettle.setUpdatetime(new Date()); wxBillSettle.setUpdatetime(new Date());
wxBillSettle.setStatus(EnumSettleStatus.FINISH.getCode()); wxBillSettle.setStatus(EnumSettleStatus.FINISH.getCode());
wxBillSettleMapper.updateById(wxBillSettle); wxBillSettleMapper.updateById(wxBillSettle);


logger.info("更新结算单success"); logger.info("更新结算单success");
}catch (Exception e){
logger.error("结算单error",e);
} catch (Exception e) {
logger.error("结算单error", e);
e.printStackTrace(); e.printStackTrace();
} }


}else{
} else {
logger.info("账单类型不存在"); logger.info("账单类型不存在");
} }
} }
@@ -357,7 +362,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillAllVo.setRentEndTime(DateUtils.format(wxBillAllVo.getEndtime())); wxBillAllVo.setRentEndTime(DateUtils.format(wxBillAllVo.getEndtime()));


//status不是欠缴,都展示0,与前端保持一致 //status不是欠缴,都展示0,与前端保持一致
if(!EnumBillRentStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())){
if (!EnumBillRentStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) {
wxBillAllVo.setOwe(0l); wxBillAllVo.setOwe(0l);
wxBillAllVo.setOweStr("0"); wxBillAllVo.setOweStr("0");
} }
@@ -863,14 +868,18 @@ public class WxBillAllServiceImpl implements WxBillAllService {
String filepath = fmUploadDir; String filepath = fmUploadDir;
String filename = UUID.randomUUID() + ".docx"; String filename = UUID.randomUUID() + ".docx";
String exportFileName = "催缴单.docx"; String exportFileName = "催缴单.docx";
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null);
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, null);
} }


@Override @Override
public void exportSettleBill(WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) { public void exportSettleBill(WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) {
wxBillSettle = wxBillSettleService.getById(wxBillSettle.getId(), EnumFilterSettle.NO.getCode()); wxBillSettle = wxBillSettleService.getById(wxBillSettle.getId(), EnumFilterSettle.NO.getCode());
if(wxBillSettle.getReceiveBillIds() == null) wxBillSettle.setReceiveBillIds(new ArrayList<>());
if(wxBillSettle.getPayBillIds() == null) wxBillSettle.setPayBillIds(new ArrayList<>());
if (wxBillSettle.getReceiveBillIds() == null) {
wxBillSettle.setReceiveBillIds(new ArrayList<>());
}
if (wxBillSettle.getPayBillIds() == null) {
wxBillSettle.setPayBillIds(new ArrayList<>());
}


//映射结果 //映射结果
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@@ -884,35 +893,35 @@ public class WxBillAllServiceImpl implements WxBillAllService {
BigDecimal receiveM = (new BigDecimal(wxBillSettle.getReceiveMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); BigDecimal receiveM = (new BigDecimal(wxBillSettle.getReceiveMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
BigDecimal payM = (new BigDecimal(wxBillSettle.getPayMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); BigDecimal payM = (new BigDecimal(wxBillSettle.getPayMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
BigDecimal bM = (new BigDecimal(wxBillSettle.getBalance()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); BigDecimal bM = (new BigDecimal(wxBillSettle.getBalance()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
result.put("receiveM", receiveM.toString()+"元");
result.put("payM", payM.toString()+"元");
result.put("bM", bM.toString()+"元");
result.put("receiveM", receiveM.toString() + "元");
result.put("payM", payM.toString() + "元");
result.put("bM", bM.toString() + "元");
result.put("receiveMU", PriceUtil.digitUppercase(receiveM.doubleValue())); result.put("receiveMU", PriceUtil.digitUppercase(receiveM.doubleValue()));
result.put("payMU", PriceUtil.digitUppercase(payM.doubleValue())); result.put("payMU", PriceUtil.digitUppercase(payM.doubleValue()));
result.put("bMU", PriceUtil.digitUppercase(bM.doubleValue())); result.put("bMU", PriceUtil.digitUppercase(bM.doubleValue()));


WordDocTableVo wordDocTableVo = new WordDocTableVo(); WordDocTableVo wordDocTableVo = new WordDocTableVo();
List<List<String>> rowsParams = new ArrayList<>(); List<List<String>> rowsParams = new ArrayList<>();
int size = wxBillSettle.getReceiveBillIds().size() > wxBillSettle.getPayBillIds().size()?wxBillSettle.getReceiveBillIds().size():wxBillSettle.getPayBillIds().size();
int size = wxBillSettle.getReceiveBillIds().size() > wxBillSettle.getPayBillIds().size() ? wxBillSettle.getReceiveBillIds().size() : wxBillSettle.getPayBillIds().size();
int count = 1; int count = 1;
for (int i = 0; i < size ; i++) {
WxBillSettleBill bill = i>wxBillSettle.getReceiveBillIds().size()-1?null:wxBillSettle.getReceiveBillIds().get(i);
for (int i = 0; i < size; i++) {
WxBillSettleBill bill = i > wxBillSettle.getReceiveBillIds().size() - 1 ? null : wxBillSettle.getReceiveBillIds().get(i);
List<String> cellList = new ArrayList<>(); List<String> cellList = new ArrayList<>();
cellList.add(count+"");
cellList.add(count + "");


if(bill != null){
if (bill != null) {
cellList.add(bill.getBillName()); cellList.add(bill.getBillName());
cellList.add(new BigDecimal(bill.getReceivePay()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).toString()); cellList.add(new BigDecimal(bill.getReceivePay()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).toString());
}else{
} else {
cellList.add(""); cellList.add("");
cellList.add(""); cellList.add("");
} }
cellList.add(count+"");
WxBillSettleBill payBill = i>wxBillSettle.getPayBillIds().size()-1?null:wxBillSettle.getPayBillIds().get(i);
if(payBill != null){
cellList.add(count + "");
WxBillSettleBill payBill = i > wxBillSettle.getPayBillIds().size() - 1 ? null : wxBillSettle.getPayBillIds().get(i);
if (payBill != null) {
cellList.add(payBill.getBillName()); cellList.add(payBill.getBillName());
cellList.add(new BigDecimal(payBill.getReceivePay()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).toString()); cellList.add(new BigDecimal(payBill.getReceivePay()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).toString());
}else{
} else {
cellList.add(""); cellList.add("");
cellList.add(""); cellList.add("");
} }
@@ -927,7 +936,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
String filepath = fmUploadDir; String filepath = fmUploadDir;
String filename = UUID.randomUUID() + ".docx"; String filename = UUID.randomUUID() + ".docx";
String exportFileName = "结算单.docx"; String exportFileName = "结算单.docx";
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,wordDocTableVo);
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, wordDocTableVo);


} }


@@ -962,7 +971,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
} }
} else if (billType.equals(EnumBillTypeParam.RENT_DEPOSIT.getCode())) { } else if (billType.equals(EnumBillTypeParam.RENT_DEPOSIT.getCode())) {
WxBillDeposit dbBill = wxBillDepositMapper.selectById(id); WxBillDeposit dbBill = wxBillDepositMapper.selectById(id);
if(dbBill!=null) {
if (dbBill != null) {
//租赁押金账单更新 //租赁押金账单更新
WxBillDeposit wxBillDeposit = new WxBillDeposit(); WxBillDeposit wxBillDeposit = new WxBillDeposit();
wxBillDeposit.setId(id); wxBillDeposit.setId(id);
@@ -978,7 +987,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
} }


WxBillPropertyDeposit propertyDeposit = wxBillPropertyDepositMapper.selectById(id); WxBillPropertyDeposit propertyDeposit = wxBillPropertyDepositMapper.selectById(id);
if(propertyDeposit!=null){
if (propertyDeposit != null) {
//物业押金账单更新 //物业押金账单更新
WxBillPropertyDeposit wxBillPropertyDeposit = new WxBillPropertyDeposit(); WxBillPropertyDeposit wxBillPropertyDeposit = new WxBillPropertyDeposit();
wxBillPropertyDeposit.setId(id); wxBillPropertyDeposit.setId(id);
@@ -1723,7 +1732,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
record.setLimitStart(0); record.setLimitStart(0);
record.setLimitEnd(Integer.MAX_VALUE); record.setLimitEnd(Integer.MAX_VALUE);
List totalList = wxBillAllMapper.getReceiveAndPayBillAsPage(record); List totalList = wxBillAllMapper.getReceiveAndPayBillAsPage(record);
if(CollectionUtils.isEmpty(totalList)){
if (CollectionUtils.isEmpty(totalList)) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
PageInfo<Map<String, Object>> pageInfo = new PageInfo(new ArrayList()); PageInfo<Map<String, Object>> pageInfo = new PageInfo(new ArrayList());
pageInfo.setPages(0); pageInfo.setPages(0);
@@ -1735,12 +1744,12 @@ public class WxBillAllServiceImpl implements WxBillAllService {


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


@@ -1798,14 +1807,14 @@ public class WxBillAllServiceImpl implements WxBillAllService {
oweMerchantVo.setName((String) map.get("name")); oweMerchantVo.setName((String) map.get("name"));
oweMerchantVo.setLinkPhone((String) map.get("linkPhone")); oweMerchantVo.setLinkPhone((String) map.get("linkPhone"));
oweMerchantVo.setShopNumber((String) map.get("shopNumber")); oweMerchantVo.setShopNumber((String) map.get("shopNumber"));
if(EnumRentShopType.POINT.getCode().equals(map.get("type"))){
if (EnumRentShopType.POINT.getCode().equals(map.get("type"))) {
oweMerchantVo.setShopType("多经点位"); oweMerchantVo.setShopType("多经点位");
}else if(EnumRentShopType.SHOP.getCode().equals(map.get("type"))){
} else if (EnumRentShopType.SHOP.getCode().equals(map.get("type"))) {
oweMerchantVo.setShopType("商铺"); 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());
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); list.add(oweMerchantVo);
} }
String name = "商户账单列表"; String name = "商户账单列表";


+ 20
- 26
mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java Dosyayı Görüntüle

@@ -65,24 +65,27 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
List<WxBillDaily> billDepositList = wxBillDailyMapper.queryBillDailyList(record); List<WxBillDaily> billDepositList = wxBillDailyMapper.queryBillDailyList(record);
billDepositList.stream().forEach(e->{ billDepositList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
//结果放入分页对象 //结果放入分页对象
PageInfo<WxBillDaily> pageInfo = new PageInfo<>(billDepositList); PageInfo<WxBillDaily> pageInfo = new PageInfo<>(billDepositList);
return pageInfo; return pageInfo;
} }


public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillDaily e) {
if (e.getReceivePay() != null) {
BigDecimal servicePay;
if (e.getServiceChargePay() != null) {
servicePay = new BigDecimal(e.getServiceChargePay());
} else {
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
}

@Override @Override
public void updateBillStatus(WxBillDaily record) { public void updateBillStatus(WxBillDaily record) {
logger.info("更新日常账单状态开始..."); logger.info("更新日常账单状态开始...");
@@ -127,6 +130,9 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
WxBillDaily record = new WxBillDaily(); WxBillDaily record = new WxBillDaily();
record.setId(id); record.setId(id);
WxBillDaily wxBillDaily = wxBillDailyMapper.queryBillDailyList(record).get(0); WxBillDaily wxBillDaily = wxBillDailyMapper.queryBillDailyList(record).get(0);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId());
computeTotalMoney(wxPayAccountBill, record);
record.setOwe(record.getRealReceivePay() - record.getPay());
if (wxBillDaily.getShopId() != null) { if (wxBillDaily.getShopId() != null) {
WxShop shop = new WxShop(); WxShop shop = new WxShop();
shop.setId(wxBillDaily.getShopId()); shop.setId(wxBillDaily.getShopId());
@@ -135,7 +141,6 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
}else{ }else{
wxBillDaily.setShops(Collections.EMPTY_LIST); wxBillDaily.setShops(Collections.EMPTY_LIST);
} }

return wxBillDaily; return wxBillDaily;
} }


@@ -191,7 +196,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
wxBillDaily.setPayDate(record.getPayDate()); wxBillDaily.setPayDate(record.getPayDate());
wxBillDaily.setPay(record.getPay()); wxBillDaily.setPay(record.getPay());
wxBillDaily.setReceivePay(record.getReceivePay()); wxBillDaily.setReceivePay(record.getReceivePay());
wxBillDaily.setOwe(record.getReceivePay()-record.getPay());
wxBillDaily.setOwe(record.getRealReceivePay() - record.getPay());
if (record.getPay().equals(record.getReceivePay())) { if (record.getPay().equals(record.getReceivePay())) {
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode());
Date payDate = record.getPayDate(); Date payDate = record.getPayDate();
@@ -351,18 +356,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
List<WxBillDaily> billDailyList = wxBillDailyMapper.queryBillDailyList(record); List<WxBillDaily> billDailyList = wxBillDailyMapper.queryBillDailyList(record);
billDailyList.stream().forEach(e->{ billDailyList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
List<WxBillDailyExportVo> datalist = new ArrayList<>(); List<WxBillDailyExportVo> datalist = new ArrayList<>();
WxBillDailyExportVo wxBillDailyExportVo; WxBillDailyExportVo wxBillDailyExportVo;


+ 21
- 17
mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java Dosyayı Görüntüle

@@ -49,29 +49,34 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
WxPayAccountBillService wxPayAccountBillService; WxPayAccountBillService wxPayAccountBillService;


@Override @Override
public PageInfo<Map<String, Object>> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) {
public PageInfo<WxBillDeposit> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId());
PageHelper.startPage(pageIndex, pageSize); PageHelper.startPage(pageIndex, pageSize);
List<Map<String, Object>> billDepositList = wxBillDepositMapper.queryBillDepositList(record);
List<WxBillDeposit> billDepositList = wxBillDepositMapper.queryBillDepositList(record);
billDepositList.stream().forEach(e->{ billDepositList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.get("receivePay") != null){
Long receivePayB = (Long)e.get("receivePay");
BigDecimal servicePay;
if(e.get("serviceChargePay") != null){
servicePay = new BigDecimal((Long)e.get("serviceChargePay"));
}else{
servicePay = new BigDecimal(receivePayB).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + receivePayB;
e.put("realReceivePay",realReceivePay);
e.put("serviceChargePay",servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billDepositList);
PageInfo<WxBillDeposit> pageInfo = new PageInfo<>(billDepositList);
return pageInfo; return pageInfo;
} }


@Override
public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillDeposit deposit) {
if (deposit.getReceivePay() != null) {
Long receivePayB = deposit.getReceivePay();
BigDecimal servicePay;
if (deposit.getServiceChargePay() != null) {
servicePay = new BigDecimal(deposit.getServiceChargePay());
} else {
servicePay = new BigDecimal(receivePayB).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + receivePayB;
deposit.setRealReceivePay(realReceivePay);
deposit.setServiceChargePay(servicePay.intValue());
}
}

@Override @Override
public void updateBillStatus(WxBillDeposit record) { public void updateBillStatus(WxBillDeposit record) {
logger.info("更新租赁押金账单状态开始..."); logger.info("更新租赁押金账单状态开始...");
@@ -113,7 +118,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
} }


@Override @Override
public Map<String, Object> getById(Long id) {
public WxBillDeposit getById(Long id) {
WxBillDeposit record = new WxBillDeposit(); WxBillDeposit record = new WxBillDeposit();
record.setId(id); record.setId(id);
return wxBillDepositMapper.queryBillDepositList(record).get(0); return wxBillDepositMapper.queryBillDepositList(record).get(0);
@@ -164,7 +169,6 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
wxBillDeposit.setPayDate(date); wxBillDeposit.setPayDate(date);
wxBillDeposit.setUpdatetime(date); wxBillDeposit.setUpdatetime(date);
wxBillDeposit.setPayWay(record.getPayWay()); wxBillDeposit.setPayWay(record.getPayWay());
//wxBillDeposit.setServiceChargePay(record.getServiceChargePay());
try { try {
wxBillDepositMapper.updateById(wxBillDeposit); wxBillDepositMapper.updateById(wxBillDeposit);
} catch (Exception e) { } catch (Exception e) {


+ 20
- 25
mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java Dosyayı Görüntüle

@@ -59,18 +59,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
List<WxBillOtherDeposit> billList = wxBillOtherDepositMapper.queryBillList(record); List<WxBillOtherDeposit> billList = wxBillOtherDepositMapper.queryBillList(record);
billList.stream().forEach(e->{ billList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
//结果放入分页对象 //结果放入分页对象
PageInfo<WxBillOtherDeposit> pageInfo = new PageInfo<>(billList); PageInfo<WxBillOtherDeposit> pageInfo = new PageInfo<>(billList);
@@ -78,6 +67,20 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService


} }


public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillOtherDeposit e) {
if (e.getReceivePay() != null) {
BigDecimal servicePay;
if (e.getServiceChargePay() != null) {
servicePay = new BigDecimal(e.getServiceChargePay());
} else {
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
}

@Override @Override
public void updateBillStatus(WxBillOtherDeposit record) { public void updateBillStatus(WxBillOtherDeposit record) {
logger.info("更新其他押金账单状态开始..."); logger.info("更新其他押金账单状态开始...");
@@ -122,6 +125,9 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
WxBillOtherDeposit record = new WxBillOtherDeposit(); WxBillOtherDeposit record = new WxBillOtherDeposit();
record.setId(id); record.setId(id);
WxBillOtherDeposit wxBillOther = wxBillOtherDepositMapper.queryBillList(record).get(0); WxBillOtherDeposit wxBillOther = wxBillOtherDepositMapper.queryBillList(record).get(0);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId());
computeTotalMoney(wxPayAccountBill, record);
record.setOwe(record.getRealReceivePay() - record.getPay());
if (wxBillOther.getShopId() != null) { if (wxBillOther.getShopId() != null) {
WxShop shop = new WxShop(); WxShop shop = new WxShop();
shop.setId(wxBillOther.getShopId()); shop.setId(wxBillOther.getShopId());
@@ -186,7 +192,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
wxBillOtherDeposit.setPayDate(record.getPayDate()); wxBillOtherDeposit.setPayDate(record.getPayDate());
wxBillOtherDeposit.setPay(record.getPay()); wxBillOtherDeposit.setPay(record.getPay());
wxBillOtherDeposit.setReceivePay(record.getReceivePay()); wxBillOtherDeposit.setReceivePay(record.getReceivePay());
wxBillOtherDeposit.setOwe(record.getReceivePay() - record.getPay());
wxBillOtherDeposit.setOwe(record.getRealReceivePay() - record.getPay());
if (record.getPay().equals(record.getReceivePay())) { if (record.getPay().equals(record.getReceivePay())) {
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
Date payDate = record.getPayDate(); Date payDate = record.getPayDate();
@@ -324,18 +330,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
List<WxBillOtherDeposit> datalist = wxBillOtherDepositMapper.queryBillList(wxBillDeposit); List<WxBillOtherDeposit> datalist = wxBillOtherDepositMapper.queryBillList(wxBillDeposit);
datalist.stream().forEach(e->{ datalist.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
excelService.exportExcel(datalist, null, "其他押金账单", WxBillOtherDeposit.class, "其他押金账单.xlsx", response, false); excelService.exportExcel(datalist, null, "其他押金账单", WxBillOtherDeposit.class, "其他押金账单.xlsx", response, false);
} }


+ 20
- 26
mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java Dosyayı Görüntüle

@@ -59,18 +59,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
List<WxBillOther> billList = wxBillOtherMapper.queryBillList(record); List<WxBillOther> billList = wxBillOtherMapper.queryBillList(record);
billList.stream().forEach(e->{ billList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
//结果放入分页对象 //结果放入分页对象
PageInfo<WxBillOther> pageInfo = new PageInfo<>(billList); PageInfo<WxBillOther> pageInfo = new PageInfo<>(billList);
@@ -78,6 +67,20 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {


} }


public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillOther e) {
if (e.getReceivePay() != null) {
BigDecimal servicePay;
if (e.getServiceChargePay() != null) {
servicePay = new BigDecimal(e.getServiceChargePay());
} else {
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
}

@Override @Override
public void updateBillStatus(WxBillOther record) { public void updateBillStatus(WxBillOther record) {
logger.info("更新其他账单状态开始..."); logger.info("更新其他账单状态开始...");
@@ -122,7 +125,9 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
WxBillOther record = new WxBillOther(); WxBillOther record = new WxBillOther();
record.setId(id); record.setId(id);
WxBillOther wxBillOther = wxBillOtherMapper.queryBillList(record).get(0); WxBillOther wxBillOther = wxBillOtherMapper.queryBillList(record).get(0);

WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId());
computeTotalMoney(wxPayAccountBill, record);
record.setOwe(record.getRealReceivePay() - record.getPay());
if (wxBillOther.getShopId() != null) { if (wxBillOther.getShopId() != null) {
WxShop shop = new WxShop(); WxShop shop = new WxShop();
shop.setId(wxBillOther.getShopId()); shop.setId(wxBillOther.getShopId());
@@ -187,7 +192,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
wxBillOther.setPayDate(record.getPayDate()); wxBillOther.setPayDate(record.getPayDate());
wxBillOther.setPay(record.getPay()); wxBillOther.setPay(record.getPay());
wxBillOther.setReceivePay(record.getReceivePay()); wxBillOther.setReceivePay(record.getReceivePay());
wxBillOther.setOwe(record.getReceivePay()-record.getPay());
wxBillOther.setOwe(record.getRealReceivePay() - record.getPay());
if (record.getPay().equals(record.getReceivePay())) { if (record.getPay().equals(record.getReceivePay())) {
wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode());
Date payDate = record.getPayDate(); Date payDate = record.getPayDate();
@@ -269,18 +274,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
List<WxBillOther> datalist = wxBillOtherMapper.queryBillList(wxBillOther); List<WxBillOther> datalist = wxBillOtherMapper.queryBillList(wxBillOther);
datalist.stream().forEach(e->{ datalist.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
excelService.exportExcel(datalist, null, "其他费用账单", WxBillOther.class, "其他费用账单.xlsx", response, false); excelService.exportExcel(datalist, null, "其他费用账单", WxBillOther.class, "其他费用账单.xlsx", response, false);
} }


+ 21
- 17
mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java Dosyayı Görüntüle

@@ -47,29 +47,33 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
WxPayAccountBillService wxPayAccountBillService; WxPayAccountBillService wxPayAccountBillService;


@Override @Override
public PageInfo<Map<String, Object>> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) {
public PageInfo<WxBillPropertyDeposit> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId());
PageHelper.startPage(pageIndex, pageSize); PageHelper.startPage(pageIndex, pageSize);
List<Map<String, Object>> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(record);
List<WxBillPropertyDeposit> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(record);
billDepositList.stream().forEach(e->{ billDepositList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.get("receivePay") != null){
Long receivePayB = (Long)e.get("receivePay");
BigDecimal servicePay;
if(e.get("serviceChargePay") != null){
servicePay = new BigDecimal((Long)e.get("serviceChargePay"));
}else{
servicePay = new BigDecimal(receivePayB).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + receivePayB;
e.put("realReceivePay",realReceivePay);
e.put("serviceChargePay",servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billDepositList);
PageInfo<WxBillPropertyDeposit> pageInfo = new PageInfo<>(billDepositList);
return pageInfo; return pageInfo;
} }


@Override
public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillPropertyDeposit deposit) {
if (deposit.getReceivePay() != null) {
BigDecimal servicePay;
if (deposit.getServiceChargePay() != null) {
servicePay = new BigDecimal(deposit.getServiceChargePay());
} else {
servicePay = new BigDecimal(deposit.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + deposit.getReceivePay();
deposit.setRealReceivePay(realReceivePay);
deposit.setServiceChargePay(servicePay.intValue());
}
}

@Override @Override
public void updateBillStatus(WxBillPropertyDeposit record) { public void updateBillStatus(WxBillPropertyDeposit record) {
logger.info("更新物业押金账单状态开始..."); logger.info("更新物业押金账单状态开始...");
@@ -112,7 +116,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
} }


@Override @Override
public Map<String, Object> getById(Long id) {
public WxBillPropertyDeposit getById(Long id) {
WxBillPropertyDeposit record = new WxBillPropertyDeposit(); WxBillPropertyDeposit record = new WxBillPropertyDeposit();
record.setId(id); record.setId(id);
return wxBillPropertyDepositMapper.queryBillDepositList(record).get(0); return wxBillPropertyDepositMapper.queryBillDepositList(record).get(0);
@@ -150,7 +154,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
Long addpay = wxBillDeposit.getPay(); Long addpay = wxBillDeposit.getPay();
wxBillDeposit.setPay(record.getPay()); wxBillDeposit.setPay(record.getPay());
wxBillDeposit.setReceivePay(record.getReceivePay()); wxBillDeposit.setReceivePay(record.getReceivePay());
wxBillDeposit.setOwe(record.getReceivePay()-record.getPay());
wxBillDeposit.setOwe(record.getRealReceivePay() - record.getPay());
if (record.getPay().equals(record.getReceivePay())) { if (record.getPay().equals(record.getReceivePay())) {
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
Date receiveDate = wxBillDeposit.getReceiveDate(); Date receiveDate = wxBillDeposit.getReceiveDate();


+ 58
- 79
mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java Dosyayı Görüntüle

@@ -14,10 +14,7 @@ import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBillActionMapper; import com.iformall.mapper.WxBillActionMapper;
import com.iformall.mapper.WxBillPropertyDepositMapper; import com.iformall.mapper.WxBillPropertyDepositMapper;
import com.iformall.mapper.WxBillPropertyMapper; import com.iformall.mapper.WxBillPropertyMapper;
import com.iformall.service.ExcelService;
import com.iformall.service.WxBillActionService;
import com.iformall.service.WxBillPropertyService;
import com.iformall.service.WxPayAccountBillService;
import com.iformall.service.*;
import com.iformall.utils.DateUtils; import com.iformall.utils.DateUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -55,6 +52,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
WxBillActionMapper wxBillActionMapper; WxBillActionMapper wxBillActionMapper;
@Autowired @Autowired
WxPayAccountBillService wxPayAccountBillService; WxPayAccountBillService wxPayAccountBillService;
@Autowired
WxBillPropertyDepositService wxBillPropertyDepositService;




@Override @Override
@@ -62,25 +61,33 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId());
PageHelper.startPage(pageIndex, pageSize); PageHelper.startPage(pageIndex, pageSize);
List<WxBillProperty> billRentList = wxBillPropertyMapper.queryBillPropertyList(record); List<WxBillProperty> billRentList = wxBillPropertyMapper.queryBillPropertyList(record);
billRentList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
billRentList.stream().forEach(e -> {
computeTotalMoney(wxPayAccountBill, e);

}); });
PageInfo<WxBillProperty> pageInfo = new PageInfo<>(billRentList); PageInfo<WxBillProperty> pageInfo = new PageInfo<>(billRentList);
return pageInfo; return pageInfo;
} }


public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillProperty e) {
//手续费 = 合同应收+手续费+滞纳金
if (e.getReceivePay() != null) {
if (e.getLatePayPrice() == null) {
long latePayPrice = 0L;
e.setLatePayPrice(latePayPrice);
}
BigDecimal servicePay;
if (e.getServiceChargePay() != null) {
servicePay = new BigDecimal(e.getServiceChargePay());
} else {
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
}

@Override @Override
public void updateBillStatus(WxBillProperty record) { public void updateBillStatus(WxBillProperty record) {
logger.info("更新物业账单状态开始..."); logger.info("更新物业账单状态开始...");
@@ -125,15 +132,20 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
public WxBillProperty getById(Long id) { public WxBillProperty getById(Long id) {
WxBillProperty record = new WxBillProperty(); WxBillProperty record = new WxBillProperty();
record.setId(id); record.setId(id);
return wxBillPropertyMapper.queryBillPropertyList(record).get(0);
WxBillProperty property = wxBillPropertyMapper.queryBillPropertyList(record).get(0);
//手续费 = 合同应收+手续费+滞纳金
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(property.getTenantId());
computeTotalMoney(wxPayAccountBill, property);
property.setOwe(property.getRealReceivePay() - property.getPay());
return property;
} }


@Override @Override
public ResultData saveOrUpdate(WxBillProperty record, MallUserInfo user) { public ResultData saveOrUpdate(WxBillProperty record, MallUserInfo user) {
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,"实收金额不能大于实际应收金额");
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, "实收金额不能大于实际应收金额");
} }
Date date = new Date(); Date date = new Date();
if (record.getId() == null) { if (record.getId() == null) {
@@ -142,7 +154,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
record.setId(idWorker.nextId()); record.setId(idWorker.nextId());
record.setCreatetime(date); record.setCreatetime(date);
record.setUpdatetime(date); record.setUpdatetime(date);
record.setOwe(record.getReceivePay()-record.getPay());
record.setOwe(record.getReceivePay() - record.getPay());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try { try {
wxBillPropertyMapper.insert(record); wxBillPropertyMapper.insert(record);
@@ -154,16 +166,16 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
} else { } else {
logger.info("更新物业账单"); logger.info("更新物业账单");
WxBillProperty property = wxBillPropertyMapper.selectById(record.getId()); WxBillProperty property = wxBillPropertyMapper.selectById(record.getId());
if(property==null){
if (property == null) {
return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND); return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND);
} }


String message = ""; String message = "";
String price = ""; String price = "";
if(record.getServiceChargePayUpdate() != null){
Double l = Double.valueOf(record.getServiceChargePayUpdate())*100;
if (record.getServiceChargePayUpdate() != null) {
Double l = Double.valueOf(record.getServiceChargePayUpdate()) * 100;
property.setServiceChargePay(l.intValue()); property.setServiceChargePay(l.intValue());
}else{
} else {
Long addpay = property.getPay(); Long addpay = property.getPay();
property.setRevenue(record.getRevenue()); property.setRevenue(record.getRevenue());
property.setLatePayRatio(record.getLatePayRatio()); property.setLatePayRatio(record.getLatePayRatio());
@@ -172,7 +184,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
property.setPayDate(record.getPayDate()); property.setPayDate(record.getPayDate());
property.setPay(record.getPay()); property.setPay(record.getPay());
property.setReceivePay(record.getReceivePay()); property.setReceivePay(record.getReceivePay());
property.setOwe(record.getReceivePay()-record.getPay());
property.setOwe(record.getRealReceivePay() - record.getPay());
if (record.getPay().equals(record.getReceivePay())) { if (record.getPay().equals(record.getReceivePay())) {
property.setStatus(EnumBillRentStatus.PAID.getCode()); property.setStatus(EnumBillRentStatus.PAID.getCode());
Date payDate = record.getPayDate(); Date payDate = record.getPayDate();
@@ -201,10 +213,10 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
wxBillAction.setBillId(property.getId()); wxBillAction.setBillId(property.getId());


wxBillAction.setDetails(message + price + "元"); wxBillAction.setDetails(message + price + "元");
if(record.getServiceChargePayUpdate() != null){
wxBillAction.setDetails(record.getServiceChargePayBefore()+"元变更为" +record.getServiceChargePayUpdate()+"元");
if (record.getServiceChargePayUpdate() != null) {
wxBillAction.setDetails(record.getServiceChargePayBefore() + "元变更为" + record.getServiceChargePayUpdate() + "元");
wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode());
}else{
} else {
wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode());
} }
wxBillAction.setUserId(user.getId()); wxBillAction.setUserId(user.getId());
@@ -237,20 +249,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
updateBillStatus(record); updateBillStatus(record);
PageHelper.startPage(pageIndex, pageSize); PageHelper.startPage(pageIndex, pageSize);
List<WxBillProperty> billRentList = wxBillPropertyMapper.queryBillPropertyList(record); List<WxBillProperty> billRentList = wxBillPropertyMapper.queryBillPropertyList(record);
billRentList.stream().forEach(e->{
billRentList.stream().forEach(e -> {
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });


PageInfo<WxBillProperty> pageInfo = new PageInfo<>(billRentList); PageInfo<WxBillProperty> pageInfo = new PageInfo<>(billRentList);
@@ -262,11 +263,11 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
@Override @Override
public ResultData updatePaid(Long id) { public ResultData updatePaid(Long id) {
WxBillProperty record = wxBillPropertyMapper.selectById(id); WxBillProperty record = wxBillPropertyMapper.selectById(id);
if(record==null){
if (record == null) {
return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND); return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND);
} }
record.setStatus(EnumBillRentStatus.PAID.getCode()); record.setStatus(EnumBillRentStatus.PAID.getCode());
Date d =new Date();
Date d = new Date();
record.setPayDate(d); record.setPayDate(d);
record.setUpdatetime(d); record.setUpdatetime(d);
try { try {
@@ -285,26 +286,15 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
//押金 //押金
WxBillPropertyDeposit depositParam = new WxBillPropertyDeposit(); WxBillPropertyDeposit depositParam = new WxBillPropertyDeposit();
depositParam.setPropertyContractId(property.getPropertyContractId()); depositParam.setPropertyContractId(property.getPropertyContractId());
Map<String, Object> deposit = null;
List<Map<String, Object>> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(depositParam);
WxBillPropertyDeposit deposit = null;
List<WxBillPropertyDeposit> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(depositParam);
if (!billDepositList.isEmpty()) { if (!billDepositList.isEmpty()) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(property.getTenantId());
deposit = billDepositList.get(0); deposit = billDepositList.get(0);
}
//手续费 = 合同应收+手续费+滞纳金
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(property.getTenantId());
if(property.getReceivePay() != null){
if(property.getLatePayPrice() == null) property.setLatePayPrice(0l);
BigDecimal servicePay;
if(property.getServiceChargePay() != null){
servicePay = new BigDecimal(property.getServiceChargePay());
}else{
servicePay = new BigDecimal(property.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + property.getLatePayPrice() + property.getReceivePay();
property.setRealReceivePay(realReceivePay);
property.setServiceChargePay(servicePay.intValue());
}
wxBillPropertyDepositService.computeTotalMoney(wxPayAccountBill, deposit);
deposit.setOwe(deposit.getRealReceivePay() - deposit.getPay());


}
Map<String, Object> result = new HashMap<>(2); Map<String, Object> result = new HashMap<>(2);
result.put("property", property); result.put("property", property);
result.put("deposit", deposit); result.put("deposit", deposit);
@@ -330,20 +320,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
String billName = wxBillProperty.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) ? "商铺物业账单" : "多经点位物业账单"; String billName = wxBillProperty.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) ? "商铺物业账单" : "多经点位物业账单";


List<WxBillProperty> billPropertyList = wxBillPropertyMapper.queryBillPropertyList(wxBillProperty); List<WxBillProperty> billPropertyList = wxBillPropertyMapper.queryBillPropertyList(wxBillProperty);
billPropertyList.stream().forEach(e->{
billPropertyList.stream().forEach(e -> {
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
Map<Long, List<WxBillProperty>> collect = billPropertyList.parallelStream() Map<Long, List<WxBillProperty>> collect = billPropertyList.parallelStream()
.collect(Collectors.groupingBy(WxBillProperty::getMerchantId)); .collect(Collectors.groupingBy(WxBillProperty::getMerchantId));
@@ -377,7 +356,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
WxBillAction billAction = new WxBillAction(); WxBillAction billAction = new WxBillAction();


if(record.getLatePayMoneyUpdate() != null) {
if (record.getLatePayMoneyUpdate() != null) {
record.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); record.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100);


billAction.setId(idWorker.nextId()); billAction.setId(idWorker.nextId());
@@ -385,7 +364,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
billAction.setUserName("系统端"); billAction.setUserName("系统端");
billAction.setAction(EnumBillAction.UPDATE_LATE_PAY_MONEY.getCode()); billAction.setAction(EnumBillAction.UPDATE_LATE_PAY_MONEY.getCode());
billAction.setBillId(record.getId()); billAction.setBillId(record.getId());
billAction.setDetails(record.getLatePayMoneyBefore()+"元变更为" +record.getLatePayMoneyUpdate()+"元");
billAction.setDetails(record.getLatePayMoneyBefore() + "元变更为" + record.getLatePayMoneyUpdate() + "元");
billAction.setUpdatetime(new Date()); billAction.setUpdatetime(new Date());
wxBillActionMapper.insert(billAction); wxBillActionMapper.insert(billAction);
} }


+ 35
- 60
mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java Dosyayı Görüntüle

@@ -13,10 +13,7 @@ import com.iformall.domain.vo.RatioVo;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.mapper.*; import com.iformall.mapper.*;
import com.iformall.service.ExcelService;
import com.iformall.service.WxBillActionService;
import com.iformall.service.WxBillRentService;
import com.iformall.service.WxPayAccountBillService;
import com.iformall.service.*;
import com.iformall.utils.DateUtils; import com.iformall.utils.DateUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
@@ -59,6 +56,8 @@ public class WxBillRentServiceImpl implements WxBillRentService {
WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper;
@Autowired @Autowired
WxPayAccountBillService wxPayAccountBillService; WxPayAccountBillService wxPayAccountBillService;
@Autowired
WxBillDepositService wxBillDepositService;


@Override @Override
public PageInfo<WxBillRent> listAsPage(WxBillRent record, Integer pageIndex, Integer pageSize) { public PageInfo<WxBillRent> listAsPage(WxBillRent record, Integer pageIndex, Integer pageSize) {
@@ -68,23 +67,29 @@ public class WxBillRentServiceImpl implements WxBillRentService {
List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(record); List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(record);
billRentList.stream().forEach(e->{ billRentList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
PageInfo<WxBillRent> pageInfo = new PageInfo<>(billRentList); PageInfo<WxBillRent> pageInfo = new PageInfo<>(billRentList);
return pageInfo; return pageInfo;
} }


public void computeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillRent rent) {
if (rent.getReceivePay() != null) {
if (rent.getLatePayPrice() == null) {
rent.setLatePayPrice(0L);
}
BigDecimal servicePay;
if (rent.getServiceChargePay() != null) {
servicePay = new BigDecimal(rent.getServiceChargePay());
} else {
servicePay = new BigDecimal(rent.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + rent.getLatePayPrice() + rent.getReceivePay();
rent.setRealReceivePay(realReceivePay);
rent.setServiceChargePay(servicePay.intValue());
}
}

@Override @Override
public void updateBillStatus(WxBillRent record) { public void updateBillStatus(WxBillRent record) {
logger.info("更新租赁账单状态开始..."); logger.info("更新租赁账单状态开始...");
@@ -129,7 +134,12 @@ public class WxBillRentServiceImpl implements WxBillRentService {
public WxBillRent getById(Long id) { public WxBillRent getById(Long id) {
WxBillRent record = new WxBillRent(); WxBillRent record = new WxBillRent();
record.setId(id); record.setId(id);
return wxBillRentMapper.queryBillRentList(record).get(0);
WxBillRent rent = wxBillRentMapper.queryBillRentList(record).get(0);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId());
//手续费 = 合同应收+手续费+滞纳金
computeTotalMoney(wxPayAccountBill, rent);
rent.setOwe(rent.getRealReceivePay() - rent.getPay());
return rent;
} }


@Override @Override
@@ -175,7 +185,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
wxBillRent.setLatePayStatus(record.getLatePayStatus()); wxBillRent.setLatePayStatus(record.getLatePayStatus());
wxBillRent.setPay(record.getPay()); wxBillRent.setPay(record.getPay());
wxBillRent.setReceivePay(record.getReceivePay()); wxBillRent.setReceivePay(record.getReceivePay());
wxBillRent.setOwe(record.getReceivePay()-record.getPay());
wxBillRent.setOwe(record.getRealReceivePay() - record.getPay());
if (record.getPay().equals(record.getReceivePay())) { if (record.getPay().equals(record.getReceivePay())) {
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode());
Date payDate = record.getPayDate(); Date payDate = record.getPayDate();
@@ -243,18 +253,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
e.setPayRatio(0l); e.setPayRatio(0l);
} }
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
PageInfo<WxBillRent> pageInfo = new PageInfo<>(billRentList); PageInfo<WxBillRent> pageInfo = new PageInfo<>(billRentList);
return pageInfo; return pageInfo;
@@ -287,27 +286,14 @@ public class WxBillRentServiceImpl implements WxBillRentService {
//押金 //押金
WxBillDeposit depositParam = new WxBillDeposit(); WxBillDeposit depositParam = new WxBillDeposit();
depositParam.setRentContractId(rent.getRentContractId()); depositParam.setRentContractId(rent.getRentContractId());
Map<String, Object> deposit = null;
List<Map<String, Object>> billDepositList = wxBillDepositMapper.queryBillDepositList(depositParam);
WxBillDeposit deposit = null;
List<WxBillDeposit> billDepositList = wxBillDepositMapper.queryBillDepositList(depositParam);
if (!billDepositList.isEmpty()) { if (!billDepositList.isEmpty()) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(rent.getTenantId());
deposit = billDepositList.get(0); deposit = billDepositList.get(0);
wxBillDepositService.computeTotalMoney(wxPayAccountBill, deposit);
deposit.setOwe(deposit.getRealReceivePay() - deposit.getPay());
} }

//手续费 = 合同应收+手续费+滞纳金
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(rent.getTenantId());
if(rent.getReceivePay() != null){
if(rent.getLatePayPrice() == null) rent.setLatePayPrice(0l);
BigDecimal servicePay;
if(rent.getServiceChargePay() != null){
servicePay = new BigDecimal(rent.getServiceChargePay());
}else{
servicePay = new BigDecimal(rent.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + rent.getLatePayPrice() + rent.getReceivePay();
rent.setRealReceivePay(realReceivePay);
rent.setServiceChargePay(servicePay.intValue());
}

//周期 //周期
Map<String, Object> result = new HashMap<>(3); Map<String, Object> result = new HashMap<>(3);
result.put("rent", rent); result.put("rent", rent);
@@ -445,18 +431,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(wxBillRent); List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(wxBillRent);
billRentList.stream().forEach(e->{ billRentList.stream().forEach(e->{
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
if(e.getReceivePay() != null){
if(e.getLatePayPrice() == null) e.setLatePayPrice(0l);
BigDecimal servicePay;
if(e.getServiceChargePay() != null){
servicePay = new BigDecimal(e.getServiceChargePay());
}else{
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
}
computeTotalMoney(wxPayAccountBill, e);
}); });
Map<Long, List<WxBillRent>> collect = billRentList.parallelStream() Map<Long, List<WxBillRent>> collect = billRentList.parallelStream()
.collect(Collectors.groupingBy(WxBillRent::getMerchantId)); .collect(Collectors.groupingBy(WxBillRent::getMerchantId));


+ 10
- 9
mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml Dosyayı Görüntüle

@@ -23,6 +23,10 @@
<result column="return_price" jdbcType="BIGINT" property="returnPrice"/> <result column="return_price" jdbcType="BIGINT" property="returnPrice"/>
<result column="pay_way" jdbcType="INTEGER" property="payWay"/> <result column="pay_way" jdbcType="INTEGER" property="payWay"/>
<result column="service_charge_pay" property="serviceChargePay"/> <result column="service_charge_pay" property="serviceChargePay"/>
<result column="shop_info" property="shopInfo"/>
<result column="freeze" property="freeze"/>
<result column="merchant_name" property="merchantName"/>
<result column="shop_number" property="shopNumber"/>
</resultMap> </resultMap>


<sql id="allColumns"> <sql id="allColumns">
@@ -66,13 +70,11 @@
select <include refid="allColumns" /> from wx_bill_rent_deposit select <include refid="allColumns" /> from wx_bill_rent_deposit
<include refid="dynamicWhereConditions" /> <include refid="dynamicWhereConditions" />
</select> </select>

<select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxRentContract" resultType="hashmap">
select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate,
br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`,
br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`,
br.`merchant_id` merchantId,br.`rent_shop_type` rentShopType,br.`return_price` returnPrice,
br.pay_way payWay,br.shop_info shopInfo,br.freeze,br.service_charge_pay serviceChargePay
<select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillDeposit" resultType="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,
br.`owe`,br.`status`,br.`need_pay`,m.`name` merchant_name,s.shop_number,br.`updatetime`,br.`merchant_id`,
br.`rent_shop_type`,br.`return_price`, br.pay_way,br.shop_info ,br.freeze,br.service_charge_pay
from wx_bill_rent_deposit br left join wx_merchant m on br.merchant_id=m.id from wx_bill_rent_deposit br left join wx_merchant m on br.merchant_id=m.id
left join wx_shop s on br.shop_id=s.id left join wx_shop s on br.shop_id=s.id
<where> <where>
@@ -85,9 +87,8 @@
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
<if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if> <if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if>
<if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if>

</where> </where>
order by id desc
order by br.id desc
</select> </select>


<select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">


+ 9
- 6
mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml Dosyayı Görüntüle

@@ -25,6 +25,8 @@
<result column="pay_way" jdbcType="INTEGER" property="payWay"/> <result column="pay_way" jdbcType="INTEGER" property="payWay"/>
<result column="freeze" property="freeze"/> <result column="freeze" property="freeze"/>
<result column="service_charge_pay" property="serviceChargePay"/> <result column="service_charge_pay" property="serviceChargePay"/>
<result column="merchant_name" property="merchantName"/>
<result column="shop_number" property="shopNumber"/>
</resultMap> </resultMap>
<sql id="allColumns"> <sql id="allColumns">
@@ -69,12 +71,13 @@
<include refid="dynamicWhereConditions" /> <include refid="dynamicWhereConditions" />
</select> </select>
<select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultType="hashmap">
select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate,
br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`,
br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`,
br.`merchant_id` merchantId,br.`rent_shop_type` rentShopType,br.`return_price` returnPrice,br.`shop_info`
shopInfo,br.pay_way payWay,br.pay_way payWay,br.freeze,br.service_charge_pay serviceChargePay
<select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit"
resultType="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,
br.`pay_date`,br.`createtime`,br.`expired_day`,br.`owe`,br.`status`,
br.`need_pay`,m.`name` merchant_name,s.shop_number,br.`updatetime`,
br.`merchant_id`,br.`rent_shop_type`,br.`return_price`,br.`shop_info`,br.pay_way,
br.freeze,br.service_charge_pay
from wx_bill_property_deposit br left join wx_merchant m on br.merchant_id=m.id from wx_bill_property_deposit br left join wx_merchant m on br.merchant_id=m.id
left join wx_shop s on br.shop_id=s.id left join wx_shop s on br.shop_id=s.id
<where> <where>


Yükleniyor…
İptal
Kaydet