123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179 |
- package com.sinosoft.em.event.dao;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.List;
- import java.util.Map;
- import net.sf.json.JSONArray;
- import org.apache.log4j.Logger;
- import com.persistence.service.JDBCHelper;
- import com.persistence.service.PersistenceFactory;
- import com.persistence.service.SysPersistence;
- import com.persistence.service.assitant.generator.IdentityGenerator;
- import com.persistence.service.exception.PersistenceException;
- import com.persistence.service.exception.TransformTypeException;
- import com.sinosoft.common.util.DateUtil;
- import com.sysmodel.datamodel.xmlmodel.ModelFactory;
- import com.sysmodel.datamodel.xmlmodel.able.MdpConstant;
- import com.sysmodel.datamodel.xmlmodel.able.SysModel;
- /**
- * 突发事件管理dao接口
- * @author zhuanghuiliang
- * @date 2015-10-28
- */
- public class EventDaoImpl implements EventDaoAble{
- //日志对象
- private static final Logger log = Logger.getLogger(EventDaoImpl.class);
- private static SysModel sysmodel = ModelFactory.getSysmodel();
- private static SysPersistence persistence = PersistenceFactory.getInstance(sysmodel);
- /**
- * 根据上次预警/响应单号查询上次预警/响应信息
- *
- * @param prevId 上次预警编号
- * @param fd_id
- * @return
- * @throws PersistenceException
- */
-
- public List<Map<String,String>> getInfoByPrevId(String prevId,String comp_id, String fd_id) throws PersistenceException {
- // TODO Auto-generated method stub
- // String sql = "SELECT EARLY_WARNING_NAME,EARLY_WARNING_ID,CURRENT_EW_LEVEL,CURRENT_ER_LEVEL,PREV_EW_ID,RELEASE_RELIEVE_DATE,IS_ALERT,EARLY_WARNING_AREA_NAME,RELEASE_RELIEVE_DATE,fd_description LEVEL_SHOW FROM ECM_EM_PUBLISH_ALERT_NOTICE left join BM_MapValueCanst on (CURRENT_EW_LEVEL =fd_code or CURRENT_ER_LEVEL=fd_code) and fd_type in('BM_WarningState','BM_REPONSELEVEL') WHERE EARLY_WARNING_ID = '"+prevId+"'";
- String sql = "SELECT A.FD_OBJECTID,A.EARLY_WARNING_NAME,A.IS_LAST_ID,A.EARLY_WARNING_ID,A.CURRENT_EW_LEVEL,A.CURRENT_ER_LEVEL,A.PREV_EW_ID,A.RELEASE_RELIEVE_DATE,A.IS_ALERT,"+
- "A.EARLY_WARNING_AREA_NAME,A.RELEASE_RELIEVE_DATE,B.fd_description LEVEL_SHOW "+
- "FROM ECM_EM_PUBLISH_ALERT_NOTICE A ,BM_MapValueCanst B "+
- "WHERE FD_OBJECTID = '"+prevId+"' and "+
- "RELEASE_UNIT = '"+comp_id+"' and "+
- "((A.CURRENT_EW_LEVEL =B.FD_CODE and b.fd_type='BM_WarningState' and is_alert='0') or "+
- " (A.CURRENT_ER_LEVEL =B.FD_CODE and b.fd_type='BM_REPONSELEVEL' and is_alert='1')) and A.FD_OBJECTID!='"+fd_id+"' ";
- log.info("==="+sql);
- List<Map<String,String>> list = persistence.getSearchResultToMap(365, sql);
- if(list!=null&&list.size()>0){
- Map<String,String> map = list.get(list.size()-1);
- String prev_ew_id = map.get("IS_LAST_ID");
- String prev_warning_id = map.get("FD_OBJECTID");
- if(prev_ew_id!=null&&!prev_ew_id.equals("")){
- //递归查询
- list.addAll(getInfoByPrevId(prev_ew_id,comp_id,prev_warning_id));
- }
- return list;
- }else{
- return null;
- }
- }
- @Override
- public String getEventInfoByPrevId(String prevId,String fd_id,String comp_id) throws PersistenceException{
- List<Map<String,String>> list = getNoticeInfoById(fd_id);
- List<Map<String,String>> list1 = getInfoByPrevId(prevId,comp_id,fd_id);
- if(list!=null&&list1!=null){
- list.addAll(list1);
- }
- log.info(JSONArray.fromObject(list).toString());
- return JSONArray.fromObject(list).toString();
- }
- /**
- * 根据预警/响应单号查询通知单信息
- *
- * @param fd_id 预警/响应编号
- * @return
- * @throws PersistenceException
- */
- public List<Map<String, String>> getNoticeInfoById(String fd_id) throws PersistenceException{
- //String sql = "SELECT EARLY_WARNING_NAME,EARLY_WARNING_ID,CURRENT_EW_LEVEL,CURRENT_ER_LEVEL,PREV_EW_ID,RELEASE_RELIEVE_DATE,IS_ALERT,EARLY_WARNING_AREA_NAME,RELEASE_RELIEVE_DATE,fd_description LEVEL_SHOW FROM ECM_EM_PUBLISH_ALERT_NOTICE left join BM_MapValueCanst on (CURRENT_EW_LEVEL =fd_code or CURRENT_ER_LEVEL=fd_code) and fd_type in('BM_WarningState','BM_REPONSELEVEL') WHERE fd_objectid = '"+fd_id+"'";
- String sql="SELECT A.EARLY_WARNING_NAME,A.EARLY_WARNING_ID,A.CURRENT_EW_LEVEL,A.CURRENT_ER_LEVEL,A.PREV_EW_ID,A.RELEASE_RELIEVE_DATE,A.IS_ALERT,A.EARLY_WARNING_AREA_NAME,A.RELEASE_RELIEVE_DATE,B.fd_description LEVEL_SHOW FROM ECM_EM_PUBLISH_ALERT_NOTICE A ,BM_MapValueCanst B WHERE a.fd_objectid = '"+fd_id+"' and ((A.CURRENT_EW_LEVEL =B.FD_CODE and b.fd_type='BM_WarningState' and is_alert='0') or (A.CURRENT_ER_LEVEL =B.FD_CODE and b.fd_type='BM_REPONSELEVEL' and is_alert='1'))";
- List<Map<String, String>> list=persistence.getSearchResultToMap(320, sql);
- return list;
- }
- /**
- * 根据预警/响应单号查询报告信息
- *
- * @param fd_id 预警/响应编号
- * @return
- * @throws PersistenceException
- */
- public String getReportInfoById(String fd_id) throws PersistenceException{
- String sql = "SELECT FD_OBJECTID FROM ECM_EM_ALERT_REPORT_PLAN WHERE EARLY_WARNING_ID='"+fd_id+"'";
- List<String[]> list=persistence.getSearchResult(320, sql);
- if(list!=null&&list.size()>0){
- return JSONArray.fromObject(list.get(0)).toString();
- }
- return null;
- }
-
- /**
- * 根据预警/响应单号查询报表信息
- *
- * @param fd_id 预警/响应编号
- * @return
- * @throws PersistenceException
- */
- public String getBaobiaoInfoById(String fd_id) throws PersistenceException{
- String sql = "SELECT FD_OBJECTID FROM REPORT_SCHEDULE WHERE WARNING_NUMBER='"+fd_id+"'";
- List<String[]> list=persistence.getSearchResult(337, sql);
- if(list!=null&&list.size()>0){
- return JSONArray.fromObject(list.get(0)).toString();
- }
- return null;
- }
- /**
- * 查询上下级单位当前预警/响应信息
- *
- * @param deptId 当前登录用户所属单位id
- * @return
- */
- public String getParentAndChildrenInfo(String deptId,String planTypeId)throws PersistenceException{
- String sql = "select dept_id from sys_department where parent_Id='"+deptId+"' or dept_id=(select parent_id from sys_department where dept_id='"+deptId+"')";
- List<String[]> list=persistence.getSearchResult(365, sql);
- String depts = "";
- if(list!=null&&list.size()>0){
- for(String[] s:list){
- depts += "'"+s[0]+"',";
- }
- if(!depts.equals("")){
- depts = depts.substring(0,depts.length()-1);
- sql = "SELECT RELEASE_UNIT,EARLY_WARNING_NAME,EARLY_WARNING_ID,CURRENT_EW_LEVEL,CURRENT_ER_LEVEL,PREV_EW_ID,RELEASE_RELIEVE_DATE," +
- "IS_ALERT,EARLY_WARNING_AREA_NAME,RELEASE_RELIEVE_DATE,fd_description LEVEL_SHOW,DEPT_NAME RELEASE_UNIT_SHOW " +
- "FROM ECM_EM_PUBLISH_ALERT_NOTICE left join BM_MapValueCanst on (CURRENT_EW_LEVEL =fd_code or CURRENT_ER_LEVEL=fd_code) and fd_type in('BM_WarningState','BM_REPONSELEVEL') " +
- "left join sys_department on dept_id=RELEASE_UNIT "+
- " WHERE RELEASE_UNIT in ("+depts+") and IS_SEND='5' and PLAN_TYPE_ID='"+planTypeId+"'";
- sql="SELECT A.RELEASE_UNIT , A.EARLY_WARNING_NAME , A.EARLY_WARNING_ID , A.CURRENT_EW_LEVEL , A.CURRENT_ER_LEVEL , A.PREV_EW_ID , A.RELEASE_RELIEVE_DATE , A.IS_ALERT , A.EARLY_WARNING_AREA_NAME , A.RELEASE_RELIEVE_DATE , B.fd_description LEVEL_SHOW, C.DEPT_NAME RELEASE_UNIT_SHOW "+
- " FROM ECM_EM_PUBLISH_ALERT_NOTICE A, BM_MapValueCanst B, sys_department C "+
- " WHERE (A.CURRENT_EW_LEVEL=fd_code OR CURRENT_ER_LEVEL =fd_code) AND B.fd_type in('BM_WarningState', 'BM_REPONSELEVEL') AND A.RELEASE_UNIT=C.DEPT_ID AND A.RELEASE_UNIT IN("+depts+") AND A.IS_SEND='5' and PLAN_TYPE_ID='"+planTypeId+"'";
- List<Map<String,String>> list1 =persistence.getSearchResultToMap(365, sql);
- return JSONArray.fromObject(list1).toString();
- }
- }
- return null;
- }
-
- public String getParentAndChildrenInfo(String deptId)throws PersistenceException{
- String sql = "select dept_id from sys_department where parent_Id='"+deptId+"' or dept_id=(select parent_id from sys_department where dept_id='"+deptId+"')";
- List<String[]> list=persistence.getSearchResult(365, sql);
- String depts = "";
- if(list!=null&&list.size()>0){
- for(String[] s:list){
- depts += "'"+s[0]+"',";
- }
- if(!depts.equals("")){
- depts = depts.substring(0,depts.length()-1);
- sql = "SELECT RELEASE_UNIT,EARLY_WARNING_NAME,EARLY_WARNING_ID,CURRENT_EW_LEVEL,CURRENT_ER_LEVEL,PREV_EW_ID,RELEASE_RELIEVE_DATE," +
- "IS_ALERT,EARLY_WARNING_AREA_NAME,RELEASE_RELIEVE_DATE,fd_description LEVEL_SHOW,DEPT_NAME RELEASE_UNIT_SHOW " +
- "FROM ECM_EM_PUBLISH_ALERT_NOTICE left join BM_MapValueCanst on (CURRENT_EW_LEVEL =fd_code or CURRENT_ER_LEVEL=fd_code) and fd_type in('BM_WarningState','BM_REPONSELEVEL') " +
- "left join sys_department on dept_id=RELEASE_UNIT WHERE RELEASE_UNIT in ("+depts+") and IS_SEND='5'";
- sql="SELECT A.RELEASE_UNIT , A.EARLY_WARNING_NAME , A.EARLY_WARNING_ID , A.CURRENT_EW_LEVEL , A.CURRENT_ER_LEVEL , A.PREV_EW_ID , A.RELEASE_RELIEVE_DATE , A.IS_ALERT , A.EARLY_WARNING_AREA_NAME , A.RELEASE_RELIEVE_DATE , B.fd_description LEVEL_SHOW, C.DEPT_NAME RELEASE_UNIT_SHOW FROM ECM_EM_PUBLISH_ALERT_NOTICE A, BM_MapValueCanst B, sys_department C WHERE (A.CURRENT_EW_LEVEL=fd_code OR CURRENT_ER_LEVEL =fd_code) AND B.fd_type in('BM_WarningState', 'BM_REPONSELEVEL') AND A.RELEASE_UNIT=C.DEPT_ID AND A.RELEASE_UNIT IN("+depts+") AND A.IS_SEND='5'";
- List<Map<String,String>> list1 =persistence.getSearchResultToMap(365, sql);
- return JSONArray.fromObject(list1).toString();
- }
- }
- return null;
- }
-
- @Override
- public List<String[]> getDeptIds(String deptId) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "SELECT DEPT_ID,PARENT_ID,DEPT_NAME,DEPT_TYPE FROM SYS_DEPARTMENT WHERE "
- + "dept_type='1' AND"
- + "(DEPT_ID=(SELECT PARENT_ID FROM SYS_DEPARTMENT WHERE DEPT_ID='"+deptId+"') "
- + "OR DEPT_ID='"+deptId+"' "
- + "OR PARENT_ID='"+deptId+"')";
- List<String[]> list=persistence.getSearchResult(800, sql);
- if(list!=null&&list.size()>0){
- return list;
- }else{
- return null;
- }
- }
- @Override
- public List<String[]> getNoticeByDeptIds(String con) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "SELECT FD_OBJECTID,RELEASE_UNIT,EARLY_WARNING_ID,IS_ALERT FROM ECM_EM_PUBLISH_ALERT_NOTICE "
- + "WHERE IS_DEL = 0 AND IS_SEND = 5 AND RELEASE_UNIT IN"+con;
- log.info(sql);
- List<String[]> list=persistence.getSearchResult(365, sql);
- if(list!=null&&list.size()>0){
- return list;
- }else{
- return null;
- }
- }
-
-
- @Override
- public List<String[]> getEventByDeptIds(String con,String eventId) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "SELECT FD_OBJECTID,ISSUE_UNITE_ID,EVENT_NAME FROM ECM_EM_EVENT_NAME "
- + "WHERE IS_DEL = '0' AND EVENT_STATE = '1' and event_type=(select event_type from ECM_EM_EVENT_NAME where FD_OBJECTID='"+eventId+"') AND ISSUE_UNITE_ID IN "+con;
- log.info(sql);
- List<String[]> list=persistence.getSearchResult(365, sql);
- if(list!=null&&list.size()>0){
- return list;
- }else{
- return null;
- }
- }
- @Override
- public String saveBindInfo(String fd_id, String noticeIds,JDBCHelper jdbc) throws TransformTypeException, PersistenceException{
- // TODO Auto-generated method stub
- //先删除已绑定的记录
- String sql = "delete from ECM_EM_EVENT_BINDING where mainid='"+fd_id+"'";
- jdbc.executeUpdateSQL(sql);
- //如果通知单id为空,直接返回
- if(noticeIds==null||noticeIds.equals("")){
- return "true";
- }
- //存放sql语句的list
- ArrayList<String> list = new ArrayList<String>();
- for(int i=0;i<noticeIds.split(",").length;i++){
- sql = "insert into ECM_EM_EVENT_BINDING(MAINID,NOTICEID,TYPE) values('"+fd_id+"','"+noticeIds.split(",")[i]+"','1')";
- list.add(sql);
- }
- //批量插入
- jdbc.executeUpdateSQL(list);
- //直接返回true,service中直接捕获异常,未抛出异常都是true
- return "true";
- }
- @Override
- public List<String[]> getNoticeByEventId(String fd_id) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "SELECT NOTICEID FROM ECM_EM_EVENT_BINDING "
- + "WHERE MAINID ='"+fd_id+"'";
- log.info(sql);
- List<String[]> list=persistence.getSearchResult(365, sql);
- if(list!=null&&list.size()>0){
- return list;
- }else{
- return null;
- }
- }
-
- @Override
- public List<String[]> getSelectEventByEventId(String fd_id) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "SELECT b.EVENT_ID FROM BM_ECM_EVENT_CONNECTION a,BM_ECM_EVENT_CONNECTION b "
- + "WHERE a.CONNECTION=b.CONNECTION and a.EVENT_ID ='"+fd_id+"' ";
- log.info(sql);
- List<String[]> list=persistence.getSearchResult(365, sql);
- if(list!=null&&list.size()>0){
- return list;
- }else{
- return null;
- }
- }
- /**
- * 根据事件id查询已绑定的通知单信息
- *
- * @param fd_id 事件id
- * @return
- * @throws PersistenceException
- */
- public String getNoticeInfoByEventId(String fd_id) throws PersistenceException{
- String sql = "SELECT NOTICEID FROM ECM_EM_EVENT_BINDING WHERE MAINID ='"+fd_id+"' ";
- List<String[]> list=persistence.getSearchResult(396, sql);
- String noticeIds = "";
- if(list!=null&&list.size()>0){
- for(String[] s:list){
- noticeIds += "'"+s[0]+"',";
- }
- if(!noticeIds.equals("")){
- noticeIds = noticeIds.substring(0,noticeIds.length()-1);
- sql = "SELECT RELEASE_UNIT,EARLY_WARNING_NAME,EARLY_WARNING_ID,CURRENT_EW_LEVEL,CURRENT_ER_LEVEL,PREV_EW_ID,RELEASE_RELIEVE_DATE," +
- "IS_ALERT,EARLY_WARNING_AREA_NAME,RELEASE_RELIEVE_DATE,fd_description LEVEL_SHOW,DEPT_NAME RELEASE_UNIT_SHOW,T.FD_OBJECTID " +
- "FROM ECM_EM_PUBLISH_ALERT_NOTICE t left join BM_MapValueCanst on CURRENT_EW_LEVEL =fd_code or CURRENT_ER_LEVEL=fd_code " +
- "left join sys_department on dept_id=RELEASE_UNIT WHERE t.FD_OBJECTID in ("+noticeIds+") and t.is_del=0 order by release_unit";
- List<Map<String,String>> list1 =persistence.getSearchResultToMap(365, sql);
- return JSONArray.fromObject(list1).toString();
- }
- }
- return null;
- }
- @Override
- public String deeteEvent(String mainids, JDBCHelper jdbc) throws PersistenceException{
- // TODO Auto-generated method stub
- if(mainids==null||mainids.equals("")){
- return "true";
- }
- String sql = "update ECM_EM_EVENT_NAME set is_del=1 where FD_OBJECTID IN ("+String2SqlString(mainids)+")";
- jdbc.executeUpdateSQL(sql);
- sql = "DELETE FROM BM_ECM_EVENT_CONNECTION WHERE EVENT_ID IN ("+String2SqlString(mainids)+")";
- jdbc.executeUpdateSQL(sql);
- System.out.println(mainids);
- return "true";
- }
-
-
- public String String2SqlString(String str){
- String s = "";
- if(str.indexOf(",")==-1){
- return "'"+str+"'";
- }else{
- String[] strs = str.split(",");
- for(int i=0;i<strs.length;i++){
- s +="'"+strs[i]+"',";
- }
- s = s.substring(0,s.length()-1);
- }
- return s;
- }
- /**
- * 查询值班信息
- *
- * @param jdbc
- * @return
- */
- @Override
- public String getDutyInfo(String deptId) throws PersistenceException {
- // TODO Auto-generated method stub
-
- String sql = "select dept_id from sys_department where parent_Id='"+deptId+"' or dept_id='"+deptId+"'";
- List<String[]> list=persistence.getSearchResult(365, sql);
- String depts = "";
- if(list!=null&&list.size()>0){
- for(String[] s:list){
- depts += "'"+s[0]+"',";
- }
- }
- if(!depts.equals("")){
- depts = depts.substring(0,depts.length()-1);
- sql = "select d1.leader_name leader_name,d1.leader_tel leader_tel,"
- + "d1.name name,d1.telephone telephone,d3.dept_id,sysdate, "
- + "start_time,END_TIME,d3.DEPT_NAME DEPT_NAME "
- + " from ECM_EM_DUTY_DETAIL d1 left join ECM_EM_DUTY d2"
- + " on d1.DUTY_ID =d2.fd_objectid"
- + " left join SYS_DEPARTMENT d3 "
- + " on d2.DEPT_NAMES=d3.dept_id "
- + " where sysdate between START_TIME and END_TIME and d2.DEPT_NAMES in("+depts+") and d1.is_del=0 and d2.RELEASE='1'"
- + " ORDER BY d3.dept_id";
- log.info("sql====="+sql);
- List<Map<String,String>> list1 = persistence.getSearchResultToMap(336, sql);
- log.info(JSONArray.fromObject(list1).toString());
- return JSONArray.fromObject(list1).toString();
- }else{
- return null;
- }
- }
- /**
- * 查询政府通知单信息
- * @param deptId 单位id
- * @return
- */
- @Override
- public String getGovInfo(String deptId) throws PersistenceException {
- // TODO Auto-generated method stub
- List<Map<String,String>> list = getGovWarningInfo(deptId);
- List<Map<String,String>> list1 = getGovResponseInfo(deptId);
- list.addAll(list1);
- List<Map<String,String>> list2 = new ArrayList<Map<String,String>>();
- SysModel sysmodel = ModelFactory.getSysmodel();
- //取得内存中的常量表数据
- MdpConstant m1 = sysmodel.getMdpConstantByName("BM_EMC_WarningName");
- MdpConstant m2 = sysmodel.getMdpConstantByName("BM_REPONSELEVEL");
- MdpConstant m3 = sysmodel.getMdpConstantByName("BM_WarningState");
- MdpConstant m4 = sysmodel.getMdpConstantByName("BM_PublishState");
- for(Map<String,String> map:list){
- map.put("NOTICETYPE", m1.getMdpConstantDisplayString(map.get("NOTICETYPE")));
- if("response".equalsIgnoreCase(map.get("TYPE"))){
- map.put("LEVEL", m2.getMdpConstantDisplayString(map.get("LEVEL")));
- }else{
- map.put("LEVEL", m3.getMdpConstantDisplayString(map.get("LEVEL")));
- }
- map.put("STATUS", m4.getMdpConstantDisplayString(map.get("STATUS")));
- list2.add(map);
- }
- log.info(JSONArray.fromObject(list2).toString());
- return JSONArray.fromObject(list2).toString();
- }
- @Override
- public String getGovInfo(String deptId,String planTypeId369,String eventId) throws PersistenceException {
- // TODO Auto-generated method stub
- List<Map<String,String>> list = getGovWarningInfo(deptId,planTypeId369,eventId);
- List<Map<String,String>> list1 = getGovResponseInfo(deptId,planTypeId369,eventId);
- list.addAll(list1);
- List<Map<String,String>> list2 = new ArrayList<Map<String,String>>();
- SysModel sysmodel = ModelFactory.getSysmodel();
- //取得内存中的常量表数据
- MdpConstant m1 = sysmodel.getMdpConstantByName("BM_EMC_WarningName");
- MdpConstant m2 = sysmodel.getMdpConstantByName("BM_REPONSELEVEL");
- MdpConstant m3 = sysmodel.getMdpConstantByName("BM_WarningState");
- MdpConstant m4 = sysmodel.getMdpConstantByName("BM_PublishState");
- for(Map<String,String> map:list){
- map.put("NOTICETYPE", m1.getMdpConstantDisplayString(map.get("NOTICETYPE")));
- if("response".equalsIgnoreCase(map.get("TYPE"))){
- map.put("LEVEL", m2.getMdpConstantDisplayString(map.get("LEVEL")));
- }else{
- map.put("LEVEL", m3.getMdpConstantDisplayString(map.get("LEVEL")));
- }
- map.put("STATUS", m4.getMdpConstantDisplayString(map.get("STATUS")));
- list2.add(map);
- }
- log.info(JSONArray.fromObject(list2).toString());
- return JSONArray.fromObject(list2).toString();
- }
- /**
- * 查询政府预警通知单信息
- * @param deptId 单位id
- * @param planTypeId369 政府或气象预警通知单--预警类别
- * @return
- */
- public List<Map<String,String>> getGovWarningInfo(String deptId) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "select a.NAME, a.fd_objectid,a.RELEASE_UNIT,a.RELEASE_DATE,a.EARLY_WARNING_NAME as NOTICETYPE,a.CURRENT_EW_LEVEL AS LEVEL,a.EARLY_WARNING_AREA AS AREA,a.EARLY_WARNING_CONTENT AS CONTENT,a.EARLY_WARNING_STATUS AS STATUS,"
- + "b.corp_id,b.corp_name,'warning' as type"
- + " from ECM_EM_GOV_ALERT_NOTICE a left join sys_department b on a.WRITE_DEPT = b.dept_id "
- // + "where b.corp_id='"+deptId+"' and a.TYPE='39' and a.is_del = '0' and EARLY_WARNING_STATUS ='33' and to_char(RELEASE_DATE,'yyyy-mm-dd') between to_char(sysdate-interval '3'month,'yyyy-mm-dd') and to_char(sysdate+interval '3'month,'yyyy-mm-dd')";
- + "where b.corp_id='"+deptId+"' and a.TYPE='39' and a.is_del = '0' and EARLY_WARNING_STATUS ='33' and to_char(RELEASE_DATE,'yyyy-mm-dd') between to_char(sysdate-interval '90'day,'yyyy-mm-dd') and to_char(sysdate+interval '90'day,'yyyy-mm-dd')";
- return persistence.getSearchResultToMap(369, sql);
- }
- public List<Map<String,String>> getGovWarningInfo(String deptId,String planTypeId369,String eventId) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "select a.NAME, a.fd_objectid,a.RELEASE_UNIT,a.RELEASE_DATE,a.EARLY_WARNING_NAME as NOTICETYPE,a.CURRENT_EW_LEVEL AS LEVEL,a.EARLY_WARNING_AREA AS AREA,a.EARLY_WARNING_CONTENT AS CONTENT,a.EARLY_WARNING_STATUS AS STATUS,"
- + "b.corp_id,b.corp_name,'warning' as type"
- + " from ECM_EM_GOV_ALERT_NOTICE a left join sys_department b on a.WRITE_DEPT = b.dept_id "
- // + "where b.corp_id='"+deptId+"' and a.TYPE='39' and a.is_del = '0' and EARLY_WARNING_STATUS ='33' and to_char(RELEASE_DATE,'yyyy-mm-dd') between to_char(sysdate-interval '3'month,'yyyy-mm-dd') and to_char(sysdate+interval '3'month,'yyyy-mm-dd') "
- + "where b.corp_id='"+deptId+"' and a.TYPE='39' and a.is_del = '0' and EARLY_WARNING_STATUS ='33' and to_char(RELEASE_DATE,'yyyy-mm-dd') between to_char(sysdate-interval '90'day,'yyyy-mm-dd') and to_char(sysdate+interval '90'day,'yyyy-mm-dd') "
- +" and EARLY_WARNING_NAME='"+planTypeId369+"'";//and EVENT_ID='"+eventId+"'";
- return persistence.getSearchResultToMap(369, sql);
- }
-
- /**
- * 查询政府响应通知单信息
- * @param deptId 单位id
- * @param planTypeId369 政府或气象预警通知单--预警类别
- * @return
- */
- public List<Map<String,String>> getGovResponseInfo(String deptId) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "select a.NAME, a.fd_objectid,a.RELEASE_UNIT,a.RELEASE_DATE,a.RESPONSE_NAME as NOTICETYPE,a.RESPONSE_LEVEL AS LEVEL,a.RESPONSE_AREA AS AREA,a.RESPONSE_CONTENT AS CONTENT,a.RESPONSE_STATUS AS STATUS,"
- + "b.corp_id,b.corp_name,'response' as type"
- + " from ECM_EM_GOV_RESPONSE_NOTICE a left join sys_department b on a.WRITE_DEPT = b.dept_id "
- // + "where b.corp_id='"+deptId+"' and a.is_del = '0' and RESPONSE_STATUS ='33' and to_char(RELEASE_DATE,'yyyy-mm-dd') between to_char(sysdate-interval '3'month,'yyyy-mm-dd') and to_char(sysdate+interval '3'month,'yyyy-mm-dd')";
- + "where b.corp_id='"+deptId+"' and a.is_del = '0' and RESPONSE_STATUS ='33' and to_char(RELEASE_DATE,'yyyy-mm-dd') between to_char(sysdate-interval '90'day,'yyyy-mm-dd') and to_char(sysdate+interval '90'day,'yyyy-mm-dd')";
- return persistence.getSearchResultToMap(370, sql);
- }
- public List<Map<String,String>> getGovResponseInfo(String deptId,String planTypeId370,String eventId) throws PersistenceException {
- // TODO Auto-generated method stub
- String sql = "select a.NAME, a.fd_objectid,a.RELEASE_UNIT,a.RELEASE_DATE,a.RESPONSE_NAME as NOTICETYPE,a.RESPONSE_LEVEL AS LEVEL,a.RESPONSE_AREA AS AREA,a.RESPONSE_CONTENT AS CONTENT,a.RESPONSE_STATUS AS STATUS,"
- + "b.corp_id,b.corp_name,'response' as type"
- + " from ECM_EM_GOV_RESPONSE_NOTICE a left join sys_department b on a.WRITE_DEPT = b.dept_id "
- // + "where b.corp_id='"+deptId+"' and a.is_del = '0' and RESPONSE_STATUS ='33' and to_char(RELEASE_DATE,'yyyy-mm-dd') between to_char(sysdate-interval '3'month,'yyyy-mm-dd') and to_char(sysdate+interval '3'month,'yyyy-mm-dd') "
- + "where b.corp_id='"+deptId+"' and a.is_del = '0' and RESPONSE_STATUS ='33' and to_char(RELEASE_DATE,'yyyy-mm-dd') between to_char(sysdate-interval '90'day,'yyyy-mm-dd') and to_char(sysdate+interval '90'day,'yyyy-mm-dd') "
- +" and RESPONSE_NAME='"+planTypeId370+"'"; //and EVENT_ID='"+eventId+"'";
- return persistence.getSearchResultToMap(370, sql);
- }
-
- /**
- * 查询报表信息
- * @param deptId 单位id
- * @return
- */
- public String getBaobiaoInfo(String warningId,String deptId) throws PersistenceException {
- // TODO Auto-generated method stub
- //查询填报计划表返回的list
- List<String[]> list = new ArrayList<String[]>();
- List<String[]> list1 = null;
-
- //用于拼接
- String str0 = "应急办:R002105430210;";
- String str1 = "R002105430211;";
- String str2 = "R002105430212;";
- String str3 = "R002105430213;";
- String str = "";
- String sql = "select report_dept from REPORT_SCHEDULE "
- + "where warning_number like'"+warningId+"' and comp_id='"+deptId+"' and is_del='0' and SEND_STAT='1'"
- + " and ("
- + " report_dept like ('R002105430210%')"
- + " or report_dept like ('R002105430211%')"
- + " or report_dept like ('R002105430212%')"
- + " or report_dept like ('R002105430213%')"
- + " )";
- System.out.println("sql==============="+sql);
- //返回数据格式
- //应急办:R002105430210;线路停运及恢复情况表,变电站停运及恢复情况表|R002105430211;线路倒杆情况统计表,线路及配变受损情况表|R002105430212;供电损失及客户停电情况表,行政区域停电情况表|R002105430213;预警发布或响应启动情况表,应急资源情况表
- //应急办:R002105430210;线路停运及恢复情况表,变电站停运及恢复情况表|R002105430211;线路倒杆情况统计表,线路及配变受损情况表|R002105430212;供电损失及客户停电情况表,行政区域停电情况表|R002105430213;预警发布或响应启动情况表,应急资源情况表
- list1 =persistence.getSearchResult(337, sql);
- for(int i=0;i<list1.size();i++){
- if(list1.get(i)[0].indexOf("R002105430210")>-1){;
- str0+=list1.get(i)[0].split(";")[2]+",";
- }else if(list1.get(i)[0].indexOf("R002105430211")>-1){;
- str1+=list1.get(i)[0].split(";")[2]+",";
- }else if(list1.get(i)[0].indexOf("R002105430212")>-1){;
- str2+=list1.get(i)[0].split(";")[2]+",";
- }else if(list1.get(i)[0].indexOf("R002105430213")>-1){;
- str3+=list1.get(i)[0].split(";")[2]+",";
- }
- }
- str0 = str0.substring(0, str0.length()-1);
- str1 = str1.substring(0, str1.length()-1);
- str2 = str2.substring(0, str2.length()-1);
- str3 = str3.substring(0, str3.length()-1);
- str=str0+"|"+str1+"|"+str2+"|"+str3;
- String [] tempArray = new String []{str};
- list.add(tempArray);
- //存放计划表里查询出的报表类型
- StringBuffer typeName = new StringBuffer();
- String time =null;
- String temp = "";
- String[] temps =null;
- if(list!=null&&list.size()>0){
- temp =list.get(0)[0];
- //计划发布时间
- //time = list.get(0)[1];
- temp = temp.split(":")[1];
- temps = temp.split("\\|");
- for(int i=0;i<temps.length;i++){
- temp = temps[i];
- temp = temp.split(";")[1];
- if(temp.indexOf(",")!=-1){
- for(int j=0;j<temp.split(",").length;j++){
- typeName.append("'"+temp.split(",")[j]+"',");
- }
- }else{
- typeName.append("'"+temp+"',");
- }
- }
- }else{
- return "";
- }
- if(typeName.charAt(typeName.length()-1)==','){
- typeName.deleteCharAt(typeName.length()-1);
- }
- String result = getReportType(typeName.toString(),deptId,time,warningId);
- return result;
- }
- //查询报表报送情况,返回报表类型名称,责任部门,上报时间
- private String getReportType(String condition,String deptId,String time,String warningId) throws PersistenceException{
- if("".equals(condition)){
- return "";
- }
- // String sql = "SELECT A.REPORT_NAME,A.DEPT_NAME,B.REPORT_TIME FROM BM_MAPFORREPORT A LEFT JOIN "
- // + "(SELECT REPORT_TYPE, MAX(REPORT_TIME) REPORT_TIME FROM REPORT_RECORDS WHERE "
- // + "COMP_ID='"+deptId+"' AND REPORT_TIME>'"+time+"'GROUP BY REPORT_TYPE,COMP_ID) B "
- // + "ON A.REPORT_TYPE=B.REPORT_TYPE WHERE A.REPORT_NAME IN("+condition+") ORDER BY A.REPORT_TYPE";
- //为了演示 先去掉时间过滤
- String sql = "SELECT A.REPORT_NAME,A.DEPT_NAME,B.REPORT_TIME FROM BM_MAPFORREPORT A LEFT JOIN "
- + "(SELECT REPORT_TYPE, MAX(REPORT_TIME) REPORT_TIME FROM REPORT_RECORDS c WHERE "
- + "COMP_ID='"+deptId+"'"
- + " and c.report_id in(select fd_objectid from report_schedule where warning_number ='"+warningId+"' and comp_id='"+deptId+"' and (report_dept like 'R002105430210%' or report_dept like 'R002105430211%' or report_dept like 'R002105430212%' or report_dept like 'R002105430213%'))"
- + " GROUP BY REPORT_TYPE,COMP_ID) B "
- + "ON A.REPORT_TYPE=B.REPORT_TYPE WHERE A.REPORT_NAME IN("+condition+") ORDER BY A.REPORT_TYPE";
- List<Map<String,String>> list =persistence.getSearchResultToMap(780, sql);
- return JSONArray.fromObject(list).toString();
- }
-
- /**
- * 查询报告信息
- * @param deptId 单位id
- * @return
- */
- public String getBaogaoInfo(String warningId,String deptId,String is_alert) throws PersistenceException {
- List<Map<String,String>> planList=getBaogao(warningId);
- //填报要求id
- String planId = "";
- //报告类型
- String reportType = "";
- //填报要求中存放的填报部门id
- String compName ="";
- if(planList!=null&&planList.size()>0){
- Map<String,String> map = planList.get(0);
- planId = map.get("FD_OBJECTID");
- String temp = map.get("REPORT_TYPE");
- for(int i=0;i<temp.split(",").length;i++){
- reportType += "'"+temp.split(",")[i]+"',";
- }
- temp = map.get("WRITE_DEPT_NAME");
- }else{
- return "";
- }
- if(reportType.equals("")){
- return "";
- }else{
- reportType = reportType.substring(0,reportType.length()-1);
- }
- String sql = "SELECT A.FD_DESCRIPTION REPORT_TYPE,B.TIME,B.INPUT_UNIT FROM "
- + "(SELECT FD_DESCRIPTION,FD_CODE "
- + "FROM BM_MAPVALUECANST WHERE FD_TYPE='BM_AlertRespReportInputState' AND FD_CODE IN("+reportType+")) A "
- + "LEFT JOIN (SELECT MAX(UPDATEDATE) TIME,REPORT_TYPE,INPUT_UNIT FROM ECM_EM_ALERT_REPORT_INPUT "
- + "WHERE REPORT_TYPE IN ("+reportType+") AND IS_DEL=0 AND IS_RELEASE=1 and is_alert='"+is_alert+"'"
- + "AND PLAN_ID='"+planId+"' GROUP BY REPORT_TYPE,INPUT_UNIT)B "
- + "ON A.FD_CODE = B.REPORT_TYPE";
- List<Map<String,String>> list = persistence.getSearchResultToMap(321, sql);
- if(list!=null&&list.size()>0){
- List<Map<String,String>> list1 = new ArrayList<Map<String,String>>();
- for(Map<String,String> map:list){
- //单位名称
- map.put("INPUT_UNIT_SHOW", getComp_name(map.get("INPUT_UNIT")));
- list1.add(map);
- }
- String result = JSONArray.fromObject(list1).toString();
- log.info(result);
- return result;
- }
- return "";
- }
- //根据预警/响应编号查询报告填报要求
- private List<Map<String,String>> getBaogao(String warningId) throws PersistenceException{
- if(warningId==null||warningId.equals("")){
- return null;
- }
- String sql = "select fd_objectid,report_type,WRITE_DEPT_NAME from ECM_EM_ALERT_REPORT_PLAN where EARLY_WARNING_ID='"+warningId+"' and is_del=0 and IS_RELEASE=1";
- List<Map<String,String>> list = persistence.getSearchResultToMap(320, sql);
- return list;
- }
- //查询部门所属单位名称
- private String getComp_name(String deptId) throws PersistenceException{
- if(deptId==null||deptId.equals("")){
- return "";
- }
- String sql = "select corp_name from sys_department where dept_id='"+deptId+"'";
- List<Map<String,String>> list = persistence.getSearchResultToMap(321, sql);
- if(list!=null&&list.size()>0){
- return list.get(0).get("CORP_NAME");
- }else{
- return "";
- }
- }
- /**
- * 查询本单位当前处于发布状态的预警和响应通知单
- * @param params
- * @return
- * @throws PersistenceException
- */
- @Override
- public String getInfoByUnit(String deptId) throws PersistenceException{
- if(deptId==null||deptId.equals("")){
- return "";
- }
- String sql = "SELECT A.FD_OBJECTID,A.EARLY_WARNING_NAME,A.EARLY_WARNING_ID,A.RELEASE_UNIT,"
- + "B.DEPT_NAME RELEASE_UNIT_SHOW,A.RELEASE_RELIEVE_DATE,A.IS_ALERT "
- + "FROM ECM_EM_PUBLISH_ALERT_NOTICE A LEFT JOIN SYS_DEPARTMENT B "
- + "ON A.RELEASE_UNIT=B.DEPT_ID "
- + "WHERE IS_SEND = '5' AND A.IS_DEL=0 AND RELEASE_UNIT='"+deptId+"' ORDER BY A.RELEASE_RELIEVE_DATE DESC";
- List<Map<String,String>> list =persistence.getSearchResultToMap(365, sql);
- return JSONArray.fromObject(list).toString();
- }
- /**
- * 查询值班信息按照日期
- *
- * @param deptId 单位id
- * @param d 日期
- * @return
- */
- @Override
- public String getDutyInfoByDate(String deptId, String d) throws PersistenceException{
- // TODO Auto-generated method stub
- if(deptId==null||deptId.equals("")){
- return "";
- }
- //如果没传日期,默认查询当天的
- if(d==null||d.equals("")){
- d=DateUtil.format(new Date());
- }
- String sql = "";
- /*String sql = "select dept_id from sys_department where parent_Id='"+deptId+"' or dept_id='"+deptId+"'";
- List<String[]> list=persistence.getSearchResult(365, sql);
- String depts = "";
- if(list!=null&&list.size()>0){
- for(String[] s:list){
- depts += "'"+s[0]+"',";
- }
- } */
- if(!deptId.equals("")){
- //depts = depts.substring(0,depts.length()-1);
- sql = "select d1.DUTY_NAME leader_name,d1.DUTY_NAME_TEL leader_tel,"
- + "d1.DATE_TIME,d3.dept_id,substr(d1.DAY_TIME,0,10) DUTY_DATE, "
- + "d3.DEPT_NAME DEPT_NAME ,d3.CORP_NAME CORP_NAME "
- + " from ECM_EM_DUTY_ALERT_INFO d1 left join ECM_EM_DUTY d2"
- + " on d1.DUTY_ID =d2.fd_objectid"
- + " left join SYS_DEPARTMENT d3 "
- + " on d2.DEPT_NAMES=d3.dept_id "
- //+ " left join BM_MAPVALUECANST d4 "
- //+ " on d4.FD_TYPE='BM_DUTYWAYSTATE' AND d4.FD_CODE=d1.DUTY_WAY "
- + " where d1.DAY_TIME in ('"+d+"') and d3.CORP_ID in('"+deptId+"') and d2.is_del='0' and d2.RELEASE='1'"
- + " ORDER BY d1.DUTY_NAME";
- log.info("sql====="+sql);
- List<Map<String,String>> list1 = persistence.getSearchResultToMap(336, sql);
- log.info(JSONArray.fromObject(list1).toString());
- return JSONArray.fromObject(list1).toString();
- }else{
- return null;
- }
- }
-
- /**
- * 查询预案启动条件
- *
- * @param planId 预案id
- * @param gradeType 1突发事件 2预警 3响应 4应对措施
- * @return
- */
- @Override
- public String getStartCondition(String planId, String gradeType) throws PersistenceException{
- // TODO Auto-generated method stub
- String type = getPlanType(planId);
- String sql = "select FRIST_GRADE,SECOND_GRADE,THRID_GRADE,FOURTH_GRADE from EMC_EM_PLAN_GRADE_NEXUS "
- + "where FILLER1='"+planId+"' and GRADE_TYPE='" + type + "_" +gradeType+"'";
- log.info("sql====="+sql);
- List<Map<String,String>> list = persistence.getSearchResultToMap(215, sql);
- log.info(JSONArray.fromObject(list).toString());
- return JSONArray.fromObject(list).toString();
- }
- /**
- * 查询预案类型
- *
- * @param planId 预案id
- * @return
- */
- public String getPlanType(String planId) throws PersistenceException{
- String sql = "select PLAN_REFINE_CATEGORY from ECM_AM_YJYASERVER "
- + "where fd_objectid='"+planId+"'";
- log.info("sql====="+sql);
- List<String[]> list = persistence.getSearchResult(214, sql);
- log.info(JSONArray.fromObject(list).toString());
- if(list!=null&&list.size()>0){
- return list.get(0)[0];
- }else{
- return "";
- }
- }
-
-
- /**
- * 预警/响应信息接收中,解除上次预警/响应通知单
- *
- * @param objectid 通知单主键
- * @param classid
- * @return
- */
- @Override
- public void changeStatus(String objectid,String classid) throws PersistenceException{
- // TODO Auto-generated method stub
- String sql = "update ECM_EM_GOV_ALERT_NOTICE set EARLY_WARNING_STATUS='34',IS_DEL='1' where fd_objectid='"+objectid+"'";
- //状态 33:发布 34:解除
- //classid 369:预警 370:响应
- if("370".equals(classid)){
- sql = "update ECM_EM_GOV_RESPONSE_NOTICE set RESPONSE_STATUS='34',IS_DEL='1' where fd_objectid='"+objectid+"'";
- }
- persistence.executeUpdateSQL(369, sql);
- }
-
- /**
- * 新增突发事件类型报表配置数据
- * 2017-03-10 谢仲铠新增
- */
- @Override
- public String getEventTypeRepConfigs(List<Map<String,String>> list, JDBCHelper jdbc,String event_type_id)
- throws PersistenceException {
- String sql = "";
- String sql1 = "";
- String sql2 = "";//一级响应
- String sql3 = "";//二级响应
- String sql4 = "";//三级响应
- String sql5 = "";//四级响应
- String sql6 = "";//红色预警
- String sql7 = "";//橙色预警
- String sql8 = "";//黄色预警
- String sql9 = "";//蓝色预警
- String sql10 = "";//用于查询报表是否已配置了时间
- sql1 = "delete from ecm_em_emergency_type_config where event_type_id='"+event_type_id+"' and is_type='1'";
- log.info("sql1====="+sql1);
- int result = persistence.executeUpdateSQL(790, sql1);
- //存放sql语句的list
- ArrayList<String> sqlList = new ArrayList<String>();
- for(int i=0;i<list.size();i++){
- //String fd_objectid=IdentityGenerator.getIdentityGenerator().gerenalIdentity(790);
- String fd_objectid=list.get(i).get("serial_number")+"_"+list.get(i).get("event_type_id");
- String serial_number = list.get(i).get("serial_number");
- String event_type_name = list.get(i).get("event_type_name");
- String report_name = list.get(i).get("report_name");
- String role_name = list.get(i).get("role_name");
- String dept_id = list.get(i).get("dept_id");
- event_type_id = list.get(i).get("event_type_id");
- String role_id = list.get(i).get("role_id");
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- Date date = new Date();
- String time = sdf.format(date);
- /*sql1 = "update ecm_em_emergency_type_config set REPORT_NAME='"+report_name+"' where role_id='"+role_id+"' "
- + "and event_type_id='"+event_type_id+"' and dept_id='"+dept_id+"' and report_name='"+report_name+"'";*/
-
- sql = "insert into ECM_EM_EMERGENCY_TYPE_CONFIG(FD_OBJECTID,SERIAL_NUMBER,EVENT_TYPE_NAME,REPORT_NAME,ROLE_NAME,DEPT_ID,EVENT_TYPE_ID,ROLE_ID,UPDATEDATE,IS_DEL,IS_TYPE) values('"
- +fd_objectid+"','"+serial_number+"','"+event_type_name+"','"+report_name+"','"+role_name+"','"+dept_id+"','"+event_type_id+"','"+role_id+"','"+time+ "','0','1');";
- log.info("sql====="+sql);
- String fd_id=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id1=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id2=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id3=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id4=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id5=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id6=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id7=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
-
- //sql2是默认给报表一级响应勾选中8:00,12:00,16:00,20:00的填报时间
- sql2 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id+"','"+fd_objectid+"','1','"+role_id+"','"+role_name+"','8:00;12:00;16:00;20:00','0','"+time+"')";
- log.info("sql2====="+sql2);
- //sql3是默认给报表二级响应勾选中8:00,12:00,16:00,20:00的填报时间
- sql3 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id1+"','"+fd_objectid+"','2','"+role_id+"','"+role_name+"','8:00;12:00;16:00;20:00','0','"+time+"')";
- log.info("sql3====="+sql3);
- //sql4是默认给报表三级响应勾选中8:00,16:00的填报时间
- sql4 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id2+"','"+fd_objectid+"','3','"+role_id+"','"+role_name+"','8:00;16:00','0','"+time+"')";
- log.info("sql4====="+sql4);
- //sql5是默认给报表四级响应勾选中8:00,16:00的填报时间
- sql5 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id3+"','"+fd_objectid+"','4','"+role_id+"','"+role_name+"','8:00;16:00','0','"+time+"')";
- log.info("sql5====="+sql5);
- //sql6是默认给报表红色预警勾选中8:00,12:00,16:00,20:00的填报时间
- sql6 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id4+"','"+fd_objectid+"','5','"+role_id+"','"+role_name+"','8:00;12:00;16:00;20:00','0','"+time+"')";
- log.info("sql6====="+sql6);
- //sql7是默认给报表红色预警勾选中8:00,12:00,16:00,20:00的填报时间
- sql7 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id5+"','"+fd_objectid+"','6','"+role_id+"','"+role_name+"','8:00;12:00;16:00;20:00','0','"+time+"')";
- log.info("sql7====="+sql7);
- //sql8是默认给报表橙色预警勾选中8:00,16:00的填报时间
- sql8 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id6+"','"+fd_objectid+"','7','"+role_id+"','"+role_name+"','8:00;16:00','0','"+time+"')";
- log.info("sql8====="+sql8);
- //sql9是默认给报表四级响应勾选中8:00,16:00的填报时间
- sql9 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id7+"','"+fd_objectid+"','8','"+role_id+"','"+role_name+"','8:00;16:00','0','"+time+"')";
- log.info("sql9====="+sql9);
- //查询报表是否已配置时间
- sql10 = "select * from ECM_EM_EVENT_REPORT where REPORT_ID='"+fd_objectid+"'";
- List<String[]> repList = persistence.getSearchResult(791, sql10);
- log.info(JSONArray.fromObject(repList).toString());
- sqlList.add(sql);
- if(repList==null||repList.size()==0){
- sqlList.add(sql2);
- sqlList.add(sql3);
- sqlList.add(sql4);
- sqlList.add(sql5);
- sqlList.add(sql6);
- sqlList.add(sql7);
- sqlList.add(sql8);
- sqlList.add(sql9);
- }
-
- }
- //批量插入
- jdbc.executeUpdateSQL(sqlList);
-
- //直接返回true,service中直接捕获异常,未抛出异常都是true
- return "true";
- }
-
- /**
- * 突发事件类型报表配置显示
- * 2017-03-13谢仲铠新增
- */
- @Override
- public String getEventConfigsShow(String event_type_id,String corp_id)
- throws PersistenceException {
- String sql="";
- if(corp_id.equals("C984DC9C294A486096C25FAA78C99AED")){
- sql = "select FD_OBJECTID,SERIAL_NUMBER,REPORT_NAME,EVENT_TYPE_NAME,DEPT_ID,ROLE_NAME,EVENT_TYPE_ID,ROLE_ID,IS_TYPE from ecm_em_emergency_type_config "
- + "where is_del='0' and SERIAL_NUMBER <> '2' and EVENT_TYPE_ID='"+event_type_id+"' order by ROLE_NAME";
- }else{
- sql = "select FD_OBJECTID,SERIAL_NUMBER,REPORT_NAME,EVENT_TYPE_NAME,DEPT_ID,ROLE_NAME,EVENT_TYPE_ID,ROLE_ID,IS_TYPE from ecm_em_emergency_type_config "
- + "where is_del='0' and SERIAL_NUMBER <> '101' and EVENT_TYPE_ID='"+event_type_id+"' order by ROLE_NAME";
- }
-
- log.info("sql====="+sql);
- List<Map<String,String>> list = persistence.getSearchResultToMap(790, sql);
- log.info(JSONArray.fromObject(list).toString());
- return JSONArray.fromObject(list).toString();
- }
-
- /**
- * 新增突发事件类型报表配置数据
- * 2017-03-10 谢仲铠新增
- */
- @Override
- public String getEventTypeReportTimeConfigDao(List<Map<String,String>> list, JDBCHelper jdbc)
- throws PersistenceException {
- String sql = "";
- String sql1 = "";
- //存放sql语句的list
- ArrayList<String> sqlList = new ArrayList<String>();
- for(int i=0;i<list.size();i++){
- String fdid=list.get(i).get("fd_id");
- String sql2 = "select * from ECM_EM_EMERGENCY_TYPE_CONFIG where fd_objectid = '"+fdid+"'";
- List<Map<String,String>> listMap = persistence.getSearchResultToMap(790, sql2);
- String fd_objectid=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- //String fd_objectid=list.get(i).get("fd_id");
- String report_id = list.get(i).get("fd_id");
- String war_rep_level = list.get(i).get("levelConfig");
- String dept_id = listMap.get(0).get("ROLE_ID");
- String dept_name = listMap.get(0).get("ROLE_NAME");
- String report_time = list.get(i).get("timeConfig");
- if(report_time.endsWith(",")){
- report_time = report_time.substring(0, report_time.length()-1);
- report_time = report_time.replaceAll(",", ";");
- }
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- Date date = new Date();
- String time = sdf.format(date);
-
- /*sql1 = "update ecm_em_emergency_type_config set REPORT_NAME='"+report_name+"' where role_id='"+role_id+"' "
- + "and event_type_id='"+event_type_id+"' and dept_id='"+dept_id+"' and report_name='"+report_name+"'";*/
- sql1 = "delete from ECM_EM_EVENT_REPORT where report_id='"+report_id+"'";
- log.info("sql1====="+sql);
- sql = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,UPDATEDATE,IS_DEL) values('"
- +fd_objectid+"','"+report_id+"','"+war_rep_level+"','"+dept_id+"','"+dept_name+"','"+report_time+"','"+time+ "','0');";
- log.info("sql====="+sql);
- int result = persistence.executeUpdateSQL(791, sql1);
- if(report_time!=""){
- sqlList.add(sql);
- }
-
- }
- //批量插入
- jdbc.executeUpdateSQL(sqlList);
- //直接返回true,service中直接捕获异常,未抛出异常都是true
- return "true";
- }
-
- /**
- * 默认加载报表配置,勾选报表填报时间
- * 2017-03-17谢仲铠新增
- */
- @Override
- public String getEventTypeTimeConfig(String event_type_id)
- throws PersistenceException {
-
- String sql = "select a.is_type,a.serial_number,b.* from ecm_em_emergency_type_config a,ecm_em_event_report b where "
- + "a.event_type_id='"+event_type_id+"' and a.fd_objectid=b.report_id and b.is_del='0'";
- log.info("sql====="+sql);
- List<Map<String,String>> list = persistence.getSearchResultToMap(791, sql);
- log.info(JSONArray.fromObject(list).toString());
- return JSONArray.fromObject(list).toString();
- }
-
- /**
- * 查询突发事件任务要求
- * @param eventTypeId 事件类型id
- * @author laieryong 2017-03-17
- */
- @Override
- public String getEmergencyByTaskDemands(String eventTypeId) throws PersistenceException {
-
- String sql = "select typeConfig.FD_OBJECTID,typeConfig.SERIAL_NUMBER,typeConfig.EVENT_TYPE_NAME,typeConfig.REPORT_NAME,typeConfig.ROLE_ID,typeConfig.ROLE_NAME,typeConfig.IS_TYPE,typeConfig.EVENT_TYPE_ID,report.WAR_REP_LEVEL,report.REPORT_TIME "
- + "from ECM_EM_EMERGENCY_TYPE_CONFIG typeConfig ,ECM_EM_EVENT_REPORT report "
- + "WHERE typeConfig.FD_OBJECTID = report.REPORT_ID AND typeConfig.IS_DEL = '0' AND typeConfig.EVENT_TYPE_ID = '"+eventTypeId+"' "
- + " ORDER BY report.WAR_REP_LEVEL ASC,typeConfig.ROLE_NAME ASC";
-
- log.info("sql====="+sql);// TODO classid
- List<Map<String,String>> list = persistence.getSearchResultToMap(790, sql);
- log.info(JSONArray.fromObject(list).toString());
- return JSONArray.fromObject(list).toString();
- }
-
- /**
- * 新增突发事件类型报告
- * @param list
- * @param jdbc
- * @return
- * @author 谢仲铠 2017-03-20
- * @throws PersistenceException
- */
- @Override
- public String addEventReportNew(List<Map<String, String>> list,JDBCHelper jdbc) throws PersistenceException {
- String sql = "";
- String sql1 = "";
- String sql2 = "";//一级响应
- String sql3 = "";//二级响应
- String sql4 = "";//三级响应
- String sql5 = "";//四级响应
- String sql6 = "";//红色预警
- String sql7 = "";//橙色预警
- String sql8 = "";//黄色预警
- String sql9 = "";//蓝色预警
- String sql10 = "";//用于查询报告是否已配置了时间
- //存放sql语句的list
- ArrayList<String> sqlList = new ArrayList<String>();
- for(int i=0;i<list.size();i++){
- //String fd_objectid=IdentityGenerator.getIdentityGenerator().gerenalIdentity(790);
- String fd_objectid=list.get(i).get("serial_number")+"_"+list.get(i).get("event_type_id");
- String serial_number = list.get(i).get("serial_number");
- String event_type_name = list.get(i).get("event_type_name");
- String report_name = list.get(i).get("report_name");
- String role_name = list.get(i).get("role_name");
- String dept_id = list.get(i).get("dept_id");
- String event_type_id = list.get(i).get("event_type_id");
- String role_id = list.get(i).get("role_id");
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- Date date = new Date();
- String time = sdf.format(date);
-
- /*sql1 = "update ecm_em_emergency_type_config set REPORT_NAME='"+report_name+"' where role_id='"+role_id+"' "
- + "and event_type_id='"+event_type_id+"' and dept_id='"+dept_id+"' and report_name='"+report_name+"'";*/
- sql1 = "delete from ecm_em_emergency_type_config where event_type_id='"+event_type_id+"' and is_type='2'";
- log.info("sql1====="+sql1);
- sql = "insert into ECM_EM_EMERGENCY_TYPE_CONFIG(FD_OBJECTID,SERIAL_NUMBER,EVENT_TYPE_NAME,REPORT_NAME,ROLE_NAME,DEPT_ID,EVENT_TYPE_ID,ROLE_ID,UPDATEDATE,IS_DEL,IS_TYPE) values('"
- +fd_objectid+"','"+serial_number+"','"+event_type_name+"','"+report_name+"','"+role_name+"','"+dept_id+"','"+event_type_id+"','"+role_id+"','"+time+ "','0','2');";
- log.info("sql====="+sql);
- int result = persistence.executeUpdateSQL(790, sql1);
-
- String fd_id=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id1=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id2=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id3=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id4=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id5=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id6=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
- String fd_id7=IdentityGenerator.getIdentityGenerator().gerenalIdentity(791);
-
- //sql2是默认给报表一级响应勾选中8:00,17:00的填报时间
- sql2 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id+"','"+fd_objectid+"','1','"+role_id+"','"+role_name+"','8:00;17:00','0','"+time+"')";
- log.info("sql2====="+sql2);
- //sql3是默认给报表二级响应勾选中8:00,17:00的填报时间
- sql3 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id1+"','"+fd_objectid+"','2','"+role_id+"','"+role_name+"','8:00;17:00','0','"+time+"')";
- log.info("sql3====="+sql3);
- //sql4是默认给报表三级响应勾选中17:00的填报时间
- sql4 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id2+"','"+fd_objectid+"','3','"+role_id+"','"+role_name+"','17:00','0','"+time+"')";
- log.info("sql4====="+sql4);
- //sql5是默认给报表四级响应勾选中17:00的填报时间
- sql5 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id3+"','"+fd_objectid+"','4','"+role_id+"','"+role_name+"','17:00','0','"+time+"')";
- log.info("sql5====="+sql5);
- //sql6是默认给报表红色预警勾选中8:00,17:00的填报时间
- sql6 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id4+"','"+fd_objectid+"','5','"+role_id+"','"+role_name+"','8:00;17:00','0','"+time+"')";
- log.info("sql6====="+sql6);
- //sql7是默认给报表红色预警勾选中8:00,17:00的填报时间
- sql7 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id5+"','"+fd_objectid+"','6','"+role_id+"','"+role_name+"','8:00;17:00','0','"+time+"')";
- log.info("sql7====="+sql7);
- //sql8是默认给报表橙色预警勾选中17:00的填报时间
- sql8 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id6+"','"+fd_objectid+"','7','"+role_id+"','"+role_name+"','17:00','0','"+time+"')";
- log.info("sql8====="+sql8);
- //sql9是默认给报表四级响应勾选中17:00的填报时间
- sql9 = "insert into ECM_EM_EVENT_REPORT(FD_OBJECTID,REPORT_ID,WAR_REP_LEVEL,DEPT_ID,DEPT_NAME,REPORT_TIME,IS_DEL,UPDATEDATE) values('"
- + fd_id7+"','"+fd_objectid+"','8','"+role_id+"','"+role_name+"','17:00','0','"+time+"')";
- log.info("sql9====="+sql9);
-
- sqlList.add(sql);
-
- //查询报表是否已配置时间
- sql10 = "select * from ECM_EM_EVENT_REPORT where REPORT_ID='"+fd_objectid+"'";
- List<String[]> repList = persistence.getSearchResult(791, sql10);
- log.info(JSONArray.fromObject(repList).toString());
- if(repList==null || repList.size()==0){
- if(serial_number=="988"){
- sqlList.add(sql6);
- sqlList.add(sql7);
- sqlList.add(sql8);
- sqlList.add(sql9);
- }else if(serial_number=="987"||serial_number=="989"){
- sqlList.add(sql2);
- sqlList.add(sql3);
- sqlList.add(sql4);
- sqlList.add(sql5);
- }
- }
- }
- //批量插入
- jdbc.executeUpdateSQL(sqlList);
- //直接返回true,service中直接捕获异常,未抛出异常都是true
- return "true";
-
-
- }
-
- /**
- * 查询事件编号是否重复
- * 2017-04-10 谢仲铠
- */
- public String selEventType(String PLAN_TYPE_ID){
- String result="";
- String sql = "select * from ECM_EM_EMERGENCY_TYPE where PLAN_TYPE_ID='"+PLAN_TYPE_ID+"'";
- try {
- List<Map<String,String>> list = persistence.getSearchResultToMap(789, sql);
- if(list.size()==0){
- result="success";
- }else{
- result="error";
- }
- } catch (PersistenceException e) {
- e.printStackTrace();
- }
- return result;
- }
-
- /**
- * 新增突发事件类型
- * @param list
- * @param jdbc
- * @return
- * @author 谢仲铠 2017-04-10
- * @throws PersistenceException
- */
-
- @Override
- public String saveEventTypes(List<Map<String, String>> list, JDBCHelper jdbc)
- throws PersistenceException {
- String FD_OBJECTID = list.get(0).get("FD_OBJECTID");
- String EVENT_NUMBER = list.get(0).get("EVENT_NUMBER");
- String EVENT_TYPE_NAME = list.get(0).get("EVENT_TYPE_NAME");
- String LEAD_DEPARTMENT = list.get(0).get("LEAD_DEPARTMENT");
- String INPUT_PERSON = list.get(0).get("INPUT_PERSON");
- String INPUT_UNIT = list.get(0).get("INPUT_UNIT");
- String INPUT_DEPARTMENT = list.get(0).get("INPUT_DEPARTMENT");
- String INPUT_PERSON_ID = list.get(0).get("INPUT_PERSON_ID");
- String INPUT_UNIT_ID = list.get(0).get("INPUT_UNIT_ID");
- String INPUT_DEPARTMENT_ID = list.get(0).get("INPUT_DEPARTMENT_ID");
- String PLAN_TYPE_ID = list.get(0).get("PLAN_TYPE_ID");
- String EVENT_MESSAGE = list.get(0).get("EVENT_MESSAGE");
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- Date date = new Date();
- String time = sdf.format(date);
- String sql = "insert into ECM_EM_EMERGENCY_TYPE(FD_OBJECTID,EVENT_NUMBER,EVENT_TYPE_NAME,LEAD_DEPARTMENT,INPUT_PERSON,INPUT_UNIT,INPUT_DEPARTMENT,INPUT_TIME,IS_DEL,UPDATEDATE,INPUT_PERSON_ID,INPUT_UNIT_ID,INPUT_DEPARTMENT_ID,PLAN_TYPE_ID,EVENT_MESSAGE) values('"
- +FD_OBJECTID+"','"+EVENT_NUMBER+"','"+EVENT_TYPE_NAME+"','"+LEAD_DEPARTMENT+"','"+INPUT_PERSON+"','"+INPUT_UNIT+"','"+INPUT_DEPARTMENT+"','"+time+"','0','"+time+"','"+INPUT_PERSON_ID+"','"+INPUT_UNIT_ID+"','"+INPUT_DEPARTMENT_ID+"','"+PLAN_TYPE_ID+"','"+EVENT_MESSAGE+"')";
- ArrayList<String> sqlList = new ArrayList<String>();
- sqlList.add(sql);
- //批量插入
- jdbc.executeUpdateSQL(sqlList);
- //直接返回true,service中直接捕获异常,未抛出异常都是true
- return "success";
- }
- @Override
- public String updateEventTypes(List<Map<String, String>> list,
- JDBCHelper jdbc) throws PersistenceException {
-
- String FD_OBJECTID = list.get(0).get("FD_OBJECTID");
- String EVENT_NUMBER = list.get(0).get("EVENT_NUMBER");
- String EVENT_TYPE_NAME = list.get(0).get("EVENT_TYPE_NAME");
- String LEAD_DEPARTMENT = list.get(0).get("LEAD_DEPARTMENT");
- String INPUT_PERSON = list.get(0).get("INPUT_PERSON");
- String INPUT_UNIT = list.get(0).get("INPUT_UNIT");
- String INPUT_DEPARTMENT = list.get(0).get("INPUT_DEPARTMENT");
- String INPUT_PERSON_ID = list.get(0).get("INPUT_PERSON_ID");
- String INPUT_UNIT_ID = list.get(0).get("INPUT_UNIT_ID");
- String INPUT_DEPARTMENT_ID = list.get(0).get("INPUT_DEPARTMENT_ID");
- String PLAN_TYPE_ID = list.get(0).get("PLAN_TYPE_ID");
- String EVENT_MESSAGE = list.get(0).get("EVENT_MESSAGE");
- String id = list.get(0).get("id");
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- Date date = new Date();
- String time = sdf.format(date);
- String sql = "update ECM_EM_EMERGENCY_TYPE set FD_OBJECTID='"+FD_OBJECTID+"',EVENT_NUMBER='"+EVENT_NUMBER+"',EVENT_TYPE_NAME='"+EVENT_TYPE_NAME+"',"
- + "LEAD_DEPARTMENT='"+LEAD_DEPARTMENT+"',INPUT_PERSON='"+INPUT_PERSON+"',INPUT_UNIT='"+INPUT_UNIT+"',INPUT_DEPARTMENT='"+INPUT_DEPARTMENT+"',"
- + "UPDATEDATE='"+time+"',INPUT_PERSON_ID='"+INPUT_PERSON_ID+"',INPUT_UNIT_ID='"+INPUT_UNIT_ID+"',INPUT_DEPARTMENT_ID='"+INPUT_DEPARTMENT_ID+"',"
- + "PLAN_TYPE_ID='"+PLAN_TYPE_ID+"',EVENT_MESSAGE='"+EVENT_MESSAGE+"' where FD_OBJECTID='"+id+"'";
- ArrayList<String> sqlList = new ArrayList<String>();
- sqlList.add(sql);
- //批量插入
- jdbc.executeUpdateSQL(sqlList);
- //直接返回true,service中直接捕获异常,未抛出异常都是true
- return "success";
- }
-
- }
|