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

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

release_toaliyun_real
gongbiao пре 7 година
родитељ
комит
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); JSONObject rentInfoObject = rentInfoArray.getJSONObject(i);
WxRentContract wxRentContract = new WxRentContract(); WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setTenantId(record.getTenantId()); wxRentContract.setTenantId(record.getTenantId());
wxRentContract.setShopId(rentInfoObject.getLong("shopId"));
Long shopId = rentInfoObject.getLong("shopId");
wxRentContract.setShopId(shopId);
int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract); int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract);
if (count > 0) { if (count > 0) {
String shopNumber = rentInfoObject.getString("shopNumber"); String shopNumber = rentInfoObject.getString("shopNumber");
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + 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 { } else {
WxRentContract wxRentContract = new WxRentContract(); WxRentContract wxRentContract = new WxRentContract();
@@ -298,7 +303,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {


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

if (resultData.code != Result.SUCCESS) {
return resultData;
}
if (dbRent.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { if (dbRent.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) {
if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null
&& !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0)) { && !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); int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery);
if (count > 0) { if (count > 0) {
String shopNumber = rentInfoObject.getString("shopNumber"); 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); WxShop wxShop = wxShopMapper.selectByPrimaryKey(shopId);
if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { 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); ResultData resultData = getResultDataForUpdate(record, userId);
if (resultData.code != Result.SUCCESS) {
return resultData;
}
// 启动审批流 // 启动审批流
if(record.getFlowParams() != null){ if(record.getFlowParams() != null){
record.getFlowParams().put("businessId",record.getId().toString()); record.getFlowParams().put("businessId",record.getId().toString());


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