|
|
|
@@ -4,6 +4,7 @@ import com.iformall.annotation.SystemControllerLog; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.WxMallBuilding; |
|
|
|
import com.iformall.domain.po.WxMallFloor; |
|
|
|
import com.iformall.service.WxMallBuildingService; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@@ -12,6 +13,8 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("wxMallBuilding") |
|
|
|
public class WxMallBuildingController extends BaseController { |
|
|
|
@@ -31,20 +34,28 @@ public class WxMallBuildingController extends BaseController { |
|
|
|
@ApiOperation("保存楼层楼座面积") |
|
|
|
@PostMapping("saveFloorArea") |
|
|
|
@SystemControllerLog(description = "商城-楼座/楼层-保存面积") |
|
|
|
public ResultData saveFloorArea(@RequestBody WxMallFloor record) { |
|
|
|
public ResultData saveFloorArea(@RequestBody List<WxMallBuilding> record) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxMallBuildingController::addBuildingAndFloor"); |
|
|
|
if(record == null) { |
|
|
|
if(record == null && record.size() > 0) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if (record.getId() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
for (WxMallBuilding building: record) { |
|
|
|
List<WxMallFloor> floors = building.getFloors(); |
|
|
|
if(floors != null && floors.size() > 0){ |
|
|
|
for (WxMallFloor floor:floors) { |
|
|
|
if (floor.getId() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if (floor.getTotalArea() == null && floor.getOperatingArea() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
floor.updateTenantInfo(getTenantInfo()); |
|
|
|
wxMallBuildingService.saveFloorArea(floor); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (record.getTotalArea() == null && record.getOperatingArea() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
record.updateTenantInfo(getTenantInfo()); |
|
|
|
wxMallBuildingService.saveFloorArea(record); |
|
|
|
return new ResultData(); |
|
|
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
|
|
|
|
} |