123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651 |
- package com.cxfws.xmxxgl.service.impl;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Calendar;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import javax.annotation.Resource;
- import javax.jws.WebService;
- import javax.persistence.criteria.CriteriaBuilder;
- import javax.persistence.criteria.CriteriaBuilder.In;
- import javax.persistence.criteria.CriteriaQuery;
- import javax.persistence.criteria.Predicate;
- import javax.persistence.criteria.Root;
- import javax.persistence.criteria.Subquery;
- import javax.xml.ws.WebServiceContext;
- import org.springframework.beans.BeanUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.data.domain.Page;
- import org.springframework.data.jpa.domain.Specification;
- import org.springframework.stereotype.Service;
- import com.cxfws.xmxxgl.service.IJsjdglWebService;
- import com.xt.jygl.accessory.entity.AccessoryEntity;
- import com.xt.jygl.accessory.service.AccessoryService;
- import com.xt.jygl.common.BaseWebCtl;
- import com.xt.jygl.common.Constants;
- import com.xt.jygl.gkjcxx.gq.service.GqService;
- import com.xt.jygl.gkjsgl.jsjdgl.entity.JsjdfjEntity;
- import com.xt.jygl.gkjsgl.jsjdgl.entity.XmxxglfbEntity;
- import com.xt.jygl.gkjsgl.jsjdgl.entity.XmyjhxxEntity;
- import com.xt.jygl.gkjsgl.jsjdgl.service.JsjdfjService;
- import com.xt.jygl.gkjsgl.jsjdgl.service.XmxxglfbService;
- import com.xt.jygl.gkjsgl.jsjdgl.service.XmyjhxxService;
- import com.xt.jygl.gkjsgl.jsjdgl.vo.JsjdfjVo;
- import com.xt.jygl.gkjsgl.jsjdgl.vo.XmxxglfbVo;
- import com.xt.jygl.gkjsgl.tzjhgl.entity.TzjhglEntity;
- import com.xt.jygl.gkjsgl.tzjhgl.service.TzjhglService;
- import com.xt.jygl.gkjsgl.tzjhgl.vo.TzjhglVo;
- import com.xt.jygl.gkjsgl.xmxxgl.entity.XmbwglbEntity;
- import com.xt.jygl.gkjsgl.xmxxgl.entity.XmxxglEntity;
- import com.xt.jygl.gkjsgl.xmxxgl.service.XmbwglbService;
- import com.xt.jygl.gkjsgl.xmxxgl.service.XmxxglService;
- import com.xt.jygl.gkjsgl.xmxxgl.service.XmxxgljggzService;
- import com.xt.jygl.gkjsgl.xmxxgl.vo.XmxxglVo;
- import com.xt.jygl.gkjygl.gkjyr.jyrbw.service.BwService;
- import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.BwEntity;
- import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.vo.BwVo;
- import com.xt.jygl.workflow.entity.TaskInfoEntity;
- import com.xt.jygl.workflow.service.TaskInfoService;
- import com.xtframe.sec.code.entity.CodeEntity;
- import com.xtframe.sec.common.BaseEntity;
- import com.xtframe.sec.common.SimplePageRequest;
- import com.xtframe.sec.utils.SecUtils;
- import com.xtframe.util.StringUtils;
- /**
- * 建设进度管理
- *
- * @author b_zhangdong
- *
- */
- @Service("jsjdglWebService")
- @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "jsjdglWebServicePort", serviceName = "jsjdglWebService")
- public class JsjdglWebService extends BaseWebCtl implements IJsjdglWebService {
- @Autowired
- protected TaskInfoService taskInfoService;
- @Autowired
- private XmxxglService xmxxglService;
- @Autowired
- private XmxxgljggzService xmxxgljggzService;
- @Autowired
- private AccessoryService accessoryService;
- @Autowired
- private XmbwglbService xmbwglbService;
- @Autowired
- private JsjdfjService jsjdfjService;
- @Autowired
- private BwService bwService;
-
- @Autowired
- private TzjhglService tzjhglService;
-
- @Autowired
- private XmyjhxxService xmyjhxxService;
-
- @Autowired
- private XmxxglfbService xmxxglfbService;
-
- @Resource
- private WebServiceContext wscontext;
- @Autowired
- private GqService gqService;
- /**
- * 获取进度列表
- */
- @Override
- public String findJsjdgl(int pages,int rows,final String xmmc, final String szdid, final String szgkid, final String szgqid, final String dqzt, final String xmfr, final String lcjd) {
- if (!this.checkUser()){
- return BaseWebCtl.NOLOGIN;
- }
-
- SimplePageRequest page = new SimplePageRequest(pages, rows);
-
- Specification<XmxxglEntity> spec = new Specification<XmxxglEntity>() {
- // 查询条件
- @Override
- public Predicate toPredicate(Root<XmxxglEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> list = new ArrayList<Predicate>();
- if (StringUtils.isNotEmpty(xmmc)) {
- list.add(cb.like(root.get("xmmc").as(String.class), "%" + xmmc + "%"));
- }
- if (StringUtils.isNotEmpty(xmfr)) {
- list.add(cb.like(root.get("xmfr").as(String.class), "%" + xmfr + "%"));
- }
- if (StringUtils.isNotEmpty(szdid)) {
- list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + szdid + "%"));
- }
- if (StringUtils.isNotEmpty(szgkid)) {
- list.add(cb.like(root.get("szgk").get("id").as(String.class), "%" + szgkid + "%"));
- }
- if (StringUtils.isNotEmpty(szgqid)) {
- list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" + szgqid + "%"));
- }
- Subquery<TaskInfoEntity> subquery = query.subquery(TaskInfoEntity.class);
- Root<TaskInfoEntity> dpRoot = subquery.from(TaskInfoEntity.class);
- subquery.select(dpRoot);
- List<Predicate> subQueryPredicates = new ArrayList<Predicate>();
- if (StringUtils.isNotEmpty(lcjd)) {
- if (lcjd.equals("已完成")) {
- list.add(cb.like(root.get("recordStatus").as(String.class), "%" + BaseEntity.RECORD_STATE_COMPLETED + "%"));
- } else {
- subQueryPredicates.add(cb.equal(root.get("id").as(String.class), dpRoot.get("busId").as(String.class)));
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + lcjd + "%"));
- subQueryPredicates.add(cb.equal(dpRoot.get("state").as(String.class), "3"));
- subquery.where(subQueryPredicates.toArray(new Predicate[] {}));
- list.add(cb.exists(subquery));
- }
- }
- if (StringUtils.isNotEmpty(dqzt)) {
- if (dqzt.equals("已完成")) {
- list.add(cb.like(root.get("recordStatus").as(String.class), "%" + BaseEntity.RECORD_STATE_COMPLETED + "%"));
- } else {
- subQueryPredicates.add(cb.equal(root.get("id").as(String.class), dpRoot.get("busId").as(String.class)));
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + dqzt + "%"));
- if ("岸线利用审批".equals(dqzt)) {
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + "岸线利用审批支撑文件审查" + "%"));
- }
- if ("项目审批、核准、备案".equals(dqzt)) {
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + "项目审批、核准、备案支撑文件审查" + "%"));
- }
- if ("初步设计审批".equals(dqzt)) {
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + "初步设计审批支撑文件审查" + "%"));
- }
- if ("施工图设计审批".equals(dqzt)) {
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + "施工图设计审批支撑文件审查" + "%"));
- }
- if ("开工备案".equals(dqzt)) {
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + "开工备案支撑文件审查" + "%"));
- }
- if ("交工验收".equals(dqzt)) {
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + "交工验收" + "%"));
- }
- if ("试运行备案".equals(dqzt)) {
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + "试运行备案" + "%"));
- }
- if ("竣工验收".equals(dqzt)) {
- subQueryPredicates.add(cb.like(dpRoot.get("currName").as(String.class), "%" + "竣工验收" + "%"));
- }
- subquery.where(subQueryPredicates.toArray(new Predicate[] {}));
- list.add(cb.exists(subquery));
- }
- }
- // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在港区的数据
- if (isJyr()) {
- list.add(cb.like(root.get("jyrid").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
- } else {
- In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
- // @SuppressWarnings("unchecked")
- // List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
- List<String> gqlist = gqService.findGqListByUserId(SecUtils.getCurrUser().getId());
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- in.value(gqlist.get(i));
- }
- list.add(in);
- }
- }
- // 只显示状态为8或者3的
- list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
- list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_VALID));
- return cb.and(list.toArray(new Predicate[] {}));
- }
- };
-
- if (page.getPage() < 1) {
- page.setPage(1);
- }
- page.setSort("id");
- page.setOrder("desc");
- Page<XmxxglEntity> list = query.findAll(spec, toPageRequest(page), XmxxglEntity.class);
- //List<XmxxglEntity> list = query.findAll(spec, XmxxglEntity.class);
- List<XmxxglVo> voList = new ArrayList<XmxxglVo>();
- for (XmxxglEntity entity : list) {
- XmxxglVo vo = new XmxxglVo();
- if (null != entity) {
- BeanUtils.copyProperties(entity, vo);
- vo.setTzlxzw(entity.getTzlx() != null ? entity.getTzlx().getText() : "");
- vo.setXmlxzw(entity.getXmlx() != null ? entity.getXmlx().getText() : "");
- vo.setXmhzjbzw(entity.getXmhzjb() != null ? entity.getXmhzjb().getText() : "");
- vo.setAxspjbzw(entity.getAxspjb() != null ? entity.getAxspjb().getText() : "");
- vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
- vo.setSzgqzw(entity.getSzgq() != null ? entity.getSzgq().getGqmc() : "");
- vo.setJyrzw(entity.getJyrid() != null ? entity.getJyrid().getGkjyr() : "");
- vo.setJyrid(entity.getJyrid() != null ? entity.getJyrid().getId() : "");
- vo.setTzlx(entity.getTzlx() != null ? entity.getTzlx().getId() : "");
- vo.setXmlx(entity.getXmlx() != null ? entity.getXmlx().getId() : "");
- vo.setXmhzjb(entity.getXmhzjb() != null ? entity.getXmhzjb().getId() : "");
- vo.setAxspjb(entity.getAxspjb() != null ? entity.getAxspjb().getId() : "");
- vo.setSzgk(entity.getSzgk() != null ? entity.getSzgk().getId() : "");
- vo.setSzgq(entity.getSzgq() != null ? entity.getSzgq().getId() : "");
- if (entity.getXmlx().getId().equals("2202")) {
- List<TaskInfoEntity> listtask = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(), XmxxglEntity.PROCESS_DEFINITION_KEY2);
- if (listtask.size() != 0) {
- vo.setDqzt(listtask.get(0).getCurrName());
- vo.setTaskkey(listtask.get(0).getTaskKey());
- } else {
- if (entity.getRecordStatus() == BaseEntity.RECORD_STATE_COMPLETED) {
- vo.setDqzt("已完成");
- }
- if (entity.getRecordStatus() == BaseEntity.RECORD_STATE_VALID || entity.getRecordStatus() == 8) {
- vo.setDqzt("未提交");
- }
- }
- } else {
- List<TaskInfoEntity> listtask = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(), XmxxglEntity.PROCESS_DEFINITION_KEY);
- if (listtask.size() != 0) {
- vo.setDqzt(listtask.get(0).getCurrName());
- vo.setTaskkey(listtask.get(0).getTaskKey());
- } else {
- if (entity.getRecordStatus() == BaseEntity.RECORD_STATE_COMPLETED) {
- vo.setDqzt("已完成");
- }
- if (entity.getRecordStatus() == BaseEntity.RECORD_STATE_VALID || entity.getRecordStatus() == 8) {
- vo.setDqzt("未提交");
- }
- }
- }
- if (!isJyr()) {
- if ((xmxxglService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xmxxgljggzService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null || xmxxglService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null || xmxxgljggzService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
- vo.setTaskState(Constants.IS_MY_TASK);
- }
- } else {
- if ((xmxxglService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getSsjyr().getId().toString(), entity.getId().toString()) != null) || xmxxgljggzService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null || xmxxglService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null || xmxxgljggzService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getSsjyr().getId().toString(), entity.getId().toString()) != null) {
- vo.setTaskState(Constants.IS_MY_TASK);
- }
- }
- voList.add(vo);
- }
- }
-
- return Object2JsonStr(voList);
- }
- /**
- * 获取进度详情
- */
- @Override
- public String findOne(String id) {
- if (!this.checkUser()){
- return BaseWebCtl.NOLOGIN;
- }
- Map<String, Object> map = new HashMap<String, Object>();
- // 附件
- List<AccessoryEntity> accessoryList = accessoryService.queryBySsidAndSstype(id, "jsjd");
- List<JsjdfjVo> jsjdfjVoList = new ArrayList<>();
- for (int i = 0; i < accessoryList.size(); i++) {
- if (StringUtils.isNotEmpty(accessoryList.get(i).getRemark())) {
- AccessoryEntity acc = accessoryList.get(i);
- JsjdfjVo fjnamevo = new JsjdfjVo();
- fjnamevo.setXhbz(acc.getRemark().substring(2, accessoryList.get(i).getRemark().length()));
- fjnamevo.setFjid(acc.getId());
- fjnamevo.setFjmc(acc.getName());
- jsjdfjVoList.add(fjnamevo);
- }
- }
- // 项目基本信息
- XmxxglEntity entity = xmxxglService.findOne(id);
- XmxxglVo vo = new XmxxglVo();
- BeanUtils.copyProperties(entity, vo);
- vo.setTzlxzw(entity.getTzlx() != null ? entity.getTzlx().getText() : "");
- vo.setXmlxzw(entity.getXmlx() != null ? entity.getXmlx().getText() : "");
- vo.setXmhzjbzw(entity.getXmhzjb() != null ? entity.getXmhzjb().getText() : "");
- vo.setAxspjbzw(entity.getAxspjb() != null ? entity.getAxspjb().getText() : "");
- if (entity.getJyrid() != null) {
- vo.setSzddzw(entity.getJyrid().getSzd() != null ? entity.getJyrid().getSzd().getText() : "");
- vo.setSzd(entity.getJyrid().getSzd() != null ? entity.getJyrid().getSzd().getId() : "");
- }
- vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
- vo.setSzgqzw(entity.getSzgq() != null ? entity.getSzgq().getGqmc() : "");
- vo.setJyrzw(entity.getJyrid() != null ? entity.getJyrid().getGkjyr() : "");
- vo.setZyhbwflzw(entity.getZyhbwfl() != null ? entity.getZyhbwfl().getText() : "");
- vo.setTzlx(entity.getTzlx() != null ? entity.getTzlx().getId() : "");
- vo.setXmlx(entity.getXmlx() != null ? entity.getXmlx().getId() : "");
- vo.setXmhzjb(entity.getXmhzjb() != null ? entity.getXmhzjb().getId() : "");
- vo.setAxspjb(entity.getAxspjb() != null ? entity.getAxspjb().getId() : "");
- vo.setSzgk(entity.getSzgk() != null ? entity.getSzgk().getId() : "");
- vo.setSzgq(entity.getSzgq() != null ? entity.getSzgq().getId() : "");
- vo.setJyrid(entity.getJyrid() != null ? entity.getJyrid().getId() : "");
- vo.setSylxzw(entity.getSylx() != null ? entity.getSylx().getText() : "");
- if (entity.getBwyt() != null) {
- String bwytzw = "";
- String[] s = entity.getBwyt().split(",");
- for (int i = 0; i < s.length; i++) {
- if (i != s.length - 1) {
- bwytzw += securityMgr.codeService().findOne(s[i]).getText() + ",";
- } else {
- bwytzw += securityMgr.codeService().findOne(s[i]).getText();
- }
- }
- vo.setBwytzw(bwytzw);
- }
- String bwids = "";
- List<XmbwglbEntity> bwlist = xmbwglbService.findByXmid(entity.getId());
- if (bwlist != null && bwlist.size() > 0) {
- for (XmbwglbEntity xmbw : bwlist) {
- bwids = bwids + xmbw.getBwid() + ",";
- }
- bwids = bwids.substring(0, bwids.length() - 1);
- }
- vo.setBwids(bwids);
- // 项目泊位关联信息
- List<XmbwglbEntity> xmbwlist = xmbwglbService.findByXmid(entity.getId());
- // 泊位信息
- List<BwEntity> bwList = new ArrayList<BwEntity>();
- if (xmbwlist != null && xmbwlist.size() > 0) {
- for (XmbwglbEntity xm : xmbwlist) {
- BwEntity bw = bwService.findOne(xm.getBwid());
- bwList.add(bw);
- }
- }
-
- List<BwVo> voList = new ArrayList<BwVo>();
- for (BwEntity entitybw : bwList) {
- BwVo vobw = new BwVo();
- if (entitybw != null) {
- BeanUtils.copyProperties(entitybw, vobw);
- vobw.setSzdzw(entitybw.getSzd() != null ? entitybw.getSzd().getText() : "");
- vobw.setSzgkzw(entitybw.getSzgk() != null ? entitybw.getSzgk().getGkmc() : "");
- vobw.setSzgqzw(entitybw.getSzgq() != null ? entitybw.getSzgq().getGqmc() : "");
- vobw.setSsjyrzw(entitybw.getSsjyr() != null ? entitybw.getSsjyr().getGkjyr() : "");
- vobw.setSsmtzw(entitybw.getSsmt() != null ? entitybw.getSsmt().getMtmc() : "");
- vobw.setBwsxzw(entitybw.getBwsx() != null ? entitybw.getBwsx().getText() : "");
- vobw.setFwlxzw(entitybw.getFwlx() != null ? entitybw.getFwlx().getText() : "");
- vobw.setWxpbwzw(entitybw.getWxpbw() != null ? entitybw.getWxpbw().getText() : "");
- vobw.setZyhbwflzw(entitybw.getZyhbwfl() != null ? entitybw.getZyhbwfl().getText() : "");
- vobw.setSffzzw(entitybw.getSffz() != null ? entitybw.getSffz().getText() : "");
- vobw.setSfdwkfzw(entitybw.getSfdwkf() != null ? entitybw.getSfdwkf().getText() : "");
- vobw.setBwszsxzw(entitybw.getBwszsx() != null ? entitybw.getBwszsx().getText() : "");
- vobw.setSclxzw(entitybw.getSclx() != null ? entitybw.getSclx().getText() : "");
- vobw.setJgxszw(entitybw.getJgxs() != null ? entitybw.getJgxs().getText() : "");
- if (entitybw.getBwyt() != null) {
- String bwytzw = "";
- String[] s = entitybw.getBwyt().split(",");
- for (int i = 0; i < s.length; i++) {
- CodeEntity ce = securityMgr.codeService().findOne(s[i]);
- if (ce != null) {
- bwytzw += ce.getText();
- if (i != s.length - 1) {
- bwytzw += ",";
- }
- }
- }
- vobw.setBwytzw(bwytzw);
- }
- vobw.setSzd(entitybw.getSzd() != null ? entitybw.getSzd().getId() : "");
- vobw.setSzgk(entitybw.getSzgk() != null ? entitybw.getSzgk().getId() : "");
- vobw.setSzgq(entitybw.getSzgq() != null ? entitybw.getSzgq().getId() : "");
- vobw.setSsjyr(entitybw.getSsjyr() != null ? entitybw.getSsjyr().getId() : "");
- vobw.setSsmt(entitybw.getSsmt() != null ? entitybw.getSsmt().getId() : "");
- vobw.setBwsx(entitybw.getBwsx() != null ? entitybw.getBwsx().getId() : "");
- vobw.setFwlx(entitybw.getFwlx() != null ? entitybw.getFwlx().getId() : "");
- vobw.setWxpbw(entitybw.getWxpbw() != null ? entitybw.getWxpbw().getId() : "");
- vobw.setZyhbwfl(entitybw.getZyhbwfl() != null ? entitybw.getZyhbwfl().getId() : "");
- vobw.setSffz(entitybw.getSffz() != null ? entitybw.getSffz().getId() : "");
- vobw.setSfdwkf(entitybw.getSfdwkf() != null ? entitybw.getSfdwkf().getId() : "");
- vobw.setBwszsx(entitybw.getBwszsx() != null ? entitybw.getBwszsx().getId() : "");
- vobw.setSclx(entitybw.getSclx() != null ? entitybw.getSclx().getId() : "");
- vobw.setJgxs(entitybw.getJgxs() != null ? entitybw.getJgxs().getId() : "");
- vobw.setXkzid(entitybw.getXkzid() != null ? entitybw.getXkzid() : "");
- vobw.setSszyq(entitybw.getSszyq() != null ? entitybw.getSszyq().getId() : "");
- vobw.setSszyqzw(entitybw.getSszyq() != null ? entitybw.getSszyq().getZyqmc() : "");
- vobw.setZls(entitybw.getZls() != null ? entitybw.getZls().getId() : "");
- vobw.setZlszw(entitybw.getZls() != null ? entitybw.getZls().getText() : "");
- vobw.setXp(entitybw.getXp() != null ? entitybw.getXp().getId() : "");
- vobw.setXpzw(entitybw.getXp() != null ? entitybw.getXp().getText() : "");
- voList.add(vobw);
- }
- }
- // 附件字段
- List<JsjdfjEntity> fjlist = jsjdfjService.findByEntity(entity, "ptfj");
- List<JsjdfjVo> jsjdfjVoList1 = new ArrayList<>();
- SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd");
- for (int i = 0; i < fjlist.size(); i++) {
- // 从发布单位中获取标识位
- if (StringUtils.isNotEmpty(fjlist.get(i).getFjbz())) {
- String s = fjlist.get(i).getFjbz().substring(0, 2);
- Date date = fjlist.get(i).getFbsj();
- JsjdfjVo fjvo = new JsjdfjVo();
- fjvo.setFjbz(fjlist.get(i).getFjbz().substring(2, fjlist.get(i).getFjbz().length()));
- if (date != null) {
- String date2 = dateFormater.format(date);
- fjvo.setFbsj(date2);
- }
- fjvo.setFbdw(fjlist.get(i).getFbdw());
- fjvo.setWjh(fjlist.get(i).getWjh());
- fjvo.setId(fjlist.get(i).getId());
- jsjdfjVoList1.add(fjvo);
- }
- }
- // 其他附件和字段
- List<JsjdfjEntity> qtfjzdlist = jsjdfjService.findByEntity(entity, "jsjdqtfj");
- // 流程历史
- List<TaskInfoEntity> historyList = new ArrayList<TaskInfoEntity>();
- if (entity.getXmlx().getId().equals("2202")) {
- historyList = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id, XmxxglEntity.PROCESS_DEFINITION_KEY2);
- } else {
- historyList = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id, XmxxglEntity.PROCESS_DEFINITION_KEY);
- }
- map.put("accessoryList", jsjdfjVoList);
- map.put("xmxx", vo);
- map.put("bwList", voList);
- map.put("qtfjzdlist", qtfjzdlist);
- map.put("fjlist", jsjdfjVoList1);
- map.put("historyList", historyList);
-
- return Object2JsonStr(map);
- }
-
- /**
- * 获取流程历史
- */
- @Override
- public String findHistoryAudit(String id,String sortno) {
- XmxxglfbVo vo = new XmxxglfbVo();
- try {
- XmxxglfbEntity xmxxfb = xmxxglfbService.findByXmidAndSortno(id, sortno);
- if (xmxxfb != null) {
- BeanUtils.copyProperties(xmxxfb, vo);
- vo.setTzlxzw(xmxxfb.getTzlx() != null ? xmxxfb.getTzlx().getText() : "");
- vo.setXmlxzw(xmxxfb.getXmlx() != null ? xmxxfb.getXmlx().getText() : "");
- vo.setXmhzjbzw(xmxxfb.getXmhzjb() != null ? xmxxfb.getXmhzjb().getText() : "");
- vo.setAxspjbzw(xmxxfb.getAxspjb() != null ? xmxxfb.getAxspjb().getText() : "");
- vo.setSzgkzw(xmxxfb.getSzgk() != null ? xmxxfb.getSzgk().getGkmc() : "");
- vo.setSzgqzw(xmxxfb.getSzgq() != null ? xmxxfb.getSzgq().getGqmc() : "");
- vo.setSzdzw(xmxxfb.getSzd() != null ? xmxxfb.getSzd().getText() : "");
- vo.setZyhbwflzw(xmxxfb.getZyhbwfl() != null ? xmxxfb.getZyhbwfl().getText() : "");
- vo.setTzlx(xmxxfb.getTzlx() != null ? xmxxfb.getTzlx().getId() : "");
- vo.setXmlx(xmxxfb.getXmlx() != null ? xmxxfb.getXmlx().getId() : "");
- vo.setXmhzjb(xmxxfb.getXmhzjb() != null ? xmxxfb.getXmhzjb().getId() : "");
- vo.setAxspjb(xmxxfb.getAxspjb() != null ? xmxxfb.getAxspjb().getId() : "");
- vo.setSzd(xmxxfb.getSzd() != null ? xmxxfb.getSzd().getId() : "");
- vo.setSzgk(xmxxfb.getSzgk() != null ? xmxxfb.getSzgk().getId() : "");
- vo.setSzgq(xmxxfb.getSzgq() != null ? xmxxfb.getSzgq().getId() : "");
- vo.setYj(xmxxfb.getYj() != null ? xmxxfb.getYj() : "");
- vo.setZyhbwfl(xmxxfb.getZyhbwfl() != null ? xmxxfb.getZyhbwfl().getId() : "");
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return Object2JsonStr(vo);
- }
- /**
- * 查询实施过程和详情
- */
- @Override
- public String findSsgc(String xmid) {
- List<TzjhglVo> voList = new ArrayList<TzjhglVo>();
- List<TzjhglEntity> tzjhlist = tzjhglService.findByXmid(xmid);
- for (int i = 0; i < tzjhlist.size(); i++) {
- TzjhglVo vo = new TzjhglVo();
- vo.setId2(tzjhlist.get(i) != null ? tzjhlist.get(i).getId() : "");
- vo.setNdjhtz(tzjhlist.get(i).getNdjhtz());
- vo.setJhnd(tzjhlist.get(i) != null ? tzjhlist.get(i).getJhnd() : "");
- // 获取当前月份
- Calendar cal = Calendar.getInstance();
- int month = cal.get(Calendar.MONTH) + 1;
- // 根据项目id,年度,月份查询当前数据
- XmyjhxxEntity entity = xmyjhxxService.findByJhndAndXmidAndYf(xmid, vo.getJhnd(), month + "");
- if (entity != null) {
- vo.setDqydtz((entity.getSjwctze() != null ? entity.getSjwctze().toString() : ""));
- vo.setDqxxjd(entity.getDqxxjd() != null ? entity.getDqxxjd() : "");
- vo.setXxjdwcqkfx(entity.getXxjdwcqkfx() != null ? entity.getXxjdwcqkfx() : "");
- }
- voList.add(vo);
- }
- return Object2JsonStr(voList);
- }
- /**
- * 根据资源id查询建设进度信息
- */
- @Override
- public String findJsjdByZyid(String zyid) {
- List<XmxxglEntity> xmxxList = new ArrayList<XmxxglEntity>();
- List<XmxxglVo> xmxxVoList = new ArrayList<>();
- List<BwEntity> bwList = bwService.findByMtid(zyid);
- if ( bwList !=null && bwList.size()>0){
- for (BwEntity bw : bwList){
- List<XmbwglbEntity> xmbwlist = xmbwglbService.findByBwid(bw.getId());
- if ( xmbwlist !=null && xmbwlist.size()>0){
- for (XmbwglbEntity xb : xmbwlist){
- XmxxglEntity entity = xmxxglService.findOne(xb.getXmid());
- if(!xmxxList.contains(entity)){
- xmxxList.add(entity);
- }
- }
- }
- }
- }
-
-
- for (XmxxglEntity entity : xmxxList){
- XmxxglVo vo = new XmxxglVo();
- BeanUtils.copyProperties(entity, vo);
- vo.setTzlxzw(entity.getTzlx() != null ? entity.getTzlx().getText() : "");
- vo.setXmlxzw(entity.getXmlx() != null ? entity.getXmlx().getText() : "");
- vo.setXmhzjbzw(entity.getXmhzjb() != null ? entity.getXmhzjb().getText() : "");
- vo.setAxspjbzw(entity.getAxspjb() != null ? entity.getAxspjb().getText() : "");
- vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
- vo.setSzgqzw(entity.getSzgq() != null ? entity.getSzgq().getGqmc() : "");
- vo.setZyhbwflzw(entity.getZyhbwfl() != null ? entity.getZyhbwfl().getText() : "");
- vo.setSylxzw(entity.getSylx() != null ? entity.getSylx().getText() : "");
- vo.setSylx(entity.getSylx() != null ? entity.getSylx().getId() : "");
- vo.setSzddzw(entity.getSzd() != null ? entity.getSzd().getText() : "");
- if (entity.getBwyt() != null) {
- String bwytzw = "";
- String[] s = entity.getBwyt().split(",");
- for (int i = 0; i < s.length; i++) {
- CodeEntity code = securityMgr.codeService().findOne(s[i]);
- if (code != null) {
- bwytzw += code.getText() + ",";
- }
- }
- if (!StringUtils.isEmpty(bwytzw)) {
- bwytzw = bwytzw.substring(0, bwytzw.length() - 1);
- }
- vo.setBwytzw(bwytzw);
- }
- String bwids = "";
- List<XmbwglbEntity> list = xmbwglbService.findByXmid(entity.getId());
- if (list != null && list.size() > 0) {
- for (XmbwglbEntity xmbw : list) {
- bwids = bwids + xmbw.getBwid() + ",";
- }
- bwids = bwids.substring(0, bwids.length() - 1);
- }
- vo.setBwids(bwids);
- vo.setTzlx(entity.getTzlx() != null ? entity.getTzlx().getId() : "");
- vo.setXmlx(entity.getXmlx() != null ? entity.getXmlx().getId() : "");
- vo.setXmhzjb(entity.getXmhzjb() != null ? entity.getXmhzjb().getId() : "");
- vo.setAxspjb(entity.getAxspjb() != null ? entity.getAxspjb().getId() : "");
- vo.setSzgk(entity.getSzgk() != null ? entity.getSzgk().getId() : "");
- vo.setSzgq(entity.getSzgq() != null ? entity.getSzgq().getId() : "");
- vo.setZyhbwfl(entity.getZyhbwfl() != null ? entity.getZyhbwfl().getId() : "");
- xmxxVoList.add(vo);
- }
-
-
- return Object2JsonStr(xmxxVoList);
- }
- /**
- *根据id获取项目历史流程信息
- */
- @Override
- public String findLslc(String id) {
- XmxxglEntity xmxxgl = xmxxglService.findOne(id);
- List<XmxxglfbVo> voList = new ArrayList<XmxxglfbVo>();
- if (xmxxgl.getXmlx().getId().equals("2202")) {
- List<TaskInfoEntity> list = taskInfoService.findByBusIdAndBusKeyOrderByIdAsc(id, XmxxglEntity.PROCESS_DEFINITION_KEY2);
- lclslist(list, voList);
- } else {
- List<TaskInfoEntity> list = taskInfoService.findByBusIdAndBusKeyOrderByIdAsc(id, XmxxglEntity.PROCESS_DEFINITION_KEY);
- lclslist(list, voList);
- }
- return Object2JsonStr(voList);
- }
-
- public void lclslist(List<TaskInfoEntity> list, List<XmxxglfbVo> voList) {
- for (int i = 0; i < list.size(); i++) {
- XmxxglfbVo vo = new XmxxglfbVo();
- vo.setCurrentname(list.get(i).getCurrName() != null ? list.get(i).getCurrName() : "");
- vo.setAuditusername(list.get(i).getAuditUsername() != null ? list.get(i).getAuditUsername() : "");
- vo.setSpyj(list.get(i).getAuditMsg() != null ? list.get(i).getAuditMsg() : "");
- vo.setCljg(list.get(i).getAuditResult() != null ? list.get(i).getAuditResult() : "");
- if (vo.getCljg().equals("false")) {
- vo.setCljg("退回");
- } else if (vo.getCljg().equals("true") && vo.getCurrentname().contains("审查")) {
- vo.setCljg("同意");
- } else if (vo.getCljg().equals("true") && vo.getCurrentname().contains("提交")) {
- vo.setCljg("提交");
- } else if (vo.getCljg().equals("1")) {
- vo.setCljg("提交");
- } else {
- vo.setCljg("");
- }
- SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- if (list.get(i).getAuditTime() != null) {
- Date date = list.get(i).getAuditTime();
- String date2 = dateFormater.format(date);
- vo.setAudittime(date2 != null ? date2 : "");
- }
- voList.add(vo);
- }
- }
- }
|