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

[修改][手续费][开发]

release_toaliyun_real
luozukai 6 лет назад
Родитель
Сommit
cadb288762
4 измененных файлов: 23 добавлений и 9 удалений
  1. +10
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  2. +9
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  3. +2
    -2
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  4. +2
    -2
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml

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

@@ -15,10 +15,7 @@ import com.iformall.domain.vo.BillTimeVo;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
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 org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@@ -76,6 +73,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
@Autowired
WxRentContractService wxRentContractService;

@Autowired
WxPayAccountBillService wxPayAccountBillService;

@Override
public Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) {
//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) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxPropertyContract.getTenantId());
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
Map<String,Object> resultMap = new HashedMap();
List<WxBillProperty> resultList = new ArrayList<>();
@@ -724,6 +725,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxBillProperty.setShopInfo(JSONObject.toJSONString(shopInfo));
}
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);
}
//批量生成预账单


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

@@ -109,6 +109,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
@Autowired
WxPropertyContractService wxPropertyContractService;

@Autowired
WxPayAccountBillService wxPayAccountBillService;

@Override
public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) {
//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) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxRentContract.getTenantId());
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
Map<String,Object> resultMap = new HashedMap();
List<WxBillRent> resultList = new ArrayList<>();
@@ -1253,7 +1257,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
index++;

//如果是计算账单金额&cross 拆分日期进行计算
if(!saveDb && billTimeVo.getEndDate().after(endDate)) {
if(billTimeVo.getEndDate().after(endDate)) {
long needpayFront = 0;
long needpayAfter = 0;
//同一天,算一天
@@ -1320,6 +1324,10 @@ public class WxRentContractServiceImpl implements WxRentContractService {
wxBillRent.setPeriod(++billcount);
wxBillRent.setShopInfo(shopInfoStr);
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);
}



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

@@ -196,7 +196,7 @@
expired_day,
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,
pay_way, late_pay_status, comments)
pay_way, late_pay_status, comments,service_charge_pay)
VALUES
<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.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.payWay},#{item.latePayStatus},#{item.comments}
#{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay}
)
</foreach>
</insert>


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

@@ -202,7 +202,7 @@
expired_day,
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,
pay_way, late_pay_status, comments)
pay_way, late_pay_status, comments,service_charge_pay)
VALUES
<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.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.payWay},#{item.latePayStatus},#{item.comments}
#{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay}
)
</foreach>
</insert>


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