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

[租赁合同][修改][账单生成]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
6e93ac0e2b
3 измененных файлов: 36 добавлений и 2 удалений
  1. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  2. +22
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  3. +3
    -2
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

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

@@ -218,6 +218,17 @@ public class WxRentContract implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "物业合同预账单列表", name = "reviewBillPropertyPList")
private List<WxBillProperty> reviewBillPropertyPList;

@io.swagger.annotations.ApiModelProperty(value = "租金信息", name = "rentInfo")
private String rentInfo;

public String getRentInfo() {
return rentInfo;
}

public void setRentInfo(String rentInfo) {
this.rentInfo = rentInfo;
}

public List<WxBillProperty> getReviewBillPropertyPList() {
return reviewBillPropertyPList;
}


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

@@ -2,6 +2,7 @@ package com.iformall.service.impl;

import cn.afterturn.easypoi.word.WordExportUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
@@ -480,6 +481,27 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return rentList;
}

public int[] computePrice(WxRentContract wxRentContract) {

JSONArray rentInfoArray = JSONArray.parseArray(wxRentContract.getRentInfo());
int arraySize = rentInfoArray.size();
int[] priceArr = new int[arraySize];
for (int i = 0; i < arraySize; i++) {
double priceSum = 0;
for (int j = i; j < arraySize; j++) {
JSONObject rentInfoObject = rentInfoArray.getJSONObject(j);
double price = rentInfoObject.getDoubleValue("price");//1000 2000 3000
JSONArray adjustRatio = rentInfoObject.getJSONArray("adjustRatio");//[1000]
adjustRatio.set(0, 0);
int ratio = adjustRatio.getIntValue(j);//0 1000
price = price + price * ratio / 10000.0;//1000 2000 3000
priceSum = priceSum + price;//1000 2000 3000
}
priceArr[i] = new BigDecimal(priceSum).setScale(0, RoundingMode.HALF_EVEN).intValue();//6000
}
return priceArr;
}

public List<WxBillRent> buildRentMonth(WxMerchant wxMerchant, Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Integer price,Integer isPreview) {
String adjustRatio = wxRentContract.getAdjustRatio();
List<Integer> integers = JSONArray.parseArray(adjustRatio, Integer.class);


+ 3
- 2
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Просмотреть файл

@@ -42,6 +42,7 @@
<result column="fix_end_date" property="fixEndDate"/>
<result column="business_type" property="businessType"/>
<result column="receive_period" property="receivePeriod"/>
<result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/>
</resultMap>
<sql id="allColumns">
@@ -49,7 +50,7 @@
`tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`,
`brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone`,
`pay_account`,`filename`,`lease`,`type`,`revenue`,`adjust_ratio`,`adjust_period`,`pay_ratio`,
`start_date`,`end_date`,`apply_status`,`bank_name`,`rent_shop_type`,fix_start_date,fix_end_date,business_type
`start_date`,`end_date`,`apply_status`,`bank_name`,`rent_shop_type`,fix_start_date,fix_end_date,business_type,rent_info
</sql>
@@ -108,7 +109,7 @@
rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type,
rc.start_date startDate,rc.end_date endDate,br.`name` brandName,rc.apply_status applyStatus,rc.bank_name
bankName,rc.merchant_id merchantId,rc.rent_shop_type rentShopType,rc.fix_start_date fixStartDate,rc.fix_end_date fixEndDate
,rc.business_type businessType,rc.adjust_period adjustPeriod
,rc.business_type businessType,rc.adjust_period adjustPeriod,rc.rent_info rentInfo
from wx_rent_contract rc
left join wx_shop s on rc.shop_id=s.id
left join wx_mall_floor f on s.floor=f.id


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