From 78a2270a9f47b0143474ff800d6a69f8d72a17dd Mon Sep 17 00:00:00 2001 From: 6c <420680616@qq.com> Date: 星期四, 01 八月 2024 09:17:52 +0800 Subject: [PATCH] 预警转发 --- src/main/java/com/product/administration/controller/CooperateController.java | 99 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 95 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/product/administration/controller/CooperateController.java b/src/main/java/com/product/administration/controller/CooperateController.java index 71b2cd1..813b9b4 100644 --- a/src/main/java/com/product/administration/controller/CooperateController.java +++ b/src/main/java/com/product/administration/controller/CooperateController.java @@ -13,7 +13,9 @@ import com.product.core.exception.BaseException; import com.product.core.spring.context.SpringMVCContextHolder; import com.product.module.sys.version.ApiVersion; +import com.product.tool.flow.service.FlowCoordinationService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @@ -21,7 +23,7 @@ /** * Copyright LX - * + * * @Title: CooperateController * @Project: product-server * @date: 2021骞�03鏈�23鏃� 14:53 @@ -34,7 +36,8 @@ @Autowired CooperatesService cooperatesService; - + @Autowired + public FlowCoordinationService flowCoordinationService; /** * @Date: 2020-03-23 18:00 * @Author: ZhouJie @@ -330,7 +333,6 @@ SystemCode.SYSTEM_DELETE_COOPERATES_FAIL.getText()); } } - /** * @Date: 2020-04-01 16:06 * @Author: ZhouJie @@ -359,7 +361,47 @@ return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); } cooperatesService.sendCooperate(fse); - + + return OK(); + } catch (BaseException e) { + e.printStackTrace(); + SpringMVCContextHolder.getSystemLogger().error(e); + return this.error(e); + } catch (Exception e) { + e.printStackTrace(); + SpringMVCContextHolder.getSystemLogger().error(e); + return this.error(SystemCode.SYSTEM_SEND_COOPERATES_FAIL.getValue(), + SystemCode.SYSTEM_SEND_COOPERATES_FAIL.getText()); + } + } + /** + * @Date: 2020-04-01 16:06 + * @Author: ZhouJie + * @Description: 鍗忓悓鍔炲叕鎾ゅ洖鎴栬�呬腑姝� type 5涓 6 鎾ゅ洖 + */ + @RequestMapping(value = "/recession-stop-cooperate/{version}", method = RequestMethod.POST) + public String recessionOrStopCooperate(HttpServletRequest request) { + try { + // 鑾峰彇鍙傛暟 + FieldSetEntity fse = null; + Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); + if (bean != null) { + RequestParameterEntity reqp = (RequestParameterEntity) bean; + fse = reqp.getFormData(); + } + // 鍒ゆ柇鍙傛暟鏄惁涓虹┖ + if (bean == null || fse == null) { + SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), + SystemCode.SYSTEM_FORM_NODATA.getText()); + return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); + } + // 鍒ゆ柇琛ㄥ悕鏄惁姝e父 + if (!CmnConst.PRODUCT_OA_COOPERATES.equals(fse.getTableName())) { + SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), + SystemCode.SYSTEM_TABLE_NODATA.getText()); + return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); + } + flowCoordinationService.saveCoordinationStartFlow(fse); return OK(); } catch (BaseException e) { e.printStackTrace(); @@ -461,6 +503,55 @@ } } /** + * @description: 鍗忓悓琛ュ厖姝f枃鍒犻櫎 + * @author: ZhouJie + * @date: 2021-06-02 17:23 + */ + @PostMapping("/delete-supply/{version}") + @ApiVersion(1) + public String delSupplyText(HttpServletRequest request) { + try { + // 鑾峰彇鍙傛暟 + FieldSetEntity fse = null; + Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); + if (bean != null) { + RequestParameterEntity reqp = (RequestParameterEntity) bean; + fse = reqp.getFormData(); + } + // 鍒ゆ柇鍙傛暟鏄惁涓虹┖ + if (bean == null || fse == null) { + SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), + SystemCode.SYSTEM_FORM_NODATA.getText()); + return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); + } + // 鍒ゆ柇琛ㄥ悕鏄惁姝e父 + if (!CmnConst.PRODUCT_OA_COOPERATE_SUB.equals(fse.getTableName())) { + SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), + SystemCode.SYSTEM_TABLE_NODATA.getText()); + return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); + } + ICooperatesService service = (ICooperatesService) getProxyInstance( + cooperatesService); + boolean success = service.delSupplyText(fse); + if (success) { + return OK(); + } + SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_AND_COOPERATE_SUPPLY_FAIL.getValue(), + SystemCode.SYSTEM_AND_COOPERATE_SUPPLY_FAIL.getText()); + return error(SystemCode.SYSTEM_AND_COOPERATE_SUPPLY_FAIL.getValue(), + SystemCode.SYSTEM_AND_COOPERATE_SUPPLY_FAIL.getText()); + } catch (BaseException e) { + e.printStackTrace(); + SpringMVCContextHolder.getSystemLogger().error(e); + return this.error(e); + } catch (Exception e) { + e.printStackTrace(); + SpringMVCContextHolder.getSystemLogger().error(e); + return this.error(SystemCode.SYSTEM_AND_COOPERATE_SUPPLY_FAIL.getValue(), + SystemCode.SYSTEM_AND_COOPERATE_SUPPLY_FAIL.getText()); + } + } + /** * @description: 鍗忓悓鍔炲叕鍌姙 * @author: ZhouJie * @date: 2021-06-03 17:03 -- Gitblit v1.9.2