| | |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.intf.report.IReportCommunityInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.vo.api.ApiRoomDataVo; |
| | | import com.java110.vo.api.ApiRoomVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Java110Cmd(serviceCode = "room.queryRoomsTree") |
| | | public class QueryRoomsTreeCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IReportCommunityInnerServiceSMO reportCommunityInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | |
| | | Assert.jsonObjectHaveKey(reqJson, "unitId", "请求中未包含单元信息"); |
| | | Assert.jsonObjectHaveKey(reqJson, "page", "请求报文中未包含page节点"); |
| | | Assert.jsonObjectHaveKey(reqJson, "row", "请求报文中未包含row节点"); |
| | | |
| | | Assert.isInteger(reqJson.getString("page"), "page不是数字"); |
| | | Assert.isInteger(reqJson.getString("row"), "row不是数字"); |
| | | Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空"); |
| | | super.validateProperty(cmdDataFlowContext); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | roomDtoList = reportCommunityInnerServiceSMOImpl.queryRoomsTree(roomDto); |
| | | apiRoomVo.setTotal(0); |
| | | if (roomDtoList != null && roomDtoList.size() > 0) { |
| | | if (ListUtil.isNotNull(roomDtoList)) { |
| | | apiRoomVo.setTotal(roomDtoList.size()); |
| | | } |
| | | |
| | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiRoomVo), HttpStatus.OK); |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | |
| | | } |