Przeglądaj źródła

[账单][修改][修改滞纳金计算]

release_toaliyun_real
luozukai 6 lat temu
rodzic
commit
56111d8da6
12 zmienionych plików z 161 dodań i 108 usunięć
  1. +17
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  2. +1
    -16
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  3. +11
    -0
      mallinkAdmin/src/main/resources/db/migration/V201907261815__L_ALTER_BILL.sql
  4. +5
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java
  5. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  6. +3
    -2
      mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java
  7. +106
    -68
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  8. +0
    -8
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  9. +2
    -1
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  10. +4
    -2
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml
  11. +3
    -2
      mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml
  12. +4
    -4
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

+ 17
- 3
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java Wyświetl plik

@@ -4,9 +4,8 @@ import com.iformall.annotation.SystemControllerLog;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.*;
import com.iformall.enums.EnumIsPreview;
import com.iformall.enums.EnumRentStartType;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxPropertyContractMapper;
@@ -21,6 +20,7 @@ import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
@@ -180,4 +180,18 @@ public class WxPropertyContractController extends BaseController {
return new ResultData();
}

/**
* 预览账单展示,编辑账期,后端生成账单金额
* @param wxPropertyContract
* @return
*/
@PostMapping("buildBillPriceList")
@SystemControllerLog(description = "物业合同-生成账单列表金额")
public ResultData buildBillPriceList(@RequestBody WxPropertyContract wxPropertyContract) throws Exception{
logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList");
WxPropertyContract dbRent = wxPropertyContractMapper.selectByPrimaryKey(wxPropertyContract.getId());
dbRent.setPreviewBillRentList(wxPropertyContract.getPreviewBillRentList());
List<WxBillProperty> result = wxPropertyContractService.buildProperty(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false);
return new ResultData(result);
}
}

+ 1
- 16
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java Wyświetl plik

@@ -84,23 +84,8 @@ public class WxRentContractController extends BaseController {
*/
@PostMapping("buildBillPriceList")
@SystemControllerLog(description = "租赁合同-生成账单列表金额")
public ResultData buildBillPriceList(@ModelAttribute WxRentContract wxRentContract) throws Exception{
public ResultData buildBillPriceList(@RequestBody WxRentContract wxRentContract) throws Exception{
logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList");

//todo:test
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// wxRentContract.setId(312447858201595904l);
// List<WxBillRent> previewBillRentList = new ArrayList<>();
// WxBillRent b = new WxBillRent();
// b.setStarttime(sdf.parse("2019-07-10"));
// b.setEndtime(sdf.parse("2020-08-10"));
// previewBillRentList.add(b);
// b = new WxBillRent();
// b.setStarttime(sdf.parse("2020-08-11"));
// b.setEndtime(sdf.parse("2021-07-30"));
// previewBillRentList.add(b);
// wxRentContract.setPreviewBillRentList(previewBillRentList);

WxRentContract dbRent = wxRentContractMapper.selectByPrimaryKey(wxRentContract.getId());
dbRent.setPreviewBillRentList(wxRentContract.getPreviewBillRentList());
List<WxBillRent> result = wxRentContractService.buildRent(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false);


+ 11
- 0
mallinkAdmin/src/main/resources/db/migration/V201907261815__L_ALTER_BILL.sql Wyświetl plik

@@ -0,0 +1,11 @@
ALTER TABLE `wx_rent_contract`
ADD COLUMN `late_pay_ratio` INT(10) NULL DEFAULT 0 COMMENT '滞纳金费率';

ALTER TABLE `wx_rent_contract`
ADD COLUMN `late_pay_day` INT(10) NULL DEFAULT NULL COMMENT 'n天后开始计算滞纳金';

ALTER TABLE `wx_property_contract`
ADD COLUMN `late_pay_ratio` INT(10) NULL DEFAULT 0 COMMENT '滞纳金费率';

ALTER TABLE `wx_property_contract`
ADD COLUMN `late_pay_day` INT(10) NULL DEFAULT NULL COMMENT 'n天后开始计算滞纳金';

+ 5
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java Wyświetl plik

@@ -6,11 +6,9 @@ import com.iformall.enums.EnumRentContractAdjustPeriod;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -143,6 +141,11 @@ public class WxPropertyContract extends BaseEntity {
@io.swagger.annotations.ApiModelProperty(value = "调整比例", name = "adjustRatio")
private String adjustRatio;

@io.swagger.annotations.ApiModelProperty(value = "滞纳金费率", name = "latePayRatio")
private Integer latePayRatio;

@io.swagger.annotations.ApiModelProperty(value = "n日后开始计算滞纳金", name = "latePayRatio")
private Integer daylatePay;

@Transient
@io.swagger.annotations.ApiModelProperty(value = "物业预账单列表", name = "previewBillRentList")


+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java Wyświetl plik

@@ -226,6 +226,11 @@ public class WxRentContract extends BaseEntity {
@io.swagger.annotations.ApiModelProperty(value = "操作类型1区分租赁物业2合并租赁物业", name = "operationType")
private Integer operationType;

@io.swagger.annotations.ApiModelProperty(value = "滞纳金费率", name = "latePayRatio")
private Integer latePayRatio;

@io.swagger.annotations.ApiModelProperty(value = "n日后开始计算滞纳金", name = "latePayRatio")
private Integer latePayDay;

public void setAdjustPeriodHandle() {
if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){


+ 3
- 2
mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java Wyświetl plik

@@ -2,11 +2,10 @@ package com.iformall.service;

import com.iformall.common.ResultData;
import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPropertyContract;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
import java.util.Map;

@@ -72,4 +71,6 @@ public interface WxPropertyContractService {
List<WxBillProperty> getWxBillPropertyPreview(Long id);

Map<String, Object> updateStatus(WxPropertyContract record);

List<WxBillProperty> buildProperty(WxMerchant wxMerchant, Long userId, WxPropertyContract propertyContract, Integer isPreview,boolean saveDb);
}

+ 106
- 68
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java Wyświetl plik

@@ -344,7 +344,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
//生成预览账单
wxBillPropertyMapper.deletePreviewBill(record);
//重新生成
List<WxBillProperty> billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode());
List<WxBillProperty> billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode(),true);
record.setPreviewBillRentList(billList);

message = "保存物业合同信息成功";
@@ -363,7 +363,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
//删除预账单,重新生成
wxBillPropertyMapper.deletePreviewBill(record);
//重新生成
billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode());
billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode(),true);
record.setPreviewBillRentList(billList);
}
}
@@ -532,7 +532,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
return JSONObject.toJSONString(shopInfo);
}

public List<WxBillProperty> buildRentMonth(WxMerchant wxMerchant, Long userId, WxPropertyContract wxPropertyContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview) {
public List<WxBillProperty> buildRentMonth(WxMerchant wxMerchant, Long userId, WxPropertyContract wxPropertyContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview,boolean saveDb) {
String adjustRatio = wxPropertyContract.getAdjustRatio();
String rentInfo = wxPropertyContract.getRentInfo();
Map<String, Object> shopInfo = new HashMap<>();
@@ -598,13 +598,13 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}
yearList.add(startDate);
}
Map<String, Object> resultMap = buildRent(receivePeriod, priceArr, yearList, Calendar.MONTH, wxPropertyContract, userId, wxMerchant, billcount, isPreview, shopInfo);
Map<String, Object> resultMap = buildRent(receivePeriod, priceArr, yearList, Calendar.MONTH, wxPropertyContract, userId, wxMerchant, billcount, isPreview, shopInfo,saveDb);
List<WxBillProperty> billRentList = (List<WxBillProperty>)resultMap.get("billList");
resultList.addAll(billRentList);
return resultList;
}

public Map<String, Object> buildRent(int receivePeriod,long[] priceArrs, List<Date> yearList,int dayType, WxPropertyContract wxPropertyContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview,Map<String, Object> shopInfo) {
public Map<String, Object> buildRent(int receivePeriod,long[] priceArrs, List<Date> yearList,int dayType, WxPropertyContract wxPropertyContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview,Map<String, Object> shopInfo,boolean saveDb) {
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
Map<String,Object> resultMap = new HashedMap();
List<WxBillProperty> resultList = new ArrayList<>();
@@ -615,28 +615,58 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
endDate = yearList.get(1);
}

List<BillTimeVo> billTimeVoList = WxRentContractServiceImpl.initBillTimeList(wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate(),wxPropertyContract.getAdjustPeriod(),dayType,receivePeriod);
List<BillTimeVo> billTimeVoList = new ArrayList<>();
if(saveDb){
billTimeVoList = WxRentContractServiceImpl.initBillTimeList(wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate(),wxPropertyContract.getAdjustPeriod(),dayType,receivePeriod);
}else{
//预账单编辑账期,生成金额
for (WxBillProperty rent:wxPropertyContract.getPreviewBillRentList()) {
BillTimeVo billTimeVo = new BillTimeVo();
billTimeVo.setStartDate(rent.getStarttime());
billTimeVo.setEndDate(rent.getEndtime());
billTimeVo.setReceiveDate(DateUtils.getDaySet(rent.getStarttime(),Calendar.DATE,-1));
billTimeVoList.add(billTimeVo);
}
}

int index = 0;
for (int i = 0; i < billTimeVoList.size(); i++) {
BillTimeVo billTimeVo = billTimeVoList.get(i);
//计算金额
long needpay = 0;

boolean flag = false;
if(yearList.size() > 1) {
if (endDate!=null && (sd.format(billTimeVo.getStartDate()).equals(sd.format(endDate)) || billTimeVo.getStartDate().after(endDate) || billTimeVo.getEndDate().after(endDate) )) {
logger.info("=====billTimeVo.getStartDate():"+sd.format(billTimeVo.getStartDate())+" endDate:"+sd.format(endDate));

index++;
if(index >= yearList.size()-1){
endDate = null;
}else{
endDate = yearList.get(index+1);//price index 0开始,year.end 从第二年开始
logger.info("==========cross:"+sd.format(endDate));
if(yearList.size() > 1) {
if (endDate!=null && (sd.format(billTimeVo.getStartDate()).equals(sd.format(endDate)) || billTimeVo.getStartDate().after(endDate) || billTimeVo.getEndDate().after(endDate) )) {
//logger.info("=====billTimeVo.getStartDate():"+sd.format(billTimeVo.getStartDate())+" endDate:"+sd.format(endDate));

index++;
if(index >= yearList.size()-1){
endDate = null;
}else{
//如果是计算账单金额&cross 拆分日期进行计算
if(!saveDb && billTimeVo.getEndDate().after(endDate)) {
long needpayFront = getNeedPayMoney(wxPropertyContract,priceArrs[index-1],billTimeVo.getStartDate(),DateUtils.getDaySet(endDate,Calendar.DATE,-1),i,billTimeVoList.size());
long needpayAfter = getNeedPayMoney(wxPropertyContract,priceArrs[index],endDate,billTimeVo.getEndDate(),i,billTimeVoList.size());
System.out.println();
needpay = needpayFront+needpayAfter;
flag = true;
}

endDate = yearList.get(index+1);//price index 0开始,year.end 从第二年开始
//logger.info("==========cross:"+sd.format(endDate));
}
}
}
}
}

//获取price 、shopInfo
long price = priceArrs[index];
//计算金额
if(!flag){
needpay = getNeedPayMoney(wxPropertyContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size());
}

WxBillProperty wxBillProperty = new WxBillProperty();
wxBillProperty.setIsPreview(isPreview);
@@ -647,53 +677,6 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxBillProperty.setEndtime(billTimeVo.getEndDate());
wxBillProperty.setReceiveDate(billTimeVo.getReceiveDate());

long needpay;
//按日
if (wxPropertyContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){
Double priceD = new Double(price);
double needpayD = WxRentContractServiceImpl.getNeedPay(0,priceD,wxBillProperty.getStarttime(),wxBillProperty.getEndtime());
needpay = new Double(needpayD).longValue();
}else{
//年 需要除12
Double priceD = new Double(price);
if(EnumPriceUnit.Y.getCode().equals(wxPropertyContract.getPriceUnit())){
priceD = new Double(price)/12;
}

SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM");
if(i == billTimeVoList.size()-1){//最后
if(isFirstDay(billTimeVo.getStartDate())){
int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01");
months++;
needpay = new Double(months * priceD).longValue();
}else {
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD,billTimeVo.getStartDate(),billTimeVo.getEndDate())).longValue();
}
}else if(i == 0){//第一期
if(wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){
if(isFirstDay(billTimeVo.getStartDate())){
int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01");
months++;
needpay = new Double(months * priceD).longValue();
}else{
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, billTimeVo.getStartDate(), billTimeVo.getEndDate())).longValue();
}
}else{
int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01");
if(isFirstDay(billTimeVo.getStartDate())){
months++;
}
needpay = new Double(months * priceD).longValue();
}
}else{//中间
int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01");
if(isFirstDay(billTimeVo.getStartDate())){
months++;
}
needpay = new Double(months * priceD).longValue();
}
}

wxBillProperty.setNeedPay(needpay);
wxBillProperty.setOwe(needpay);
wxBillProperty.setReceivePay(needpay);
@@ -715,16 +698,71 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxBillProperty.setShopInfo(JSONObject.toJSONString(shopInfo));
}
wxBillProperty.setLatePayRatio(0);
//wxBillPropertyMapper.insertSelective(wxBillProperty);
resultList.add(wxBillProperty);
}
//批量生成预账单
wxBillPropertyMapper.insertBills(resultList);
if(saveDb) {
wxBillPropertyMapper.insertBills(resultList);
}
resultMap.put("billcount",billcount);
resultMap.put("billList",resultList);
return resultMap;
}

public long getNeedPayMoney(WxPropertyContract wxRentContract,long price,Date startDate,Date endDate,int i,int billTimeVoListSize){
long needpay;
//按日
if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){
Double priceD = new Double(price);
double needpayD = WxRentContractServiceImpl.getNeedPay(0,priceD,startDate,endDate);
needpay = new Double(needpayD).longValue();
}else{
//年 需要除12
Double priceD = new Double(price);
if(EnumPriceUnit.Y.getCode().equals(wxRentContract.getPriceUnit())){
priceD = new Double(price)/12;
}

SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM");
if(i == billTimeVoListSize - 1){//最后
if(isFirstDay(startDate)){
int months = WxRentContractServiceImpl.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01");
months++;
needpay = new Double(months * priceD).longValue();
}else {
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate)).longValue();
}
}else if(i == 0){//第一期
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){
if(isFirstDay(startDate)){
int months = WxRentContractServiceImpl.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01");
months++;
needpay = new Double(months * priceD).longValue();
}else{
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate)).longValue();
}
}else{
if(isFirstDay(startDate)){
int months = WxRentContractServiceImpl.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01");
if(isFirstDay(startDate)){
months++;
}
needpay = new Double(months * priceD).longValue();
}else{
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate)).longValue();
}
}
}else{//中间
int months = WxRentContractServiceImpl.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01");
if(isFirstDay(startDate)){
months++;
}
needpay = new Double(months * priceD).longValue();
}
}
return needpay;
}

public void setExpiredDay(WxBillProperty wxBillProperty,int dayType, int receivePeriod){
Date date = new Date();
if (wxBillProperty.getReceiveDate().before(date)) {
@@ -760,8 +798,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
* @param propertyContract
* @return
*/
@Override
@Transactional(rollbackFor = {Exception.class})
public List<WxBillProperty> buildProperty(WxMerchant wxMerchant,Long userId,WxPropertyContract propertyContract,Integer isPreview) {
public List<WxBillProperty> buildProperty(WxMerchant wxMerchant,Long userId,WxPropertyContract propertyContract,Integer isPreview,boolean saveDb) {
List<WxBillProperty> result = new ArrayList<>();

WxPropertyContract wxPropertyContract;
@@ -788,7 +827,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
Long price = propertyContract.getPrice();

//按月计租
result = buildRentMonth(wxMerchant, userId, propertyContract, receivePeriod, lease, rentalStartDate, price,isPreview);
result = buildRentMonth(wxMerchant, userId, propertyContract, receivePeriod, lease, rentalStartDate, price,isPreview,saveDb);
}
for (int i = 0; i < result.size(); i++) {
result.get(i).setPeriod(i+1);
@@ -796,7 +835,6 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
return result;
}


@Override
public void deleteById(Long id) {
wxPropertyContractMapper.deleteByPrimaryKey(id);


+ 0
- 8
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Wyświetl plik

@@ -1034,8 +1034,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
boolean flag = false;
if(yearList.size() > 1) {
if (endDate!=null && (sd.format(billTimeVo.getStartDate()).equals(sd.format(endDate)) || billTimeVo.getStartDate().after(endDate) || billTimeVo.getEndDate().after(endDate) )) {
logger.info("=====billTimeVo.getStartDate():"+sd.format(billTimeVo.getStartDate())+" endDate:"+sd.format(endDate));

if(yearList.size() > 1) {
if (endDate!=null && (sd.format(billTimeVo.getStartDate()).equals(sd.format(endDate)) || billTimeVo.getStartDate().after(endDate) || billTimeVo.getEndDate().after(endDate) )) {
//logger.info("=====billTimeVo.getStartDate():"+sd.format(billTimeVo.getStartDate())+" endDate:"+sd.format(endDate));
@@ -1046,14 +1044,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}else{
//如果是计算账单金额&cross 拆分日期进行计算
if(!saveDb && billTimeVo.getEndDate().after(endDate)) {
logger.info("==========s:"+sd.format(billTimeVo.getStartDate()));
logger.info("==========e:"+sd.format(billTimeVo.getEndDate()));
logger.info("==========endDate:"+sd.format(endDate));

long needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),DateUtils.getDaySet(endDate,Calendar.DATE,-1),i,billTimeVoList.size());
long needpayAfter = getNeedPayMoney(wxRentContract,priceArrs[index],endDate,billTimeVo.getEndDate(),i,billTimeVoList.size());
logger.info("==========needpayFront:"+needpayFront);
logger.info("==========needpayAfter:"+needpayAfter);
System.out.println();
needpay = needpayFront+needpayAfter;
flag = true;


+ 2
- 1
mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml Wyświetl plik

@@ -92,12 +92,13 @@
merchant_name,s.shop_number,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`period`,
br.`revenue`,br.`late_pay_ratio`,br.`late_pay_time`,br.`property_contract_id`,d.receive_pay deposit,
case when br.late_pay_status=2 then (case when br.late_pay_time is null then 0
else FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe)end)
else FLOOR(DATEDIFF(now(),date_add(br.receive_date,interval r.late_pay_day day))*r.late_pay_ratio/10000*br.owe)end)
else br.late_pay_price end late_pay_price,d.`status`
deposit_status,br.`shop_info`,br.pay_way,br.late_pay_status,
br.`comments`,br.starttime,br.endtime
from wx_bill_property 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_property_contract r on br.property_contract_id=r.id
left join wx_bill_property_deposit d on br.property_contract_id=d.property_contract_id
<where>
br.is_preview = 0


+ 4
- 2
mallinkService/src/main/resources/mapper/WxBillRentMapper.xml Wyświetl plik

@@ -98,8 +98,10 @@
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,r.merchant_name,
s.shop_number,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,r.type as rent_type,
r.pay_ratio,br.`revenue`,br.`late_pay_ratio`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`,
d.receive_pay deposit,case when br.late_pay_status=2 then (case when br.late_pay_time is null then 0
else FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe)end) else br.late_pay_price end
d.receive_pay deposit,
case when br.late_pay_status=2 then (case when br.late_pay_time is null then 0
else FLOOR(DATEDIFF(now(),date_add(br.receive_date,interval r.late_pay_day day))*r.late_pay_ratio/10000*br.owe)end)
else br.late_pay_price end
late_pay_price,d.`status`
deposit_status,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime
from wx_bill_rent br


+ 3
- 2
mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml Wyświetl plik

@@ -44,7 +44,8 @@
<result column="rent_start_type" property="rentStartType"/>
<result column="operation_type" property="operationType"/>
<result column="late_pay_ratio" property="latePayRatio"/>
<result column="late_pay_day" property="latePayDay"/>
</resultMap>
<sql id="allColumns">
@@ -54,7 +55,7 @@
`shop_type`,`shop_id`,`updatetime`,`createtime`,`rent_area`,
`link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`,
`start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,
`file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`
`file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day
</sql>
<sql id="dynamicWhereConditions">


+ 4
- 4
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Wyświetl plik

@@ -51,10 +51,10 @@
<result column="rent_input_way" property="rentInputWay"/>
<result column="adjust_ratio_way" property="adjustRatioWay"/>
<result column="operation_type" property="operationType"/>
<result column="late_pay_ratio" property="latePayRatio"/>
<result column="late_pay_day" property="latePayDay"/>

</resultMap>
<sql id="allColumns">
@@ -65,7 +65,7 @@
`start_date`,`end_date`,
`apply_status`,`bank_name`,`rent_shop_type`,`fix_start_date`,`fix_end_date`,
`business_type`,`rent_info`, `file_names`,price_unit,rent_price,`subject_name`,rent_start_type,
`rent_input_way`,`adjust_ratio_way`,`operation_type`
`rent_input_way`,`adjust_ratio_way`,`operation_type`,late_pay_ratio,late_pay_day
</sql>


Ładowanie…
Anuluj
Zapisz