|
@@ -70,13 +70,30 @@ public class HouseManagerController {
|
|
|
resultPage.getCurrent(), resultPage.getRecords()));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/getHouseDetail")
|
|
|
+ @ApiOperation(value = "根据房源ID获取房源详情")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "houseId", value = "房源ID", paramType = "query", required = true, dataType = "String"),
|
|
|
+ })
|
|
|
+ public Result<Object> getHouseDetail(@RequestParam(required = true) String houseId){
|
|
|
+ if(StringUtils.isBlank(houseId)){
|
|
|
+ return Result.failure("房源ID不能为空");
|
|
|
+ }
|
|
|
+ TmHouse tmHouse = tmHouseService.getById(houseId);
|
|
|
+ if(null == tmHouse || tmHouse.getIsDelete().compareTo(1) == 0){
|
|
|
+ return Result.failure("房源不存在");
|
|
|
+ }
|
|
|
+ return Result.success(tmHouse);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@GetMapping("/getEstateDetail")
|
|
|
@ApiOperation(value = "根据楼盘ID获取楼盘详情")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "estateId", value = "楼盘ID", paramType = "query", required = true, dataType = "String"),
|
|
|
})
|
|
|
- public Result<Object> getHouseList(@RequestParam(required = true) String estateId){
|
|
|
+ public Result<Object> getEstateDetail(@RequestParam(required = true) String estateId){
|
|
|
if(StringUtils.isBlank(estateId)){
|
|
|
return Result.failure("楼盘ID不能为空");
|
|
|
}
|
|
@@ -219,7 +236,7 @@ public class HouseManagerController {
|
|
|
if(null == dbHouse || null == dbHouse.getAuditId()){
|
|
|
return Result.failure("房源不存在或者未提交审核");
|
|
|
}
|
|
|
- dbHouse = null;
|
|
|
+// dbHouse = null;
|
|
|
//抢房源的锁,去掉原来审核的
|
|
|
dbHouse = tmHouseService.selectForUpdate(houseId);
|
|
|
if(null == dbHouse){
|
|
@@ -239,17 +256,16 @@ public class HouseManagerController {
|
|
|
}
|
|
|
//走到这里,说明审核的锁已经抢到了
|
|
|
//两个锁都抢到了,则可以开始做撤销动作了
|
|
|
- dbHouse.setAuditId(null);
|
|
|
- dbHouse.setAuditorId(null);
|
|
|
- dbHouse.setAuditorName(null);
|
|
|
+ dbHouse.setAuditId("");
|
|
|
+ dbHouse.setAuditorId("");
|
|
|
+ dbHouse.setAuditorName("");
|
|
|
dbHouse.setAuditTime(null);
|
|
|
if(!tmHouseService.updateHouse(dbHouse)){
|
|
|
throw new CommonBaseException(ResultCodeEnum.D101 , "撤销房源的审批记录失败");
|
|
|
}
|
|
|
|
|
|
- tmAudit.setIsDelete(DeleteStatus.HAS_DELETE.getCode());
|
|
|
- int updateAudit = tmAuditService.updateAudit(tmAudit);
|
|
|
- if(updateAudit != 1){
|
|
|
+ int deleteAudit = tmAuditService.deleteAudit(tmAudit.getId());
|
|
|
+ if(deleteAudit != 1){
|
|
|
throw new CommonBaseException(ResultCodeEnum.D101 , "删除审批记录失败");
|
|
|
}
|
|
|
|