From d526cf637048d71f046667f26e76436e9d489861 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期日, 23 四月 2023 22:45:11 +0800
Subject: [PATCH] 优化代码

---
 service-job/src/main/java/com/java110/job/adapt/DatabusAdaptImpl.java |  111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 109 insertions(+), 2 deletions(-)

diff --git a/service-job/src/main/java/com/java110/job/adapt/DatabusAdaptImpl.java b/service-job/src/main/java/com/java110/job/adapt/DatabusAdaptImpl.java
old mode 100644
new mode 100755
index e922534..1699bf8
--- a/service-job/src/main/java/com/java110/job/adapt/DatabusAdaptImpl.java
+++ b/service-job/src/main/java/com/java110/job/adapt/DatabusAdaptImpl.java
@@ -17,12 +17,24 @@
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.client.RestTemplate;
+import com.java110.core.factory.WechatFactory;
+import com.java110.core.log.LoggerFactory;
 import com.java110.dto.businessDatabus.CustomBusinessDatabusDto;
+import com.java110.dto.machine.CarInoutDto;
+import com.java110.dto.machine.MachineDto;
+import com.java110.dto.smallWeChat.SmallWeChatDto;
+import com.java110.dto.smallWeChat.TemplateDataDto;
+import com.java110.dto.smallWechatAttr.SmallWechatAttrDto;
 import com.java110.dto.tempCarFeeConfig.TempCarPayOrderDto;
 import com.java110.entity.order.Business;
+import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
+import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
 import com.java110.job.adapt.hcIot.GetToken;
-import com.java110.po.machine.MachineRecordPo;
+import com.java110.job.adapt.payment.notice.MachinePaymentNoticeAdapt;
+import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpHeaders;
 
 import java.util.List;
@@ -31,6 +43,14 @@
  * @desc add by 鍚村鏂� 15:21
  */
 public abstract class DatabusAdaptImpl implements IDatabusAdapt {
+    private static Logger logger = LoggerFactory.getLogger(DatabusAdaptImpl.class);
+
+
+    @Autowired
+    private ISmallWeChatInnerServiceSMO smallWeChatInnerServiceSMOImpl;
+
+    @Autowired
+    private ISmallWechatAttrInnerServiceSMO smallWechatAttrInnerServiceSMOImpl;
 
     /**
      * 灏佽澶翠俊鎭�
@@ -55,6 +75,37 @@
     public ResultVo openDoor(JSONObject paramIn) {
         return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
     }
+    /**
+     * 寮�闂�
+     *
+     * @param paramIn 涓氬姟淇℃伅
+     * @return
+     */
+    @Override
+    public ResultVo closeDoor(JSONObject paramIn) {
+        return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
+    }
+
+    @Override
+    public ResultVo getQRcode(JSONObject reqJson) {
+        return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
+    }
+
+    @Override
+    public ResultVo customCarInOut(JSONObject reqJson) {
+        return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
+    }
+
+    @Override
+    public ResultVo payVideo(MachineDto machineDto) {
+        return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
+    }
+
+    @Override
+    public ResultVo heartbeatVideo(JSONObject reqJson) {
+        return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
+    }
+
 
     /**
      * 閲嶅惎璁惧
@@ -88,6 +139,28 @@
     public ResultVo getTempCarFeeOrder(TempCarPayOrderDto tempCarPayOrderDto) {
         return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
     }
+    /**
+     * 淇敼鍦ㄥ満杞﹁締杞︾墝鍙�
+     *
+     * @param carInoutDto
+     * @return
+     */
+    @Override
+    public ResultVo updateCarInoutCarNum(CarInoutDto carInoutDto) {
+        return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
+    }
+
+    /**
+     * 淇敼鍦ㄥ満杞﹁締杞︾墝鍙�
+     *
+     * @param reqJson
+     * @return
+     */
+    @Override
+    public ResultVo getManualOpenDoorLogs(JSONObject reqJson) {
+        return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
+    }
+
 
     /**
      * 鏌ヨ 涓存椂杞﹀緟鏀粯璁㈠崟
@@ -111,11 +184,45 @@
     public void execute(Business business, List<Business> businesses) throws Exception {
 
     }
+
     /**
      * 鎵嬪伐 閫佹暟鎹�
+     *
      * @param customBusinessDatabusDto
      */
-    public void customExchange(CustomBusinessDatabusDto customBusinessDatabusDto){
+    public void customExchange(CustomBusinessDatabusDto customBusinessDatabusDto) {
 
     }
+
+    /**
+     * 鏌ヨ妯℃澘淇℃伅
+     * @param communityId
+     * @param specCd
+     * @return
+     */
+    protected TemplateDataDto getOwnerTemplateId(String communityId, String specCd){
+        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
+        smallWeChatDto.setWeChatType("1100");
+        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
+        smallWeChatDto.setObjId(communityId);
+        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
+        if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) {
+            logger.info("鏈厤缃井淇″叕浼楀彿淇℃伅,瀹氭椂浠诲姟鎵ц缁撴潫");
+            return null;
+        }
+        SmallWeChatDto weChatDto = smallWeChatDtos.get(0);
+        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
+        smallWechatAttrDto.setCommunityId(communityId);
+        smallWechatAttrDto.setWechatId(weChatDto.getWeChatId());
+        smallWechatAttrDto.setSpecCd(specCd);
+        List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto);
+        if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) {
+            logger.info("鏈厤缃井淇″叕浼楀彿娑堟伅妯℃澘");
+            return null;
+        }
+        String templateId = smallWechatAttrDtos.get(0).getValue();
+        String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret());
+
+        return new TemplateDataDto(templateId,accessToken,smallWeChatDtos.get(0).getAppId());
+    }
 }

--
Gitblit v1.8.0