1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package com.sinosoft.em.baobiao.rcbb.service;
- import java.util.List;
- import java.util.Map;
- import javax.ws.rs.POST;
- import javax.ws.rs.Path;
- import javax.ws.rs.ProduceMime;
- import net.sf.json.JSONArray;
- import org.apache.log4j.Logger;
- import com.formaction.Utils;
- import com.persistence.service.PersistenceFactory;
- import com.persistence.service.exception.PersistenceException;
- import com.sinosoft.am.org.jdbcUtil.ORGTemplate;
- import com.sysmodel.datamodel.xmlmodel.ModelFactory;
- @Path("/ExportExcelService/")
- public class ExportExcelServiceImpl implements ExportExcelService {
- private final Logger log = Logger.getLogger(getClass());
-
- @POST
- @ProduceMime("application/json")
- @Path("/getReportClassId/")
- public String getReport(String params){
- String report_type = Utils.getParameter("report_type", params)==null ?"": Utils.getParameter("report_type", params);
- String sql = "select classid from bm_mapforreport where report_type = ?";
- List<Map<String,String>> list = null;
- try {
- list = new ORGTemplate().query(sql, report_type);
- } catch (Exception e) {
- log.error(e.getMessage());
- }
- log.info("getReport.list.size()"+list.size());
- String result = "{\"rows\":" + JSONArray.fromObject(list).toString()
- + "}";
- log.info("getReport===" + result);
- return result;
- }
- @POST
- @ProduceMime("application/json")
- @Path("/getColumn/")
- public String getColumn(String params){
- String report_type = Utils.getParameter("report_type", params) ==null ? "" : Utils.getParameter("report_type", params) ;
- String sql = "select table_column from EMC_AM_REPORT_DICTIONARY where report_type=? and is_used=?";
- List<Map<String,String>> list = null;
- try {
- list = new ORGTemplate().query(sql, report_type,"1");
- } catch (Exception e) {
- log.error(e.getMessage());
- }
- log.info("getColumn.list.size()"+list.size());
- String result = "{\"rows\":" + JSONArray.fromObject(list).toString()
- + "}";
- log.info("getColumn===" + result);
- return result;
- }
- }
|