From b933bf8cfb7e0b3d231e7bc721b749fae54e911a Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 23 四月 2019 18:03:24 +0800
Subject: [PATCH] 删除feign工程
---
StoreService/src/main/java/com/java110/store/smo/impl/StoreServiceSMOImpl.java | 109 ++++++++++++++++++++++++------------------------------
1 files changed, 49 insertions(+), 60 deletions(-)
diff --git a/StoreService/src/main/java/com/java110/store/smo/impl/StoreServiceSMOImpl.java b/StoreService/src/main/java/com/java110/store/smo/impl/StoreServiceSMOImpl.java
index 167301a..1e4550f 100644
--- a/StoreService/src/main/java/com/java110/store/smo/impl/StoreServiceSMOImpl.java
+++ b/StoreService/src/main/java/com/java110/store/smo/impl/StoreServiceSMOImpl.java
@@ -2,41 +2,28 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.JSONPath;
import com.java110.common.cache.MappingCache;
import com.java110.common.constant.KafkaConstant;
import com.java110.common.constant.MappingConstant;
import com.java110.common.constant.ResponseConstant;
-import com.java110.common.constant.StateConstant;
import com.java110.common.exception.SMOException;
import com.java110.common.kafka.KafkaFactory;
-import com.java110.common.log.LoggerEngine;
import com.java110.common.util.Assert;
import com.java110.common.util.DateUtil;
-import com.java110.common.util.ProtocolUtil;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.core.context.BusinessServiceDataFlow;
import com.java110.core.factory.DataFlowFactory;
import com.java110.entity.center.DataFlowLinksCost;
import com.java110.entity.center.DataFlowLog;
-import com.java110.entity.merchant.BoMerchant;
-import com.java110.entity.merchant.BoMerchantAttr;
-import com.java110.entity.merchant.Merchant;
-import com.java110.entity.merchant.MerchantAttr;
-import com.java110.entity.order.BusiOrder;
import com.java110.event.service.BusinessServiceDataFlowEventPublishing;
-import com.java110.feign.base.IPrimaryKeyService;
-import com.java110.store.dao.IStoreServiceDao;
import com.java110.store.smo.IStoreServiceSMO;
-import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.ObjectUtils;
-import java.util.*;
+import java.util.Date;
+import java.util.List;
/**
* 鐢ㄦ埛鏈嶅姟淇℃伅绠$悊涓氬姟淇℃伅瀹炵幇
@@ -46,78 +33,80 @@
@Transactional
public class StoreServiceSMOImpl extends BaseServiceSMO implements IStoreServiceSMO {
- private final static Logger logger = LoggerFactory.getLogger(StoreServiceSMOImpl.class);
+ private static Logger logger = LoggerFactory.getLogger(StoreServiceSMOImpl.class);
- @Override
- public JSONObject service(BusinessServiceDataFlow businessServiceDataFlow) throws SMOException {
- try {
- Assert.hasLength(businessServiceDataFlow.getbId(),"bId 涓嶈兘涓虹┖");
+ @Override
+ public JSONObject service(BusinessServiceDataFlow businessServiceDataFlow) throws SMOException {
+ try {
+ Assert.hasLength(businessServiceDataFlow.getbId(), "bId 涓嶈兘涓虹┖");
- BusinessServiceDataFlowEventPublishing.multicastEvent(businessServiceDataFlow);
- Assert.notEmpty(businessServiceDataFlow.getResJson(),"鐢ㄦ埛鏈嶅姟["+businessServiceDataFlow.getBusinessType()+"]娌℃湁杩斿洖鍐呭");
- } catch (Exception e) {
- logger.error("鐢ㄦ埛淇℃伅澶勭悊寮傚父",e);
- throw new SMOException(ResponseConstant.RESULT_PARAM_ERROR,"鐢ㄦ埛淇℃伅澶勭悊寮傚父"+e.getMessage());
- }finally {
- if(businessServiceDataFlow == null){
- return null;
- }
-
- //杩欓噷璁板綍鏃ュ織
- Date endDate = DateUtil.getCurrentDate();
-
- businessServiceDataFlow.setEndDate(endDate);
- //娣诲姞鑰楁椂
- DataFlowFactory.addCostTime(businessServiceDataFlow, "service", "涓氬姟澶勭悊鎬昏�楁椂",
- businessServiceDataFlow.getStartDate(), businessServiceDataFlow.getEndDate());
- //淇濆瓨鑰楁椂
- saveCostTimeLogMessage(businessServiceDataFlow);
- //淇濆瓨鏃ュ織
- saveLogMessage(businessServiceDataFlow);
+ BusinessServiceDataFlowEventPublishing.multicastEvent(businessServiceDataFlow);
+ Assert.notEmpty(businessServiceDataFlow.getResJson(), "鐢ㄦ埛鏈嶅姟[" + businessServiceDataFlow.getBusinessType() + "]娌℃湁杩斿洖鍐呭");
+ } catch (Exception e) {
+ logger.error("鐢ㄦ埛淇℃伅澶勭悊寮傚父", e);
+ throw new SMOException(ResponseConstant.RESULT_PARAM_ERROR, "鐢ㄦ埛淇℃伅澶勭悊寮傚父" + e.getMessage());
+ } finally {
+ if (businessServiceDataFlow == null) {
+ return null;
}
- return businessServiceDataFlow.getResJson();
+
+ //杩欓噷璁板綍鏃ュ織
+ Date endDate = DateUtil.getCurrentDate();
+
+ businessServiceDataFlow.setEndDate(endDate);
+ //娣诲姞鑰楁椂
+ DataFlowFactory.addCostTime(businessServiceDataFlow, "service", "涓氬姟澶勭悊鎬昏�楁椂",
+ businessServiceDataFlow.getStartDate(), businessServiceDataFlow.getEndDate());
+ //淇濆瓨鑰楁椂
+ saveCostTimeLogMessage(businessServiceDataFlow);
+ //淇濆瓨鏃ュ織
+ saveLogMessage(businessServiceDataFlow);
+ }
+ return businessServiceDataFlow.getResJson();
}
/**
* 淇濆瓨鏃ュ織淇℃伅
- * @param businessServiceDataFlow
+ *
+ * @param businessServiceDataFlow 淇濆瓨鏃ュ織瀵硅薄
*/
- private void saveLogMessage(BusinessServiceDataFlow businessServiceDataFlow){
+ private void saveLogMessage(BusinessServiceDataFlow businessServiceDataFlow) {
- try{
- if(MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_LOG_ON_OFF))){
- for(DataFlowLog dataFlowLog :businessServiceDataFlow.getLogDatas()) {
+ try {
+ if (MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_LOG_ON_OFF))) {
+ for (DataFlowLog dataFlowLog : businessServiceDataFlow.getLogDatas()) {
KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_LOG_NAME, "", JSONObject.toJSONString(dataFlowLog));
}
}
- }catch (Exception e){
- logger.error("鎶ラ敊鏃ュ織鍑洪敊浜嗭紝",e);
+ } catch (Exception e) {
+ logger.error("鎶ラ敊鏃ュ織鍑洪敊浜嗭紝", e);
}
}
/**
* 淇濆瓨鑰楁椂淇℃伅
- * @param businessServiceDataFlow
+ *
+ * @param businessServiceDataFlow 淇濆瓨鑰楁椂瀵硅薄
*/
- private void saveCostTimeLogMessage(BusinessServiceDataFlow businessServiceDataFlow){
- try{
- if(MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_COST_TIME_ON_OFF))){
+ private void saveCostTimeLogMessage(BusinessServiceDataFlow businessServiceDataFlow) {
+ try {
+ if (MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_COST_TIME_ON_OFF))) {
List<DataFlowLinksCost> dataFlowLinksCosts = businessServiceDataFlow.getLinksCostDates();
JSONObject costDate = new JSONObject();
JSONArray costDates = new JSONArray();
JSONObject newObj = null;
- for(DataFlowLinksCost dataFlowLinksCost : dataFlowLinksCosts){
+ for (DataFlowLinksCost dataFlowLinksCost : dataFlowLinksCosts) {
newObj = JSONObject.parseObject(JSONObject.toJSONString(dataFlowLinksCost));
- newObj.put("dataFlowId",businessServiceDataFlow.getDataFlowId());
- newObj.put("transactionId",businessServiceDataFlow.getTransactionId());
+ newObj.put("dataFlowId", businessServiceDataFlow.getDataFlowId());
+ newObj.put("transactionId", businessServiceDataFlow.getTransactionId());
costDates.add(newObj);
}
- costDate.put("costDates",costDates);
+ costDate.put("costDates", costDates);
- KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_COST_TIME_LOG_NAME,"",costDate.toJSONString());
+ KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_COST_TIME_LOG_NAME, "", costDate.toJSONString());
}
- }catch (Exception e){
- logger.error("鎶ラ敊鏃ュ織鍑洪敊浜嗭紝",e);
+ } catch (Exception e) {
+ logger.error("鎶ラ敊鏃ュ織鍑洪敊浜嗭紝", e);
}
}
}
--
Gitblit v1.8.0