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

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

release_toaliyun_real
luozukai 6 лет назад
Родитель
Сommit
cf12c3dce9
4 измененных файлов: 44 добавлений и 20 удалений
  1. +9
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
  2. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  3. +29
    -16
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  4. +2
    -0
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml

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

@@ -263,4 +263,13 @@ public class WxMerchant extends BaseEntity {
@TableField(exist = false)
@SortColumn(column = "tradeDate")
private String tradeDate;

@TableField(exist = false)
@SortColumn(column = "consumeCountP")
private String consumeCountP;

@TableField(exist = false)
@SortColumn(column = "consumeCount")
private String consumeCount;

}

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

@@ -751,7 +751,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService

//生成金额直接计算
if(!saveDb){
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
return needpay;
}

@@ -766,7 +766,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
months++;
needpay = new Double(months * priceD).longValue();
}else {
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
}
}else if(i == 0){//第一期
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){
@@ -775,7 +775,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
months++;
needpay = new Double(months * priceD).longValue();
}else{
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
}
}else{
if(isFirstDay(startDate)){
@@ -785,7 +785,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}
needpay = new Double(months * priceD).longValue();
}else{
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
}
}
}else{//中间


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

@@ -1258,18 +1258,18 @@ public class WxRentContractServiceImpl implements WxRentContractService {
long needpayAfter = 0;
//同一天,算一天
if(sd.format(billTimeVo.getStartDate()).equals(sd.format(billTimeVo.getEndDate()))){
needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),endDate,i,billTimeVoList.size(),saveDb,dayType,receivePeriod);
needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),endDate,i,billTimeVoList.size(),saveDb,dayType,receivePeriod,false);
}else{
if(billTimeVo.getStartDate().before(endDate)){
if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType()) && EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) {
//设置跳点率为年周期 price不变
needpayFront = priceArrs[index - 1];
}else {
needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate, Calendar.DATE, -1), i, billTimeVoList.size(), saveDb, dayType, receivePeriod);
needpayAfter = getNeedPayMoney(wxRentContract, priceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb, dayType, receivePeriod);
needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate, Calendar.DATE, -1), i, billTimeVoList.size(), saveDb, dayType, receivePeriod,true);
needpayAfter = getNeedPayMoney(wxRentContract, priceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb, dayType, receivePeriod,true);
}
}else{
needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb,dayType,receivePeriod);
needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb,dayType,receivePeriod,false);
}
}
needpay = needpayFront+needpayAfter;
@@ -1288,7 +1288,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {

//计算金额
if(!flag){
needpay = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(),saveDb,dayType,receivePeriod);
needpay = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(),saveDb,dayType,receivePeriod,false);
}

WxBillRent wxBillRent = new WxBillRent();
@@ -1332,7 +1332,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return resultMap;
}

public long getNeedPayMoney(WxRentContract wxRentContract,long price,Date startDate,Date endDate,int i,int billTimeVoListSize,boolean saveDb,int dayType,int receivePeriod){
public long getNeedPayMoney(WxRentContract wxRentContract,long price,Date startDate,Date endDate,int i,int billTimeVoListSize,boolean saveDb,int dayType,int receivePeriod,boolean part){
long needpay;
//按日
if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){
@@ -1360,7 +1360,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {

//生成金额直接计算
if(!saveDb){
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,part)).longValue();
return needpay;
}

@@ -1377,7 +1377,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
int months = getMonths(sdM.format(startDate)+"-01",sdM.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))+"-01");
needpay = new Double(months * priceD).longValue();
}else{
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
}
}else if(i == 0){//第一期
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){
@@ -1386,7 +1386,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
months++;
needpay = new Double(months * priceD).longValue();
}else{
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
}
}else{
if(isFirstDay(startDate)){
@@ -1396,7 +1396,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
needpay = new Double(months * priceD).longValue();
}else{
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
}
}
}else{//中间
@@ -2253,7 +2253,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return wxRentContractMapper.getShopType(wxRentContract);
}

public static double getMonthNeedPay(Double price,Date start,Date end,int dayType,int receivePeriod){
public static double getMonthNeedPay(Double price,Date start,Date end,int dayType,int receivePeriod,boolean part){
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat sdD = new SimpleDateFormat("d");
@@ -2276,11 +2276,24 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}

//判断是否满足整月
Calendar instance = Calendar.getInstance();
instance.setTime(start);
instance.add(dayType, receivePeriod);
instance.add(Calendar.DATE, -1);
if(sd.format(instance.getTime()).equals(sd.format(end))){
boolean isFullMonth = false;
if(part){
int startInt = Integer.parseInt(sdD.format(start));
int endInt = Integer.parseInt(sdD.format(DateUtils.getDaySet(end,Calendar.DATE,1)));
if(startInt == endInt){
isFullMonth = true;
}
}else{
Calendar instance = Calendar.getInstance();
instance.setTime(start);
instance.add(dayType, receivePeriod);
instance.add(Calendar.DATE, -1);
if(sd.format(instance.getTime()).equals(sd.format(end))){
isFullMonth = true;
}
}

if(isFullMonth){
int months = getMonths(sdM.format(start)+"-01",sdM.format(DateUtils.getDaySet(end,Calendar.DATE,1))+"-01");
return (months) * price;
}


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

@@ -475,6 +475,8 @@
<if test=" null != linkPerson and ''!=linkPerson ">
and `link_person` like concat('%', #{linkPerson},'%')
</if>

<if test=" null != sortColumns">order by ${sortColumns}</if>
</select>

<select id="userTradeDetailList" parameterType="com.iformall.domain.po.WxMerchant" resultType="com.iformall.domain.vo.WxMerchantTradeDetailVo">


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