zhengfangyuan 3 лет назад
Родитель
Сommit
e2bb52ee21
3 измененных файлов: 7 добавлений и 73 удалений
  1. +4
    -4
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  2. +3
    -3
      mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java
  3. +0
    -66
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

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

@@ -402,8 +402,8 @@ public class WxRentContract extends TenantEntity {
@TableField(exist = false)
private Integer flowHas;
@io.swagger.annotations.ApiModelProperty(value = "商业管理费", name = "bussinessManagementFee")
private Long bussinessManagementFee;
@io.swagger.annotations.ApiModelProperty(value = "商业管理费单价", name = "bussinessManagementFee")
private String bussinessManagementFee;
@io.swagger.annotations.ApiModelProperty(value = "商业管理费调整方式1按比例2按金额", name = "bussinessManagementFeeRatioWay")
private Integer bussinessManagementFeeRatioWay;
@@ -411,8 +411,8 @@ public class WxRentContract extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "商业管理费调整方式1按比例2按金额", name = "bussinessManagementFeeRatio")
private String bussinessManagementFeeRatio;
@io.swagger.annotations.ApiModelProperty(value = "营业管理费", name = "operatingManagementFee")
private Long operatingManagementFee;
@io.swagger.annotations.ApiModelProperty(value = "营业管理费单价", name = "operatingManagementFee")
private String operatingManagementFee;
@io.swagger.annotations.ApiModelProperty(value = "营业管理费调整方式1按比例2按金额", name = "operatingManagementFeeRatioWay")
private Integer operatingManagementFeeRatioWay;


+ 3
- 3
mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java Просмотреть файл

@@ -43,7 +43,7 @@ public class WxRentContractHelper {
}
//计算除租金外其他可调整费项(按面积计算)
private static long[] calcuteOtherCanAdjustFeeByArea(WxRentContract wxRentContract,Long fee,Integer ratioWay,String ratio,String feeField,String feeRatioField) {
private static long[] calcuteOtherCanAdjustFeeByArea(WxRentContract wxRentContract,String fee,Integer ratioWay,String ratio,String feeField,String feeRatioField) {
if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_AREA.getCode()) ||
wxRentContract.getType().equals(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode())) {
if (wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode())) {
@@ -71,14 +71,14 @@ public class WxRentContractHelper {
return null;
}
}else {
if (null == fee) {
if (StringUtils.isBlank(fee)) {
return null;
}
String rentArea = wxRentContract.getRentArea();
if (rentArea == null || rentArea.equalsIgnoreCase("NaN")) {
rentArea = "0";
}
Long ratioFirstYearPrice = new BigDecimal(fee).multiply(new BigDecimal(rentArea)).longValue();
Long ratioFirstYearPrice = new BigDecimal(fee).multiply(new BigDecimal(100)).multiply(new BigDecimal(rentArea)).longValue();
return calcuteRatioByJoin(ratioWay, ratio, ratioFirstYearPrice);
}
}


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

@@ -923,72 +923,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
}
private void buildBussinessManagementFee( Long userId,WxRentContract wxRentContract) {
if (wxRentContract != null && wxRentContract.getBussinessManagementFee() > 0) {
final IdWorker idWorker = IdWorker.get();
WxBillDeposit wxBillDeposit = new WxBillDeposit();
wxBillDeposit.setId(idWorker.nextId());
wxBillDeposit.setRentContractId(wxRentContract.getId());
wxBillDeposit.setPay(0L);
long needpay = wxRentContract.getDeposit();
wxBillDeposit.setReceivePay(needpay);
wxBillDeposit.setNeedPay(needpay);
wxBillDeposit.setOwe(needpay);
//找到计租方式
int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH;

Date date = new Date();
Calendar instance = Calendar.getInstance();
instance.setTime(wxRentContract.getRentalStartDate());
instance.add(Calendar.DAY_OF_MONTH, -1);
Date time = instance.getTime();
wxBillDeposit.setReceiveDate(time);

//账单开始时间
instance.clear();
instance.setTime(wxBillDeposit.getReceiveDate());
instance.add(Calendar.DAY_OF_MONTH, 1);
wxBillDeposit.setStarttime(instance.getTime());
//账单结束时间
instance.clear();
instance.setTime(wxBillDeposit.getReceiveDate());
instance.add(dayType, wxRentContract.getLease());
wxBillDeposit.setEndtime(instance.getTime());
wxBillDeposit.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillDeposit.setExpiredDay(0L);
wxBillDeposit.setReceiveDate(time);
wxBillDeposit.updateTenantInfo(wxRentContract);
wxBillDeposit.setIsDel(0);
wxBillDeposit.setMerchantId(wxRentContract.getMerchantId());
wxBillDeposit.setUserId(userId);
if (wxRentContract.shopIdsByRentInfo().size()==1) {
wxBillDeposit.setShopId(wxRentContract.shopIdsByRentInfo().get(0));
}
wxBillDeposit.setCreatetime(date);
wxBillDeposit.setUpdatetime(date);
wxBillDeposit.setIsDel(EnumDelStatus.NOT_DEL.getCode());
wxBillDeposit.setRentShopType(wxRentContract.getRentShopType());
if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) {
String rentInfo = wxRentContract.getRentInfo();
if (rentInfo != null) {
JSONArray rentInfoArray = JSONArray.parseArray(rentInfo);
Map<String, Object> shopInfo = new HashMap<>();
for (int i = 0, size = rentInfoArray.size(); i < size; i++) {
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i);
shopInfo.put(rentInfoObject.getString("shopNumber"), rentInfoObject.get("deposit"));
}
wxBillDeposit.setShopInfo(JSONObject.toJSONString(shopInfo));
}
}
try {
wxBillDepositMapper.insert(wxBillDeposit);
} catch (Exception e) {
logger.error("添加押金账单失败,e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
}
}
}

@Override
public Object getMerchants(WxRentContract wxRentContract) {
List<WxRentContract> rentContractList = wxRentContractMapper.getMerchants(wxRentContract);


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