{"record":{"id":"77daf199761cf7f1","repo":"binarywang/WxJava","slug":"wxstoreid","errorCode":null,"errorMessage":"查询请求 wxStoreId 不可为空","messagePattern":"查询请求 wxStoreId 不可为空","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java","lineNumber":137,"sourceCode":"  @Override\n  public String storeCharge(WxMaStoreChargeRequest request) throws WxErrorException {\n    String response = this.wxMaService.postWithSignature(Intracity.STORE_CHARGE, request);\n    Map<?, ?> map = gson.fromJson(response, Map.class);\n    return (String) map.get(\"payurl\");\n  }\n\n  @Override\n  public int storeRefund(WxMaStoreRefundRequest request) throws WxErrorException {\n    String response = this.wxMaService.postWithSignature(Intracity.STORE_REFUND, request);\n    Map<?, ?> map = gson.fromJson(response, Map.class);\n    return ((Number) map.get(\"refund_amount\")).intValue();\n  }\n\n  @Override\n  public WxMaStoreFlowResponse<? extends WxMaStoreFlowResponse.BasicFlowRecord> queryFlow(\n      WxMaQueryFlowRequest request) throws WxErrorException {\n    if (request == null || request.getWxStoreId() == null) {\n      throw new IllegalArgumentException(\"查询请求 wxStoreId 不可为空\");\n    }\n    WxMaStoreFlowResponse<? extends WxMaStoreFlowResponse.BasicFlowRecord> inst =\n        getFlowInstanceByType(request.getFlowType());\n    if (inst == null) {\n      throw new IllegalArgumentException(\"查询请求 flowType 不正确，只能是1、2、3之一\");\n    }\n\n    String response = this.wxMaService.postWithSignature(Intracity.QUERY_FLOW, request);\n\n    WxMaStoreFlowResponse<? extends WxMaStoreFlowResponse.BasicFlowRecord> flowResponse;\n    flowResponse =\n        (WxMaStoreFlowResponse<? extends WxMaStoreFlowResponse.BasicFlowRecord>)\n            gson.fromJson(response, inst.getClass());\n    logger.debug(\"queryFlow: {}\", flowResponse);\n    return flowResponse;\n  }\n\n  private WxMaStoreFlowResponse<? extends WxMaStoreFlowResponse.BasicFlowRecord>","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/binarywang/WxJava/blob/1c43293a3c2c9d7e91304b6d037fb017f680d0c6/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java#L119-L155","documentation":"Unchecked IllegalArgumentException from queryFlow(WxMaQueryFlowRequest) when request == null or request.getWxStoreId() == null. The flow query is scoped per-store, so a store identifier is mandatory even though WxMaQueryFlowRequest also carries serviceTransId and a time range.","triggerScenarios":"Calling queryFlow(req) with a null request object, or a request where setWxStoreId(...) was not called.","commonSituations":"Building WxMaQueryFlowRequest from query params that omitted wxStoreId; sharing a request-builder that only sets dates and flowType.","solutions":["Set wxStoreId on the request: req.setWxStoreId(wxStoreId).","Null-check the request object itself before calling queryFlow."],"exampleFix":"// before\nWxMaQueryFlowRequest req = new WxMaQueryFlowRequest();\nreq.setFlowType(1);\nreq.setBeginDate(start);\nintracityService.queryFlow(req);\n\n// after\nWxMaQueryFlowRequest req = new WxMaQueryFlowRequest();\nreq.setWxStoreId(wxStoreId);\nreq.setFlowType(1);\nreq.setBeginDate(start);\nintracityService.queryFlow(req);","handlingStrategy":"validation","validationCode":"if (req == null || req.getWxStoreId() == null) {\n  throw new IllegalArgumentException(\"wxStoreId required for queryFlow\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  resp = intracityService.queryFlow(req);\n} catch (IllegalArgumentException e) {\n  throw e;\n}","preventionTips":["Treat wxStoreId as required on every queryFlow request.","Validate the full request object (null + key fields) in a shared pre-call validator."],"tags":["validation","intracity","query-flow","illegal-argument","null-check"],"backgroundTag":null,"analyzedSha":"1c43293a3c2c9d7e91304b6d037fb017f680d0c6","analyzedAt":"2026-08-14T02:29:11.060Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}