wuxw hace 1 año
padre
commit
4b3dbbd2dc

+ 12 - 0
service-common/src/main/java/com/java110/common/bmo/mall/IMallCommonApiBmo.java

@@ -0,0 +1,12 @@
+package com.java110.common.bmo.mall;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.context.ICmdDataFlowContext;
+
+public interface IMallCommonApiBmo {
+
+    void validate(ICmdDataFlowContext context, JSONObject reqJson);
+
+
+    void doCmd(ICmdDataFlowContext context, JSONObject reqJson);
+}

+ 100 - 0
service-common/src/main/java/com/java110/common/bmo/mall/impl/QueryOwnerCommunityImpl.java

@@ -0,0 +1,100 @@
+package com.java110.common.bmo.mall.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.bmo.mall.IMallCommonApiBmo;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.dto.community.CommunityDto;
+import com.java110.dto.community.CommunityMemberDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.dto.store.StoreDto;
+import com.java110.intf.community.ICommunityMemberV1InnerServiceSMO;
+import com.java110.intf.community.ICommunityV1InnerServiceSMO;
+import com.java110.intf.store.IStoreV1InnerServiceSMO;
+import com.java110.intf.user.IBuildingOwnerV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.ListUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class QueryOwnerCommunityImpl implements IMallCommonApiBmo {
+
+    @Autowired
+    private IBuildingOwnerV1InnerServiceSMO buildingOwnerV1InnerServiceSMOImpl;
+
+    @Autowired
+    private ICommunityV1InnerServiceSMO communityV1InnerServiceSMOImpl;
+
+    @Autowired
+    private ICommunityMemberV1InnerServiceSMO communityMemberV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IStoreV1InnerServiceSMO storeV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(ICmdDataFlowContext context, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "link", "未包含手机号");
+
+    }
+
+    @Override
+    public void doCmd(ICmdDataFlowContext context, JSONObject reqJson) {
+
+        OwnerDto ownerDto = new OwnerDto();
+        ownerDto.setLink(reqJson.getString("link"));
+        ownerDto.setCommunityId(reqJson.getString("communityId"));
+        List<OwnerDto> ownerDtos = buildingOwnerV1InnerServiceSMOImpl.queryBuildingOwners(ownerDto);
+
+        if (ListUtil.isNull(ownerDtos)) {
+            throw new CmdException("业主不存在");
+        }
+
+
+        //todo 查询小区
+
+        CommunityDto communityDto = new CommunityDto();
+        communityDto.setCommunityId(ownerDtos.get(0).getCommunityId());
+        List<CommunityDto> communityDtos = communityV1InnerServiceSMOImpl.queryCommunitys(communityDto);
+
+        if (ListUtil.isNull(communityDtos)) {
+            throw new CmdException("小区不存在");
+        }
+
+
+        //todo 查询物业信息
+        CommunityMemberDto communityMemberDto = new CommunityMemberDto();
+        communityMemberDto.setCommunityId(communityDtos.get(0).getCommunityId());
+        communityMemberDto.setMemberTypeCd(CommunityMemberDto.MEMBER_TYPE_PROPERTY);
+        List<CommunityMemberDto> communityMemberDtos = communityMemberV1InnerServiceSMOImpl.queryCommunityMembers(communityMemberDto);
+        if (ListUtil.isNull(communityMemberDtos)) {
+            throw new CmdException("物业不存在");
+        }
+
+
+        StoreDto storeDto = new StoreDto();
+        storeDto.setStoreId(communityMemberDtos.get(0).getMemberId());
+        List<StoreDto> storeDtos = storeV1InnerServiceSMOImpl.queryStores(storeDto);
+
+        if (ListUtil.isNull(storeDtos)) {
+            throw new CmdException("物业不存在");
+        }
+
+        JSONObject data = new JSONObject();
+        data.put("ownerId", ownerDtos.get(0).getMemberId());
+        data.put("ownerName", ownerDtos.get(0).getName());
+        data.put("ownerTel", ownerDtos.get(0).getLink());
+        data.put("communityId", communityDtos.get(0).getCommunityId());
+        data.put("communityName", communityDtos.get(0).getName());
+        data.put("storeId", storeDtos.get(0).getStoreId());
+        data.put("storeName", storeDtos.get(0).getName());
+
+        context.setResponseEntity(ResultVo.createResponseEntity(data));
+
+
+    }
+}

+ 51 - 0
service-common/src/main/java/com/java110/common/cmd/mall/OpenCommonApiCmd.java

@@ -0,0 +1,51 @@
+package com.java110.common.cmd.mall;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.bmo.mall.IMallCommonApiBmo;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.CmdContextUtils;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.store.StoreDto;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.factory.ApplicationContextFactory;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.ListUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/**
+ * 专属于HC小区管理系统调用
+ */
+@Java110Cmd(serviceCode = "common.openCommonApi")
+public class OpenCommonApiCmd extends Cmd {
+
+    private IMallCommonApiBmo mallCommonApiBmoImpl;
+
+
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        Assert.hasKeyAndValue(reqJson, "mallApiCode", "未包含MALL接口编码");
+
+
+        mallCommonApiBmoImpl = ApplicationContextFactory.getBean(reqJson.getString("mallApiCode"), IMallCommonApiBmo.class);
+        if (mallCommonApiBmoImpl == null) {
+            throw new CmdException("未实现该能力");
+        }
+
+        mallCommonApiBmoImpl.validate(context, reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        mallCommonApiBmoImpl = ApplicationContextFactory.getBean(reqJson.getString("iotApiCode"), IMallCommonApiBmo.class);
+        if (mallCommonApiBmoImpl == null) {
+            throw new CmdException("未实现该能力");
+        }
+        mallCommonApiBmoImpl.doCmd(context, reqJson);
+    }
+}

+ 3 - 0
service-job/src/main/java/com/java110/job/adapt/returnMoney/wechat/ReturnPayFeeMoneyAdapt.java

@@ -204,6 +204,7 @@ public class ReturnPayFeeMoneyAdapt extends DatabusAdaptImpl {
                 .setSSLSocketFactory(sslsf)
                 .build();
         String jsonStr = "";
+        System.out.println("请求微信地址:"+wechatReturnUrl+",请求报文:"+xmlData);
         try {
             HttpPost httpost = new HttpPost(wechatReturnUrl);
             httpost.setEntity(new StringEntity(xmlData, "UTF-8"));
@@ -218,6 +219,8 @@ public class ReturnPayFeeMoneyAdapt extends DatabusAdaptImpl {
             }
         } finally {
             httpclient.close();
+            System.out.println("返回报文:"+jsonStr);
+
         }
         Map<String, String> resMap = PayUtil.xmlStrToMap(jsonStr);
         if ("SUCCESS".equals(resMap.get("return_code")) && "SUCCESS".equals(resMap.get("result_code"))) {