| @@ -15,10 +15,7 @@ import com.iformall.domain.vo.BillTimeVo; | |||||
| 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.WxFlowRecordService; | |||||
| import com.iformall.service.WxFlowService; | |||||
| import com.iformall.service.WxPropertyContractService; | |||||
| import com.iformall.service.WxRentContractService; | |||||
| import com.iformall.service.*; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.collections.map.HashedMap; | import org.apache.commons.collections.map.HashedMap; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -76,6 +73,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| @Autowired | @Autowired | ||||
| WxRentContractService wxRentContractService; | WxRentContractService wxRentContractService; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | public Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | ||||
| //Object rentContractStatusInfo = getRentContractStatusInfo(record); | //Object rentContractStatusInfo = getRentContractStatusInfo(record); | ||||
| @@ -621,6 +621,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| } | } | ||||
| 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) { | 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) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxPropertyContract.getTenantId()); | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| Map<String,Object> resultMap = new HashedMap(); | Map<String,Object> resultMap = new HashedMap(); | ||||
| List<WxBillProperty> resultList = new ArrayList<>(); | List<WxBillProperty> resultList = new ArrayList<>(); | ||||
| @@ -724,6 +725,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| wxBillProperty.setShopInfo(JSONObject.toJSONString(shopInfo)); | wxBillProperty.setShopInfo(JSONObject.toJSONString(shopInfo)); | ||||
| } | } | ||||
| wxBillProperty.setLatePayRatio(0); | wxBillProperty.setLatePayRatio(0); | ||||
| //计算手续费 | |||||
| BigDecimal servicePay = new BigDecimal(wxBillProperty.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); | |||||
| wxBillProperty.setServiceChargePay(servicePay.intValue()); | |||||
| resultList.add(wxBillProperty); | resultList.add(wxBillProperty); | ||||
| } | } | ||||
| //批量生成预账单 | //批量生成预账单 | ||||
| @@ -109,6 +109,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| @Autowired | @Autowired | ||||
| WxPropertyContractService wxPropertyContractService; | WxPropertyContractService wxPropertyContractService; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { | public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { | ||||
| //Object rentContractStatusInfo = getRentContractStatusInfo(record); | //Object rentContractStatusInfo = getRentContractStatusInfo(record); | ||||
| @@ -1213,6 +1216,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| public Map<String, Object> buildRent(int receivePeriod, long[] priceArrs, List<Date> yearList, int dayType, WxRentContract wxRentContract, Long userId, int billcount, Integer isPreview, String shopInfoStr,boolean saveDb) { | public Map<String, Object> buildRent(int receivePeriod, long[] priceArrs, List<Date> yearList, int dayType, WxRentContract wxRentContract, Long userId, int billcount, Integer isPreview, String shopInfoStr,boolean saveDb) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxRentContract.getTenantId()); | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| Map<String,Object> resultMap = new HashedMap(); | Map<String,Object> resultMap = new HashedMap(); | ||||
| List<WxBillRent> resultList = new ArrayList<>(); | List<WxBillRent> resultList = new ArrayList<>(); | ||||
| @@ -1253,7 +1257,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| index++; | index++; | ||||
| //如果是计算账单金额&cross 拆分日期进行计算 | //如果是计算账单金额&cross 拆分日期进行计算 | ||||
| if(!saveDb && billTimeVo.getEndDate().after(endDate)) { | |||||
| if(billTimeVo.getEndDate().after(endDate)) { | |||||
| long needpayFront = 0; | long needpayFront = 0; | ||||
| long needpayAfter = 0; | long needpayAfter = 0; | ||||
| //同一天,算一天 | //同一天,算一天 | ||||
| @@ -1320,6 +1324,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| wxBillRent.setPeriod(++billcount); | wxBillRent.setPeriod(++billcount); | ||||
| wxBillRent.setShopInfo(shopInfoStr); | wxBillRent.setShopInfo(shopInfoStr); | ||||
| wxBillRent.setLatePayRatio(0); | wxBillRent.setLatePayRatio(0); | ||||
| //计算手续费 | |||||
| BigDecimal servicePay = new BigDecimal(wxBillRent.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); | |||||
| wxBillRent.setServiceChargePay(servicePay.intValue()); | |||||
| resultList.add(wxBillRent); | resultList.add(wxBillRent); | ||||
| } | } | ||||
| @@ -196,7 +196,7 @@ | |||||
| expired_day, | expired_day, | ||||
| tenant_id, owe, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime, | tenant_id, owe, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime, | ||||
| rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info, | rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info, | ||||
| pay_way, late_pay_status, comments) | |||||
| pay_way, late_pay_status, comments,service_charge_pay) | |||||
| VALUES | VALUES | ||||
| <foreach collection="list" item="item" index="index" separator=","> | <foreach collection="list" item="item" index="index" separator=","> | ||||
| ( | ( | ||||
| @@ -204,7 +204,7 @@ | |||||
| #{item.expiredDay},#{item.tenantId},#{item.owe},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId}, | #{item.expiredDay},#{item.tenantId},#{item.owe},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId}, | ||||
| #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue}, | #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue}, | ||||
| #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo}, | #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo}, | ||||
| #{item.payWay},#{item.latePayStatus},#{item.comments} | |||||
| #{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay} | |||||
| ) | ) | ||||
| </foreach> | </foreach> | ||||
| </insert> | </insert> | ||||
| @@ -202,7 +202,7 @@ | |||||
| expired_day, | expired_day, | ||||
| tenant_id, owe, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime, | tenant_id, owe, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime, | ||||
| rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info, | rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info, | ||||
| pay_way, late_pay_status, comments) | |||||
| pay_way, late_pay_status, comments,service_charge_pay) | |||||
| VALUES | VALUES | ||||
| <foreach collection="list" item="item" index="index" separator=","> | <foreach collection="list" item="item" index="index" separator=","> | ||||
| ( | ( | ||||
| @@ -210,7 +210,7 @@ | |||||
| #{item.expiredDay},#{item.tenantId},#{item.owe},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId}, | #{item.expiredDay},#{item.tenantId},#{item.owe},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId}, | ||||
| #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue}, | #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue}, | ||||
| #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo}, | #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo}, | ||||
| #{item.payWay},#{item.latePayStatus},#{item.comments} | |||||
| #{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay} | |||||
| ) | ) | ||||
| </foreach> | </foreach> | ||||
| </insert> | </insert> | ||||