| @@ -218,6 +218,17 @@ public class WxRentContract implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "物业合同预账单列表", name = "reviewBillPropertyPList") | @io.swagger.annotations.ApiModelProperty(value = "物业合同预账单列表", name = "reviewBillPropertyPList") | ||||
| private List<WxBillProperty> 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() { | public List<WxBillProperty> getReviewBillPropertyPList() { | ||||
| return reviewBillPropertyPList; | return reviewBillPropertyPList; | ||||
| } | } | ||||
| @@ -2,6 +2,7 @@ package com.iformall.service.impl; | |||||
| import cn.afterturn.easypoi.word.WordExportUtil; | import cn.afterturn.easypoi.word.WordExportUtil; | ||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| @@ -480,6 +481,27 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return rentList; | 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) { | public List<WxBillRent> buildRentMonth(WxMerchant wxMerchant, Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Integer price,Integer isPreview) { | ||||
| String adjustRatio = wxRentContract.getAdjustRatio(); | String adjustRatio = wxRentContract.getAdjustRatio(); | ||||
| List<Integer> integers = JSONArray.parseArray(adjustRatio, Integer.class); | List<Integer> integers = JSONArray.parseArray(adjustRatio, Integer.class); | ||||
| @@ -42,6 +42,7 @@ | |||||
| <result column="fix_end_date" property="fixEndDate"/> | <result column="fix_end_date" property="fixEndDate"/> | ||||
| <result column="business_type" property="businessType"/> | <result column="business_type" property="businessType"/> | ||||
| <result column="receive_period" property="receivePeriod"/> | <result column="receive_period" property="receivePeriod"/> | ||||
| <result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| @@ -49,7 +50,7 @@ | |||||
| `tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`, | `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`, | `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`, | `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> | </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.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 | 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 | 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 | from wx_rent_contract rc | ||||
| left join wx_shop s on rc.shop_id=s.id | left join wx_shop s on rc.shop_id=s.id | ||||
| left join wx_mall_floor f on s.floor=f.id | left join wx_mall_floor f on s.floor=f.id | ||||