From a9abd78c8d75b1b7293b839f05ab2cd938220b6d Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 23 Apr 2019 18:19:27 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E5=BA=97=E9=93=BA=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxRentContractServiceImpl.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 979fd523b..2d60be180 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -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 {