|
|
@@ -7,7 +7,9 @@ import com.java110.api.listener.AbstractServiceApiListener;
|
|
|
import com.java110.core.annotation.Java110Listener;
|
|
|
import com.java110.core.context.DataFlowContext;
|
|
|
import com.java110.core.factory.GenerateCodeFactory;
|
|
|
+import com.java110.core.smo.community.ICommunityInnerServiceSMO;
|
|
|
import com.java110.core.smo.file.IFileInnerServiceSMO;
|
|
|
+import com.java110.dto.community.CommunityDto;
|
|
|
import com.java110.dto.file.FileDto;
|
|
|
import com.java110.entity.center.AppService;
|
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
|
@@ -41,6 +43,9 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
|
|
|
@Autowired
|
|
|
private IFileInnerServiceSMO fileInnerServiceSMOImpl;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
|
|
|
+
|
|
|
private static Logger logger = LoggerFactory.getLogger(AppUserBindingOwnerListener.class);
|
|
|
|
|
|
@Override
|
|
|
@@ -56,7 +61,7 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
|
|
|
@Override
|
|
|
protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
|
|
|
Assert.hasKeyAndValue(reqJson, "communityName", "未包含小区名称");
|
|
|
- Assert.hasKeyAndValue(reqJson, "areaCode", "未包含小区名称");
|
|
|
+ Assert.hasKeyAndValue(reqJson, "areaCode", "未包含小区地区");
|
|
|
Assert.hasKeyAndValue(reqJson, "appUserName", "未包含用户名称");
|
|
|
Assert.hasKeyAndValue(reqJson, "idCard", "未包含身份证号");
|
|
|
Assert.hasKeyAndValue(reqJson, "link", "未包含联系电话");
|
|
|
@@ -68,189 +73,12 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
|
|
|
logger.debug("ServiceDataFlowEvent : {}", event);
|
|
|
|
|
|
//查询小区是否存在
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 生成小区楼ID
|
|
|
- *
|
|
|
- * @param paramObj 请求入参数据
|
|
|
- */
|
|
|
- private void generateMemberId(JSONObject paramObj) {
|
|
|
- String memberId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ownerId);
|
|
|
- paramObj.put("memberId", memberId);
|
|
|
- if (!paramObj.containsKey("ownerId") || "1001".equals(paramObj.getString("ownerTypeCd"))) {
|
|
|
- paramObj.put("ownerId", memberId);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加小区楼信息
|
|
|
- * <p>
|
|
|
- * * name:'',
|
|
|
- * * age:'',
|
|
|
- * * link:'',
|
|
|
- * * sex:'',
|
|
|
- * * remark:''
|
|
|
- *
|
|
|
- * @param paramInJson 接口调用放传入入参
|
|
|
- * @return 订单服务能够接受的报文
|
|
|
- */
|
|
|
- private JSONObject addOwner(JSONObject paramInJson) {
|
|
|
-
|
|
|
-
|
|
|
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
|
|
|
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_OWNER_INFO);
|
|
|
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
|
|
|
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
|
|
|
- JSONObject businessOwner = new JSONObject();
|
|
|
- businessOwner.putAll(paramInJson);
|
|
|
- businessOwner.put("state", "2000");
|
|
|
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOwner", businessOwner);
|
|
|
-
|
|
|
- return business;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加小区成员
|
|
|
- *
|
|
|
- * @param paramInJson 组装 楼小区关系
|
|
|
- * @return 小区成员信息
|
|
|
- */
|
|
|
- private JSONObject addCommunityMember(JSONObject paramInJson) {
|
|
|
-
|
|
|
-
|
|
|
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
|
|
|
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_MEMBER_JOINED_COMMUNITY);
|
|
|
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ_COMMUNITY_MEMBER);
|
|
|
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
|
|
|
- JSONObject businessCommunityMember = new JSONObject();
|
|
|
- businessCommunityMember.put("communityMemberId", "-1");
|
|
|
- businessCommunityMember.put("communityId", paramInJson.getString("communityId"));
|
|
|
- businessCommunityMember.put("memberId", paramInJson.getString("ownerId"));
|
|
|
- businessCommunityMember.put("memberTypeCd", CommunityMemberTypeConstant.OWNER);
|
|
|
- businessCommunityMember.put("auditStatusCd", StateConstant.AGREE_AUDIT);
|
|
|
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessCommunityMember", businessCommunityMember);
|
|
|
-
|
|
|
- return business;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 售卖房屋信息
|
|
|
- *
|
|
|
- * @param paramInJson 接口调用放传入入参
|
|
|
- * @param dataFlowContext 数据上下文
|
|
|
- * @return 订单服务能够接受的报文
|
|
|
- */
|
|
|
- private JSONObject sellRoom(JSONObject paramInJson, DataFlowContext dataFlowContext) {
|
|
|
-
|
|
|
-
|
|
|
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
|
|
|
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_OWNER_ROOM_REL);
|
|
|
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
|
|
|
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
|
|
|
- JSONObject businessUnit = new JSONObject();
|
|
|
- businessUnit.putAll(paramInJson);
|
|
|
- businessUnit.put("relId", "-1");
|
|
|
- businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID));
|
|
|
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOwnerRoomRel", businessUnit);
|
|
|
-
|
|
|
- return business;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加物业费用
|
|
|
- *
|
|
|
- * @param paramInJson 接口调用放传入入参
|
|
|
- * @param dataFlowContext 数据上下文
|
|
|
- * @return 订单服务能够接受的报文
|
|
|
- */
|
|
|
- private JSONObject addPropertyFee(JSONObject paramInJson, DataFlowContext dataFlowContext) {
|
|
|
-
|
|
|
-
|
|
|
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
|
|
|
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO);
|
|
|
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1);
|
|
|
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
|
|
|
- JSONObject businessUnit = new JSONObject();
|
|
|
- businessUnit.put("feeId", "-1");
|
|
|
- businessUnit.put("feeTypeCd", FeeTypeConstant.FEE_TYPE_PROPERTY);
|
|
|
- businessUnit.put("incomeObjId", paramInJson.getString("storeId"));
|
|
|
- businessUnit.put("amount", "-1.00");
|
|
|
- businessUnit.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
|
|
|
- businessUnit.put("endTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
|
|
|
- businessUnit.put("communityId", paramInJson.getString("communityId"));
|
|
|
- businessUnit.put("payerObjId", paramInJson.getString("roomId"));
|
|
|
- businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID));
|
|
|
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFee", businessUnit);
|
|
|
-
|
|
|
- return business;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加物业费用
|
|
|
- *
|
|
|
- * @param paramInJson 接口调用放传入入参
|
|
|
- * @param dataFlowContext 数据上下文
|
|
|
- * @return 订单服务能够接受的报文
|
|
|
- */
|
|
|
- private JSONObject addOwnerPhoto(JSONObject paramInJson, DataFlowContext dataFlowContext) {
|
|
|
-
|
|
|
-
|
|
|
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
|
|
|
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL);
|
|
|
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 2);
|
|
|
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
|
|
|
- JSONObject businessUnit = new JSONObject();
|
|
|
- businessUnit.put("fileRelId", "-1");
|
|
|
- businessUnit.put("relTypeCd", "10000");
|
|
|
- businessUnit.put("saveWay", "table");
|
|
|
- businessUnit.put("objId", paramInJson.getString("memberId"));
|
|
|
- businessUnit.put("fileRealName", paramInJson.getString("ownerPhotoId"));
|
|
|
- businessUnit.put("fileSaveName", paramInJson.getString("ownerPhotoId"));
|
|
|
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFileRel", businessUnit);
|
|
|
-
|
|
|
- return business;
|
|
|
+ CommunityDto communityDto = new CommunityDto();
|
|
|
+ //communityInnerServiceSMOImpl.queryCommunitys();
|
|
|
+ //
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 数据校验
|
|
|
- * <p>
|
|
|
- * name:'',
|
|
|
- * age:'',
|
|
|
- * link:'',
|
|
|
- * sex:'',
|
|
|
- * remark:''
|
|
|
- *
|
|
|
- * @param paramIn "communityId": "7020181217000001",
|
|
|
- * "memberId": "3456789",
|
|
|
- * "memberTypeCd": "390001200001"
|
|
|
- */
|
|
|
- private void validate(String paramIn) {
|
|
|
- Assert.jsonObjectHaveKey(paramIn, "name", "请求报文中未包含name");
|
|
|
- Assert.jsonObjectHaveKey(paramIn, "userId", "请求报文中未包含userId");
|
|
|
- Assert.jsonObjectHaveKey(paramIn, "age", "请求报文中未包含age");
|
|
|
- Assert.jsonObjectHaveKey(paramIn, "link", "请求报文中未包含link");
|
|
|
- Assert.jsonObjectHaveKey(paramIn, "sex", "请求报文中未包含sex");
|
|
|
- Assert.jsonObjectHaveKey(paramIn, "ownerTypeCd", "请求报文中未包含类型");
|
|
|
- Assert.jsonObjectHaveKey(paramIn, "communityId", "请求报文中未包含communityId");
|
|
|
- //Assert.jsonObjectHaveKey(paramIn, "idCard", "请求报文中未包含身份证号");
|
|
|
-
|
|
|
- JSONObject paramObj = JSONObject.parseObject(paramIn);
|
|
|
-
|
|
|
- if (paramObj.containsKey("roomId")) {
|
|
|
-
|
|
|
- Assert.jsonObjectHaveKey(paramObj, "state", "请求报文中未包含state节点");
|
|
|
- Assert.jsonObjectHaveKey(paramObj, "storeId", "请求报文中未包含storeId节点");
|
|
|
-
|
|
|
- Assert.hasLength(paramObj.getString("roomId"), "roomId不能为空");
|
|
|
- Assert.hasLength(paramObj.getString("state"), "state不能为空");
|
|
|
- Assert.hasLength(paramObj.getString("storeId"), "storeId不能为空");
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -266,4 +94,13 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
|
|
|
public void setFileInnerServiceSMOImpl(IFileInnerServiceSMO fileInnerServiceSMOImpl) {
|
|
|
this.fileInnerServiceSMOImpl = fileInnerServiceSMOImpl;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public ICommunityInnerServiceSMO getCommunityInnerServiceSMOImpl() {
|
|
|
+ return communityInnerServiceSMOImpl;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setCommunityInnerServiceSMOImpl(ICommunityInnerServiceSMO communityInnerServiceSMOImpl) {
|
|
|
+ this.communityInnerServiceSMOImpl = communityInnerServiceSMOImpl;
|
|
|
+ }
|
|
|
}
|