123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- package com.sinosoft.am.filemanger.laws.service;
- import javax.ws.rs.POST;
- import javax.ws.rs.Path;
- import javax.ws.rs.ProduceMime;
- import com.formaction.Parameter;
- import com.formaction.Utils;
- import com.formaction.vo.Msg;
- import com.persistence.service.exception.PersistenceException;
- import com.sinosoft.am.filemanger.laws.dao.LawsDao;
- import com.sinosoft.am.filemanger.laws.dao.TotalFile;
- @Path("/LawsService/")
- public class LawsService{
- /**
- * 汇总界面初始化调用地址
- * @param params
- * @return
- * @throws PersistenceException
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getLaws")
- public String getLaws(String params) throws PersistenceException {
- String id=Utils.getParameter("id", params);
- String StartTime=Utils.getParameter("StartTime", params);
- String EndTime=Utils.getParameter("EndTime", params);
- String StartTime1=Utils.getParameter("StartTime1", params);
- String EndTime1=Utils.getParameter("EndTime1", params);
- String tempLevel=Utils.getParameter("tempLevel", params);
- String valueType=Utils.getParameter("valueType", params);
- String deptId = Utils.getParameter("deptId", params);
- LawsDao dao = new LawsDao();
- String json=dao.NumInit(id,StartTime,EndTime,StartTime1,EndTime1,tempLevel,valueType,deptId);
- return json;
- }
-
- //制度文件总的汇总
- @ProduceMime("application/json")
- @POST
- @Path("/getTotalFile")
- public String getTotalFile(String params) throws PersistenceException {
- String id=Utils.getParameter("id", params);
- String StartTime=Utils.getParameter("StartTime", params);
- String EndTime=Utils.getParameter("EndTime", params);
- TotalFile dao = new TotalFile();
- String json=dao.getPlanInfo(id,StartTime,EndTime);
- return json;
- }
-
- /**
- * 发布
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/LawsFabu")
- public Msg LawsFabu(String params){//发布 应急制度文件发布
- Msg m=new Msg();
- LawsDao dao = new LawsDao();
- // String comp_id=Utils.getParameter("comp_id", params)==null?"":Utils.getParameter("comp_id", params);
- String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
-
- try {
- m=dao.getLawsFabu(fd_id);
- } catch (ClassNotFoundException e) {
- m.setSucsess(new Boolean(false).toString());
- m.setInfo(Parameter.OPER_SUCSESS);
- e.printStackTrace();
- }
- return m;
- }
-
- /**
- * 撤销发布
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/noLawsFabu")
- public Msg noLawsFabu(String params){//发布 应急制度文件发布
- Msg m=new Msg();
- LawsDao dao = new LawsDao();
- // String comp_id=Utils.getParameter("comp_id", params)==null?"":Utils.getParameter("comp_id", params);
- String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
-
- try {
- m=dao.getnoLawsFabu(fd_id);
- } catch (ClassNotFoundException e) {
- m.setSucsess(new Boolean(false).toString());
- m.setInfo(Parameter.OPER_SUCSESS);
- e.printStackTrace();
- }
- return m;
- }
-
- /**
- * 共享
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/LawsShare")
- public Msg LawsShare(String params){//发布 应急制度文件发布
- Msg m=new Msg();
- LawsDao dao = new LawsDao();
- // String comp_id=Utils.getParameter("comp_id", params)==null?"":Utils.getParameter("comp_id", params);
- String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
-
- try {
- m=dao.getLawsShare(fd_id);
- } catch (ClassNotFoundException e) {
- m.setSucsess(new Boolean(false).toString());
- m.setInfo(Parameter.OPER_SUCSESS);
- e.printStackTrace();
- }
- return m;
- }
- /**
- * 撤销共享
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/noLawsShare")
- public Msg noLawsShare(String params){//发布 应急制度文件发布
- Msg m=new Msg();
- LawsDao dao = new LawsDao();
- // String comp_id=Utils.getParameter("comp_id", params)==null?"":Utils.getParameter("comp_id", params);
- String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
-
- try {
- m=dao.getnoLawsShare(fd_id);
- } catch (ClassNotFoundException e) {
- m.setSucsess(new Boolean(false).toString());
- m.setInfo(Parameter.OPER_SUCSESS);
- e.printStackTrace();
- }
- return m;
- }
-
- /**
- * 修改录入人联系方式
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/LawsUser")
- public Msg LawsUser(String params){//发布 应急制度文件发布
- Msg m=new Msg();
- LawsDao dao = new LawsDao();
- String user_id = Utils.getParameter("userid", params)==null?"":Utils.getParameter("userid", params);
- String phone = Utils.getParameter("phone", params)==null?"":Utils.getParameter("phone", params);
-
- try {
- m=dao.getLawsUser(user_id,phone);
- } catch (ClassNotFoundException e) {
- m.setSucsess(new Boolean(false).toString());
- m.setInfo(Parameter.OPER_SUCSESS);
- e.printStackTrace();
- }
- return m;
- }
- }
|