123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050 |
- package com.idea.ifpug.service;
- import cn.hutool.core.bean.BeanUtil;
- import cn.hutool.core.util.ReflectUtil;
- import cn.hutool.crypto.SecureUtil;
- import cn.hutool.json.JSONArray;
- import cn.hutool.json.JSONObject;
- import com.alibaba.excel.ExcelWriter;
- import cn.hutool.poi.excel.ExcelReader;
- import cn.hutool.poi.excel.ExcelUtil;
- import com.alibaba.excel.write.metadata.WriteSheet;
- import com.alibaba.excel.write.metadata.fill.FillConfig;
- import com.github.pagehelper.PageInfo;
- import com.idea.ifpug.excel.TestExcel;
- import com.idea.ifpug.model.*;
- import com.idea.ifpug.utils.IfpugDataUtils;
- import com.idea.ifpug.vo.ExcelResultModel;
- import com.rockstar.common.conf.V2Config;
- import com.rockstar.frame.model.extend.DateTrans;
- import com.rockstar.frame.model.extend.Tablepar;
- import com.rockstar.util.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import org.springframework.web.multipart.MultipartFile;
- import javax.servlet.http.HttpServletResponse;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStream;
- import java.math.BigDecimal;
- import java.util.*;
- @Service
- public class SysIfpugService {
- @Autowired
- private SysIfpugResultService resultService;
- @Autowired
- private SysIfpugTcfService tcfService;
- @Autowired
- private SysIfpugFpsService fpsService;
- @Autowired
- private SysIfpugIlfsService ilfsService;
- @Autowired
- private SysIfpugEifsService eifsService;
- @Autowired
- private SysIfpugEisService eisService;
- @Autowired
- private SysIfpugEosService eosService;
- @Autowired
- private SysIfpugEqsService eqsService;
- public PageInfo<SysIfpugResult> historyList(Tablepar tablepar, SysIfpugResult model, DateTrans dt) {
- return resultService.list(tablepar, model, dt);
- }
- public Object getResultDesc(String id) {
- Map<String, Object> resultMap = new HashMap<>();
- SysIfpugResult result = resultService.selectByPrimaryKey(id);
- resultMap.put("result", result);
- // TCF
- SysIfpugTcfExample tcfExample = new SysIfpugTcfExample();
- tcfExample.createCriteria().andResultIdEqualTo(id);
- List<SysIfpugTcf> tcfList = tcfService.selectByExample(tcfExample);
- resultMap.put("tcf", tcfList.size()>0?tcfList.get(0):null);
- // FPS
- SysIfpugFpsExample fpsExample = new SysIfpugFpsExample();
- fpsExample.setOrderByClause("sort asc");
- fpsExample.createCriteria().andResultIdEqualTo(id);
- List<SysIfpugFps> fpsList = fpsService.selectByExample(fpsExample);
- resultMap.put("fps", fpsList);
- // ILFS
- SysIfpugIlfsExample ilfsExample = new SysIfpugIlfsExample();
- ilfsExample.createCriteria().andResultIdEqualTo(id);
- List<SysIfpugIlfs> ilfsList = ilfsService.selectByExample(ilfsExample);
- resultMap.put("ilfs", ilfsList);
- // EIFS
- SysIfpugEifsExample eifsExample = new SysIfpugEifsExample();
- eifsExample.createCriteria().andResultIdEqualTo(id);
- List<SysIfpugEifs> eifsList = eifsService.selectByExample(eifsExample);
- resultMap.put("eifs", eifsList);
- // EIS
- SysIfpugEisExample eisExample = new SysIfpugEisExample();
- eisExample.createCriteria().andResultIdEqualTo(id);
- List<SysIfpugEis> eisList = eisService.selectByExample(eisExample);
- resultMap.put("eis", eisList);
- // EOS
- SysIfpugEosExample eosExample = new SysIfpugEosExample();
- eosExample.createCriteria().andResultIdEqualTo(id);
- List<SysIfpugEos> eosList = eosService.selectByExample(eosExample);
- resultMap.put("eos", eosList);
- // EQS
- SysIfpugEqsExample eqsExample = new SysIfpugEqsExample();
- eqsExample.createCriteria().andResultIdEqualTo(id);
- List<SysIfpugEqs> eqsList = eqsService.selectByExample(eqsExample);
- resultMap.put("eqs", eqsList);
- return resultMap;
- }
- public void saveResult(JSONObject json){
- SysIfpugResult record = new SysIfpugResult();
- JSONObject info = json.getJSONObject("info");
- record.setId(info.getStr("id"));
- record.setProjectDesc(info.getStr("projectDesc"));
- record.setCustomerName(info.getStr("customerName"));
- record.setProjectName(info.getStr("projectName"));
- record.setProjectCode(info.getStr("projectCode"));
- record.setCalculateUser(info.getStr("calculateUser"));
- record.setCalculateDate(info.getDate("calculateDate"));
- JSONArray array = json.getJSONArray("list");
- for (JSONObject jsonObject : array.toArray(new JSONObject[]{})) {
- String title = jsonObject.getStr("param");
- String value = jsonObject.getStr("value");
- if("未调整功能点计数(UFC)".equals(title)){
- record.setUfc(value);
- }else if("技术复杂度因子(TCF)".equals(title)){
- record.setTcf(value);
- }else if("调整后功能点计数(AFP)".equals(title)){
- record.setAfp(value);
- }else if("项目生产率(PE)".equals(title)){
- record.setPe(value);
- }else if("项目所需工时".equals(title)){
- record.setWorkTime(value);
- }else if("工时价格".equals(title)){
- record.setWorkPrice(new BigDecimal(value));
- }else if("项目成本".equals(title)){
- record.setProjectCost(new BigDecimal(value));
- }
- }
- record.setCreateTime(new Date());
- resultService.insertSelective(record);
- }
- public SysIfpugResult getResult(String id){
- return resultService.selectByPrimaryKey(id);
- }
- public void saveTcf(SysIfpugTcf result){
- tcfService.insertSelective(result);
- }
- public SysIfpugTcf getTcf(String id){
- return tcfService.selectByPrimaryKey(id);
- }
- public void saveFps(JSONObject json){
- String resultId = json.getStr("id");
- JSONArray array = json.getJSONArray("list");
- // for (JSONObject jsonObject : array.toList(JSONObject.class)) {
- for (JSONObject jsonObject : array.toArray(new JSONObject[]{})) {
- SysIfpugFps fps = new SysIfpugFps();
- fps.setResultId(resultId);
- fps.setFpType(jsonObject.getStr("fpType"));
- fps.setCommplex(jsonObject.getStr("commplex"));
- fps.setNum(jsonObject.getStr("num"));
- fps.setWeights(jsonObject.getStr("weights"));
- fps.setFps(jsonObject.getStr("fps"));
- fps.setFp(jsonObject.getStr("fp"));
- fpsService.insertSelective(fps);
- }
- }
- public SysIfpugFps getFps(String id){
- return fpsService.selectByPrimaryKey(id);
- }
- public void saveIlfs(JSONObject json){
- String resultId = json.getStr("id");
- JSONArray array = json.getJSONArray("list");
- for (JSONObject jsonObject : array.toArray(new JSONObject[]{})) {
- SysIfpugIlfs sysIfpugIlfs = jsonObject.toBean(SysIfpugIlfs.class);
- sysIfpugIlfs.setResultId(resultId);
- ilfsService.insertSelective(sysIfpugIlfs);
- }
- // for (SysIfpugIlfs sysIfpugIlfs : array.toList(SysIfpugIlfs.class)) {
- // sysIfpugIlfs.setResultId(resultId);
- // ilfsService.insertSelective(sysIfpugIlfs);
- // }
- }
- public SysIfpugIlfs getIlfs(String id){
- return ilfsService.selectByPrimaryKey(id);
- }
- public void saveEifs(JSONObject json){
- String resultId = json.getStr("id");
- JSONArray array = json.getJSONArray("list");
- // for (SysIfpugEifs sysIfpugEifs : array.toList(SysIfpugEifs.class)) {
- for (JSONObject jsonObject : array.toArray(new JSONObject[]{})) {
- SysIfpugEifs sysIfpugEifs = jsonObject.toBean(SysIfpugEifs.class);
- sysIfpugEifs.setResultId(resultId);
- eifsService.insertSelective(sysIfpugEifs);
- }
- }
- public SysIfpugEifs getEifs(String id){
- return eifsService.selectByPrimaryKey(id);
- }
- public void saveEis(JSONObject json){
- String resultId = json.getStr("id");
- JSONArray array = json.getJSONArray("list");
- // for (SysIfpugEis sysIfpugEifs : array.toList(SysIfpugEis.class)) {
- for (JSONObject jsonObject : array.toArray(new JSONObject[]{})) {
- SysIfpugEis sysIfpugEifs = jsonObject.toBean(SysIfpugEis.class);
- sysIfpugEifs.setResultId(resultId);
- eisService.insertSelective(sysIfpugEifs);
- }
- }
- public SysIfpugEis getEis(String id){
- return eisService.selectByPrimaryKey(id);
- }
- public void saveEos(JSONObject json){
- String resultId = json.getStr("id");
- JSONArray array = json.getJSONArray("list");
- // for (SysIfpugEos sysIfpugEos : array.toList(SysIfpugEos.class)) {
- for (JSONObject jsonObject : array.toArray(new JSONObject[]{})) {
- SysIfpugEos sysIfpugEos = jsonObject.toBean(SysIfpugEos.class);
- sysIfpugEos.setResultId(resultId);
- eosService.insertSelective(sysIfpugEos);
- }
- }
- public SysIfpugEos getEos(String id){
- return eosService.selectByPrimaryKey(id);
- }
- public void saveEqs(JSONObject json){
- String resultId = json.getStr("id");
- JSONArray array = json.getJSONArray("list");
- // for (SysIfpugEqs sysIfpugEqs : array.toList(SysIfpugEqs.class)) {
- for (JSONObject jsonObject : array.toArray(new JSONObject[]{})) {
- SysIfpugEqs sysIfpugEqs = jsonObject.toBean(SysIfpugEqs.class);
- sysIfpugEqs.setResultId(resultId);
- eqsService.insertSelective(sysIfpugEqs);
- }
- }
- public SysIfpugEqs getEqs(String id){
- return eqsService.selectByPrimaryKey(id);
- }
- private List<List<Object>> readFile(MultipartFile file) throws IOException{
- ExcelReader reader = ExcelUtil.getReader(file.getInputStream());
- List<List<Object>> readAll = reader.read();
- return readAll;
- }
- // 读取ILFS文件
- public List<SysIfpugIlfs> readIlfsFile(MultipartFile file) throws IOException {
- List<List<Object>> readAll = readFile(file);
- List<SysIfpugIlfs> ifpugList = new ArrayList<>();
- for (int i = 0; i < readAll.size(); i++) {
- if(i < 4)
- continue;
- SysIfpugIlfs ilfs = new SysIfpugIlfs();
- ilfs.setFileName(readAll.get(i).get(1).toString());
- ilfs.setDet(readAll.get(i).get(2).toString());
- ilfs.setRet(readAll.get(i).get(3).toString());
- ilfs.setDi(readAll.get(i).get(4).toString());
- ilfs.setZhong(readAll.get(i).get(5).toString());
- ilfs.setGao(readAll.get(i).get(6).toString());
- ilfs.setRemark(readAll.get(i).get(7).toString());
- ifpugList.add(ilfs);
- }
- return ifpugList;
- }
- // 读取EIFS文件
- public List<SysIfpugEifs> readEifsFile(MultipartFile file) throws IOException {
- List<List<Object>> readAll = readFile(file);
- List<SysIfpugEifs> ifpugList = new ArrayList<>();
- for (int i = 0; i < readAll.size(); i++) {
- if(i < 4)
- continue;
- SysIfpugEifs eifs = new SysIfpugEifs();
- eifs.setFileName(readAll.get(i).get(1).toString());
- eifs.setDet(readAll.get(i).get(2).toString());
- eifs.setRet(readAll.get(i).get(3).toString());
- eifs.setDi(readAll.get(i).get(4).toString());
- eifs.setZhong(readAll.get(i).get(5).toString());
- eifs.setGao(readAll.get(i).get(6).toString());
- eifs.setRemark(readAll.get(i).get(7).toString());
- ifpugList.add(eifs);
- }
- return ifpugList;
- }
- // 读取EIS文件
- public List<SysIfpugEis> readEisFile(MultipartFile file) throws IOException {
- List<List<Object>> readAll = readFile(file);
- List<SysIfpugEis> ifpugList = new ArrayList<>();
- for (int i = 0; i < readAll.size(); i++) {
- if(i < 4)
- continue;
- SysIfpugEis eis = new SysIfpugEis();
- eis.setInputName(readAll.get(i).get(1).toString());
- eis.setDet(readAll.get(i).get(2).toString());
- eis.setFtr(readAll.get(i).get(3).toString());
- eis.setDi(readAll.get(i).get(4).toString());
- eis.setZhong(readAll.get(i).get(5).toString());
- eis.setGao(readAll.get(i).get(6).toString());
- eis.setRemark(readAll.get(i).get(7).toString());
- ifpugList.add(eis);
- }
- return ifpugList;
- }
- // 读取EOS文件
- public List<SysIfpugEos> readEosFile(MultipartFile file) throws IOException {
- List<List<Object>> readAll = readFile(file);
- List<SysIfpugEos> ifpugList = new ArrayList<>();
- for (int i = 0; i < readAll.size(); i++) {
- if(i < 4)
- continue;
- SysIfpugEos eos = new SysIfpugEos();
- eos.setOutputName(readAll.get(i).get(1).toString());
- eos.setDet(readAll.get(i).get(2).toString());
- eos.setFtr(readAll.get(i).get(3).toString());
- eos.setDi(readAll.get(i).get(4).toString());
- eos.setZhong(readAll.get(i).get(5).toString());
- eos.setGao(readAll.get(i).get(6).toString());
- eos.setRemark(readAll.get(i).get(7).toString());
- ifpugList.add(eos);
- }
- return ifpugList;
- }
- // 读取EQS文件
- public List<SysIfpugEqs> readEqsFile(MultipartFile file) throws IOException {
- List<List<Object>> readAll = readFile(file);
- List<SysIfpugEqs> ifpugList = new ArrayList<>();
- for (int i = 0; i < readAll.size(); i++) {
- if(i < 4)
- continue;
- SysIfpugEqs eqs = new SysIfpugEqs();
- eqs.setSeachName(readAll.get(i).get(1).toString());
- eqs.setInputDet(readAll.get(i).get(2).toString());
- eqs.setInputFtr(readAll.get(i).get(3).toString());
- eqs.setInputFzd(readAll.get(i).get(4).toString());
- eqs.setOutputDet(readAll.get(i).get(5).toString());
- eqs.setOutputFtr(readAll.get(i).get(6).toString());
- eqs.setOutputFzd(readAll.get(i).get(7).toString());
- eqs.setDi(readAll.get(i).get(8).toString());
- eqs.setZhong(readAll.get(i).get(9).toString());
- eqs.setGao(readAll.get(i).get(10).toString());
- eqs.setRemark(readAll.get(i).get(11).toString());
- ifpugList.add(eqs);
- }
- return ifpugList;
- }
- // 结果导出
- public void resultDownload(String resultId, OutputStream out) throws Exception {
- TestExcel excelUtils = new TestExcel();
- String template = V2Config.getProfile()+"Template/excelTemplate.xlsx";
- ExcelWriter excelWriter = excelUtils.getExcelWriter(out, template);
- {
- // 核算结果
- WriteSheet resultSheet = excelUtils.getWriteSheet(0, "核算结果");
- SysIfpugResult result = resultService.selectByPrimaryKey(resultId);
- Map<String, Object> resultMap = BeanUtil.beanToMap(result);
- excelWriter.fill(resultMap, resultSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(new ArrayList<Object>(), fillConfig, resultSheet);
- }
- {
- // TCF
- SysIfpugTcfExample tcfExample = new SysIfpugTcfExample();
- tcfExample.createCriteria().andResultIdEqualTo(resultId);
- List<SysIfpugTcf> tcfList = tcfService.selectByExample(tcfExample);
- SysIfpugTcf tcf = tcfList.size()>0?tcfList.get(0):new SysIfpugTcf();
- WriteSheet tcfSheet = excelUtils.getWriteSheet(1, "TCF");
- Map<String, Object> resultMap = BeanUtil.beanToMap(tcf);
- excelWriter.fill(resultMap, tcfSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(new ArrayList<>(), fillConfig, tcfSheet);
- }{
- // FPS - TODO 待完善
- // SysIfpugFpsExample fpsExample = new SysIfpugFpsExample();
- // fpsExample.createCriteria().andResultIdEqualTo(resultId);
- // List<SysIfpugFps> tcfList = fpsService.selectByExample(fpsExample);
- // SysIfpugFps fps = tcfList.size()>0?tcfList.get(0):new SysIfpugFps();
- // WriteSheet tcfSheet = excelUtils.getWriteSheet(2, "FPs");
- // Map<String, Object> resultMap = BeanUtil.beanToMap(fps);
- // excelWriter.fill(resultMap, tcfSheet);
- // FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- // excelWriter.fill(new ArrayList<>(), fillConfig, tcfSheet);
- }{
- // ILFS
- SysIfpugIlfsExample ilfsExample = new SysIfpugIlfsExample();
- ilfsExample.createCriteria().andResultIdEqualTo(resultId);
- List<SysIfpugIlfs> ilfsList = ilfsService.selectByExample(ilfsExample);
- Map<String, Object> ilfsMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- for (SysIfpugIlfs item : ilfsList) {
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- }
- ilfsMap.put("diCount", diCount);
- ilfsMap.put("zhongCount", zhongCount);
- ilfsMap.put("gaoCount", gaoCount);
- WriteSheet ilfsSheet = excelUtils.getWriteSheet(3, "ILFs");
- excelWriter.fill(ilfsMap, ilfsSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(ilfsList, fillConfig, ilfsSheet);
- }{
- // EIFS
- SysIfpugEifsExample eifsExample = new SysIfpugEifsExample();
- eifsExample.createCriteria().andResultIdEqualTo(resultId);
- List<SysIfpugEifs> eifsList = eifsService.selectByExample(eifsExample);
- Map<String, Object> eifsMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- for (SysIfpugEifs item : eifsList) {
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- }
- eifsMap.put("diCount", diCount);
- eifsMap.put("zhongCount", zhongCount);
- eifsMap.put("gaoCount", gaoCount);
- WriteSheet ilfsSheet = excelUtils.getWriteSheet(3, "EIFs");
- excelWriter.fill(eifsMap, ilfsSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(eifsList, fillConfig, ilfsSheet);
- }{
- // EIS
- SysIfpugEisExample eisExample = new SysIfpugEisExample();
- eisExample.createCriteria().andResultIdEqualTo(resultId);
- List<SysIfpugEis> eisList = eisService.selectByExample(eisExample);
- Map<String, Object> eisMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- for (SysIfpugEis item : eisList) {
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- }
- eisMap.put("diCount", diCount);
- eisMap.put("zhongCount", zhongCount);
- eisMap.put("gaoCount", gaoCount);
- WriteSheet eisSheet = excelUtils.getWriteSheet(4, "EIs");
- excelWriter.fill(eisMap, eisSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(eisList, fillConfig, eisSheet);
- }{
- // EOS
- SysIfpugEosExample eosExample = new SysIfpugEosExample();
- eosExample.createCriteria().andResultIdEqualTo(resultId);
- List<SysIfpugEos> eosList = eosService.selectByExample(eosExample);
- Map<String, Object> eosMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- for (SysIfpugEos item : eosList) {
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- }
- eosMap.put("diCount", diCount);
- eosMap.put("zhongCount", zhongCount);
- eosMap.put("gaoCount", gaoCount);
- WriteSheet eosSheet = excelUtils.getWriteSheet(5, "EOs");
- excelWriter.fill(eosMap, eosSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(eosList, fillConfig, eosSheet);
- }{
- // EQS
- SysIfpugEqsExample eqsExample = new SysIfpugEqsExample();
- eqsExample.createCriteria().andResultIdEqualTo(resultId);
- List<SysIfpugEqs> eqsList = eqsService.selectByExample(eqsExample);
- Map<String, Object> eqsMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- for (SysIfpugEqs item : eqsList) {
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- }
- eqsMap.put("diCount", diCount);
- eqsMap.put("zhongCount", zhongCount);
- eqsMap.put("gaoCount", gaoCount);
- WriteSheet eqsSheet = excelUtils.getWriteSheet(6, "EQs");
- excelWriter.fill(eqsMap, eqsSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(eqsList, fillConfig, eqsSheet);
- }
- excelUtils.clse(excelWriter);
- }
- // init - index
- public void initDataIndex(List<Object> dataList){
- int indez = 1;
- for (Object obj : dataList) {
- ReflectUtil.invoke(obj, "setIndex", String.valueOf(indez));
- indez++;
- }
- }
- // 页面结果导出
- public void resultViewDownload(ExcelResultModel resultModel, OutputStream out) throws Exception {
- TestExcel excelUtils = new TestExcel();
- String template = V2Config.getProfile()+"Template/excelTemplate.xlsx";
- ExcelWriter excelWriter = excelUtils.getExcelWriter(out, template);
- {
- // 核算结果
- WriteSheet resultSheet = excelUtils.getWriteSheet(0, "核算结果");
- SysIfpugResult result = resultModel.getResult();
- Map<String, Object> resultMap = BeanUtil.beanToMap(result);
- excelWriter.fill(resultMap, resultSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(new ArrayList<Object>(), fillConfig, resultSheet);
- }{
- // TCF
- SysIfpugTcf tcf = resultModel.getTcf();
- WriteSheet tcfSheet = excelUtils.getWriteSheet(1, "TCF");
- tcf = initSysIfpugTcf(tcf);
- Map<String, Object> resultMap = BeanUtil.beanToMap(tcf);
- excelWriter.fill(resultMap, tcfSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(new ArrayList<>(), fillConfig, tcfSheet);
- }{
- // FPS
- List<SysIfpugFps> fpsList = resultModel.getFpsList();
- int fpsCount = 0;
- for (SysIfpugFps sysIfpugFps : fpsList) {
- fpsCount += Integer.parseInt(sysIfpugFps.getFps());
- }
- Map<String, Object> fpsMap = new HashMap<>();
- fpsMap.put("fpsCount", fpsCount);
- fpsMap.put("fpCount", "100%");
- WriteSheet fpsSheet = excelUtils.getWriteSheet(2, "FPs");
- excelWriter.fill(fpsMap, fpsSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(fpsList, fillConfig, fpsSheet);
- }{
- // ILFS
- List<SysIfpugIlfs> ilfsList = resultModel.getIlfsList();
- Map<String, Object> ilfsMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- int index = 1;
- for (SysIfpugIlfs item : ilfsList) {
- item.setDi(!StringUtils.isNotEmpty(item.getDi())?"0":item.getDi());
- item.setZhong(!StringUtils.isNotEmpty(item.getZhong())?"0":item.getZhong());
- item.setGao(!StringUtils.isNotEmpty(item.getGao())?"0":item.getGao());
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- item.setIndex(String.valueOf(index));
- index++;
- }
- ilfsMap.put("diCount", diCount);
- ilfsMap.put("zhongCount", zhongCount);
- ilfsMap.put("gaoCount", gaoCount);
- WriteSheet ilfsSheet = excelUtils.getWriteSheet(3, "ILFs");
- excelWriter.fill(ilfsMap, ilfsSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(ilfsList, fillConfig, ilfsSheet);
- }{
- // EIFS
- List<SysIfpugEifs> eifsList = resultModel.getEifsList();
- Map<String, Object> eifsMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- int index = 1;
- for (SysIfpugEifs item : eifsList) {
- item.setDi(!StringUtils.isNotEmpty(item.getDi())?"0":item.getDi());
- item.setZhong(!StringUtils.isNotEmpty(item.getZhong())?"0":item.getZhong());
- item.setGao(!StringUtils.isNotEmpty(item.getGao())?"0":item.getGao());
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- item.setIndex(String.valueOf(index));
- index++;
- }
- eifsMap.put("diCount", diCount);
- eifsMap.put("zhongCount", zhongCount);
- eifsMap.put("gaoCount", gaoCount);
- WriteSheet ilfsSheet = excelUtils.getWriteSheet(4, "EIFs");
- excelWriter.fill(eifsMap, ilfsSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(eifsList, fillConfig, ilfsSheet);
- }{
- // EIS
- List<SysIfpugEis> eisList = resultModel.getEisList();
- Map<String, Object> eisMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- int index = 1;
- for (SysIfpugEis item : eisList) {
- item.setDi(!StringUtils.isNotEmpty(item.getDi())?"0":item.getDi());
- item.setZhong(!StringUtils.isNotEmpty(item.getZhong())?"0":item.getZhong());
- item.setGao(!StringUtils.isNotEmpty(item.getGao())?"0":item.getGao());
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- item.setIndex(String.valueOf(index));
- index++;
- }
- eisMap.put("diCount", diCount);
- eisMap.put("zhongCount", zhongCount);
- eisMap.put("gaoCount", gaoCount);
- WriteSheet eisSheet = excelUtils.getWriteSheet(5, "EIs");
- excelWriter.fill(eisMap, eisSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(eisList, fillConfig, eisSheet);
- }{
- // EOS
- List<SysIfpugEos> eosList = resultModel.getEosList();
- Map<String, Object> eosMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- int index = 1;
- for (SysIfpugEos item : eosList) {
- item.setDi(!StringUtils.isNotEmpty(item.getDi())?"0":item.getDi());
- item.setZhong(!StringUtils.isNotEmpty(item.getZhong())?"0":item.getZhong());
- item.setGao(!StringUtils.isNotEmpty(item.getGao())?"0":item.getGao());
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- item.setIndex(String.valueOf(index));
- index++;
- }
- eosMap.put("diCount", diCount);
- eosMap.put("zhongCount", zhongCount);
- eosMap.put("gaoCount", gaoCount);
- WriteSheet eosSheet = excelUtils.getWriteSheet(6, "EOs");
- excelWriter.fill(eosMap, eosSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(eosList, fillConfig, eosSheet);
- }{
- // EQS
- List<SysIfpugEqs> eqsList = resultModel.getEqsList();
- Map<String, Object> eqsMap = new HashMap<>();
- int diCount = 0;
- int zhongCount = 0;
- int gaoCount = 0;
- int index = 1;
- for (SysIfpugEqs item : eqsList) {
- item.setDi(!StringUtils.isNotEmpty(item.getDi())?"0":item.getDi());
- item.setZhong(!StringUtils.isNotEmpty(item.getZhong())?"0":item.getZhong());
- item.setGao(!StringUtils.isNotEmpty(item.getGao())?"0":item.getGao());
- diCount += Integer.parseInt(item.getDi());
- zhongCount += Integer.parseInt(item.getZhong());
- gaoCount += Integer.parseInt(item.getGao());
- item.setIndex(String.valueOf(index));
- index++;
- }
- eqsMap.put("diCount", diCount);
- eqsMap.put("zhongCount", zhongCount);
- eqsMap.put("gaoCount", gaoCount);
- WriteSheet eqsSheet = excelUtils.getWriteSheet(7, "EQs");
- excelWriter.fill(eqsMap, eqsSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(eqsList, fillConfig, eqsSheet);
- }{
- // 功能点规模计算明细
- List<IfpugPointScaleDetailsExcel> detailList = getPointScaleDetail(resultModel.getIlfsList(), resultModel.getEifsList(),
- resultModel.getEisList(), resultModel.getEosList(), resultModel.getEqsList());
- WriteSheet pointScaleSheet = excelUtils.getWriteSheet(8, "功能点规模计算明细");
- // 统计数据
- int ilfDetCount = 0, ilfRetCount = 0,
- eifDetCount = 0, eifRetCount = 0,
- eiDetCount = 0, eiFtrCount = 0,
- eoDetCount = 0, eoFtrCount = 0,
- eqImputDetCount = 0, eqImputFtrCount = 0, eqoutputDetCount = 0, eqoutputFtrCount = 0;
- for (IfpugPointScaleDetailsExcel detailsExcel : detailList) {
- ilfDetCount += StringUtils.isNotEmpty(detailsExcel.getIlfDet())?Integer.parseInt(detailsExcel.getIlfDet()):0;
- ilfRetCount += StringUtils.isNotEmpty(detailsExcel.getIlfRet())?Integer.parseInt(detailsExcel.getIlfRet()):0;
- eifDetCount += StringUtils.isNotEmpty(detailsExcel.getEifDet())?Integer.parseInt(detailsExcel.getEifDet()):0;
- eifRetCount += StringUtils.isNotEmpty(detailsExcel.getEifRet())?Integer.parseInt(detailsExcel.getEifRet()):0;
- eiDetCount += StringUtils.isNotEmpty(detailsExcel.getEiDet())?Integer.parseInt(detailsExcel.getEiDet()):0;
- eiFtrCount += StringUtils.isNotEmpty(detailsExcel.getEiFtr())?Integer.parseInt(detailsExcel.getEiFtr()):0;
- eoDetCount += StringUtils.isNotEmpty(detailsExcel.getEoDet())?Integer.parseInt(detailsExcel.getEoDet()):0;
- eoFtrCount += StringUtils.isNotEmpty(detailsExcel.getEoFtr())?Integer.parseInt(detailsExcel.getEoFtr()):0;
- eqImputDetCount += StringUtils.isNotEmpty(detailsExcel.getEqImputDet())?Integer.parseInt(detailsExcel.getEqImputDet()):0;
- eqImputFtrCount += StringUtils.isNotEmpty(detailsExcel.getEqImputFtr())?Integer.parseInt(detailsExcel.getEqImputFtr()):0;
- eqoutputDetCount += StringUtils.isNotEmpty(detailsExcel.getEqoutputDet())?Integer.parseInt(detailsExcel.getEqoutputDet()):0;
- eqoutputFtrCount += StringUtils.isNotEmpty(detailsExcel.getEqoutputFtr())?Integer.parseInt(detailsExcel.getEqoutputFtr()):0;
- }
- Map<String, Object> pointScaleMap = new HashMap<>();
- pointScaleMap.put("ilfDetCount", ilfDetCount);
- pointScaleMap.put("ilfRetCount", ilfRetCount);
- pointScaleMap.put("eifDetCount", eifDetCount);
- pointScaleMap.put("eifRetCount", eifRetCount);
- pointScaleMap.put("eiDetCount", eiDetCount);
- pointScaleMap.put("eiFtrCount", eiFtrCount);
- pointScaleMap.put("eoDetCount", eoDetCount);
- pointScaleMap.put("eoFtrCount", eoFtrCount);
- pointScaleMap.put("eqImputDetCount", eqImputDetCount);
- pointScaleMap.put("eqImputFtrCount", eqImputFtrCount);
- pointScaleMap.put("eqoutputDetCount", eqoutputDetCount);
- pointScaleMap.put("eqoutputFtrCount", eqoutputFtrCount);
- excelWriter.fill(pointScaleMap, pointScaleSheet);
- FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
- excelWriter.fill(detailList, fillConfig, pointScaleSheet);
- }
- excelUtils.clse(excelWriter);
- }
- public String notEmptyToString(String reslt){
- return StringUtils.isNotEmpty(reslt)?reslt:"0";
- }
- public SysIfpugTcf initSysIfpugTcf(SysIfpugTcf tcf){
- tcf.setDataComm(notEmptyToString(tcf.getDataComm()));
- tcf.setDataHandle(notEmptyToString(tcf.getDataHandle()));
- tcf.setBehavior(notEmptyToString(tcf.getBehavior()));
- tcf.setLoads(notEmptyToString(tcf.getLoads()));
- tcf.setThings(notEmptyToString(tcf.getThings()));
- tcf.setDataInput(notEmptyToString(tcf.getDataInput()));
- tcf.setUserRatio(notEmptyToString(tcf.getUserRatio()));
- tcf.setLineUpdate(notEmptyToString(tcf.getLineUpdate()));
- tcf.setComplex(notEmptyToString(tcf.getComplex()));
- tcf.setMultiplex(notEmptyToString(tcf.getMultiplex()));
- tcf.setInstalls(notEmptyToString(tcf.getInstalls()));
- tcf.setOperate(notEmptyToString(tcf.getOperate()));
- tcf.setPlatform(notEmptyToString(tcf.getPlatform()));
- tcf.setExtends(notEmptyToString(tcf.getExtend()));
- return tcf;
- }
- // 结果导入
- public Map<String, Object> resultImport(InputStream inputStream) throws Exception {
- ExcelReader reader = ExcelUtil.getReader(inputStream);
- List<List<Object>> readAll = reader.read(4);
- // 载体
- List<SysIfpugIlfs> ilfsList = new ArrayList<>();
- List<SysIfpugEifs> eifsList = new ArrayList<>();
- List<SysIfpugEis> eisList = new ArrayList<>();
- List<SysIfpugEos> eosList = new ArrayList<>();
- List<SysIfpugEqs> eqsList = new ArrayList<>();
- for (List<Object> objects : readAll) {
- resultDataInit(objects, ilfsList, eifsList, eisList, eosList, eqsList);
- }
- Map<String, Object> resultMap = new HashMap<>();
- resultMap.put("ilfs", ilfsList);
- resultMap.put("eifs", eifsList);
- resultMap.put("eis", eisList);
- resultMap.put("eos", eosList);
- resultMap.put("eqs", eqsList);
- IfpugDataUtils utils = new IfpugDataUtils();
- List<SysIfpugFps> fpsList = utils.initFps(ilfsList, eifsList, eisList, eosList, eqsList);
- resultMap.put("fps", fpsList);
- SysIfpugResult result = utils.initResult(fpsList);
- resultMap.put("result", result);
- return resultMap;
- }
- // 结果判空
- private boolean judgData(String... data) {
- boolean falg = false;
- for (String datum : data) {
- if(falg)
- continue;
- if(StringUtils.isNotEmpty(datum) && Integer.parseInt(datum) > 0)
- falg = true;
- }
- return falg;
- }
- // 结果装载
- private void resultDataInit(List<Object> list, List<SysIfpugIlfs> ilfsList, List<SysIfpugEifs> eifsList,
- List<SysIfpugEis> eisList, List<SysIfpugEos> eosList, List<SysIfpugEqs> eqsList) {
- // 功能点 TODO 未处理===
- String gnName = list.get(4).toString();
- // ILF
- String ilfDet = list.get(9).toString();
- String ilfRet = list.get(10).toString();
- // EIF
- String eifDet = list.get(11).toString();
- String eifRet = list.get(12).toString();
- // EI
- String eiDet = list.get(13).toString();
- String eiFtr = list.get(14).toString();
- // EO
- String eoDet = list.get(15).toString();
- String eoFtr = list.get(16).toString();
- // EQ
- String eqImDet = list.get(17).toString();
- String eqImFtr = list.get(18).toString();
- String eqOutDet = list.get(19).toString();
- String eqOutFtr = list.get(20).toString();
- // 备注
- String remark = list.get(21).toString();
- // ILF
- if(judgData(ilfDet, ilfRet)){
- SysIfpugIlfs ilfs = new SysIfpugIlfs();
- ilfs.setFileName(gnName);
- ilfs.setDet(ilfDet);
- ilfs.setRet(ilfRet);
- ilfs.setRemark(remark);
- // 计算复杂度
- IfpugDataUtils.ilfsFzd(ilfs);
- ilfsList.add(ilfs);
- }
- // EIF
- if(judgData(eifDet, eifRet)){
- SysIfpugEifs eifs = new SysIfpugEifs();
- eifs.setFileName(gnName);
- eifs.setDet(eifDet);
- eifs.setRet(eifRet);
- eifs.setRemark(remark);
- // 计算复杂度
- IfpugDataUtils.eifsFzd(eifs);
- eifsList.add(eifs);
- }
- // EI
- if(judgData(eiDet, eiFtr)){
- SysIfpugEis eis = new SysIfpugEis();
- eis.setInputName(gnName);
- eis.setDet(eiDet);
- eis.setFtr(eiFtr);
- eis.setRemark(remark);
- // 计算复杂度
- IfpugDataUtils.eisFzd(eis);
- eisList.add(eis);
- }
- // EO
- if(judgData(eoDet, eoFtr)){
- SysIfpugEos eos = new SysIfpugEos();
- eos.setOutputName(gnName);
- eos.setDet(eoDet);
- eos.setFtr(eoFtr);
- eos.setRemark(remark);
- // 计算复杂度
- IfpugDataUtils.eosFzd(eos);
- eosList.add(eos);
- }
- // EQ
- if(judgData(eqImDet, eqImFtr, eqOutDet, eqOutFtr)){
- SysIfpugEqs eqs = new SysIfpugEqs();
- eqs.setSeachName(gnName);
- eqs.setInputDet(eqImDet);
- eqs.setInputFtr(eqImFtr);
- eqs.setOutputDet(eqOutDet);
- eqs.setOutputFtr(eqOutFtr);
- eqs.setRemark(remark);
- // 计算复杂度
- IfpugDataUtils.eqsFzd(eqs);
- eqsList.add(eqs);
- }
- }
- // 获取EQ复杂度
- public String getEQCommplex(String inPfz, String ouFzd){
- if("低".equals(inPfz) && "低".equals(ouFzd)){
- return "低";
- }else if("高".equals(inPfz) && "高".equals(ouFzd)){
- return "高";
- }else{
- return "中";
- }
- }
- // 获取功能复杂度
- public String getCommplex(String di, String zhong, String gao){
- if(StringUtils.isNotEmpty(di) || StringUtils.isNotEmpty(zhong) || StringUtils.isNotEmpty(gao)){
- int diNum = StringUtils.isNotEmpty(di)?Integer.parseInt(di):0;
- int zhongNum = StringUtils.isNotEmpty(zhong)?Integer.parseInt(zhong):0;
- int gaoNum = StringUtils.isNotEmpty(gao)?Integer.parseInt(gao):0;
- if(diNum > 0 && zhongNum <= 0 && gaoNum <= 0){
- return "低";
- }else if(diNum <= 0 && zhongNum <= 0 && gaoNum > 0){
- return "高";
- }else{
- return "中";
- }
- }
- return "";
- }
- // 获取功能点数
- public String getCommplexNum(String di, String zhong, String gao){
- if(StringUtils.isNotEmpty(di) || StringUtils.isNotEmpty(zhong) || StringUtils.isNotEmpty(gao)){
- int diNum = StringUtils.isNotEmpty(di)?Integer.parseInt(di):0;
- int zhongNum = StringUtils.isNotEmpty(zhong)?Integer.parseInt(zhong):0;
- int gaoNum = StringUtils.isNotEmpty(gao)?Integer.parseInt(gao):0;
- if(diNum > 0 && zhongNum <= 0 && gaoNum <= 0){
- return String.valueOf(diNum);
- }else if(diNum <= 0 && zhongNum <= 0 && gaoNum > 0){
- return String.valueOf(gaoNum);
- }else{
- return String.valueOf(zhongNum);
- }
- }
- return "0";
- }
- // 计算权重
- public String getWeights(String type, String fzd){
- if("ILF".equals(type)){
- if("低".equals(fzd)){
- return "7";
- }else if("中".equals(fzd)){
- return "10";
- }else if("高".equals(fzd)){
- return "15";
- }
- }else if("EIF".equals(type)){
- if("低".equals(fzd)){
- return "5";
- }else if("中".equals(fzd)){
- return "7";
- }else if("高".equals(fzd)){
- return "10";
- }
- }else if("EI".equals(type)){
- if("低".equals(fzd)){
- return "3";
- }else if("中".equals(fzd)){
- return "4";
- }else if("高".equals(fzd)){
- return "6";
- }
- }else if("EO".equals(type)){
- if("低".equals(fzd)){
- return "4";
- }else if("中".equals(fzd)){
- return "5";
- }else if("高".equals(fzd)){
- return "7";
- }
- }else if("EQ".equals(type)){
- if("低".equals(fzd)){
- return "3";
- }else if("中".equals(fzd)){
- return "4";
- }else if("高".equals(fzd)){
- return "6";
- }
- }
- return "0";
- }
- // 生成功能点规模计算明细
- private List<IfpugPointScaleDetailsExcel> getPointScaleDetail(List<SysIfpugIlfs> ilfsList, List<SysIfpugEifs> eifsList,
- List<SysIfpugEis> eisList, List<SysIfpugEos> eosList, List<SysIfpugEqs> eqsList) {
- int indexNo = 0;
- List<IfpugPointScaleDetailsExcel> result = new ArrayList<>();
- for (SysIfpugIlfs item : ilfsList) {
- indexNo++;
- IfpugPointScaleDetailsExcel detailsExcel = new IfpugPointScaleDetailsExcel();
- detailsExcel.setIndexNo(String.valueOf(indexNo));
- detailsExcel.setFourthLayer(item.getFileName());
- detailsExcel.setFtype("ILF");
- String commplex = getCommplex(item.getDi(),item.getZhong(),item.getGao());
- detailsExcel.setCommplex(commplex);
- detailsExcel.setWeights(getWeights("ILF", commplex));
- detailsExcel.setNum(getCommplexNum(item.getDi(),item.getZhong(),item.getGao()));
- detailsExcel.setIlfDet(item.getDet());
- detailsExcel.setIlfRet(item.getRet());
- detailsExcel.setRemark(item.getRemark());
- result.add(detailsExcel);
- }
- for (SysIfpugEifs item : eifsList) {
- indexNo++;
- IfpugPointScaleDetailsExcel detailsExcel = new IfpugPointScaleDetailsExcel();
- detailsExcel.setIndexNo(String.valueOf(indexNo));
- detailsExcel.setFourthLayer(item.getFileName());
- detailsExcel.setFtype("EIF");
- String commplex = getCommplex(item.getDi(),item.getZhong(),item.getGao());
- detailsExcel.setCommplex(commplex);
- detailsExcel.setWeights(getWeights("EIF", commplex));
- detailsExcel.setNum(getCommplexNum(item.getDi(),item.getZhong(),item.getGao()));
- detailsExcel.setEifDet(item.getDet());
- detailsExcel.setEifRet(item.getRet());
- detailsExcel.setRemark(item.getRemark());
- result.add(detailsExcel);
- }
- for (SysIfpugEis item : eisList) {
- indexNo++;
- IfpugPointScaleDetailsExcel detailsExcel = new IfpugPointScaleDetailsExcel();
- detailsExcel.setIndexNo(String.valueOf(indexNo));
- detailsExcel.setFourthLayer(item.getInputName());
- detailsExcel.setFtype("EI");
- String commplex = getCommplex(item.getDi(),item.getZhong(),item.getGao());
- detailsExcel.setCommplex(commplex);
- detailsExcel.setWeights(getWeights("EI", commplex));
- detailsExcel.setNum(getCommplexNum(item.getDi(),item.getZhong(),item.getGao()));
- detailsExcel.setEiDet(item.getDet());
- detailsExcel.setEiFtr(item.getFtr());
- detailsExcel.setRemark(item.getRemark());
- result.add(detailsExcel);
- }
- for (SysIfpugEos item : eosList) {
- indexNo++;
- IfpugPointScaleDetailsExcel detailsExcel = new IfpugPointScaleDetailsExcel();
- detailsExcel.setIndexNo(String.valueOf(indexNo));
- detailsExcel.setFourthLayer(item.getOutputName());
- detailsExcel.setFtype("EO");
- String commplex = getCommplex(item.getDi(),item.getZhong(),item.getGao());
- detailsExcel.setCommplex(commplex);
- detailsExcel.setWeights(getWeights("EO", commplex));
- detailsExcel.setNum(getCommplexNum(item.getDi(),item.getZhong(),item.getGao()));
- detailsExcel.setEoDet(item.getDet());
- detailsExcel.setEoFtr(item.getFtr());
- detailsExcel.setRemark(item.getRemark());
- result.add(detailsExcel);
- }
- for (SysIfpugEqs item : eqsList) {
- indexNo++;
- IfpugPointScaleDetailsExcel detailsExcel = new IfpugPointScaleDetailsExcel();
- detailsExcel.setIndexNo(String.valueOf(indexNo));
- detailsExcel.setFourthLayer(item.getSeachName());
- detailsExcel.setFtype("EQ");
- String commplex = getEQCommplex(item.getInputFzd(), item.getOutputFtr());
- detailsExcel.setCommplex(commplex);
- detailsExcel.setWeights(getWeights("EQ", commplex));
- detailsExcel.setNum(getCommplexNum(item.getDi(),item.getZhong(),item.getGao()));
- detailsExcel.setEqImputDet(item.getInputDet());
- detailsExcel.setEqImputFtr(item.getInputDet());
- detailsExcel.setEqoutputDet(item.getOutputDet());
- detailsExcel.setEqoutputFtr(item.getOutputFtr());
- detailsExcel.setRemark(item.getRemark());
- result.add(detailsExcel);
- }
- return result;
- }
- public static void main(String[] args) {
- System.err.println(SecureUtil.md5("IndustrySupervisionSuperviseDistribute"));
- }
- }
|