java110 5 年 前
コミット
eea796cbce

+ 2 - 0
java110-bean/src/main/java/com/java110/dto/smallWeChat/SmallWeChatDto.java

@@ -17,6 +17,8 @@ public class SmallWeChatDto extends PageDto implements Serializable {
 
     public static final String WECHAT_TYPE_PUBLIC = "1100"; // 公众号
 
+    public static final String OBJ_TYPE_COMMUNITY = "1000";// 当前小区
+
     private Date createTime;
     private String appId;
     private String name;

+ 5 - 1
service-api/src/main/java/com/java110/api/listener/smallWeChat/ListSmallWeChatsListener.java

@@ -8,6 +8,7 @@ import com.java110.core.event.service.api.ServiceDataFlowEvent;
 import com.java110.core.smo.store.ISmallWeChatInnerServiceSMO;
 import com.java110.dto.smallWeChat.SmallWeChatDto;
 import com.java110.utils.constant.ServiceCodeSmallWeChatConstant;
+import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.StringUtil;
 import com.java110.vo.api.smallWeChat.ApiSmallWeChatDataVo;
@@ -60,15 +61,18 @@ public class ListSmallWeChatsListener extends AbstractServiceApiListener {
     @Override
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
         super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
     }
 
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
         String appId = event.getDataFlowContext().getRequestHeaders().get("app-id");
-        if(StringUtil.isEmpty(appId)){
+        if (StringUtil.isEmpty(appId)) {
             appId = event.getDataFlowContext().getRequestHeaders().get("app_id");
         }
         SmallWeChatDto smallWeChatDto = BeanConvertUtil.covertBean(reqJson, SmallWeChatDto.class);
+        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
+        smallWeChatDto.setObjId(reqJson.getString("communityId"));
         int count = smallWeChatInnerServiceSMOImpl.querySmallWeChatsCount(smallWeChatDto);
         List<ApiSmallWeChatDataVo> smallWeChats = null;
         if (count > 0) {

+ 1 - 1
service-api/src/main/java/com/java110/api/listener/smallWeChat/ListSmallWechatAttrsListener.java

@@ -74,7 +74,7 @@ public class ListSmallWechatAttrsListener extends AbstractServiceApiListener {
             smallWechatAttrDtos = new ArrayList<>();
         }
 
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, smallWechatAttrDtos);
+        ResultVo resultVo = new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK, smallWechatAttrDtos);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);