123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638 |
- package com.sinosoft.em.evaluate.scoreGrade.service;
- import java.io.FileNotFoundException;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.UnsupportedEncodingException;
- import java.util.List;
- import java.util.Map;
- import java.util.UUID;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import javax.ws.rs.POST;
- import javax.ws.rs.Path;
- import javax.ws.rs.ProduceMime;
- import javax.ws.rs.core.Context;
- import org.apache.log4j.Logger;
- import org.apache.poi.hssf.usermodel.HSSFCell;
- import org.apache.poi.hssf.usermodel.HSSFCellStyle;
- import org.apache.poi.hssf.usermodel.HSSFRow;
- import org.apache.poi.hssf.usermodel.HSSFSheet;
- import org.apache.poi.hssf.usermodel.HSSFWorkbook;
- import org.apache.poi.hssf.util.HSSFColor;
- import org.apache.poi.ss.usermodel.CellStyle;
- import org.apache.poi.hssf.util.Region;
- import org.apache.poi.ss.usermodel.Cell;
- import com.formaction.Utils;
- import com.formaction.service.CRUDServiceImpl;
- import com.formaction.vo.Msg;
- import com.persistence.service.exception.PersistenceException;
- import com.sinosoft.common.upLoad.service.UploadManageImpl;
- import com.sinosoft.em.evaluate.scoreGrade.dao.PengGuExcel;
- import com.sinosoft.em.evaluate.scoreGrade.dao.ScoreGradeDao;
- import com.sinosoft.lz.system.logon.vo.LoginInfo;
- @Path("/ScoreGradeService/")
- public class ScoreGradeServiceImpl implements ScoreGradeService {
-
- @Context
- private org.apache.cxf.jaxrs.ext.MessageContext mc;
-
- private final Logger log = Logger.getLogger(getClass());
- @ProduceMime("application/json")
- @POST
- @Path("/getScoreGradeById")
- public String getScoreGradeById(String params) {
- String id = Utils.getParameter("id", params) == null ? "" : Utils
- .getParameter("id", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getScoreGradeById(id);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- @ProduceMime("application/json")
- @POST
- @Path("/getScoreGradeTrunkIds")
- public String getScoreGradeTrunkIds(String params) {
- String condition = Utils.getParameter("condition", params) == null ? "" : Utils
- .getParameter("condition", params);
- String evalId = Utils.getParameter("evalId", params) == null ? "" : Utils
- .getParameter("evalId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getScoreGradeTrunkIds(condition,evalId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- //保存==================================================
- @ProduceMime("application/json")
- @POST
- @Path("/saveSocre")
- public Msg saveSocre(String params) {
- String rows = Utils.getParameter("rows", params) == null ? "" : Utils
- .getParameter("rows", params);
-
- String evalId = Utils.getParameter("evalId", params) == null ? "" : Utils
- .getParameter("evalId", params);
-
- String resultTrunk = Utils.getParameter("resultTrunk", params) == null ? "" : Utils
- .getParameter("resultTrunk", params);
-
- //填报人
- String realName = Utils.getParameter("realName", params) == null ? "" : Utils
- .getParameter("realName", params);
- //填报部门
- String deptName = Utils.getParameter("deptName", params) == null ? "" : Utils
- .getParameter("deptName", params);
- //填报时间
- String dateTime = Utils.getParameter("dateTime", params) == null ? "" : Utils
- .getParameter("dateTime", params);
-
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.saveSocre(rows,evalId,resultTrunk,realName,deptName,dateTime);
-
- }
- //重置=========================================================
- @ProduceMime("application/json")
- @POST
- @Path("/reloadSocre")
- public String reloadSocre(String params) {
- String condition = Utils.getParameter("condition", params) == null ? "" : Utils
- .getParameter("condition", params);
- String evalId = Utils.getParameter("evalId", params) == null ? "" : Utils
- .getParameter("evalId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.reloadSorce(condition,evalId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- /**
- * ====导出============================================================
- * @throws FileNotFoundException
- */
-
- @ProduceMime("application/json")
- @POST
- @Path("/ExportgetScoreGradeTrunkIds")
- public String ExportgetScoreGradeTrunkIds(String params) throws FileNotFoundException {
- String condition = Utils.getParameter("condition", params) == null ? "" : Utils
- .getParameter("condition", params);
- String evalId = Utils.getParameter("evalId", params) == null ? "" : Utils
- .getParameter("evalId", params);
- // resultTrunk
- String resultTrunk = Utils.getParameter("resultTrunk", params) == null ? "" : Utils
- .getParameter("resultTrunk", params);
- //评分单位
- String [] result = resultTrunk.split(",");
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
-
- List<Map<String,String>> list = scoreGradeDao.ExportgetScoreGradeTrunkIds(condition,evalId);
-
- HttpServletRequest request = mc.getHttpServletRequest();
- String filePath = request.getRealPath("excels");
- String fileName = UUID.randomUUID().toString()+".xls";
- FileOutputStream out = new FileOutputStream(filePath+"/"+fileName);
- log.info(filePath+"/"+fileName);
- try {
- HSSFWorkbook workbook = new HSSFWorkbook();
- CellStyle cellStyle=workbook.createCellStyle();
- cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 居中
- cellStyle.setWrapText(true);//设置自动换行
- //加边框
- cellStyle.setBottomBorderColor(HSSFColor.BLACK.index);
- cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
- cellStyle.setLeftBorderColor(HSSFColor.BLACK.index);
- cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
- cellStyle.setRightBorderColor(HSSFColor.BLACK.index);
- cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
- cellStyle.setTopBorderColor(HSSFColor.BLACK.index);
- //一页
- HSSFSheet childSheet = workbook.createSheet();
- //设置列宽
- childSheet.setColumnWidth(0, 5000);
- childSheet.setColumnWidth(1, 5000);
- childSheet.setColumnWidth(2, 5000);
- childSheet.setColumnWidth(3, 5000);
- childSheet.setColumnWidth(4, 5000);
- childSheet.setColumnWidth(5, 5000);
- childSheet.setColumnWidth(6, 5000);
- // 起始行 // 结束行 // 其实列 // 结束列
- childSheet.addMergedRegion(new Region(0, (short)0, 0,(short)6));
- CellStyle cellStyle1=workbook.createCellStyle();
- cellStyle1.setWrapText(true); //换行
- HSSFRow row0 = childSheet.createRow(0);
- row0.setHeight((short)1000);
- HSSFCell cell00 = row0.createCell(0);
- cell00.setCellType(Cell.CELL_TYPE_STRING); //按照String类型读取
- cell00.setCellValue(" ");
- cell00.setCellStyle(cellStyle1);
- childSheet.addMergedRegion(new Region(1, (short)0, 1,(short)6));
- HSSFCell cell10 = childSheet.createRow(1).createCell(0);
- cell10.setCellType(Cell.CELL_TYPE_STRING); //按照String类型读取
- cell10.setCellValue("评估评分表");
- cell10.setCellStyle(cellStyle);
-
- HSSFRow row2 = childSheet.createRow(2);
- HSSFCell cell20 = row2.createCell(0);
- cell20.setCellType(Cell.CELL_TYPE_STRING); //按照String类型读取
- cell20.setCellValue("体系名");
-
- HSSFCell cell21 = row2.createCell(1);
- cell21.setCellType(Cell.CELL_TYPE_STRING); //按照String类型读取
- cell21.setCellValue("一级项目");
-
- HSSFCell cell22 = row2.createCell(2);
- cell22.setCellType(Cell.CELL_TYPE_STRING); //按照String类型读取
- cell22.setCellValue("二级项目");
-
- HSSFCell cell23 = row2.createCell(3);
- cell23.setCellType(Cell.CELL_TYPE_STRING); //按照String类型读取
- cell23.setCellValue("三级项目");
-
- HSSFCell cell24 = row2.createCell(4);
- cell24.setCellType(Cell.CELL_TYPE_STRING); //按照String类型读取
- cell24.setCellValue("评价内容");
-
-
-
- //循环评分单位 表头
- for(int i = 0;i<result.length;i++){
-
- String[] res = result[i].split("\\$");
- HSSFCell cell25 = row2.createCell(5+i);
- cell25.setCellType(Cell.CELL_TYPE_STRING); //按照String类型读取
- cell25.setCellValue(res[1]);
- }
-
-
-
- System.out.println("list.size()++++++++++++++++++++++++++++++++++++++++++++++++++++++"+list.size());
- int listSize=list.size();
- for (int r = 3 ; r < list.size()+3; r++) {// 循环该 子sheet row
- //获取数据中的每个值
- Map<String,String> detail = list.get(listSize+2-r);
- HSSFRow rows = childSheet.createRow(r);
-
- HSSFCell cell0 = rows.createCell(0);
- cell0.setCellType(Cell.CELL_TYPE_STRING);
- cell0.setCellValue(detail.get("TRUNK_NAME"));//体系名
-
- HSSFCell cell1 = rows.createCell(1);
- cell1.setCellType(Cell.CELL_TYPE_STRING);
- cell1.setCellValue(detail.get("LEVEL_ONE"));
-
- HSSFCell cell2 = rows.createCell(2);
- cell2.setCellType(Cell.CELL_TYPE_STRING);
- cell2.setCellValue(detail.get("LEVEL_TWO"));
-
- HSSFCell cell3 = rows.createCell(3);
- cell3.setCellType(Cell.CELL_TYPE_STRING);
- cell3.setCellValue(detail.get("LEVEL_THREE"));
-
- HSSFCell cell4 = rows.createCell(4);
- cell4.setCellType(Cell.CELL_TYPE_STRING);
- cell4.setCellValue(detail.get("DETAIL"));
-
- for(int i = 0;i<result.length;i++){
- String[] res = result[i].split("\\$");
-
- HSSFCell cell5 = rows.createCell(5+i);
- cell5.setCellType(Cell.CELL_TYPE_STRING);
-
-
- String sdf = "a"+res[0]+"$";
- String dsdf = detail.get(sdf);
- if(dsdf==null||"".equals(dsdf)){
- dsdf = "";
- }
-
- cell5.setCellValue(dsdf);
-
- }
-
- }
- workbook.write(out);
- out.close();
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- log.info(fileName);
- return fileName;
-
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- //导入=====================================================================
-
- @SuppressWarnings("unused")
- @POST
- @ProduceMime("text/html")
- @Path("/importExcel/")
- public String importExcel(@Context HttpServletRequest request,
- @Context HttpServletResponse response) throws UnsupportedEncodingException {
- //评分单位ids
- String resultTrunk =new String(request.getParameter("resultTrunk").getBytes("iso-8859-1"),"UTF-8")==null?"":new String(request.getParameter("resultTrunk").getBytes("iso-8859-1"),"UTF-8") ;
- //条件筛选
- String condition=request.getParameter("condition") == null?"":request.getParameter("condition");
- String evalId=request.getParameter("evalId")==null?"":request.getParameter("evalId");
- //获取任务id
- Msg msg = new Msg();
- UploadManageImpl upload = new UploadManageImpl();
- msg =upload.uploadDutyFilePath(request, response);
- if(msg.getSucsess()=="false"){
- String ret="{success : " + msg.getSucsess() + " , info : '" + msg.getInfo() + "',ObjectID:'ObjectID'}";
- return "";
- }
-
- String resultString=msg.getInfo();
- LoginInfo loginInfo = (LoginInfo) request.getSession().getAttribute("loginInfo");
- if(resultString!=null&& !"".equals(resultString)){
- String[] strs = resultString.split(";");
- String flag = strs[0];//true
- String info = strs[1];//success
- String path = strs[2];//路径
- if("true".equals(flag)){
- PengGuExcel doExcel = new PengGuExcel();
- msg.setInfo(doExcel.readExcel(path,condition,evalId,resultTrunk));
- if(msg.getSucsess().equals("false")){
- msg.setInfo("3");
- }
- }
- }
- String retString = "{success : '" + msg.getSucsess() + "' , info : '" + msg.getInfo() + "',ObjectID:'ObjectID'}";
- log.info("msginfo=========="+msg.getInfo());
- String ms = msg.getInfo();
- String ms2 = msg.getSucsess();
- return ms ;
- }
-
-
- @ProduceMime("application/json")
- @POST
- @Path("/getScoreGradeLevelOneTotal")
- public String getScoreGradeLevelOneTotal(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils
- .getParameter("gradeId", params);
- String companyId = Utils.getParameter("companyId", params) == null ? "" : Utils
- .getParameter("companyId", params);
- String trunkId = Utils.getParameter("trunkId", params) == null ? "" : Utils
- .getParameter("trunkId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getScoreGradeLevelOneTotal(gradeId,companyId,trunkId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- /**
- * 根据公司和评估指标获得一级项目及下级项目的总和
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getScoreGradeId")
- public String getScoreGradeId(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils
- .getParameter("gradeId", params);
- String trunkId = Utils.getParameter("trunkId", params) == null ? "" : Utils
- .getParameter("trunkId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getScoreGradeId(gradeId,trunkId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- /**
- * 根据公司和评估指标获得一级项目及下级项目的分值总和
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getScoreGradeTotalId")
- public String getScoreGradeTotalId(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils
- .getParameter("gradeId", params);
- String trunkId = Utils.getParameter("trunkId", params) == null ? "" : Utils
- .getParameter("trunkId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getScoreGradeTotalId(gradeId,trunkId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- /**
- * 根据公司和评估指标获得二级项目及下级项目的总和
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getScoreGradeTwoId")
- public String getScoreGradeTwoId(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils
- .getParameter("gradeId", params);
- String companyId = Utils.getParameter("companyId", params) == null ? "" : Utils
- .getParameter("companyId", params);
- String level = Utils.getParameter("level", params) == null ? "" : Utils
- .getParameter("level", params);
- String score = Utils.getParameter("score", params) == null ? "" : Utils
- .getParameter("score", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getScoreGradeTwoId(gradeId,companyId,level,score);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- @ProduceMime("application/json")
- @POST
- @Path("/getDetailScoreById")
- public String getDetailScoreById(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils
- .getParameter("gradeId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getDetailScoreById(gradeId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- @ProduceMime("application/json")
- @POST
- @Path("/getDetailScoreByIdChart")
- public String getDetailScoreByIdChart(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils
- .getParameter("gradeId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getDetailScoreByIdChart(gradeId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- @ProduceMime("application/json")
- @POST
- @Path("/getDetailScoreByIdChartLine")
- public String getDetailScoreByIdChartLine(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils
- .getParameter("gradeId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getDetailScoreByIdChartLine(gradeId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
-
- /* *//**
- * 获取柱图数据
- * @param params
- * @return
- *//*
- @ProduceMime("application/json")
- @POST
- @Path("/getColumnData")
- public String getColumnData(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils.getParameter("gradeId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getScoreData(gradeId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }*/
-
-
- /**
- * 获取柱图数据
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getLineData")
- public String getLineData(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils.getParameter("gradeId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getLineData(gradeId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- /**
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getlei_da_Data")
- public String getlei_da_Data(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils.getParameter("gradeId", params);
- String companyIdName = Utils.getParameter("companyIdName", params) == null ? "" : Utils.getParameter("companyIdName", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.Lei_Da_Data(gradeId,companyIdName);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
-
- /**
- * 获得==雷达图==数据
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getXiaJilei_da_Data")
- public String getXiaJilei_da_Data(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils.getParameter("gradeId", params);
- String companyIdName = Utils.getParameter("companyIdName", params) == null ? "" : Utils.getParameter("companyIdName", params);
- String jibie = Utils.getParameter("jibie", params) == null ? "" : Utils.getParameter("jibie", params);
-
-
- String jiaoBiaoName = Utils.getParameter("jiaoBiaoName", params) == null ? "" : Utils.getParameter("jiaoBiaoName", params);
- String title12 = Utils.getParameter("title12", params) == null ? "" : Utils.getParameter("title12", params);
-
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.xiaJiLei_Da_Data(gradeId,companyIdName,jibie,jiaoBiaoName,title12);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
-
-
-
- /**
- * 根据不同体系下一级项目评分标准的得分占比例
- * @param params
- * @return
- */
-
- @ProduceMime("application/json")
- @POST
- @Path("/getSystemData")
- public String getSystemData(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils.getParameter("gradeId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getSystemData(gradeId);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- @ProduceMime("application/json")
- @POST
- @Path("/getSystemErjiData")
- public String getSystemErjiData(String params) {
- //体系id 也就是 评分分数表中 评分id
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils.getParameter("gradeId", params);
- //公司id
- String company_id = Utils.getParameter("company_id", params) == null ? "" : Utils.getParameter("company_id", params);
- //分数级别
- String socreGrade = Utils.getParameter("socreGrade", params) == null ? "" : Utils.getParameter("socreGrade", params);
- //一级项目的名字
- String YijiName = Utils.getParameter("YijiName", params) == null ? "" : Utils.getParameter("YijiName", params);
-
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- return scoreGradeDao.getSystemErjiData(gradeId,company_id,socreGrade,YijiName);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- @ProduceMime("application/json")
- @POST
- @Path("/getCompanyWeight")
- public String getCompanyWeight(String params) {
- String gradeId = Utils.getParameter("gradeId", params) == null ? "" : Utils
- .getParameter("gradeId", params);
- String companyId = Utils.getParameter("companyId", params) == null ? "" : Utils
- .getParameter("companyId", params);
- String trunkId = Utils.getParameter("trunkId", params) == null ? "" : Utils
- .getParameter("trunkId", params);
- try {
- ScoreGradeDao scoreGradeDao = new ScoreGradeDao();
- if(trunkId.equals("")){
- String weight = scoreGradeDao.getCompanyWeight(companyId, gradeId);
- return weight;
- }else{
- String score = scoreGradeDao.getCompanyTrunkScore(companyId, gradeId, trunkId);
- return score;
- }
-
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- }
|