|
@@ -11,6 +11,7 @@ import com.java110.core.smo.store.IStoreInnerServiceSMO;
|
|
|
import com.java110.dto.CommunityMemberDto;
|
|
import com.java110.dto.CommunityMemberDto;
|
|
|
import com.java110.dto.store.StoreDto;
|
|
import com.java110.dto.store.StoreDto;
|
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
|
|
|
+import com.java110.utils.util.StringUtil;
|
|
|
import com.java110.vo.api.community.ApiCommunityDataVo;
|
|
import com.java110.vo.api.community.ApiCommunityDataVo;
|
|
|
import com.java110.vo.api.community.ApiCommunityVo;
|
|
import com.java110.vo.api.community.ApiCommunityVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -67,23 +68,42 @@ public class ListAuditEnterCommunitysListener extends AbstractServiceApiListener
|
|
|
@Override
|
|
@Override
|
|
|
protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
|
|
protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
|
|
|
|
|
|
|
|
- CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(reqJson, CommunityMemberDto.class);
|
|
|
|
|
|
|
+ if (StringUtil.jsonHasKayAndValue(reqJson, "name") || StringUtil.jsonHasKayAndValue(reqJson, "tel")) {
|
|
|
|
|
+ getInfoByStore(context,reqJson);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ getInfoByCommunity(context,reqJson);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- communityMemberDto.setNeedCommunityInfo(true);
|
|
|
|
|
- communityMemberDto.setNoAuditEnterCommunity(true);
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- int count = communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);
|
|
|
|
|
|
|
+ private void getInfoByStore(DataFlowContext context, JSONObject reqJson) {
|
|
|
|
|
+ StoreDto storeDto = new StoreDto();
|
|
|
|
|
+ storeDto.setName(reqJson.getString("name"));
|
|
|
|
|
+ storeDto.setTel(reqJson.getString("tel"));
|
|
|
|
|
+ List<StoreDto> storeDtos = storeInnerServiceSMOImpl.getStores(storeDto);
|
|
|
|
|
|
|
|
List<ApiCommunityDataVo> communitys = null;
|
|
List<ApiCommunityDataVo> communitys = null;
|
|
|
-
|
|
|
|
|
- if (count > 0) {
|
|
|
|
|
- communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto), ApiCommunityDataVo.class);
|
|
|
|
|
|
|
+ int count = 0;
|
|
|
|
|
+ if (storeDtos.size() > 0) {
|
|
|
|
|
+ CommunityMemberDto communityMemberDto = new CommunityMemberDto();
|
|
|
|
|
+ communityMemberDto.setNeedCommunityInfo(true);
|
|
|
|
|
+ communityMemberDto.setNoAuditEnterCommunity(true);
|
|
|
|
|
+ communityMemberDto.setMemberId(reqJson.getString("memberId"));
|
|
|
|
|
+ communityMemberDto.setSubMemberId(storeDtos.get(0).getStoreId());
|
|
|
|
|
+
|
|
|
|
|
+ count = communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);
|
|
|
|
|
+
|
|
|
|
|
+ if (count > 0) {
|
|
|
|
|
+ communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto), ApiCommunityDataVo.class);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ communitys = new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
communitys = new ArrayList<>();
|
|
communitys = new ArrayList<>();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//刷入 商户信息
|
|
//刷入 商户信息
|
|
|
- if(communitys.size() > 0){
|
|
|
|
|
|
|
+ if (communitys.size() > 0) {
|
|
|
freshCommunityInfo(communitys);
|
|
freshCommunityInfo(communitys);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -96,20 +116,20 @@ public class ListAuditEnterCommunitysListener extends AbstractServiceApiListener
|
|
|
ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCommunityVo), HttpStatus.OK);
|
|
ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCommunityVo), HttpStatus.OK);
|
|
|
|
|
|
|
|
context.setResponseEntity(responseEntity);
|
|
context.setResponseEntity(responseEntity);
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 刷新 小区 商户信息
|
|
* 刷新 小区 商户信息
|
|
|
|
|
+ *
|
|
|
* @param communityDataVos
|
|
* @param communityDataVos
|
|
|
*/
|
|
*/
|
|
|
- private void freshCommunityInfo(List<ApiCommunityDataVo> communityDataVos){
|
|
|
|
|
- for(ApiCommunityDataVo apiCommunityDataVo : communityDataVos) {
|
|
|
|
|
|
|
+ private void freshCommunityInfo(List<ApiCommunityDataVo> communityDataVos) {
|
|
|
|
|
+ for (ApiCommunityDataVo apiCommunityDataVo : communityDataVos) {
|
|
|
StoreDto storeDto = new StoreDto();
|
|
StoreDto storeDto = new StoreDto();
|
|
|
storeDto.setStoreId(apiCommunityDataVo.getMemberId());
|
|
storeDto.setStoreId(apiCommunityDataVo.getMemberId());
|
|
|
List<StoreDto> storeDtos = storeInnerServiceSMOImpl.getStores(storeDto);
|
|
List<StoreDto> storeDtos = storeInnerServiceSMOImpl.getStores(storeDto);
|
|
|
|
|
|
|
|
- if(storeDtos.size() != 1){
|
|
|
|
|
|
|
+ if (storeDtos.size() != 1) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
//BeanConvertUtil.covertBean(storeDtos.get(0), apiCommunityDataVo);
|
|
//BeanConvertUtil.covertBean(storeDtos.get(0), apiCommunityDataVo);
|
|
@@ -122,6 +142,38 @@ public class ListAuditEnterCommunitysListener extends AbstractServiceApiListener
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void getInfoByCommunity(DataFlowContext context, JSONObject reqJson) {
|
|
|
|
|
+ CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(reqJson, CommunityMemberDto.class);
|
|
|
|
|
+
|
|
|
|
|
+ communityMemberDto.setNeedCommunityInfo(true);
|
|
|
|
|
+ communityMemberDto.setNoAuditEnterCommunity(true);
|
|
|
|
|
+
|
|
|
|
|
+ int count = communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);
|
|
|
|
|
+
|
|
|
|
|
+ List<ApiCommunityDataVo> communitys = null;
|
|
|
|
|
+
|
|
|
|
|
+ if (count > 0) {
|
|
|
|
|
+ communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto), ApiCommunityDataVo.class);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ communitys = new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //刷入 商户信息
|
|
|
|
|
+ if (communitys.size() > 0) {
|
|
|
|
|
+ freshCommunityInfo(communitys);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ApiCommunityVo apiCommunityVo = new ApiCommunityVo();
|
|
|
|
|
+
|
|
|
|
|
+ apiCommunityVo.setTotal(count);
|
|
|
|
|
+ apiCommunityVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
|
|
|
|
|
+ apiCommunityVo.setCommunitys(communitys);
|
|
|
|
|
+
|
|
|
|
|
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCommunityVo), HttpStatus.OK);
|
|
|
|
|
+
|
|
|
|
|
+ context.setResponseEntity(responseEntity);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public IStoreInnerServiceSMO getStoreInnerServiceSMOImpl() {
|
|
public IStoreInnerServiceSMO getStoreInnerServiceSMOImpl() {
|
|
|
return storeInnerServiceSMOImpl;
|
|
return storeInnerServiceSMOImpl;
|
|
|
}
|
|
}
|