From e4e6942264c68d401e0a5999a36542e25cc7460f Mon Sep 17 00:00:00 2001 From: wangpeng Date: Mon, 19 Feb 2024 10:06:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=90=E6=82=A3=E6=8E=92=E6=9F=A5=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/app/AppHiddenController.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/src/main/java/com/zcloud/controller/app/AppHiddenController.java b/src/main/java/com/zcloud/controller/app/AppHiddenController.java index 644aa97..beec1ce 100644 --- a/src/main/java/com/zcloud/controller/app/AppHiddenController.java +++ b/src/main/java/com/zcloud/controller/app/AppHiddenController.java @@ -78,6 +78,8 @@ public class AppHiddenController extends BaseController { @Autowired private MSMLoginService msmloginService; @Autowired + private SendMessageUtil sendMessageUtil; + @Autowired private HiddenUserService hiddenUserService; // 隐患相关人员信息 @Autowired private HiddenExamineService hiddenexamineService; // 隐患意见 @@ -435,6 +437,73 @@ public class AppHiddenController extends BaseController { return map; } + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/riskListCheckAppAdd") // /appAdd + @ResponseBody + @LogAnno(menuType= "手机",menuServer= "隐患",instructionsOperate = "隐患",instructionsType = "新增") + public Object riskListCheckAppAdd() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("HIDDEN_ID", this.get32UUID()); // 主键 +// pd.put("CREATOR", Jurisdiction.getUSER_ID()); //发现人 +// pd.put("HIDDENFINDDEPT", Jurisdiction.getDEPARTMENT_ID()); + pd.put("CREATTIME", DateUtil.date2Str(new Date())); // 发现时间 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); // 发现时间 + pd.put("ISDELETE", "0"); // 是否删除 1 删除 0未删除 +// pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业id + if (pd.get("RECTIFICATIONTYPE") != null && Tools.notEmpty(pd.get("RECTIFICATIONTYPE").toString())) { + if ("1".equals(pd.get("RECTIFICATIONTYPE").toString())) { + pd.put("RECTIFICATIONTIME", DateUtil.getDay()); // 整改时间 + pd.put("RECTIFICATIONOR", pd.get("CREATOR")); // 整改人 + pd.put("RECTIFICATIONDEPT", pd.get("HIDDENFINDDEPT")); + pd.put("STATE", "4"); + } else { + pd.put("STATE", "1"); + } + } + if (pd.get("RISKITEM_ID") != null && Tools.notEmpty(pd.get("RISKITEM_ID").toString())) { + PageData item = new PageData(); + item.put("LISTCHECKITEM_ID", pd.get("RISKITEM_ID")); + item = this.listcheckitemService.findById(item); + pd.put("RISK_UNIT", item.get("RISKUNITNAME")); + pd.put("IDENTIFICATION", item.get("PARTSNAME")); + pd.put("RISK_DESCR", item.get("RISK_DESCR")); + pd.put("RISK_POSITION", item.get("POSITIONNAME")); + pd.put("LEVEL", item.get("DNAME5")); + } + pd.put("ISCONFIRM", "0"); + hiddenService.save(pd); + + // 发短信 + if ("2".equals(pd.get("RECTIFICATIONTYPE").toString())) {// 给整改人发送短信,暂时先用发验证码代替 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd.get("RECTIFICATIONOR"));// 收信人userid + mes.put("templateCode", "SMS_215820677");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "time");// 存入短信模板中的参数名称 + params1.put("value", pd.get("RECTIFICATIONDEADLINE"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + + sendMessageUtil.sendMessages(mes, paramsList); + } + + map.put("result", errInfo); + map.put("pd", pd); + return map; + } + /** * 新增 *