java110
2021-08-22 6b44359d8a1095db6f326341e8bdbfc0be7b7cf0
service-front/src/main/java/com/java110/front/smo/wechatGateway/impl/WechatGatewaySMOImpl.java
old mode 100644 new mode 100755
@@ -48,8 +48,7 @@
    private WechatAuthProperties wechatAuthProperties;
    @Override
    public ResponseEntity<String>
    gateway(IPageData pd) throws Exception {
    public ResponseEntity<String> gateway(IPageData pd, String wId) throws Exception {
        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
        Assert.hasKeyAndValue(paramIn, "fromUserName", "请求报文中未包含fromUserName");
@@ -68,12 +67,23 @@
        boolean bindFlag = judgeBindOwner(pd, fromUserName);
        if (!bindFlag) {
            String noBindOwnerResponseMessage = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.NO_BIND_OWNER);
            String noBindOwnerResponseMessage = MappingCache.getRemark(WechatConstant.WECHAT_DOMAIN, WechatConstant.NO_BIND_OWNER);
            if (StringUtil.isEmpty(noBindOwnerResponseMessage)) {
                noBindOwnerResponseMessage = WechatConstant.NO_BIND_OWNER_RESPONSE_MESSAGE;
            }
            if (!noBindOwnerResponseMessage.contains("wAppId=")) {
                if (noBindOwnerResponseMessage.indexOf("W_APP_ID") > 0) {
                    noBindOwnerResponseMessage = noBindOwnerResponseMessage.replace("W_APP_ID", "wAppId=" + WechatFactory.getAppId(wId));
                } else {
                    if (noBindOwnerResponseMessage.indexOf("?") > -1) {
                        noBindOwnerResponseMessage += ("&wAppId=" + WechatFactory.getAppId(wId));
                    } else {
                        noBindOwnerResponseMessage += ("?wAppId=" + WechatFactory.getAppId(wId));
                    }
                }
            }
            responseStr = WechatFactory.formatText(toUserName, fromUserName, noBindOwnerResponseMessage);
            return new ResponseEntity<String>(responseStr, HttpStatus.OK);