diff --git a/src/main/java/com/zcloud/controller/gf/AppGFConfinedSpaceGasWHController.java b/src/main/java/com/zcloud/controller/gf/AppGFConfinedSpaceGasWHController.java index 065853e0..5b408d5e 100644 --- a/src/main/java/com/zcloud/controller/gf/AppGFConfinedSpaceGasWHController.java +++ b/src/main/java/com/zcloud/controller/gf/AppGFConfinedSpaceGasWHController.java @@ -31,158 +31,170 @@ import java.util.Map; @RequestMapping("/app/gfConfinedSpaceGasWh") public class AppGFConfinedSpaceGasWHController extends BaseController { - @Resource - private GFConfinedSpaceGasWHService GFconfinedspacegaswhService; + @Resource + private GFConfinedSpaceGasWHService GFconfinedspacegaswhService; - /**新增 - * @param - * @throws Exception - */ - @RequestMapping(value="/add") - @ResponseBody - @DockAnnotation(isAdd = true) - public Object add() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/add") + @ResponseBody + @DockAnnotation(isAdd = true) + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData pd2 = new PageData(); - pd2 = GFconfinedspacegaswhService.findById(pd); - if(pd2 != null && pd2.size()>0){ - PageData confinedGasPageData = new PageData(); // pd对接数据 - confinedGasPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); - GFconfinedspacegaswhService.edit(pd); + PageData pd2 = new PageData(); + pd2 = GFconfinedspacegaswhService.findById(pd); + if (pd2 != null && pd2.size() > 0) { + PageData confinedGasPageData = new PageData(); // pd对接数据 + confinedGasPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); + GFconfinedspacegaswhService.edit(pd); // map.put("dockData", JSON.toJSONString(dockData)); - }else{ - pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - pd.put("CONFINEDSPACEGASWH_ID", this.get32UUID()); //主键 - GFconfinedspacegaswhService.save(pd); - PageData confinedGasPageData = new PageData(); // pd对接数据 - confinedGasPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); + } else { + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("CONFINEDSPACEGASWH_ID", this.get32UUID()); //主键 + GFconfinedspacegaswhService.save(pd); + PageData confinedGasPageData = new PageData(); // pd对接数据 + confinedGasPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); // map.put("dockData", JSON.toJSONString(dockData)); - } - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); - return map; - } + } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); + return map; + } - /**删除 - * @param - * @throws Exception - */ - @RequestMapping(value="/delete") - @ResponseBody - @DockAnnotation - public Object delete() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/delete") + @ResponseBody + @DockAnnotation + public Object delete() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData confinedGasPageData = new PageData(); // pd对接数据 - confinedGasPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); - GFconfinedspacegaswhService.delete(pd); - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); //返回结果 - return map; - } + PageData confinedGasPageData = new PageData(); // pd对接数据 + confinedGasPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); + GFconfinedspacegaswhService.delete(pd); + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); //返回结果 + return map; + } - /**修改 - * @param - * @throws Exception - */ - @RequestMapping(value="/edit") - @ResponseBody - @DockAnnotation - public Object edit() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/edit") + @ResponseBody + @DockAnnotation + public Object edit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData confinedGasPageData = new PageData(); // pd对接数据 - confinedGasPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); - pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - GFconfinedspacegaswhService.edit(pd); - map.put("dockingData", JSON.toJSONString(dockData)); - map.put("result", errInfo); - return map; - } + PageData confinedGasPageData = new PageData(); // pd对接数据 + confinedGasPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + GFconfinedspacegaswhService.edit(pd); + map.put("dockingData", JSON.toJSONString(dockData)); + map.put("result", errInfo); + return map; + } - /**列表 - * @param page - * @throws Exception - */ - @RequestMapping(value="/list") - @ResponseBody - public Object list(Page page) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); - page.setPd(pd); - List varList = GFconfinedspacegaswhService.list(page); //列出ConfinedSpaceGasWH列表 - map.put("varList", varList); - map.put("page", page); - map.put("result", errInfo); - return map; - } + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/list") + @ResponseBody + public Object list(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = GFconfinedspacegaswhService.list(page); //列出ConfinedSpaceGasWH列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } - /**去修改页面获取数据 - * @param - * @throws Exception - */ - @RequestMapping(value="/goEdit") - @ResponseBody - public Object goEdit() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - pd = GFconfinedspacegaswhService.findById(pd); //根据ID读取 - map.put("pd", pd); - map.put("result", errInfo); - return map; - } + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + @ResponseBody + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = GFconfinedspacegaswhService.findById(pd); //根据ID读取 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } - /**批量删除 - * @param - * @throws Exception - */ - @RequestMapping(value="/deleteAll") - @ResponseBody - @DockAnnotation - public Object deleteAll() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 批量删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/deleteAll") + @ResponseBody + @DockAnnotation + public Object deleteAll() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData confinedGasPageData = new PageData(); // pd对接数据 - confinedGasPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); - String DATA_IDS = pd.getString("DATA_IDS"); - if(Tools.notEmpty(DATA_IDS)){ - String ArrayDATA_IDS[] = DATA_IDS.split(","); - GFconfinedspacegaswhService.deleteAll(ArrayDATA_IDS); - map.put("dockData", JSON.toJSONString(dockData)); - errInfo = "success"; - }else{ - errInfo = "error"; - } - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); //返回结果 - return map; - } + PageData confinedGasPageData = new PageData(); // pd对接数据 + confinedGasPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(confinedGasPageData)); + String DATA_IDS = pd.getString("DATA_IDS"); + if (Tools.notEmpty(DATA_IDS)) { + String ArrayDATA_IDS[] = DATA_IDS.split(","); + GFconfinedspacegaswhService.deleteAll(ArrayDATA_IDS); + map.put("dockData", JSON.toJSONString(dockData)); + errInfo = "success"; + } else { + errInfo = "error"; + } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); //返回结果 + return map; + } } diff --git a/src/main/java/com/zcloud/controller/gf/AppGFElectricityController.java b/src/main/java/com/zcloud/controller/gf/AppGFElectricityController.java index 4acf6aca..f3b46546 100644 --- a/src/main/java/com/zcloud/controller/gf/AppGFElectricityController.java +++ b/src/main/java/com/zcloud/controller/gf/AppGFElectricityController.java @@ -35,1342 +35,1369 @@ import java.util.*; @RequestMapping("/app/gfElectricity") public class AppGFElectricityController extends BaseController { - @Resource - private GFElectricityAcceptUserService electricityacceptuserService; - @Resource - private GFElectricityService GFelectricityService; - @Resource - private GFElectricityLogService GFelectricityLogService; - @Resource - private GFElectricityToMeasuresService GFelectricityToMeasuresService; - @Resource - private GFElectricityGasService GFelectricityGasService; - @Autowired - private SendMessageUtil sendMessageUtil; - @Autowired - private Smb smb; + @Resource + private GFElectricityAcceptUserService electricityacceptuserService; + @Resource + private GFElectricityService GFelectricityService; + @Resource + private GFElectricityLogService GFelectricityLogService; + @Resource + private GFElectricityToMeasuresService GFelectricityToMeasuresService; + @Resource + private GFElectricityGasService GFelectricityGasService; + @Autowired + private SendMessageUtil sendMessageUtil; + @Autowired + private Smb smb; - @Resource - private SendMessageService mqClient; + @Resource + private SendMessageService mqClient; - /**获取编码 - * @param - * @throws Exception - */ - @RequestMapping(value="/getCode") - @ResponseBody + /** + * 获取编码 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/getCode") + @ResponseBody // @LogAnno(menuType= "手机",menuServer= "高空作业",instructionsOperate = "高空作业",instructionsType = "获取编码") - public Object getCode() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - Calendar calendar = Calendar.getInstance(); - DecimalFormat dft=new DecimalFormat("00"); - int year = calendar.get(Calendar.YEAR); - String month = dft.format(calendar.get(Calendar.MONTH) + 1); - String day = dft.format(calendar.get(Calendar.DAY_OF_MONTH)); - pd.put("CREATDATE",year + "-" + month + "-" + day); - pd = GFelectricityService.getCode(pd); //根据ID读取 - String code = "YD"+year + month + day + dft.format((Integer.parseInt(pd.get("code").toString())+1)); - map.put("code", code); - map.put("result", errInfo); - return map; - } + public Object getCode() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + Calendar calendar = Calendar.getInstance(); + DecimalFormat dft = new DecimalFormat("00"); + int year = calendar.get(Calendar.YEAR); + String month = dft.format(calendar.get(Calendar.MONTH) + 1); + String day = dft.format(calendar.get(Calendar.DAY_OF_MONTH)); + pd.put("CREATDATE", year + "-" + month + "-" + day); + pd = GFelectricityService.getCode(pd); //根据ID读取 + String code = "YD" + year + month + day + dft.format((Integer.parseInt(pd.get("code").toString()) + 1)); + map.put("code", code); + map.put("result", errInfo); + return map; + } - /**新增 - * @param - * @throws Exception - */ - @RequestMapping(value="/add") - @ResponseBody - @Transactional - @DockAnnotation(isAdd = true) - public Object add() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData pd2 = new PageData(); - Calendar calendar = Calendar.getInstance(); - DecimalFormat dft=new DecimalFormat("00"); - int year = calendar.get(Calendar.YEAR); - String month = dft.format(calendar.get(Calendar.MONTH) + 1); - String day = dft.format(calendar.get(Calendar.DAY_OF_MONTH)); - pd2.put("CREATDATE",year + "-" + month + "-" + day); - pd2.put("CORPINFO_ID",pd.get("CORPINFO_ID")); - pd2 = GFelectricityService.getCode(pd2); //根据ID读取 - String code = "YD"+year + month + day + dft.format((Integer.parseInt(pd2.get("code").toString())+1)); - pd = this.getPageData(); - pd.put("CHECK_NO", code); - pd.put("ELECTRICITY_ID", this.get32UUID()); //主键 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 - pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/add") + @ResponseBody + @Transactional + @DockAnnotation(isAdd = true) + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData pd2 = new PageData(); + Calendar calendar = Calendar.getInstance(); + DecimalFormat dft = new DecimalFormat("00"); + int year = calendar.get(Calendar.YEAR); + String month = dft.format(calendar.get(Calendar.MONTH) + 1); + String day = dft.format(calendar.get(Calendar.DAY_OF_MONTH)); + pd2.put("CREATDATE", year + "-" + month + "-" + day); + pd2.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + pd2 = GFelectricityService.getCode(pd2); //根据ID读取 + String code = "YD" + year + month + day + dft.format((Integer.parseInt(pd2.get("code").toString()) + 1)); + pd = this.getPageData(); + pd.put("CHECK_NO", code); + pd.put("ELECTRICITY_ID", this.get32UUID()); //主键 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 // map.put("dockData", JSON.toJSONString(pd)); - PageData dockData = new PageData(); // 主要对接数据 + PageData dockData = new PageData(); // 主要对接数据 - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - GFelectricityService.save(pd); + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + GFelectricityService.save(pd); - if(pd.get("APPLY_STATUS").equals("1")) { - PageData log = new PageData(); - log.put("ELECTRICITYLOG_ID", this.get32UUID()); - log.put("ACTION", "提交申请"); - log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID")); - log.put("CREATOR",pd.get("ACTION_USER")); - log.put("CREATTIME", DateUtil.date2Str(new Date())); + if (pd.get("APPLY_STATUS").equals("1")) { + PageData log = new PageData(); + log.put("ELECTRICITYLOG_ID", this.get32UUID()); + log.put("ACTION", "提交申请"); + log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID")); + log.put("CREATOR", pd.get("ACTION_USER")); + log.put("CREATTIME", DateUtil.date2Str(new Date())); // map.put("dockDataLog", JSON.toJSONString(log)); - PageData electricitydockDataLog = new PageData(); // pd对接数据 - electricitydockDataLog.putAll(log); - dockData.put("dockDataLog", JSON.toJSONString(electricitydockDataLog)); - GFelectricityLogService.save(log); + PageData electricitydockDataLog = new PageData(); // pd对接数据 + electricitydockDataLog.putAll(log); + dockData.put("dockDataLog", JSON.toJSONString(electricitydockDataLog)); + GFelectricityLogService.save(log); - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_Y01");// 短信模板编码 - mes.put("SMSCode", "SMS_227245922");// 短信模板编码 - mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "params1");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - // 第3个参数 - PageData params3 = new PageData(); - params3.put("name", "params2");// 存入短信模板中的参数名称 - params3.put("value", "作业单位确认");// 存入上面参数名称所传递的值 - paramsList.add(params3); - // 第4个参数 - PageData params4 = new PageData(); - params4.put("name", "params3");// 存入短信模板中的参数名称 - params4.put("value", "确认");// 存入上面参数名称所传递的值 - paramsList.add(params4); - sendMessageUtil.sendMessages(mes, paramsList); - } - if("1".equals(pd.get("ISANALYZE"))){ - TenCorpDto tenCorpDto = new TenCorpDto(); - tenCorpDto.setMark(pd.getString("ELECTRICITY_ID")); - tenCorpDto.setMark_name("ELECTRICITY_ID"); - tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000"); - tenCorpDto.setTopic("eightWork"); - tenCorpDto.setData(pd); - tenCorpDto.setMessage(TenCorpConst.electricity); + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_Y01");// 短信模板编码 + mes.put("SMSCode", "SMS_227245922");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "params1");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + // 第3个参数 + PageData params3 = new PageData(); + params3.put("name", "params2");// 存入短信模板中的参数名称 + params3.put("value", "作业单位确认");// 存入上面参数名称所传递的值 + paramsList.add(params3); + // 第4个参数 + PageData params4 = new PageData(); + params4.put("name", "params3");// 存入短信模板中的参数名称 + params4.put("value", "确认");// 存入上面参数名称所传递的值 + paramsList.add(params4); + sendMessageUtil.sendMessages(mes, paramsList); + } + if ("1".equals(pd.get("ISANALYZE"))) { + TenCorpDto tenCorpDto = new TenCorpDto(); + tenCorpDto.setMark(pd.getString("ELECTRICITY_ID")); + tenCorpDto.setMark_name("ELECTRICITY_ID"); + tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000"); + tenCorpDto.setTopic("eightWork"); + tenCorpDto.setData(pd); + tenCorpDto.setMessage(TenCorpConst.electricity); - mqClient.SendDelayQueue(tenCorpDto); - // 发短信 - PageData mes1 = new PageData(); - mes1.put("RECEIVER_ID", pd.get("ANALYZE_USER_ID"));// 收信人userid - mes1.put("templateCode", "DH_QT");// 短信模板编码 - mes1.put("SMSCode", "SMS_223540753");// 短信模板编码 - mes1.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList1 = new ArrayList(); - // 第1个参数 - PageData params5 = new PageData(); - params5.put("name", "params1");// 存入短信模板中的参数名称 - params5.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList1.add(params5); - // 第2个参数 - PageData params6 = new PageData(); - params6.put("name", "params2");// 存入短信模板中的参数名称 - params6.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList1.add(params6); - sendMessageUtil.sendMessages(mes1, paramsList1); - } - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); - return map; - } + mqClient.SendDelayQueue(tenCorpDto); + // 发短信 + PageData mes1 = new PageData(); + mes1.put("RECEIVER_ID", pd.get("ANALYZE_USER_ID"));// 收信人userid + mes1.put("templateCode", "DH_QT");// 短信模板编码 + mes1.put("SMSCode", "SMS_223540753");// 短信模板编码 + mes1.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList1 = new ArrayList(); + // 第1个参数 + PageData params5 = new PageData(); + params5.put("name", "params1");// 存入短信模板中的参数名称 + params5.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList1.add(params5); + // 第2个参数 + PageData params6 = new PageData(); + params6.put("name", "params2");// 存入短信模板中的参数名称 + params6.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList1.add(params6); + sendMessageUtil.sendMessages(mes1, paramsList1); + } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); + return map; + } - /**删除 - */ - @RequestMapping(value="/delete") - @ResponseBody - @DockAnnotation - public Object delete() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 删除 + */ + @RequestMapping(value = "/delete") + @ResponseBody + @DockAnnotation + public Object delete() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - GFelectricityService.delete(pd); - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); //返回结果 - return map; - } + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + GFelectricityService.delete(pd); + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); //返回结果 + return map; + } - /**修改 - * @param - * @throws Exception - */ - @RequestMapping(value="/edit") - @ResponseBody - @Transactional - @DockAnnotation - public Object edit() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - GFelectricityService.edit(pd); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/edit") + @ResponseBody + @Transactional + @DockAnnotation + public Object edit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + GFelectricityService.edit(pd); + PageData dockData = new PageData(); // 主要对接数据 - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); // map.put("dockData", JSON.toJSONString(pd)); - if(pd.get("APPLY_STATUS").equals("1")) { - PageData log = new PageData(); - log.put("ELECTRICITYLOG_ID", this.get32UUID()); - log.put("ACTION", "提交申请"); - log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID")); - log.put("CREATOR",pd.get("ACTION_USER")); - log.put("CREATTIME", DateUtil.date2Str(new Date())); + if (pd.get("APPLY_STATUS").equals("1")) { + PageData log = new PageData(); + log.put("ELECTRICITYLOG_ID", this.get32UUID()); + log.put("ACTION", "提交申请"); + log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID")); + log.put("CREATOR", pd.get("ACTION_USER")); + log.put("CREATTIME", DateUtil.date2Str(new Date())); // map.put("dockDataLog", JSON.toJSONString(log)); - PageData electricitydockDataLog = new PageData(); // pd对接数据 - electricitydockDataLog.putAll(log); - dockData.put("dockDataLog", JSON.toJSONString(electricitydockDataLog)); - GFelectricityLogService.save(log); + PageData electricitydockDataLog = new PageData(); // pd对接数据 + electricitydockDataLog.putAll(log); + dockData.put("dockDataLog", JSON.toJSONString(electricitydockDataLog)); + GFelectricityLogService.save(log); - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_Y01");// 短信模板编码 - mes.put("SMSCode", "SMS_227245922");// 短信模板编码 - mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "params1");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - // 第3个参数 - PageData params3 = new PageData(); - params3.put("name", "params2");// 存入短信模板中的参数名称 - params3.put("value", "作业单位确认");// 存入上面参数名称所传递的值 - paramsList.add(params3); - // 第4个参数 - PageData params4 = new PageData(); - params4.put("name", "params3");// 存入短信模板中的参数名称 - params4.put("value", "确认");// 存入上面参数名称所传递的值 - paramsList.add(params4); - sendMessageUtil.sendMessages(mes, paramsList); - } - if("1".equals(pd.get("ISANALYZE"))){ - TenCorpDto tenCorpDto = new TenCorpDto(); - tenCorpDto.setMark(pd.getString("ELECTRICITY_ID")); - tenCorpDto.setMark_name("ELECTRICITY_ID"); - tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000"); - tenCorpDto.setTopic("eightWork"); - tenCorpDto.setData(pd); - tenCorpDto.setMessage(TenCorpConst.electricity); + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_Y01");// 短信模板编码 + mes.put("SMSCode", "SMS_227245922");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "params1");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + // 第3个参数 + PageData params3 = new PageData(); + params3.put("name", "params2");// 存入短信模板中的参数名称 + params3.put("value", "作业单位确认");// 存入上面参数名称所传递的值 + paramsList.add(params3); + // 第4个参数 + PageData params4 = new PageData(); + params4.put("name", "params3");// 存入短信模板中的参数名称 + params4.put("value", "确认");// 存入上面参数名称所传递的值 + paramsList.add(params4); + sendMessageUtil.sendMessages(mes, paramsList); + } + if ("1".equals(pd.get("ISANALYZE"))) { + TenCorpDto tenCorpDto = new TenCorpDto(); + tenCorpDto.setMark(pd.getString("ELECTRICITY_ID")); + tenCorpDto.setMark_name("ELECTRICITY_ID"); + tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000"); + tenCorpDto.setTopic("eightWork"); + tenCorpDto.setData(pd); + tenCorpDto.setMessage(TenCorpConst.electricity); - mqClient.SendDelayQueue(tenCorpDto); - } - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); - return map; - } - /**修改 - * @param - * @throws Exception - */ - @RequestMapping(value="/editGuardian") - @ResponseBody - @Transactional - @DockAnnotation(hasAnnex = true) - public Object editGuardian( - @RequestParam(value="FFILE",required=false) MultipartFile[] files - ) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + mqClient.SendDelayQueue(tenCorpDto); + } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); + return map; + } - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - PageData pd2 = new PageData(); - pd2 = GFelectricityService.findById(pd); - pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 - pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - if (files != null && files.length > 0) { - ArrayList pictureList = new ArrayList(); - MultipartFile file = files[0]; + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/editGuardian") + @ResponseBody + @Transactional + @DockAnnotation(hasAnnex = true) + public Object editGuardian(@RequestParam(value = "FFILE", required = false) MultipartFile[] files) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + PageData pd2 = new PageData(); + pd2 = GFelectricityService.findById(pd); + pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 + pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + if (files != null && files.length > 0) { + ArrayList pictureList = new ArrayList(); + MultipartFile file = files[0]; - pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); - map.put("sendPicturesList", JSON.toJSONString(pictureList)); - pd2.put("GUARDIAN_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd2.put("GUARDIAN_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + + pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); + map.put("sendPicturesList", JSON.toJSONString(pictureList)); + pd2.put("GUARDIAN_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("GUARDIAN_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); // pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT")); // pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd2 = new PageData(); // pd对接数据 - electricitydockDatapd2.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd2 = new PageData(); // pd对接数据 + electricitydockDatapd2.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); // map.put("dockData", JSON.toJSONString(pd2)); - } - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); - return map; - } + } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); + return map; + } - /**修改 - * @param - * @throws Exception - */ - @RequestMapping(value="/editConfess") - @ResponseBody - @Transactional - @DockAnnotation(hasAnnex = true) - public Object editConfess( - @RequestParam(value="FFILE",required=false) MultipartFile[] files - ) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/editConfess") + @ResponseBody + @Transactional + @DockAnnotation(hasAnnex = true) + public Object editConfess(@RequestParam(value = "FFILE", required = false) MultipartFile[] files) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - PageData pd2 = new PageData(); - pd2 = GFelectricityService.findById(pd); - pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 - pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - if (files != null && files.length > 0) { - ArrayList pictureList = new ArrayList(); - MultipartFile file = files[0]; + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + PageData pd2 = new PageData(); + pd2 = GFelectricityService.findById(pd); + pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 + pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + if (files != null && files.length > 0) { + ArrayList pictureList = new ArrayList(); + MultipartFile file = files[0]; - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); - pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); - map.put("sendPicturesList", JSON.toJSONString(pictureList)); - pd2.put("CONFESS_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd2.put("CONFESS_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); + map.put("sendPicturesList", JSON.toJSONString(pictureList)); + pd2.put("CONFESS_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("CONFESS_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); // pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT")); // pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd2 = new PageData(); // pd对接数据 - electricitydockDatapd2.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd2 = new PageData(); // pd对接数据 + electricitydockDatapd2.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); // map.put("dockData", JSON.toJSONString(pd2)); - } - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); - return map; - } + } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); + return map; + } - /**修改 - * @param - * @throws Exception - */ - @RequestMapping(value="/editAcceptconfess") - @ResponseBody - @Transactional - @DockAnnotation(hasAnnex = true) - public Object editAcceptconfess(MultipartRequest request) throws Exception { - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/editAcceptconfess") + @ResponseBody + @Transactional + @DockAnnotation(hasAnnex = true) + public Object editAcceptconfess(MultipartRequest request) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - PageData pd2 = new PageData(); - pd2 = GFelectricityService.findById(pd); - pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 - pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - List fileList = new ArrayList(); - String signertime = ""; - String SIGNTIME[] = pd.getString("SIGNTIME").split(","); + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + PageData pd2 = new PageData(); + pd2 = GFelectricityService.findById(pd); + pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 + pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + List fileList = new ArrayList(); + String signertime = ""; + String SIGNTIME[] = pd.getString("SIGNTIME").split(","); - ArrayList pictureList = new ArrayList(); - Map saveImgMap = new HashMap(); - int count = 1; - for (int i = 0; i < SIGNTIME.length; i++) { - signertime = SIGNTIME[i]; - fileList.add(request.getFile("file"+i)); - MultipartFile[] fileArr = new MultipartFile[fileList.size()]; - saveImg(fileList.toArray(fileArr),signertime,pd.getString("ELECTRICITY_ID"), - pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"), - pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"),pictureList,saveImgMap,count); - fileList.clear(); - count += 1; - } - dockData.put("saveImgMap", JSON.toJSONString(saveImgMap)); - map.put("dockData", JSON.toJSONString(dockData)); - map.put("sendPicturesList", JSON.toJSONString(pictureList)); - map.put("result", errInfo); - return map; - } - private void saveImg(MultipartFile[] files,String signertime, String ELECTRICITY_ID, - String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, - String ACCEPT_CONFESS_DEPARTMENT_ID, ArrayList pictureList, - Map saveImgMap,int count) throws Exception{ - if (files != null && files.length > 0) { - for (int i = 0; i < files.length; i++) { - PageData pd = new PageData(); - pd = this.getPageData(); - MultipartFile file = files[i]; - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName,Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile); - pd.put("ACCEPT_CONFESS_USER_SIGNER_TIME", signertime); - pd.put("ACCEPT_CONFESS_ID", this.get32UUID()); - pd.put("OPERATOR", pd.get("OPERATOR")); //修改人 - pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - pd.put("ACCEPT_CONFESS_USER_SIGNER_PATH", Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName); - pd.put("ISDELETE", '0'); - pd.put("CORPINFO_ID", CORPINFO_ID); - pd.put("ELECTRICITY_ID", ELECTRICITY_ID); - pd.put("ACCEPT_CONFESS_USER_ID", ACCEPT_CONFESS_USER_ID); - pd.put("ACCEPT_CONFESS_DEPARTMENT_ID", ACCEPT_CONFESS_DEPARTMENT_ID); - pd.put("ACCEPT_USER_ID",""); - pd.put("ACCEPT_DEPARTMENT_ID", ""); - saveImgMap.put("other" + count, JSON.toJSONString(pd)); - count += 1; - electricityacceptuserService.save(pd); - pictureList.add(Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName + "@@" + fileName); - } - } - } - /**修改 - * @param - * @throws Exception - */ - @RequestMapping(value="/editAcceptStatus") - @ResponseBody - @Transactional - @DockAnnotation(hasAnnex = true) - public Object editAcceptStatus(MultipartRequest request) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + ArrayList pictureList = new ArrayList(); + Map saveImgMap = new HashMap(); + int count = 1; + for (int i = 0; i < SIGNTIME.length; i++) { + signertime = SIGNTIME[i]; + fileList.add(request.getFile("file" + i)); + MultipartFile[] fileArr = new MultipartFile[fileList.size()]; + saveImg(fileList.toArray(fileArr), signertime, pd.getString("ELECTRICITY_ID"), pd.getString("CORPINFO_ID"), pd.getString("ACCEPT_CONFESS_USER_ID"), pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"), pictureList, saveImgMap, count); + fileList.clear(); + count += 1; + } + dockData.put("saveImgMap", JSON.toJSONString(saveImgMap)); + map.put("dockData", JSON.toJSONString(dockData)); + map.put("sendPicturesList", JSON.toJSONString(pictureList)); + map.put("result", errInfo); + return map; + } - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - PageData pd2 = new PageData(); - pd2 = GFelectricityService.findById(pd); - pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 - pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - PageData log = new PageData(); - log.put("ELECTRICITYLOG_ID", this.get32UUID()); + private void saveImg(MultipartFile[] files, String signertime, String ELECTRICITY_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID, ArrayList pictureList, Map saveImgMap, int count) throws Exception { + if (files != null && files.length > 0) { + for (int i = 0; i < files.length; i++) { + PageData pd = new PageData(); + pd = this.getPageData(); + MultipartFile file = files[i]; + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile); + pd.put("ACCEPT_CONFESS_USER_SIGNER_TIME", signertime); + pd.put("ACCEPT_CONFESS_ID", this.get32UUID()); + pd.put("OPERATOR", pd.get("OPERATOR")); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("ACCEPT_CONFESS_USER_SIGNER_PATH", Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName); + pd.put("ISDELETE", '0'); + pd.put("CORPINFO_ID", CORPINFO_ID); + pd.put("ELECTRICITY_ID", ELECTRICITY_ID); + pd.put("ACCEPT_CONFESS_USER_ID", ACCEPT_CONFESS_USER_ID); + pd.put("ACCEPT_CONFESS_DEPARTMENT_ID", ACCEPT_CONFESS_DEPARTMENT_ID); + pd.put("ACCEPT_USER_ID", ""); + pd.put("ACCEPT_DEPARTMENT_ID", ""); + saveImgMap.put("other" + count, JSON.toJSONString(pd)); + count += 1; + electricityacceptuserService.save(pd); + pictureList.add(Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName + "@@" + fileName); + } + } + } + + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/editAcceptStatus") + @ResponseBody + @Transactional + @DockAnnotation(hasAnnex = true) + public Object editAcceptStatus(MultipartRequest request) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 + + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + PageData pd2 = new PageData(); + pd2 = GFelectricityService.findById(pd); + pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 + pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + PageData log = new PageData(); + log.put("ELECTRICITYLOG_ID", this.get32UUID()); // log.put("ACTION", "审核打回"); - log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID")); - log.put("CREATOR",pd.get("ACTION_USER")); - log.put("CREATTIME", DateUtil.date2Str(new Date())); + log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID")); + log.put("CREATOR", pd.get("ACTION_USER")); + log.put("CREATTIME", DateUtil.date2Str(new Date())); // map.put("dockData", JSON.toJSONString(pd)); - String status = pd.get("STATUS").toString(); - if ("2".equals(status) || "3".equals(status) || "4".equals(status)) { - String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + - (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"); - pd.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES); - pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES); - } else if ("-2".equals(status) || "-3".equals(status) || "-4".equals(status) || "-5".equals(status)) { - //打回清空数据 - pd2.put("OTHER_PROTECTIVE_MEASURES", ""); - } + String status = pd.get("STATUS").toString(); + if ("2".equals(status) || "3".equals(status) || "4".equals(status)) { + String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"); + pd.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES); + pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES); + } else if ("-2".equals(status) || "-3".equals(status) || "-4".equals(status) || "-5".equals(status)) { + //打回清空数据 + pd2.put("OTHER_PROTECTIVE_MEASURES", ""); + } - switch (status) { + switch (status) { - case "5"://验收人 - List fileList = new ArrayList(); - String signertime = ""; - String SIGNTIME[] = pd.getString("SIGNTIME").split(","); + case "5"://验收人 + List fileList = new ArrayList(); + String signertime = ""; + String SIGNTIME[] = pd.getString("SIGNTIME").split(","); - ArrayList pictureList = new ArrayList(); - Map saveAcceptImgMap = new HashMap(); - int count = 1; - for (int i = 0; i < SIGNTIME.length; i++) { - signertime = SIGNTIME[i]; - fileList.add(request.getFile("file"+i)); - MultipartFile[] fileArr = new MultipartFile[fileList.size()]; - saveAcceptImg(fileList.toArray(fileArr),signertime,pd.getString("ELECTRICITY_ID"), - pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_USER_ID"), - pd.getString("ACCEPT_DEPARTMENT_ID"),pictureList,saveAcceptImgMap,count); - fileList.clear(); - count++; - } - dockData.put("saveAcceptImg", JSON.toJSONString(saveAcceptImgMap)); - map.put("sendPicturesList", JSON.toJSONString(pictureList)); - pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd2 = new PageData(); // pd对接数据 - electricitydockDatapd2.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); + ArrayList pictureList = new ArrayList(); + Map saveAcceptImgMap = new HashMap(); + int count = 1; + for (int i = 0; i < SIGNTIME.length; i++) { + signertime = SIGNTIME[i]; + fileList.add(request.getFile("file" + i)); + MultipartFile[] fileArr = new MultipartFile[fileList.size()]; + saveAcceptImg(fileList.toArray(fileArr), signertime, pd.getString("ELECTRICITY_ID"), pd.getString("CORPINFO_ID"), pd.getString("ACCEPT_USER_ID"), pd.getString("ACCEPT_DEPARTMENT_ID"), pictureList, saveAcceptImgMap, count); + fileList.clear(); + count++; + } + dockData.put("saveAcceptImg", JSON.toJSONString(saveAcceptImgMap)); + map.put("sendPicturesList", JSON.toJSONString(pictureList)); + pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd2 = new PageData(); // pd对接数据 + electricitydockDatapd2.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - log.put("ACTION", "验收通过"); + log.put("ACTION", "验收通过"); - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_Y05");// 短信模板编码 - mes.put("SMSCode", "SMS_227250920");// 短信模板编码 - mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "type");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - sendMessageUtil.sendMessages(mes, paramsList); - break; + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_Y05");// 短信模板编码 + mes.put("SMSCode", "SMS_227250920");// 短信模板编码 + mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + sendMessageUtil.sendMessages(mes, paramsList); + break; - case "-5"://验收打回 - log.put("ACTION", "验收人打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd21 = new PageData(); // pd对接数据 - electricitydockDatapd21.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd21)); + case "-5"://验收打回 + log.put("ACTION", "验收人打回"); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd21 = new PageData(); // pd对接数据 + electricitydockDatapd21.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd21)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - PageData mes3 = new PageData(); - mes3.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes3.put("templateCode", "YD_N05");// 短信模板编码 - mes3.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList3 = new ArrayList(); - // 第1个参数 - PageData paramsc1 = new PageData(); - paramsc1.put("name", "params1");// 存入短信模板中的参数名称 - paramsc1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList3.add(paramsc1); + PageData mes3 = new PageData(); + mes3.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes3.put("templateCode", "YD_N05");// 短信模板编码 + mes3.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList3 = new ArrayList(); + // 第1个参数 + PageData paramsc1 = new PageData(); + paramsc1.put("name", "params1");// 存入短信模板中的参数名称 + paramsc1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList3.add(paramsc1); - // 第2个参数 - PageData paramsc2 = new PageData(); - paramsc2.put("name", "params2");// 存入短信模板中的参数名称 - paramsc2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList3.add(paramsc2); - // 第3个参数 - PageData paramsc3 = new PageData(); - paramsc3.put("name", "params3");// 存入短信模板中的参数名称 - paramsc3.put("value", "验收");// 存入上面参数名称所传递的值 - paramsList3.add(paramsc3); - sendMessageUtil.sendMessages(mes3, paramsList3); - break; - default: - break; - } - GFelectricityLogService.save(log); - PageData electricitydockDataLog = new PageData(); // pd对接数据 - electricitydockDataLog.putAll(log); - dockData.put("dockDataLog", JSON.toJSONString(electricitydockDataLog)); + // 第2个参数 + PageData paramsc2 = new PageData(); + paramsc2.put("name", "params2");// 存入短信模板中的参数名称 + paramsc2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList3.add(paramsc2); + // 第3个参数 + PageData paramsc3 = new PageData(); + paramsc3.put("name", "params3");// 存入短信模板中的参数名称 + paramsc3.put("value", "验收");// 存入上面参数名称所传递的值 + paramsList3.add(paramsc3); + sendMessageUtil.sendMessages(mes3, paramsList3); + break; + default: + break; + } + GFelectricityLogService.save(log); + PageData electricitydockDataLog = new PageData(); // pd对接数据 + electricitydockDataLog.putAll(log); + dockData.put("dockDataLog", JSON.toJSONString(electricitydockDataLog)); // map.put("dockDataLog", JSON.toJSONString(log)); - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); - return map; - } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); + return map; + } - private void saveAcceptImg(MultipartFile[] files,String signertime, String ELECTRICITY_ID, - String CORPINFO_ID, String ACCEPT_USER_ID, String ACCEPT_DEPARTMENT_ID, - ArrayList pictureList,Map saveAcceptImgMap,int count) throws Exception{ - if (files != null && files.length > 0) { - for (int i = 0; i < files.length; i++) { - PageData cpd = new PageData(); - cpd = this.getPageData(); - MultipartFile file = files[i]; - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName,Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile); - cpd.put("ACCEPT_USER_SIGNER_TIME", signertime); - cpd.put("ACCEPT_CONFESS_ID", this.get32UUID()); - cpd.put("OPERATOR", cpd.get("OPERATOR")); //修改人 - cpd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - cpd.put("ACCEPT_USER_SIGNER_PATH", Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName); - cpd.put("ISDELETE", '0'); - cpd.put("CORPINFO_ID", CORPINFO_ID); - cpd.put("ELECTRICITY_ID", ELECTRICITY_ID); - cpd.put("ACCEPT_USER_ID", ACCEPT_USER_ID); - cpd.put("ACCEPT_CONFESS_DEPARTMENT_ID", ""); - cpd.put("ACCEPT_CONFESS_USER_ID", ""); - cpd.put("ACCEPT_DEPARTMENT_ID", ACCEPT_DEPARTMENT_ID); - saveAcceptImgMap.put("other" + count, JSON.toJSONString(cpd)); - count++; - electricityacceptuserService.save(cpd); - pictureList.add(Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName + "@@" + fileName); - } - } - } + private void saveAcceptImg(MultipartFile[] files, String signertime, String ELECTRICITY_ID, String CORPINFO_ID, String ACCEPT_USER_ID, String ACCEPT_DEPARTMENT_ID, ArrayList pictureList, Map saveAcceptImgMap, int count) throws Exception { + if (files != null && files.length > 0) { + for (int i = 0; i < files.length; i++) { + PageData cpd = new PageData(); + cpd = this.getPageData(); + MultipartFile file = files[i]; + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile); + cpd.put("ACCEPT_USER_SIGNER_TIME", signertime); + cpd.put("ACCEPT_CONFESS_ID", this.get32UUID()); + cpd.put("OPERATOR", cpd.get("OPERATOR")); //修改人 + cpd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + cpd.put("ACCEPT_USER_SIGNER_PATH", Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName); + cpd.put("ISDELETE", '0'); + cpd.put("CORPINFO_ID", CORPINFO_ID); + cpd.put("ELECTRICITY_ID", ELECTRICITY_ID); + cpd.put("ACCEPT_USER_ID", ACCEPT_USER_ID); + cpd.put("ACCEPT_CONFESS_DEPARTMENT_ID", ""); + cpd.put("ACCEPT_CONFESS_USER_ID", ""); + cpd.put("ACCEPT_DEPARTMENT_ID", ACCEPT_DEPARTMENT_ID); + saveAcceptImgMap.put("other" + count, JSON.toJSONString(cpd)); + count++; + electricityacceptuserService.save(cpd); + pictureList.add(Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName + "@@" + fileName); + } + } + } - /**修改 - * @param - * @throws Exception - */ - @RequestMapping(value="/editStatus") - @ResponseBody - @Transactional - @DockAnnotation(hasAnnex = true) - public Object editStatus( - @RequestParam(value="FFILE",required=false) MultipartFile[] files - ) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/editStatus") + @ResponseBody + @Transactional + @DockAnnotation(hasAnnex = true) + public Object editStatus(@RequestParam(value = "FFILE", required = false) MultipartFile[] files) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - PageData pd2 = new PageData(); - pd2 = GFelectricityService.findById(pd); - pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 - pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - PageData log = new PageData(); - log.put("ELECTRICITYLOG_ID", this.get32UUID()); + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + PageData pd2 = new PageData(); + pd2 = GFelectricityService.findById(pd); + pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人 + pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + PageData log = new PageData(); + log.put("ELECTRICITYLOG_ID", this.get32UUID()); // log.put("ACTION", "审核打回"); - log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID")); - log.put("CREATOR",pd.get("ACTION_USER")); - log.put("CREATTIME", DateUtil.date2Str(new Date())); + log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID")); + log.put("CREATOR", pd.get("ACTION_USER")); + log.put("CREATTIME", DateUtil.date2Str(new Date())); // map.put("dockData", JSON.toJSONString(pd)); - String status = pd.get("STATUS").toString(); - if ("2".equals(status) || "3".equals(status) || "4".equals(status)) { - String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + - (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"); - pd.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES); - pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES); - } else if ("-2".equals(status) || "-3".equals(status) || "-4".equals(status) || "-5".equals(status)) { - //打回清空数据 - pd2.put("OTHER_PROTECTIVE_MEASURES", ""); - } + String status = pd.get("STATUS").toString(); + if ("2".equals(status) || "3".equals(status) || "4".equals(status)) { + String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"); + pd.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES); + pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES); + } else if ("-2".equals(status) || "-3".equals(status) || "-4".equals(status) || "-5".equals(status)) { + //打回清空数据 + pd2.put("OTHER_PROTECTIVE_MEASURES", ""); + } - switch (status) { - case "2"://作业单位 - if (files != null && files.length > 0) { - ArrayList pictureList = new ArrayList(); - MultipartFile file = files[0]; + switch (status) { + case "2"://作业单位 + if (files != null && files.length > 0) { + ArrayList pictureList = new ArrayList(); + MultipartFile file = files[0]; - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); - pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); - map.put("sendPicturesList", JSON.toJSONString(pictureList)); - pd2.putAll(pd); - pd2.put("CONFIRM_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd2.put("CONFIRM_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); - pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); + map.put("sendPicturesList", JSON.toJSONString(pictureList)); + pd2.putAll(pd); + pd2.put("CONFIRM_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("CONFIRM_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd2 = new PageData(); // pd对接数据 - electricitydockDatapd2.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd2 = new PageData(); // pd对接数据 + electricitydockDatapd2.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - GFelectricityToMeasuresService.delete(pd); - PageData electricitydockDataDel = new PageData(); // pd对接数据 - electricitydockDataDel.putAll(pd); - dockData.put("dockDataDel", JSON.toJSONString(electricitydockDataDel)); + GFelectricityToMeasuresService.delete(pd); + PageData electricitydockDataDel = new PageData(); // pd对接数据 + electricitydockDataDel.putAll(pd); + dockData.put("dockDataDel", JSON.toJSONString(electricitydockDataDel)); // map.put("dockDataDel", JSON.toJSONString(pd)); - List list = (List) JSON.parse(pd.get("measuresList").toString()); - HashMap measuresMap = new HashMap(); - int measuresCount = 1; - for (JSONObject json : list) { - PageData measures = new PageData(); - measures.put("ELECTRICITYTOMEASURES_ID", this.get32UUID()); // 主键 - measures.put("ELECTRICITY_ID", pd2.get("ELECTRICITY_ID")); - measures.put("BUS_ELECTRICITY_MEASURES_ID", json.get("BUS_ELECTRICITY_MEASURES_ID")); - measures.put("STATUS", json.get("STATUS")); - measures.put("CONFIRM_ID", pd.get("OPERATOR")); - measures.put("CONFIRM_NAME", pd.get("ACTION_USER")); - measuresMap.put("other"+measuresCount, JSON.toJSONString(measures)); - measuresCount+=1; - GFelectricityToMeasuresService.save(measures); - } - PageData electricitydockDatameasures = new PageData(); // pd对接数据 - electricitydockDatameasures.putAll(measuresMap); - dockData.put("dockDatameasures", JSON.toJSONString(electricitydockDatameasures)); + List list = (List) JSON.parse(pd.get("measuresList").toString()); + HashMap measuresMap = new HashMap(); + int measuresCount = 1; + for (JSONObject json : list) { + PageData measures = new PageData(); + measures.put("ELECTRICITYTOMEASURES_ID", this.get32UUID()); // 主键 + measures.put("ELECTRICITY_ID", pd2.get("ELECTRICITY_ID")); + measures.put("BUS_ELECTRICITY_MEASURES_ID", json.get("BUS_ELECTRICITY_MEASURES_ID")); + measures.put("STATUS", json.get("STATUS")); + measures.put("CONFIRM_ID", pd.get("OPERATOR")); + measures.put("CONFIRM_NAME", pd.get("ACTION_USER")); + measuresMap.put("other" + measuresCount, JSON.toJSONString(measures)); + measuresCount += 1; + GFelectricityToMeasuresService.save(measures); + } + PageData electricitydockDatameasures = new PageData(); // pd对接数据 + electricitydockDatameasures.putAll(measuresMap); + dockData.put("dockDatameasures", JSON.toJSONString(electricitydockDatameasures)); // map.put("dockDatameasures", JSON.toJSONString(measuresMap)); - log.put("ACTION", "作业单位通过"); + log.put("ACTION", "作业单位通过"); - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd.get("AUDIT_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_Y02");// 短信模板编码 - mes.put("SMSCode", "SMS_227245922");// 短信模板编码 - mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "params1");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - // 第3个参数 - PageData params3 = new PageData(); - params3.put("name", "params2");// 存入短信模板中的参数名称 - params3.put("value", "用电单位审核");// 存入上面参数名称所传递的值 - paramsList.add(params3); - // 第4个参数 - PageData params4 = new PageData(); - params4.put("name", "params3");// 存入短信模板中的参数名称 - params4.put("value", "审核");// 存入上面参数名称所传递的值 - paramsList.add(params4); - sendMessageUtil.sendMessages(mes, paramsList); - if("1".equals(pd.get("ISANALYZE"))){ - TenCorpDto tenCorpDto = new TenCorpDto(); - tenCorpDto.setMark(pd.getString("ELECTRICITY_ID")); - tenCorpDto.setMark_name("ELECTRICITY_ID"); - tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000"); - tenCorpDto.setTopic("eightWork"); - tenCorpDto.setData(pd); - tenCorpDto.setMessage(TenCorpConst.electricity); + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd.get("AUDIT_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_Y02");// 短信模板编码 + mes.put("SMSCode", "SMS_227245922");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "params1");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + // 第3个参数 + PageData params3 = new PageData(); + params3.put("name", "params2");// 存入短信模板中的参数名称 + params3.put("value", "用电单位审核");// 存入上面参数名称所传递的值 + paramsList.add(params3); + // 第4个参数 + PageData params4 = new PageData(); + params4.put("name", "params3");// 存入短信模板中的参数名称 + params4.put("value", "审核");// 存入上面参数名称所传递的值 + paramsList.add(params4); + sendMessageUtil.sendMessages(mes, paramsList); + if ("1".equals(pd.get("ISANALYZE"))) { + TenCorpDto tenCorpDto = new TenCorpDto(); + tenCorpDto.setMark(pd.getString("ELECTRICITY_ID")); + tenCorpDto.setMark_name("ELECTRICITY_ID"); + tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000"); + tenCorpDto.setTopic("eightWork"); + tenCorpDto.setData(pd); + tenCorpDto.setMessage(TenCorpConst.electricity); - mqClient.SendDelayQueue(tenCorpDto); - } + mqClient.SendDelayQueue(tenCorpDto); + } - } - break; + } + break; - case "3"://用电单位审核 - if (files != null && files.length > 0) { - ArrayList pictureList = new ArrayList(); - MultipartFile file = files[0]; + case "3"://用电单位审核 + if (files != null && files.length > 0) { + ArrayList pictureList = new ArrayList(); + MultipartFile file = files[0]; - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); - pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); - map.put("sendPicturesList", JSON.toJSONString(pictureList)); - pd2.put("AUDIT_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd2.put("AUDIT_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); - pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd2 = new PageData(); // pd对接数据 - electricitydockDatapd2.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); + pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); + map.put("sendPicturesList", JSON.toJSONString(pictureList)); + pd2.put("AUDIT_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("AUDIT_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd2 = new PageData(); // pd对接数据 + electricitydockDatapd2.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - log.put("ACTION", "用电单位审核通过"); + log.put("ACTION", "用电单位审核通过"); - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd.get("APPROVE_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_Y03");// 短信模板编码 - mes.put("SMSCode", "SMS_227245922");// 短信模板编码 - mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "params1");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - // 第3个参数 - PageData params3 = new PageData(); - params3.put("name", "params2");// 存入短信模板中的参数名称 - params3.put("value", "配送电单位审批");// 存入上面参数名称所传递的值 - paramsList.add(params3); - // 第4个参数 - PageData params4 = new PageData(); - params4.put("name", "params3");// 存入短信模板中的参数名称 - params4.put("value", "审批");// 存入上面参数名称所传递的值 - paramsList.add(params4); - sendMessageUtil.sendMessages(mes, paramsList); - } - break; + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd.get("APPROVE_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_Y03");// 短信模板编码 + mes.put("SMSCode", "SMS_227245922");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "params1");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + // 第3个参数 + PageData params3 = new PageData(); + params3.put("name", "params2");// 存入短信模板中的参数名称 + params3.put("value", "配送电单位审批");// 存入上面参数名称所传递的值 + paramsList.add(params3); + // 第4个参数 + PageData params4 = new PageData(); + params4.put("name", "params3");// 存入短信模板中的参数名称 + params4.put("value", "审批");// 存入上面参数名称所传递的值 + paramsList.add(params4); + sendMessageUtil.sendMessages(mes, paramsList); + } + break; - case "4"://配送电单位审批 - if (files != null && files.length > 0) { - ArrayList pictureList = new ArrayList(); - MultipartFile file = files[0]; + case "4"://配送电单位审批 + if (files != null && files.length > 0) { + ArrayList pictureList = new ArrayList(); + MultipartFile file = files[0]; - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); - pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); - map.put("sendPicturesList", JSON.toJSONString(pictureList)); - pd2.put("APPROVE_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd2.put("APPROVE_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); - pd2.put("APPROVE_CONTENT", pd.get("CONTENT")); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd2 = new PageData(); // pd对接数据 - electricitydockDatapd2.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); + pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); + map.put("sendPicturesList", JSON.toJSONString(pictureList)); + pd2.put("APPROVE_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("APPROVE_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("APPROVE_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd2 = new PageData(); // pd对接数据 + electricitydockDatapd2.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - log.put("ACTION", "配送电单位审批通过"); + log.put("ACTION", "配送电单位审批通过"); - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd.get("ACCEPT_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_Y04");// 短信模板编码 - mes.put("SMSCode", "SMS_227245922");// 短信模板编码 - mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "params1");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - // 第3个参数 - PageData params3 = new PageData(); - params3.put("name", "params2");// 存入短信模板中的参数名称 - params3.put("value", "用电单位审核");// 存入上面参数名称所传递的值 - paramsList.add(params3); - // 第4个参数 - PageData params4 = new PageData(); - params4.put("name", "params3");// 存入短信模板中的参数名称 - params4.put("value", "审核");// 存入上面参数名称所传递的值 - paramsList.add(params4); - sendMessageUtil.sendMessages(mes, paramsList); - } - break; + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd.get("ACCEPT_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_Y04");// 短信模板编码 + mes.put("SMSCode", "SMS_227245922");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "params1");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + // 第3个参数 + PageData params3 = new PageData(); + params3.put("name", "params2");// 存入短信模板中的参数名称 + params3.put("value", "用电单位审核");// 存入上面参数名称所传递的值 + paramsList.add(params3); + // 第4个参数 + PageData params4 = new PageData(); + params4.put("name", "params3");// 存入短信模板中的参数名称 + params4.put("value", "审核");// 存入上面参数名称所传递的值 + paramsList.add(params4); + sendMessageUtil.sendMessages(mes, paramsList); + } + break; - case "5"://验收人 - if (files != null && files.length > 0) { - ArrayList pictureList = new ArrayList(); - MultipartFile file = files[0]; + case "5"://验收人 + if (files != null && files.length > 0) { + ArrayList pictureList = new ArrayList(); + MultipartFile file = files[0]; - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); - pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); - map.put("sendPicturesList", JSON.toJSONString(pictureList)); - pd2.put("ACCEPT_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd2.put("ACCEPT_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); - pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd2 = new PageData(); // pd对接数据 - electricitydockDatapd2.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); + pictureList.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName + "@@" + fileName); + map.put("sendPicturesList", JSON.toJSONString(pictureList)); + pd2.put("ACCEPT_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("ACCEPT_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd2 = new PageData(); // pd对接数据 + electricitydockDatapd2.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - log.put("ACTION", "验收通过"); + log.put("ACTION", "验收通过"); - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_Y05");// 短信模板编码 - mes.put("SMSCode", "SMS_227250920");// 短信模板编码 - mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "type");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - sendMessageUtil.sendMessages(mes, paramsList); - } - break; - case "-2"://作业单位打回 - log.put("ACTION", "作业单位打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd2 = new PageData(); // pd对接数据 - electricitydockDatapd2.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_Y05");// 短信模板编码 + mes.put("SMSCode", "SMS_227250920");// 短信模板编码 + mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "type");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + sendMessageUtil.sendMessages(mes, paramsList); + } + break; + case "-2"://作业单位打回 + log.put("ACTION", "作业单位打回"); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd2 = new PageData(); // pd对接数据 + electricitydockDatapd2.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd2)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_N02");// 短信模板编码 - mes.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "params1");// 存入短信模板中的参数名称 - params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_N02");// 短信模板编码 + mes.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "params1");// 存入短信模板中的参数名称 + params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "params2");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - // 第3个参数 - PageData params3 = new PageData(); - params3.put("name", "params3");// 存入短信模板中的参数名称 - params3.put("value", "作业单位");// 存入上面参数名称所传递的值 - paramsList.add(params3); - sendMessageUtil.sendMessages(mes, paramsList); - break; - case "-3"://用电单位审核 - log.put("ACTION", "用电单位打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd21 = new PageData(); // pd对接数据 - electricitydockDatapd21.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd21)); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "params2");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + // 第3个参数 + PageData params3 = new PageData(); + params3.put("name", "params3");// 存入短信模板中的参数名称 + params3.put("value", "作业单位");// 存入上面参数名称所传递的值 + paramsList.add(params3); + sendMessageUtil.sendMessages(mes, paramsList); + break; + case "-3"://用电单位审核 + log.put("ACTION", "用电单位打回"); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + pd2.put("AUDIT_CONTENT", pd.get("CONTENT")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd21 = new PageData(); // pd对接数据 + electricitydockDatapd21.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd21)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - PageData mes1 = new PageData(); - mes1.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes1.put("templateCode", "YD_N03");// 短信模板编码 - mes1.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes1.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList1 = new ArrayList(); - // 第1个参数 - PageData paramsa1 = new PageData(); - paramsa1.put("name", "params1");// 存入短信模板中的参数名称 - paramsa1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList1.add(paramsa1); - // 第2个参数 - PageData paramsa2 = new PageData(); - paramsa2.put("name", "params2");// 存入短信模板中的参数名称 - paramsa2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList1.add(paramsa2); - // 第3个参数 - PageData paramsa3 = new PageData(); - paramsa3.put("name", "params3");// 存入短信模板中的参数名称 - paramsa3.put("value", "用电单位");// 存入上面参数名称所传递的值 - paramsList1.add(paramsa3); - sendMessageUtil.sendMessages(mes1, paramsList1); - break; - case "-4"://配送电单位打回 - log.put("ACTION", "配送电单位打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("APPROVE_CONTENT", pd.get("CONTENT")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd22 = new PageData(); // pd对接数据 - electricitydockDatapd22.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd22)); + PageData mes1 = new PageData(); + mes1.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes1.put("templateCode", "YD_N03");// 短信模板编码 + mes1.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes1.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList1 = new ArrayList(); + // 第1个参数 + PageData paramsa1 = new PageData(); + paramsa1.put("name", "params1");// 存入短信模板中的参数名称 + paramsa1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList1.add(paramsa1); + // 第2个参数 + PageData paramsa2 = new PageData(); + paramsa2.put("name", "params2");// 存入短信模板中的参数名称 + paramsa2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList1.add(paramsa2); + // 第3个参数 + PageData paramsa3 = new PageData(); + paramsa3.put("name", "params3");// 存入短信模板中的参数名称 + paramsa3.put("value", "用电单位");// 存入上面参数名称所传递的值 + paramsList1.add(paramsa3); + sendMessageUtil.sendMessages(mes1, paramsList1); + break; + case "-4"://配送电单位打回 + log.put("ACTION", "配送电单位打回"); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + pd2.put("APPROVE_CONTENT", pd.get("CONTENT")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd22 = new PageData(); // pd对接数据 + electricitydockDatapd22.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd22)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - // 发短信 - PageData mes2 = new PageData(); - mes2.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes2.put("templateCode", "YD_N04");// 短信模板编码 - mes2.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes2.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList2 = new ArrayList(); - // 第1个参数 - PageData paramsb1 = new PageData(); - paramsb1.put("name", "params1");// 存入短信模板中的参数名称 - paramsb1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList2.add(paramsb1); + // 发短信 + PageData mes2 = new PageData(); + mes2.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes2.put("templateCode", "YD_N04");// 短信模板编码 + mes2.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes2.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList2 = new ArrayList(); + // 第1个参数 + PageData paramsb1 = new PageData(); + paramsb1.put("name", "params1");// 存入短信模板中的参数名称 + paramsb1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList2.add(paramsb1); - // 第2个参数 - PageData paramsb2 = new PageData(); - paramsb2.put("name", "params2");// 存入短信模板中的参数名称 - paramsb2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList2.add(paramsb2); - // 第3个参数 - PageData paramsb3 = new PageData(); - paramsb3.put("name", "params3");// 存入短信模板中的参数名称 - paramsb3.put("value", "配送电单位");// 存入上面参数名称所传递的值 - paramsList2.add(paramsb3); - sendMessageUtil.sendMessages(mes2, paramsList2); - break; - case "-5"://验收打回 - log.put("ACTION", "验收人打回"); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); - GFelectricityService.edit(pd2); - PageData electricitydockDatapd23 = new PageData(); // pd对接数据 - electricitydockDatapd23.putAll(pd2); - dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd23)); + // 第2个参数 + PageData paramsb2 = new PageData(); + paramsb2.put("name", "params2");// 存入短信模板中的参数名称 + paramsb2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList2.add(paramsb2); + // 第3个参数 + PageData paramsb3 = new PageData(); + paramsb3.put("name", "params3");// 存入短信模板中的参数名称 + paramsb3.put("value", "配送电单位");// 存入上面参数名称所传递的值 + paramsList2.add(paramsb3); + sendMessageUtil.sendMessages(mes2, paramsList2); + break; + case "-5"://验收打回 + log.put("ACTION", "验收人打回"); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + pd2.put("ACCEPT_CONTENT", pd.get("CONTENT")); + GFelectricityService.edit(pd2); + PageData electricitydockDatapd23 = new PageData(); // pd对接数据 + electricitydockDatapd23.putAll(pd2); + dockData.put("dockDatapd2", JSON.toJSONString(electricitydockDatapd23)); // map.put("dockDatapd2", JSON.toJSONString(pd2)); - PageData mes3 = new PageData(); - mes3.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid - mes3.put("templateCode", "YD_N05");// 短信模板编码 - mes3.put("SMSCode", "SMS_223580715");// 短信模板编码 - mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList3 = new ArrayList(); - // 第1个参数 - PageData paramsc1 = new PageData(); - paramsc1.put("name", "params1");// 存入短信模板中的参数名称 - paramsc1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList3.add(paramsc1); + PageData mes3 = new PageData(); + mes3.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid + mes3.put("templateCode", "YD_N05");// 短信模板编码 + mes3.put("SMSCode", "SMS_223580715");// 短信模板编码 + mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList3 = new ArrayList(); + // 第1个参数 + PageData paramsc1 = new PageData(); + paramsc1.put("name", "params1");// 存入短信模板中的参数名称 + paramsc1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList3.add(paramsc1); - // 第2个参数 - PageData paramsc2 = new PageData(); - paramsc2.put("name", "params2");// 存入短信模板中的参数名称 - paramsc2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList3.add(paramsc2); - // 第3个参数 - PageData paramsc3 = new PageData(); - paramsc3.put("name", "params3");// 存入短信模板中的参数名称 - paramsc3.put("value", "验收");// 存入上面参数名称所传递的值 - paramsList3.add(paramsc3); - sendMessageUtil.sendMessages(mes3, paramsList3); - break; - default: - break; - } - GFelectricityLogService.save(log); - PageData electricitydockDataLog = new PageData(); // pd对接数据 - electricitydockDataLog.putAll(log); - dockData.put("dockDataLog", JSON.toJSONString(electricitydockDataLog)); + // 第2个参数 + PageData paramsc2 = new PageData(); + paramsc2.put("name", "params2");// 存入短信模板中的参数名称 + paramsc2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList3.add(paramsc2); + // 第3个参数 + PageData paramsc3 = new PageData(); + paramsc3.put("name", "params3");// 存入短信模板中的参数名称 + paramsc3.put("value", "验收");// 存入上面参数名称所传递的值 + paramsList3.add(paramsc3); + sendMessageUtil.sendMessages(mes3, paramsList3); + break; + default: + break; + } + GFelectricityLogService.save(log); + PageData electricitydockDataLog = new PageData(); // pd对接数据 + electricitydockDataLog.putAll(log); + dockData.put("dockDataLog", JSON.toJSONString(electricitydockDataLog)); // map.put("dockDataLog", JSON.toJSONString(log)); - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); - return map; - } - /**列表 - * @param page - * @throws Exception - */ - @RequestMapping(value="/jhlist") - @ResponseBody - public Object jhlist(Page page) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); - page.setPd(pd); - List varList = GFelectricityService.jhlist(page); //列出confinedspace列表 - map.put("varList", varList); - map.put("page", page); - map.put("result", errInfo); - return map; - } - /**列表 - * @param page - * @throws Exception - */ - @RequestMapping(value="/aqlist") - @ResponseBody - public Object aqlist(Page page) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); - page.setPd(pd); - List varList = GFelectricityService.aqlist(page); //列出confinedspace列表 - map.put("varList", varList); - map.put("page", page); - map.put("result", errInfo); - return map; - } - /**列表 - * @param page - * @throws Exception - */ - @RequestMapping(value="/jslist") - @ResponseBody - public Object jslist(Page page) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); - page.setPd(pd); - List varList = GFelectricityService.jslist(page); //列出confinedspace列表 - map.put("varList", varList); - map.put("page", page); - map.put("result", errInfo); - return map; - } - /**列表 - * @param page - * @throws Exception - */ - @RequestMapping(value="/list") - @ResponseBody - public Object list(Page page) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); - page.setPd(pd); - List varList = GFelectricityService.list(page); //列出electricity列表 - map.put("varList", varList); - map.put("page", page); - map.put("result", errInfo); - return map; - } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); + return map; + } - /**作废 - * @paramout - * @throws Exception - */ - @PostMapping(value="/cancel") - @ResponseBody - @DockAnnotation - public void cancel(@RequestBody PageData pd) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - System.out.println(JSONObject.toJSONString(pd)); - PageData cpd = new PageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/jhlist") + @ResponseBody + public Object jhlist(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = GFelectricityService.jhlist(page); //列出confinedspace列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - cpd = GFelectricityService.findById(pd); - if(cpd!=null && cpd.size()>0 && cpd.getString("ANALYZE_TIME") != null){ - String WORK_START_DATE = pd.getString("WORK_START_DATE"); - String ANALYZE_TIME = cpd.getString("ANALYZE_TIME"); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - System.out.println(WORK_START_DATE); - System.out.println(ANALYZE_TIME); - System.out.println("-------------123----------"); - try { - Date date1 = format.parse(WORK_START_DATE); - Date date2 = format.parse(ANALYZE_TIME); - long workTime = date1.getTime(); - long analyzeTime = date2.getTime(); - System.out.println(workTime - analyzeTime); - System.out.println(analyzeTime - workTime); - if (workTime - analyzeTime >= 0) { - return; - } else { - PageData electricityPageData1 = new PageData(); // pd对接数据 - electricityPageData1.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData1)); + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/aqlist") + @ResponseBody + public Object aqlist(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = GFelectricityService.aqlist(page); //列出confinedspace列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/jslist") + @ResponseBody + public Object jslist(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = GFelectricityService.jslist(page); //列出confinedspace列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/list") + @ResponseBody + public Object list(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = GFelectricityService.list(page); //列出electricity列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * 作废 + * + * @throws Exception + * @paramout + */ + @PostMapping(value = "/cancel") + @ResponseBody + @DockAnnotation + public void cancel(@RequestBody PageData pd) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + System.out.println(JSONObject.toJSONString(pd)); + PageData cpd = new PageData(); + PageData dockData = new PageData(); // 主要对接数据 + + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + cpd = GFelectricityService.findById(pd); + if (cpd != null && cpd.size() > 0 && cpd.getString("ANALYZE_TIME") != null) { + String WORK_START_DATE = pd.getString("WORK_START_DATE"); + String ANALYZE_TIME = cpd.getString("ANALYZE_TIME"); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + System.out.println(WORK_START_DATE); + System.out.println(ANALYZE_TIME); + System.out.println("-------------123----------"); + try { + Date date1 = format.parse(WORK_START_DATE); + Date date2 = format.parse(ANALYZE_TIME); + long workTime = date1.getTime(); + long analyzeTime = date2.getTime(); + System.out.println(workTime - analyzeTime); + System.out.println(analyzeTime - workTime); + if (workTime - analyzeTime >= 0) { + return; + } else { + PageData electricityPageData1 = new PageData(); // pd对接数据 + electricityPageData1.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData1)); // map.put("dockData", JSON.toJSONString(pd)); - GFelectricityService.cancel(pd); - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_ZF");// 短信模板编码 - mes.put("SMSCode", "SMS_462060039");// 短信模板编码 - mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "params1");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - sendMessageUtil.sendMessages(mes, paramsList); - } - } catch (ParseException e) { - e.printStackTrace(); - } - }else{ - PageData electricityPageData1 = new PageData(); // pd对接数据 - electricityPageData1.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData1)); + GFelectricityService.cancel(pd); + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_ZF");// 短信模板编码 + mes.put("SMSCode", "SMS_462060039");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "params1");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + sendMessageUtil.sendMessages(mes, paramsList); + } + } catch (ParseException e) { + e.printStackTrace(); + } + } else { + PageData electricityPageData1 = new PageData(); // pd对接数据 + electricityPageData1.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData1)); // map.put("dockData", JSON.toJSONString(pd)); - GFelectricityService.cancel(pd); - PageData pd2 = new PageData(); - pd2 = GFelectricityService.checkno(pd); - PageData pd3 = new PageData(); - pd3.put("CHECK_NO",pd2.getString("CHECK_NO")); - pd3.put("CORPINFO_ID",pd.getString("CORPINFO_ID")); - PageData electricitydockDatapd3 = new PageData(); // pd对接数据 - electricitydockDatapd3.putAll(pd3); - dockData.put("dockDatapd3", JSON.toJSONString(electricitydockDatapd3)); + GFelectricityService.cancel(pd); + PageData pd2 = new PageData(); + pd2 = GFelectricityService.checkno(pd); + PageData pd3 = new PageData(); + pd3.put("CHECK_NO", pd2.getString("CHECK_NO")); + pd3.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); + PageData electricitydockDatapd3 = new PageData(); // pd对接数据 + electricitydockDatapd3.putAll(pd3); + dockData.put("dockDatapd3", JSON.toJSONString(electricitydockDatapd3)); // map.put("dockDatapd3", JSON.toJSONString(pd3)); - GFelectricityService.editSpecialwork(pd3); - GFelectricityService.editSpecialwork1(pd3); - GFelectricityService.editSpecialwork2(pd3); - GFelectricityService.editSpecialwork3(pd3); - GFelectricityService.editSpecialwork4(pd3); - GFelectricityService.editSpecialwork5(pd3); - GFelectricityService.editSpecialwork6(pd3); - GFelectricityService.editSpecialwork7(pd3); - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid - mes.put("templateCode", "YD_ZF");// 短信模板编码 - mes.put("SMSCode", "SMS_462060039");// 短信模板编码 - mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "number");// 存入短信模板中的参数名称 - params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 - paramsList.add(params1); - // 第2个参数 - PageData params2 = new PageData(); - params2.put("name", "params1");// 存入短信模板中的参数名称 - params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - sendMessageUtil.sendMessages(mes, paramsList); - } - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); //返回结果 - return ; - } + GFelectricityService.editSpecialwork(pd3); + GFelectricityService.editSpecialwork1(pd3); + GFelectricityService.editSpecialwork2(pd3); + GFelectricityService.editSpecialwork3(pd3); + GFelectricityService.editSpecialwork4(pd3); + GFelectricityService.editSpecialwork5(pd3); + GFelectricityService.editSpecialwork6(pd3); + GFelectricityService.editSpecialwork7(pd3); + PageData mes = new PageData(); + mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid + mes.put("templateCode", "YD_ZF");// 短信模板编码 + mes.put("SMSCode", "SMS_462060039");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "number");// 存入短信模板中的参数名称 + params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "params1");// 存入短信模板中的参数名称 + params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值 + paramsList.add(params2); + sendMessageUtil.sendMessages(mes, paramsList); + } + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); //返回结果 + return; + } - /**去修改页面获取数据 - * @param - * @throws Exception - */ - @RequestMapping(value="/goEdit") - @ResponseBody - public Object goEdit() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - pd = GFelectricityService.findById(pd); //根据ID读取 - map.put("measuresList", GFelectricityService.listAllMeasures(pd)); - map.put("gasList", GFelectricityGasService.listAll(pd)); - map.put("imgList1",electricityacceptuserService.findById(pd)); - map.put("imgList",electricityacceptuserService.findByIds(pd)); - map.put("pd", pd); - map.put("result", errInfo); - return map; - } + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + @ResponseBody + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = GFelectricityService.findById(pd); //根据ID读取 + map.put("measuresList", GFelectricityService.listAllMeasures(pd)); + map.put("gasList", GFelectricityGasService.listAll(pd)); + map.put("imgList1", electricityacceptuserService.findById(pd)); + map.put("imgList", electricityacceptuserService.findByIds(pd)); + map.put("pd", pd); + map.put("result", errInfo); + return map; + } - /**去修改页面获取数据 - * @param - * @throws Exception - */ - @RequestMapping(value="/gas/list") - @ResponseBody - public Object gasList() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - List varList = GFelectricityGasService.listAll(pd); //列出electricity列表 - map.put("varList", varList); - map.put("result", errInfo); - return map; - } + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/gas/list") + @ResponseBody + public Object gasList() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + List varList = GFelectricityGasService.listAll(pd); //列出electricity列表 + map.put("varList", varList); + map.put("result", errInfo); + return map; + } - /**去修改页面获取数据 - * @param - * @throws Exception - */ - @RequestMapping(value="/gas/delete") - @ResponseBody - @DockAnnotation - public Object gasDel() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/gas/delete") + @ResponseBody + @DockAnnotation + public Object gasDel() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - GFelectricityGasService.delete(pd); - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); //返回结果 - return map; - } + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + GFelectricityGasService.delete(pd); + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); //返回结果 + return map; + } - /**去修改页面获取数据 - * @param - * @throws Exception - */ - @RequestMapping(value="/gas/save") - @ResponseBody - @DockAnnotation(isAdd = true) - public Object gasSave() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData dockData = new PageData(); // 主要对接数据 + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/gas/save") + @ResponseBody + @DockAnnotation(isAdd = true) + public Object gasSave() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData dockData = new PageData(); // 主要对接数据 - pd.put("ELECTRICITYGAS_ID", this.get32UUID()); //主键 - pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 - PageData electricityPageData = new PageData(); // pd对接数据 - electricityPageData.putAll(pd); - dockData.put("dockData", JSON.toJSONString(electricityPageData)); - GFelectricityGasService.save(pd); - GFelectricityService.edittime(pd); - map.put("dockData", JSON.toJSONString(dockData)); - map.put("result", errInfo); //返回结果 - return map; - } + pd.put("ELECTRICITYGAS_ID", this.get32UUID()); //主键 + pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 + PageData electricityPageData = new PageData(); // pd对接数据 + electricityPageData.putAll(pd); + dockData.put("dockData", JSON.toJSONString(electricityPageData)); + GFelectricityGasService.save(pd); + GFelectricityService.edittime(pd); + map.put("dockData", JSON.toJSONString(dockData)); + map.put("result", errInfo); //返回结果 + return map; + } - /**待办作业数统计 - * @param - * @throws Exception - */ - @RequestMapping(value="/countCheck") - @ResponseBody - public Object countCheck() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - PageData count = GFelectricityService.countCheck(pd); - map.put("result", errInfo); - map.put("count", count); - return map; - } + /** + * 待办作业数统计 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/countCheck") + @ResponseBody + public Object countCheck() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData count = GFelectricityService.countCheck(pd); + map.put("result", errInfo); + map.put("count", count); + return map; + } } diff --git a/src/main/java/com/zcloud/controller/gf/AppGFHighWorkController.java b/src/main/java/com/zcloud/controller/gf/AppGFHighWorkController.java index 3265cc21..e449d2a2 100644 --- a/src/main/java/com/zcloud/controller/gf/AppGFHighWorkController.java +++ b/src/main/java/com/zcloud/controller/gf/AppGFHighWorkController.java @@ -591,8 +591,8 @@ public class AppGFHighWorkController extends BaseController { String status = pd.get("STATUS").toString(); String OTHER_PROTECTIVE_MEASURES = pd2.getString("OTHER_PROTECTIVE_MEASURES"); if ("2".equals(status) || "3".equals(status) || "4".equals(status) || "5".equals(status)) { - OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + - (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"); + OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) + ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"); // pd2.put("OTHER_PROTECTIVE_MEASURES", (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") + // (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;")); // pd2.put("HAZARD_IDENTIFICATION", (StringUtils.isNotBlank(pd2.getString("HAZARD_IDENTIFICATION")) ? pd2.getString("HAZARD_IDENTIFICATION") : "") + diff --git a/src/main/resources/config/sysSet.ini b/src/main/resources/config/sysSet.ini index 710b4c30..28d71845 100644 --- a/src/main/resources/config/sysSet.ini +++ b/src/main/resources/config/sysSet.ini @@ -7,7 +7,7 @@ showCount=10 ;在线管理IP onlineIp=127.0.0.1 ;在线管理端口 -onlinePort=8869 +onlinePort=18869 ;信息提示音 fhsmsSound=m1 diff --git a/src/main/test/Test.java b/src/main/test/Test.java deleted file mode 100644 index 99b837d6..00000000 --- a/src/main/test/Test.java +++ /dev/null @@ -1,55 +0,0 @@ -import com.alibaba.fastjson.JSONObject; -import com.zcloud.util.HttpRequestUtil; -import com.zcloud.util.Tools; - -public class Test { - private static String username = "qinan"; - private static String password = "ZBo7pZ6UKDGLXq/xc87WB/J84jk0B7jpujsQZFcGbG4NrNN0CuWSiImfNln0nloVYC0BOp+9bnCq7MEFpzJXy11z2iYnlOA8B7MM5YDi2dpI+bHO0+lfL57eH6IXP7rrSjiKWCBDjNPgYGETkSgXNRVb8L9LnwX6qbHDri4ARTI="; - private static String userName = "n3Q3nVlzQ/8wVC0CObso2H+i8Y3g8q7k0DGZrZY4ofqnAv1wgfFst7AnlTYu7Rw1aJv36cPD/nrWARmNqP+UghX17K5iutwmKLVwC4EZaVmVABQGLjYdCekj2ePHpGjDFyHYaGQrIVJ651WxFZfKtdBexSL7b9sm7FRbpievNmA="; - private static String source = "API"; - private static String code = "1"; - private static String perLocToken = "4b13428cadd8bafbf9ae7ae2544"; - private static String perLocUrl = "http://172.16.130.86/gateway-service"; - - public static void main(String[] args) throws Exception { - getToken(); - } - - public static String goToLogin() { - JSONObject request = new JSONObject(); - request.put("username", username); - request.put("password", password); - request.put("userName", userName); - request.put("source", source); - request.put("code", code); - String loginResStr = HttpRequestUtil.doPost("http://172.16.130.86/gateway-service" + "/auth/encryptLogin", request.toJSONString()); - JSONObject loginResponse = JSONObject.parseObject(loginResStr); - if(Tools.notEmpty(loginResStr) && loginResponse != null - && loginResponse.get("code") != null && loginResponse.getInteger("code") == 200 - && loginResponse.get("data") != null && loginResponse.getJSONObject("data").getString("token") != null){ - return loginResponse.getJSONObject("data").getString("token"); - } else { // 登录失败 - throw new RuntimeException("人员定位第三方登录失败"); - } - } - - public static String getToken() throws Exception { - // token 不为空。验证token是否失效 - if (Tools.notEmpty(perLocToken)) { - JSONObject request = new JSONObject(); - request.put("pageNum", 1); - request.put("pageSize", 10); - String httpResponseStr = HttpRequestUtil.doPost(perLocToken, perLocUrl + "/system/menu/menuTree",request.toJSONString()); - JSONObject httpResponse = JSONObject.parseObject(httpResponseStr); - // token 有效 - if (Tools.notEmpty(httpResponseStr) && httpResponse != null && httpResponse.get("code") != null && httpResponse.getInteger("code") == 200) { - return perLocToken; - } else { // token 失效 或者报错 - perLocToken = goToLogin(); - } - } else { - perLocToken = goToLogin(); - } - return perLocToken; - } -}