|
|
|
@@ -187,11 +187,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
//保存租赁合同信息 |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
if (record.getStartDate().after(record.getRentalStartDate())) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR, "起租开始时间不能大于计租开始时间"); |
|
|
|
} |
|
|
|
int dayType = record.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; |
|
|
|
|
|
|
|
//计租开始时间 |
|
|
|
Calendar instance = Calendar.getInstance(); |
|
|
|
instance.setTime(record.getRentalStartDate()); |
|
|
|
@@ -262,11 +258,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
} else { |
|
|
|
WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); |
|
|
|
if (wxShop != null && wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { |
|
|
|
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); |
|
|
|
} else { |
|
|
|
if (wxShop == null) { |
|
|
|
return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); |
|
|
|
} |
|
|
|
if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { |
|
|
|
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
@@ -487,11 +484,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
} else { |
|
|
|
WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); |
|
|
|
if (wxShop != null && wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { |
|
|
|
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); |
|
|
|
} else { |
|
|
|
if (wxShop == null) { |
|
|
|
return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); |
|
|
|
} |
|
|
|
if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { |
|
|
|
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|