Преглед изворни кода

[租赁合同][修改][店铺删除问题]

release_toaliyun_real
gongbiao пре 7 година
родитељ
комит
a9abd78c8d
1 измењених фајлова са 8 додато и 10 уклоњено
  1. +8
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 8
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Прегледај датотеку

@@ -187,11 +187,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
//保存租赁合同信息 //保存租赁合同信息
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId()); 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; int dayType = record.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH;

//计租开始时间 //计租开始时间
Calendar instance = Calendar.getInstance(); Calendar instance = Calendar.getInstance();
instance.setTime(record.getRentalStartDate()); instance.setTime(record.getRentalStartDate());
@@ -262,11 +258,12 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
} else { } else {
WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); 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 + " 已删除"); 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 { } else {
@@ -487,11 +484,12 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
} else { } else {
WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId); 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 + " 已删除"); 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 { } else {


Loading…
Откажи
Сачувај