Explorar el Código

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

release_toaliyun_real
luozukai hace 6 años
padre
commit
cf12c3dce9
Se han modificado 4 ficheros con 44 adiciones y 20 borrados
  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 Ver fichero

@@ -263,4 +263,13 @@ public class WxMerchant extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
@SortColumn(column = "tradeDate") @SortColumn(column = "tradeDate")
private String 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 Ver fichero

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


//生成金额直接计算 //生成金额直接计算
if(!saveDb){ 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; return needpay;
} }


@@ -766,7 +766,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
months++; months++;
needpay = new Double(months * priceD).longValue(); needpay = new Double(months * priceD).longValue();
}else { }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){//第一期 }else if(i == 0){//第一期
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){
@@ -775,7 +775,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
months++; months++;
needpay = new Double(months * priceD).longValue(); needpay = new Double(months * priceD).longValue();
}else{ }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{ }else{
if(isFirstDay(startDate)){ if(isFirstDay(startDate)){
@@ -785,7 +785,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
} }
needpay = new Double(months * priceD).longValue(); needpay = new Double(months * priceD).longValue();
}else{ }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{//中间 }else{//中间


+ 29
- 16
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Ver fichero

@@ -1258,18 +1258,18 @@ public class WxRentContractServiceImpl implements WxRentContractService {
long needpayAfter = 0; long needpayAfter = 0;
//同一天,算一天 //同一天,算一天
if(sd.format(billTimeVo.getStartDate()).equals(sd.format(billTimeVo.getEndDate()))){ 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{ }else{
if(billTimeVo.getStartDate().before(endDate)){ if(billTimeVo.getStartDate().before(endDate)){
if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType()) && EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType()) && EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) {
//设置跳点率为年周期 price不变 //设置跳点率为年周期 price不变
needpayFront = priceArrs[index - 1]; needpayFront = priceArrs[index - 1];
}else { }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{ }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; needpay = needpayFront+needpayAfter;
@@ -1288,7 +1288,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {


//计算金额 //计算金额
if(!flag){ 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(); WxBillRent wxBillRent = new WxBillRent();
@@ -1332,7 +1332,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return resultMap; 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; long needpay;
//按日 //按日
if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){ if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){
@@ -1360,7 +1360,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {


//生成金额直接计算 //生成金额直接计算
if(!saveDb){ 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; 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"); int months = getMonths(sdM.format(startDate)+"-01",sdM.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))+"-01");
needpay = new Double(months * priceD).longValue(); needpay = new Double(months * priceD).longValue();
}else{ }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){//第一期 }else if(i == 0){//第一期
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){
@@ -1386,7 +1386,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
months++; months++;
needpay = new Double(months * priceD).longValue(); needpay = new Double(months * priceD).longValue();
}else{ }else{
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
} }
}else{ }else{
if(isFirstDay(startDate)){ if(isFirstDay(startDate)){
@@ -1396,7 +1396,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
needpay = new Double(months * priceD).longValue(); needpay = new Double(months * priceD).longValue();
}else{ }else{
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod)).longValue();
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue();
} }
} }
}else{//中间 }else{//中间
@@ -2253,7 +2253,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return wxRentContractMapper.getShopType(wxRentContract); 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 sd = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat sdD = new SimpleDateFormat("d"); 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"); int months = getMonths(sdM.format(start)+"-01",sdM.format(DateUtils.getDaySet(end,Calendar.DATE,1))+"-01");
return (months) * price; return (months) * price;
} }


+ 2
- 0
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml Ver fichero

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

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


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


Cargando…
Cancelar
Guardar