From b2e1069da3667e1b72dee6dd14d736fc70f1b0ca Mon Sep 17 00:00:00 2001
From: mrzcc <121184950@qq.com>
Date: 星期二, 18 二月 2020 11:34:16 +0800
Subject: [PATCH] 优化巡检计划sql查询
---
CommonService/src/main/java/com/java110/common/api/CommonApi.java | 46 +++++++++++++++++++++++++---------------------
1 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/CommonService/src/main/java/com/java110/common/api/CommonApi.java b/CommonService/src/main/java/com/java110/common/api/CommonApi.java
index 4c9da49..1b9c039 100644
--- a/CommonService/src/main/java/com/java110/common/api/CommonApi.java
+++ b/CommonService/src/main/java/com/java110/common/api/CommonApi.java
@@ -21,7 +21,7 @@
import java.util.Map;
/**
- * 鐢ㄦ埛鏈嶅姟绫�
+ * 鍏叡鏈嶅姟绫�
* Created by wuxw on 2018/5/14.
*/
@RestController
@@ -31,18 +31,19 @@
@Autowired
ICommonServiceSMO commonServiceSMOImpl;
- @RequestMapping(path = "/commonApi/service",method= RequestMethod.GET)
+ @RequestMapping(path = "/commonApi/service", method = RequestMethod.GET)
public String serviceGet(HttpServletRequest request) {
- return DataTransactionFactory.createBusinessResponseJson(ResponseConstant.RESULT_CODE_ERROR,"涓嶆敮鎸丟et鏂规硶璇锋眰").toJSONString();
+ return DataTransactionFactory.createBusinessResponseJson(ResponseConstant.RESULT_CODE_ERROR, "涓嶆敮鎸丟et鏂规硶璇锋眰").toJSONString();
}
/**
* 鐢ㄦ埛鏈嶅姟缁熶竴澶勭悊鎺ュ彛
+ *
* @param orderInfo
* @param request
* @return
*/
- @RequestMapping(path = "/commonApi/service",method= RequestMethod.POST)
+ @RequestMapping(path = "/commonApi/service", method = RequestMethod.POST)
public String servicePost(@RequestBody String orderInfo, HttpServletRequest request) {
BusinessServiceDataFlow businessServiceDataFlow = null;
JSONObject responseJson = null;
@@ -53,23 +54,25 @@
preValiateOrderInfo(orderInfo);
businessServiceDataFlow = this.writeDataToDataFlowContext(orderInfo, headers);
responseJson = commonServiceSMOImpl.service(businessServiceDataFlow);
- }catch (InitDataFlowContextException e){
- logger.error("璇锋眰鎶ユ枃閿欒,鍒濆鍖� BusinessServiceDataFlow澶辫触"+orderInfo,e);
- responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo,ResponseConstant.RESULT_PARAM_ERROR,e.getMessage(),null);
- }catch (InitConfigDataException e){
- logger.error("璇锋眰鎶ユ枃閿欒,鍔犺浇閰嶇疆淇℃伅澶辫触"+orderInfo,e);
- responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo,ResponseConstant.RESULT_PARAM_ERROR,e.getMessage(),null);
- }catch (Exception e){
- logger.error("璇锋眰璁㈠崟寮傚父",e);
- responseJson = DataTransactionFactory.createBusinessResponseJson(businessServiceDataFlow,ResponseConstant.RESULT_CODE_ERROR,e.getMessage()+e,
+ } catch (InitDataFlowContextException e) {
+ logger.error("璇锋眰鎶ユ枃閿欒,鍒濆鍖� BusinessServiceDataFlow澶辫触" + orderInfo, e);
+ responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo, ResponseConstant.RESULT_PARAM_ERROR, e.getMessage(), null);
+ } catch (InitConfigDataException e) {
+ logger.error("璇锋眰鎶ユ枃閿欒,鍔犺浇閰嶇疆淇℃伅澶辫触" + orderInfo, e);
+ responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo, ResponseConstant.RESULT_PARAM_ERROR, e.getMessage(), null);
+ } catch (Exception e) {
+ logger.error("璇锋眰璁㈠崟寮傚父", e);
+ responseJson = DataTransactionFactory.createBusinessResponseJson(businessServiceDataFlow, ResponseConstant.RESULT_CODE_ERROR, e.getMessage() + e,
null);
- }finally {
+ } finally {
+ logger.debug("common鏈嶅姟璇锋眰鎶ユ枃锛�" + orderInfo + " 杩斿洖鎶ユ枃锛�" + responseJson.toJSONString());
return responseJson.toJSONString();
}
}
/**
* 杩欓噷棰勬牎楠岋紝璇锋眰鎶ユ枃涓笉鑳芥湁 dataFlowId
+ *
* @param orderInfo
*/
private void preValiateOrderInfo(String orderInfo) {
@@ -80,17 +83,18 @@
/**
* 鑾峰彇璇锋眰淇℃伅
+ *
* @param request
* @param headers
* @throws RuntimeException
*/
- private void getRequestInfo(HttpServletRequest request,Map headers) throws Exception{
- try{
- super.initHeadParam(request,headers);
- super.initUrlParam(request,headers);
- }catch (Exception e){
- logger.error("鍔犺浇澶翠俊鎭け璐�",e);
- throw new InitConfigDataException(ResponseConstant.RESULT_PARAM_ERROR,"鍔犺浇澶翠俊鎭け璐�");
+ private void getRequestInfo(HttpServletRequest request, Map headers) throws Exception {
+ try {
+ super.initHeadParam(request, headers);
+ super.initUrlParam(request, headers);
+ } catch (Exception e) {
+ logger.error("鍔犺浇澶翠俊鎭け璐�", e);
+ throw new InitConfigDataException(ResponseConstant.RESULT_PARAM_ERROR, "鍔犺浇澶翠俊鎭け璐�");
}
}
--
Gitblit v1.8.0