| | |
| | | package com.java110.api.bmo.room.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.ApiBaseBMO; |
| | | import com.java110.api.bmo.room.IRoomBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.room.IRoomInnerServiceSMO; |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName RoomBMOImpl |
| | |
| | | |
| | | @Service("roomBMOImpl") |
| | | public class RoomBMOImpl extends ApiBaseBMO implements IRoomBMO { |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 修改房屋 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject updateRoom(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | RoomDto roomDto = new RoomDto(); |
| | | roomDto.setCommunityId(paramInJson.getString("communityId")); |
| | | roomDto.setRoomId(paramInJson.getString("roomId")); |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); |
| | | |
| | | Assert.listOnlyOne(roomDtos, "存在" + roomDtos.size() + "条房屋信息"); |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ROOM_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.putAll(BeanConvertUtil.beanCovertMap(roomDtos.get(0))); |
| | | businessUnit.putAll(paramInJson); |
| | | businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID)); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessRoom", businessUnit); |
| | | |
| | | return business; |
| | | } |
| | | } |