Просмотр исходного кода

[租赁合同][修改][判断店铺已出租问题]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
fadbed30be
1 измененных файлов: 14 добавлений и 4 удалений
  1. +14
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

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

@@ -229,12 +229,17 @@ public class WxRentContractServiceImpl implements WxRentContractService {
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i);
WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setTenantId(record.getTenantId());
wxRentContract.setShopId(rentInfoObject.getLong("shopId"));
Long shopId = rentInfoObject.getLong("shopId");
wxRentContract.setShopId(shopId);
int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract);
if (count > 0) {
String shopNumber = rentInfoObject.getString("shopNumber");
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租");
}
WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId);
if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) {
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租");
}
}
} else {
WxRentContract wxRentContract = new WxRentContract();
@@ -298,7 +303,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {

// 更新
ResultData resultData = getResultDataForUpdate(record, userId);

if (resultData.code != Result.SUCCESS) {
return resultData;
}
if (dbRent.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) {
if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null
&& !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0)) {
@@ -442,11 +449,11 @@ public class WxRentContractServiceImpl implements WxRentContractService {
int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery);
if (count > 0) {
String shopNumber = rentInfoObject.getString("shopNumber");
return new ResultData(ErrorCode.SHOP_IS_RENT, "店铺 " + shopNumber + " 已出租");
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租");
}
WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId);
if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) {
return new ResultData(ErrorCode.SHOP_IS_RENT, "店铺 " + wxShop.getShopNumber() + " 已出租");
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租");
}

}
@@ -1175,6 +1182,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
}
ResultData resultData = getResultDataForUpdate(record, userId);
if (resultData.code != Result.SUCCESS) {
return resultData;
}
// 启动审批流
if(record.getFlowParams() != null){
record.getFlowParams().put("businessId",record.getId().toString());


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