|
|
@@ -7,10 +7,13 @@ import com.java110.core.event.cmd.Cmd;
|
|
|
import com.java110.core.event.cmd.CmdEvent;
|
|
|
import com.java110.core.factory.GenerateCodeFactory;
|
|
|
import com.java110.doc.annotation.*;
|
|
|
+import com.java110.dto.owner.OwnerDto;
|
|
|
import com.java110.intf.community.ICommunityInnerServiceSMO;
|
|
|
import com.java110.intf.community.IRoomV1InnerServiceSMO;
|
|
|
import com.java110.intf.community.IUnitInnerServiceSMO;
|
|
|
import com.java110.intf.user.IOwnerRoomRelV1InnerServiceSMO;
|
|
|
+import com.java110.intf.user.IOwnerV1InnerServiceSMO;
|
|
|
+import com.java110.po.owner.OwnerPo;
|
|
|
import com.java110.po.owner.OwnerRoomRelPo;
|
|
|
import com.java110.po.room.RoomPo;
|
|
|
import com.java110.utils.constant.BusinessTypeConstant;
|
|
|
@@ -21,6 +24,8 @@ import com.java110.utils.util.DateUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
@Java110CmdDoc(title = "业主房屋关系绑定",
|
|
|
description = "对应后台 业主入驻房屋功能",
|
|
|
httpMethod = "post",
|
|
|
@@ -51,13 +56,13 @@ import java.text.ParseException;
|
|
|
)
|
|
|
|
|
|
@Java110ExampleDoc(
|
|
|
- reqBody="{\n" +
|
|
|
+ reqBody = "{\n" +
|
|
|
"\t\"ownerId\": 121231,\n" +
|
|
|
"\t\"state\": \"2001\",\n" +
|
|
|
"\t\"roomId\": \"123123\",\n" +
|
|
|
"\t\"communityId\": \"2022121921870161\"\n" +
|
|
|
"}",
|
|
|
- resBody="{\"code\":0,\"msg\":\"成功\"}"
|
|
|
+ resBody = "{\"code\":0,\"msg\":\"成功\"}"
|
|
|
)
|
|
|
@Java110Cmd(serviceCode = "room.sellRoom")
|
|
|
public class SellRoomCmd extends Cmd {
|
|
|
@@ -74,6 +79,9 @@ public class SellRoomCmd extends Cmd {
|
|
|
@Autowired
|
|
|
private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IOwnerV1InnerServiceSMO ownerV1InnerServiceSMOImpl;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
|
|
|
@@ -81,7 +89,7 @@ public class SellRoomCmd extends Cmd {
|
|
|
Assert.jsonObjectHaveKey(reqJson, "ownerId", "请求报文中未包含ownerId节点");
|
|
|
Assert.jsonObjectHaveKey(reqJson, "roomId", "请求报文中未包含roomId节点");
|
|
|
Assert.jsonObjectHaveKey(reqJson, "state", "请求报文中未包含state节点");
|
|
|
- // Assert.jsonObjectHaveKey(reqJson, "storeId", "请求报文中未包含storeId节点");
|
|
|
+ // Assert.jsonObjectHaveKey(reqJson, "storeId", "请求报文中未包含storeId节点");
|
|
|
|
|
|
Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
|
|
|
Assert.hasLength(reqJson.getString("ownerId"), "ownerId不能为空");
|
|
|
@@ -103,6 +111,9 @@ public class SellRoomCmd extends Cmd {
|
|
|
|
|
|
//更新房屋信息为售出
|
|
|
updateShellRoom(reqJson);
|
|
|
+
|
|
|
+ //todo 修改业主信息,目的是触发databus 如果 业主房屋上费用的 业主名称 不正确 可以 刷一下
|
|
|
+ updateOwner(reqJson);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -143,4 +154,21 @@ public class SellRoomCmd extends Cmd {
|
|
|
throw new CmdException("添加业主房屋关系");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改业主信息 目的是触发databus 如果 业主房屋上费用的 业主名称 不正确 可以 刷一下
|
|
|
+ *
|
|
|
+ * @param reqJson
|
|
|
+ */
|
|
|
+ private void updateOwner(JSONObject reqJson) {
|
|
|
+ OwnerDto ownerDto = new OwnerDto();
|
|
|
+ ownerDto.setMemberId(reqJson.getString("ownerId"));
|
|
|
+ ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_OWNER);
|
|
|
+ List<OwnerDto> ownerDtos = ownerV1InnerServiceSMOImpl.queryOwners(ownerDto);
|
|
|
+ Assert.listOnlyOne(ownerDtos, "业主不存在");
|
|
|
+ OwnerPo ownerPo = BeanConvertUtil.covertBean(ownerDtos.get(0), OwnerPo.class);
|
|
|
+ ownerV1InnerServiceSMOImpl.updateOwner(ownerPo);
|
|
|
+ }
|
|
|
+
|
|
|
}
|