From 8a524787c88a9128cc69af890d4181a01aad0e8c Mon Sep 17 00:00:00 2001
From: 吴学文 <wuxuewen@wuxuewendeMacBook-Pro.local>
Date: 星期六, 06 七月 2019 23:09:33 +0800
Subject: [PATCH] 修改代码生成器生成的app 加入user_id 的问题
---
CommunityService/src/main/java/com/java110/community/smo/impl/CommunityServiceSMOImpl.java | 88 ++++++++++++++++++++++---------------------
1 files changed, 45 insertions(+), 43 deletions(-)
diff --git a/CommunityService/src/main/java/com/java110/community/smo/impl/CommunityServiceSMOImpl.java b/CommunityService/src/main/java/com/java110/community/smo/impl/CommunityServiceSMOImpl.java
index c9b1175..89b21ec 100644
--- a/CommunityService/src/main/java/com/java110/community/smo/impl/CommunityServiceSMOImpl.java
+++ b/CommunityService/src/main/java/com/java110/community/smo/impl/CommunityServiceSMOImpl.java
@@ -33,78 +33,80 @@
@Transactional
public class CommunityServiceSMOImpl extends BaseServiceSMO implements ICommunityServiceSMO {
- private final static Logger logger = LoggerFactory.getLogger(CommunityServiceSMOImpl.class);
+ private static Logger logger = LoggerFactory.getLogger(CommunityServiceSMOImpl.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.getCurrentBusiness().getServiceCode()+"]娌℃湁杩斿洖鍐呭");
- } 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.getCurrentBusiness().getServiceCode() + "]娌℃湁杩斿洖鍐呭");
+ } 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
*/
- 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
*/
- 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