123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089 |
- package com.xt.jygl.sys.ctl;
- 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.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.servlet.http.HttpServletRequest;
- import net.sf.json.JSONArray;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.data.jpa.domain.Specification;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
- import com.fasterxml.jackson.core.JsonProcessingException;
- import com.xt.jygl.common.BaseWebCtl;
- import com.xt.jygl.common.Constants;
- import com.xt.jygl.common.GlobalData;
- import com.xt.jygl.common.Utils;
- import com.xt.jygl.ggfwxxgl.jdtx.service.TxService;
- import com.xt.jygl.ggfwxxgl.tzgg.ggxx.entity.GgxxtxEntity;
- import com.xt.jygl.ggfwxxgl.tzgg.ggxx.service.GgxxtxService;
- import com.xt.jygl.gkjcxx.gk.service.GkService;
- import com.xt.jygl.gkjcxx.gq.service.GqService;
- import com.xt.jygl.gkjsgl.jgsq.service.JgsqService;
- import com.xt.jygl.gkjsgl.jgsq.service.JgsqdsService;
- import com.xt.jygl.gkjsgl.jsjdbg.service.JsjdbgService;
- import com.xt.jygl.gkjsgl.jsjdbg.service.JsjdbgdsService;
- import com.xt.jygl.gkjsgl.jsjdcbsj.service.JsjdcbsjService;
- import com.xt.jygl.gkjsgl.jsjdcbsj.service.JsjdcbsjdsService;
- import com.xt.jygl.gkjsgl.xmxxgl.entity.XmxxglEntity;
- import com.xt.jygl.gkjsgl.xmxxgl.service.XmxxglService;
- import com.xt.jygl.gkjsgl.xmxxgl.service.XmxxgljggzService;
- import com.xt.jygl.gkjygl.cghzyxxgl.dcsb.entity.DcsbEntity;
- import com.xt.jygl.gkjygl.cghzyxxgl.dcsb.service.DcsbService;
- import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
- import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzxxEntity;
- import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzxxService;
- import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkbg.entity.XkzbgEntity;
- import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkbg.service.XkzbgService;
- import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxksq.entity.XkzsqEntity;
- import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxksq.service.XkzsqService;
- import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkyx.entity.XkzyxEntity;
- import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkyx.service.XkzyxService;
- import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkzx.entity.XkzzxEntity;
- import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkzx.service.XkzzxService;
- import com.xt.jygl.gkjygl.gklhxkgl.gkjylhbg.service.LhbgService;
- import com.xt.jygl.gkjygl.gklhxkgl.gkjylhsq.service.LhsqService;
- import com.xt.jygl.gkjygl.gklhxkgl.gkjylhyx.service.LhyxService;
- import com.xt.jygl.workflow.entity.TaskInfoEntity;
- import com.xt.jygl.workflow.param.WorkItem;
- import com.xt.jygl.workflow.service.TaskInfoService;
- import com.xt.jygl.workflow.service.WorkflowMangerService;
- import com.xtframe.core.base.ctl.WebJsonResult;
- import com.xtframe.sec.common.BaseEntity;
- import com.xtframe.sec.common.SimplePageRequest;
- import com.xtframe.sec.menu.entity.MenuEntity;
- import com.xtframe.sec.role.entity.RoleEntity;
- import com.xtframe.sec.user.entity.UserEntity;
- import com.xtframe.sec.utils.SecUtils;
- import com.xtframe.util.StringUtils;
- /**
- *
- * @author liangzan
- *
- */
- @Controller
- public class MainCtl extends BaseWebCtl {
- // @Autowired
- // private SecurityMgr securityMgr;
- @Autowired
- private WorkflowMangerService workflowMangerService;
- @Autowired
- private GkService gkService;
- @Autowired
- private GqService gqService;
- @Autowired
- private XkzxxService xkzxxService;
- @Autowired
- private DcsbService dcsbService;
- @Autowired
- private XmxxglService xmxxglService;
- @Autowired
- private XmxxgljggzService xmxxgljggzService;
- @Autowired
- private XkzsqService xkzsqService;
- @Autowired
- private XkzbgService xkzbgService;
- @Autowired
- private XkzyxService xkzyxService;
- @Autowired
- private XkzzxService xkzzxService;
- @Autowired
- private TaskInfoService taskInfoService;
- @Autowired
- private TxService txService;
- @Autowired
- private GgxxtxService ggxxtxService;
- @Autowired
- private LhsqService lhsqService;
- @Autowired
- private LhbgService lhbgService;
- @Autowired
- private LhyxService lhyxService;
- @Autowired
- private JsjdcbsjdsService jsjdcbsjdsService;
- @Autowired
- private JsjdbgdsService jsjdbgdsService;
- @Autowired
- private JgsqdsService jgsqdsService;
- @Autowired
- private JsjdcbsjService jsjdcbsjService;
- @Autowired
- private JsjdbgService jsjdbgService;
- @Autowired
- private JgsqService jgsqService;
- @RequestMapping(value = "/main")
- public String main(Model model) {
- List<MenuEntity> rootMenus = securityMgr.menuService().findAuthedMenuByPid(Constants.BLANK_UUID);
- if (null != rootMenus && rootMenus.size() > 0) {
- for (MenuEntity menuEntity : rootMenus) {
- menuEntity.setChildren(getChildren(menuEntity));
- }
- }
- Map<String, Object> map = new HashMap<String, Object>();
- String curruserid = securityMgr.getCurrUser().getId();
- List<RoleEntity> role = securityMgr.roleService().findByUserId(curruserid);
- for (RoleEntity entity : role) {
- String roleId = entity.getId();
- List<MenuEntity> menu = securityMgr.menuService().findValidMenuByRoleId(roleId);
- for (MenuEntity menuentity : menu) {
- String code = menuentity.getCode();
- map.put(menuentity.getId(), code);
- }
- }
- // 港口管理人员的权限设置,取得有权限的港区
- if (Constants.NO_ID.equals(securityMgr.getCurrUser().getSfjyr().getId()) && securityMgr.getCurrUser().getSsglbm() != null) {
- List<String> gqList = gqService.findGqListByUserId(securityMgr.getCurrUser().getId());
- Utils.getSession().setAttribute("gqList", gqList);
- if (gqList != null && gqList.size() > 0) {
- Utils.getSession().setAttribute("gkList", gkService.findByGqList(gqList));
- }
- }
- model.addAttribute("map", JSONArray.fromObject(map));
- model.addAttribute("cityname", GlobalData.CITY_NAME);
- model.addAttribute("menuData", JSONArray.fromObject(rootMenus).toString());
- model.addAttribute("username", SecUtils.getCurrUser().getName());
- model.addAttribute("isSSO", GlobalData.isSSO + "");
- return "sys/main";
- }
- public List<MenuEntity> getChildren(MenuEntity entity) {
- List<MenuEntity> children = securityMgr.menuService().findAuthedMenuByPid(entity.getId());
- if (null != children && children.size() > 0) {
- for (MenuEntity menuEntity : children) {
- menuEntity.setChildren(getChildren(menuEntity));
- }
- }
- return children;
- }
- @RequestMapping(value = "/favicon.ico")
- public String favicon(Model model) {
- return "forward:/static/favicon.ico";
- }
- @RequestMapping(value = "/todo")
- public String todo(Model model, String menuid, SimplePageRequest page, HttpServletRequest request, String type, Date begin, Date end) throws JsonProcessingException {
- /*
- * if (StringUtils.isEmpty(type)) { type = "dcsb"; }
- */
- /*
- * if (StringUtils.isNotEmpty(SearchCondition.type) && isGET(request)) {
- * type = SearchCondition.type; }
- */
- List<WorkItem> volist = new ArrayList<WorkItem>();
- if ("jsjd".equals(type)) {
- volist = getJsjdList();
- } else if ("dcsb".equals(type)) {
- volist = getDcsbList();
- } else if ("xkzsq".equals(type)) {
- volist = getXkzsqList();
- } else if ("xkzbg".equals(type)) {
- volist = getXkzbgList();
- } else if ("xkzyx".equals(type)) {
- volist = getXkzyxList();
- } else if ("xkzzx".equals(type)) {
- volist = getXkzzxList();
- }
- model.addAttribute("list", volist);
- model.addAttribute("menuid", menuid);
- model.addAttribute("type", type);
- return "sys/todo";
- }
- @RequestMapping(value = "/getDbNum")
- @ResponseBody
- public WebJsonResult getDbNum(Model model) throws JsonProcessingException {
- WebJsonResult ws = success();
- /* int jsjd = getJsjdNum(); */
- String jyrid = "";
- String gqids = "";
- if (isJyr()) {
- jyrid = getSsjyr().getId();
- gqids = getSsjyr().getSzgq();
- } else {
- List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- gqids = gqids + "'" + gqlist.get(i) + "'" + ",";
- }
- gqids = gqids.substring(0, gqids.length() - 1);
- }
- }
- // 判断省市区别
- if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
- int dcsb = getDcsbNum(jyrid, gqids);
- int xkzsq = getXkzsqNum(jyrid, gqids);
- int xkzbg = getXkzbgNum(jyrid, gqids);
- int xkzyx = getXkzyxNum(jyrid, gqids);
- int xkzzx = getXkzzxNum(jyrid, gqids);
- int jsjdcbsjds = getJsjdcbsjdsNum(jyrid, gqids);
- int jsjdbgds = getJsjdbgdsNum(jyrid, gqids);
- int jgsqds = getJgsqdsNum(jyrid, gqids);
- ws.setAttr("dcsb", dcsb);
- ws.setAttr("xkzsq", xkzsq);
- ws.setAttr("xkzbg", xkzbg);
- ws.setAttr("xkzyx", xkzyx);
- ws.setAttr("xkzzx", xkzzx);
- ws.setAttr("jsjdcbsjds", jsjdcbsjds);
- ws.setAttr("jsjdbgds", jsjdbgds);
- ws.setAttr("jgsqds", jgsqds);
- } else {
- int lhsq = getLhsqNum(jyrid, gqids);
- int lhbg = getLhbgNum(jyrid, gqids);
- int lhyx = getLhyxNum(jyrid, gqids);
- int jsjdcbsj = getJsjdcbsjNum(jyrid, gqids);
- int jsjdbg = getJsjdbgNum(jyrid, gqids);
- int jgsq = getJgsqNum(jyrid, gqids);
- ws.setAttr("lhsq", lhsq);
- ws.setAttr("lhbg", lhbg);
- ws.setAttr("lhyx", lhyx);
- ws.setAttr("jsjdcbsj", jsjdcbsj);
- ws.setAttr("jsjdbg", jsjdbg);
- ws.setAttr("jgsq", jgsq);
- }
-
-
- Calendar ca = Calendar.getInstance();
- ca.add(Calendar.MONTH, 1);
- ws.setAttr("warn", "");
- ws.setAttr("jdtxwarn", "");
- ws.setAttr("tzggwarn", "");
- if (getSsjyr() != null) {
- List<XkzxxEntity> list = xkzxxService.queryNeedWarn(ca.getTime(), getSsjyr().getId());
- List<Object> jdtxjyr = txService.findByJyrid(getSsjyr().getId());
- ws.setAttr("warn", "您有<span>" + list.size() + "</span>条许可证即将过期,请及时处理!");
- ws.setAttr("jdtxwarn", "您有<span>" + jdtxjyr.size() + "</span>条监督提醒即将过期,请及时处理!");
- // 通知公告
- List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(getSsjyr().getId(), "1");
- ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请及时查看!");
- } else if (SecUtils.getCurrUser().getSsglry() != null) {
- // 过滤掉自己所发布的监督提醒
- List<Object> jdtxzj = txService.findByXzryidAndCu(SecUtils.getCurrUser().getSsglry().getId());
- if (jdtxzj.size() > 0) {
- if (jdtxzj.get(0).equals(SecUtils.getCurrUser().getSsglry().getId())) {
- ws.setAttr("jdtxwarn", "");
- } else {
- List<Object> jdtxxzry = txService.findByXzryid(SecUtils.getCurrUser().getSsglry().getId());
- ws.setAttr("jdtxwarn", "您有<span>" + jdtxxzry.size() + "</span>条监督提醒即将过期,请及时处理!");
- }
- }
- // 通知公告,过滤自己所发布的监督提醒
- List<Object> tzggzj = ggxxtxService.findByJyridAndCu(SecUtils.getCurrUser().getSsglry().getId());
- if (tzggzj.size() > 0) {
- if (tzggzj.get(0).equals(SecUtils.getCurrUser().getName())) {
- ws.setAttr("jdtxwarn", "");
- } else {
- List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(SecUtils.getCurrUser().getSsglry().getId(), "0");
- ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请及时查看!");
- }
- } else {
- List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(SecUtils.getCurrUser().getSsglry().getId(), "0");
- ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请及时查看!");
- }
- }
- /* ws.setAttr("jsjd", jsjd); */
-
- return ws;
- }
- // 建设进度管理
- public List<WorkItem> getJsjdList() throws JsonProcessingException {
- List<WorkItem> volist = new ArrayList<WorkItem>();
- Specification<XmxxglEntity> spec = new Specification<XmxxglEntity>() {
- // 查询条件
- @Override
- public Predicate toPredicate(Root<XmxxglEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> list = new ArrayList<Predicate>();
- Subquery<TaskInfoEntity> subquery = query.subquery(TaskInfoEntity.class);
- Root<TaskInfoEntity> dpRoot = subquery.from(TaskInfoEntity.class);
- subquery.select(dpRoot);
- 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");
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- in.value(gqlist.get(i));
- }
- list.add(in);
- }
- }
- 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[] {}));
- }
- };
- List<XmxxglEntity> list = query.findAll(spec, XmxxglEntity.class);
- if (list != null && list.size() > 0) {
- for (XmxxglEntity entity : list) {
- if (null != entity) {
- WorkItem item = new WorkItem();
- 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) {
- item.setProcessName("建设进度");
- item.setProcessKey("jsjd");
- item.setDescription(entity.getXmmc());
- item.setCreateTime(entity.getCreateDateTime().toString());
- item.setStatus("1");
- if (!StringUtils.isEmpty(entity.getCreateUser())) {
- UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
- item.setSenderName(user.getName());
- }
- item.setBusinessKey(entity.getId());
- volist.add(item);
- }
- } 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) {
- item.setProcessName("建设进度");
- item.setProcessKey("jsjd");
- item.setDescription(entity.getXmmc());
- item.setCreateTime(entity.getCreateDateTime().toString());
- item.setStatus("1");
- if (!StringUtils.isEmpty(entity.getCreateUser())) {
- UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
- item.setSenderName(user.getName());
- }
- item.setBusinessKey(entity.getId());
- volist.add(item);
- }
- }
- }
- }
- }
- return volist;
- }
- // 单船申报
- public List<WorkItem> getDcsbList() throws JsonProcessingException {
- List<WorkItem> volist = new ArrayList<WorkItem>();
- // 查询条件
- Specification<DcsbEntity> spec = new Specification<DcsbEntity>() {
- @Override
- public Predicate toPredicate(Root<DcsbEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> list = new ArrayList<Predicate>();
- if (isJyr()) {
- list.add(cb.like(root.get("ssjyr").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");
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- in.value(gqlist.get(i));
- }
- list.add(in);
- }
- }
- list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
- return cb.and(list.toArray(new Predicate[] {}));
- }
- };
- List<DcsbEntity> list = query.findAll(spec, DcsbEntity.class);
- if (list != null && list.size() > 0) {
- for (DcsbEntity entity : list) {
- if (entity != null) {
- WorkItem item = new WorkItem();
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
- List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), DcsbEntity.PROCESS_DEFINITION_KEY);
- if (lists != null & lists.size() > 0) {
- TaskInfoEntity taskinfo = lists.get(0);
- if ("申请".equals(taskinfo.getCurrName())) {
- item.setStatus("1");
- } else {
- item.setStatus("0");
- }
- item.setProcessName("单船申报");
- item.setProcessKey("dcsb");
- item.setDescription(entity.getSsjyr().getGkjyr());
- item.setCreateTime(entity.getCreateDateTime().toString());
- if (!StringUtils.isEmpty(entity.getCreateUser())) {
- UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
- item.setSenderName(user.getName());
- }
- item.setBusinessKey(entity.getId());
- volist.add(item);
- }
- }
- }
- }
- }
- return volist;
- }
- // 许可证申请
- public List<WorkItem> getXkzsqList() throws JsonProcessingException {
- List<WorkItem> volist = new ArrayList<WorkItem>();
- // 查询条件
- Specification<XkzsqEntity> spec = new Specification<XkzsqEntity>() {
- @Override
- public Predicate toPredicate(Root<XkzsqEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> list = new ArrayList<Predicate>();
- // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
- if (isJyr()) {
- list.add(cb.like(root.get("jyrid").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");
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- in.value(gqlist.get(i));
- }
- list.add(in);
- }
- }
- list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
- return cb.and(list.toArray(new Predicate[] {}));
- }
- };
- List<XkzsqEntity> list = query.findAll(spec, XkzsqEntity.class);
- if (list != null && list.size() > 0) {
- for (XkzsqEntity entity : list) {
- if (entity != null) {
- if (entity.getRecordStatus() != 9) {
- WorkItem item = new WorkItem();
- if ((xkzsqService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xkzsqService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
- List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), XkzsqEntity.PROCESS_DEFINITION_KEY);
- if (lists != null & lists.size() > 0) {
- TaskInfoEntity taskinfo = lists.get(0);
- if ("申请".equals(taskinfo.getCurrName())) {
- item.setStatus("1");
- } else {
- item.setStatus("0");
- }
- item.setProcessName("许可证申请");
- item.setProcessKey("xkzsq");
- item.setDescription(entity.getJyrmc());
- item.setCreateTime(entity.getCreateDateTime() != null ? entity.getCreateDateTime().toString() : "");
- if (!StringUtils.isEmpty(entity.getCreateUser())) {
- UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
- item.setSenderName(user.getName());
- }
- item.setBusinessKey(entity.getId());
- volist.add(item);
- }
- }
- }
- }
- }
- }
- return volist;
- }
- // 许可证变更
- public List<WorkItem> getXkzbgList() throws JsonProcessingException {
- List<WorkItem> volist = new ArrayList<WorkItem>();
- // 查询条件
- Specification<XkzbgEntity> spec = new Specification<XkzbgEntity>() {
- @Override
- public Predicate toPredicate(Root<XkzbgEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> list = new ArrayList<Predicate>();
- list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
- // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
- if (!isJyr()) {
- In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
- @SuppressWarnings("unchecked")
- List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- in.value(gqlist.get(i));
- }
- list.add(in);
- }
- } else {
- Subquery<GkjyrEntity> subquery = query.subquery(GkjyrEntity.class);
- Root<GkjyrEntity> dpRoot = subquery.from(GkjyrEntity.class);
- subquery.select(dpRoot);
- List<Predicate> subQueryPredicates = new ArrayList<Predicate>();
- subQueryPredicates.add(cb.equal(root.get("jyrid").as(String.class), dpRoot.get("id").as(String.class)));
- subQueryPredicates.add(cb.equal(dpRoot.get("yjyrid").as(String.class), getSsjyr().getId()));
- subquery.where(subQueryPredicates.toArray(new Predicate[] {}));
- list.add(cb.exists(subquery));
- }
- return cb.and(list.toArray(new Predicate[] {}));
- }
- };
- List<XkzbgEntity> list = query.findAll(spec, XkzbgEntity.class);
- if (list != null && list.size() > 0) {
- for (XkzbgEntity entity : list) {
- if (entity != null) {
- WorkItem item = new WorkItem();
- if (entity.getRecordStatus() != 9) {
- if ((xkzbgService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xkzbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
- List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), XkzbgEntity.PROCESS_DEFINITION_KEY);
- if (lists != null & lists.size() > 0) {
- TaskInfoEntity taskinfo = lists.get(0);
- if ("申请".equals(taskinfo.getCurrName())) {
- item.setStatus("1");
- } else {
- item.setStatus("0");
- }
- item.setProcessName("许可证变更");
- item.setProcessKey("xkzbg");
- item.setDescription(entity.getJyrmc());
- item.setCreateTime(entity.getCreateDateTime() != null ? entity.getCreateDateTime().toString() : "");
- if (!StringUtils.isEmpty(entity.getCreateUser())) {
- UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
- item.setSenderName(user.getName());
- }
- item.setBusinessKey(entity.getId());
- volist.add(item);
- }
- }
- }
- }
- }
- }
- return volist;
- }
- // 许可证延续
- public List<WorkItem> getXkzyxList() throws JsonProcessingException {
- List<WorkItem> volist = new ArrayList<WorkItem>();
- // 查询条件
- Specification<XkzyxEntity> spec = new Specification<XkzyxEntity>() {
- @Override
- public Predicate toPredicate(Root<XkzyxEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> list = new ArrayList<Predicate>();
- // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
- if (isJyr()) {
- list.add(cb.like(root.get("jyrid").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");
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- in.value(gqlist.get(i));
- }
- list.add(in);
- }
- }
- list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
- return cb.and(list.toArray(new Predicate[] {}));
- }
- };
- List<XkzyxEntity> list = query.findAll(spec, XkzyxEntity.class);
- if (list != null && list.size() > 0) {
- for (XkzyxEntity entity : list) {
- if (entity != null) {
- WorkItem item = new WorkItem();
- if (entity.getRecordStatus() != 9) {
- if ((xkzyxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xkzyxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
- List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), XkzyxEntity.PROCESS_DEFINITION_KEY);
- if (lists != null & lists.size() > 0) {
- TaskInfoEntity taskinfo = lists.get(0);
- if ("申请".equals(taskinfo.getCurrName())) {
- item.setStatus("1");
- } else {
- item.setStatus("0");
- }
- item.setProcessName("许可证延续");
- item.setProcessKey("xkzyx");
- item.setDescription(entity.getJyrmc());
- item.setCreateTime(entity.getCreateDateTime() != null ? entity.getCreateDateTime().toString() : "");
- if (!StringUtils.isEmpty(entity.getCreateUser())) {
- UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
- item.setSenderName(user.getName());
- }
- item.setBusinessKey(entity.getId());
- volist.add(item);
- }
- }
- }
- }
- }
- }
- return volist;
- }
- // 许可证注销
- public List<WorkItem> getXkzzxList() throws JsonProcessingException {
- List<WorkItem> volist = new ArrayList<WorkItem>();
- // 查询条件
- Specification<XkzzxEntity> spec = new Specification<XkzzxEntity>() {
- @Override
- public Predicate toPredicate(Root<XkzzxEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> list = new ArrayList<Predicate>();
- list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
- // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
- if (!isJyr()) {
- In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
- @SuppressWarnings("unchecked")
- List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- in.value(gqlist.get(i));
- }
- list.add(in);
- }
- } else {
- Subquery<GkjyrEntity> subquery = query.subquery(GkjyrEntity.class);
- Root<GkjyrEntity> dpRoot = subquery.from(GkjyrEntity.class);
- subquery.select(dpRoot);
- List<Predicate> subQueryPredicates = new ArrayList<Predicate>();
- subQueryPredicates.add(cb.equal(root.get("jyrid").as(String.class), dpRoot.get("id").as(String.class)));
- subQueryPredicates.add(cb.equal(dpRoot.get("yjyrid").as(String.class), getSsjyr().getId()));
- subquery.where(subQueryPredicates.toArray(new Predicate[] {}));
- list.add(cb.exists(subquery));
- }
- return cb.and(list.toArray(new Predicate[] {}));
- }
- };
- List<XkzzxEntity> list = query.findAll(spec, XkzzxEntity.class);
- if (list != null && list.size() > 0) {
- for (XkzzxEntity entity : list) {
- if (entity != null) {
- WorkItem item = new WorkItem();
- if (entity.getRecordStatus() != 9) {
- if ((xkzzxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xkzzxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
- List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), XkzzxEntity.PROCESS_DEFINITION_KEY);
- if (lists != null & lists.size() > 0) {
- TaskInfoEntity taskinfo = lists.get(0);
- if ("申请".equals(taskinfo.getCurrName())) {
- } else {
- item.setProcessName("许可证注销");
- item.setProcessKey("xkzzx");
- item.setDescription(entity.getJyrmc());
- item.setCreateTime(entity.getCreateDateTime() != null ? entity.getCreateDateTime().toString() : "");
- if (!StringUtils.isEmpty(entity.getCreateUser())) {
- UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
- item.setSenderName(user.getName());
- }
- item.setBusinessKey(entity.getId());
- volist.add(item);
- }
- }
- }
- }
- }
- }
- }
- return volist;
- }
- // 建设进度管理
- public int getJsjdNum() throws JsonProcessingException {
- Specification<XmxxglEntity> spec = new Specification<XmxxglEntity>() {
- // 查询条件
- @Override
- public Predicate toPredicate(Root<XmxxglEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> list = new ArrayList<Predicate>();
- Subquery<TaskInfoEntity> subquery = query.subquery(TaskInfoEntity.class);
- Root<TaskInfoEntity> dpRoot = subquery.from(TaskInfoEntity.class);
- subquery.select(dpRoot);
- 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");
- if (gqlist != null && gqlist.size() > 0) {
- for (int i = 0; i < gqlist.size(); i++) {
- in.value(gqlist.get(i));
- }
- list.add(in);
- }
- }
- 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[] {}));
- }
- };
- List<XmxxglEntity> list = query.findAll(spec, XmxxglEntity.class);
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (XmxxglEntity entity : list) {
- if (null != entity) {
- 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) {
- sum++;
- }
- } 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) {
- sum++;
- }
- }
- }
- }
- }
- return sum;
- }
- // 单船申报
- public int getDcsbNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = dcsbService.findByJyrid(jyrid);
- } else {
- list = dcsbService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 许可证申请
- public int getXkzsqNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = xkzsqService.findByJyrids(jyrid);
- } else {
- list = xkzsqService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((xkzsqService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || xkzsqService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 许可证变更
- public int getXkzbgNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = xkzbgService.findByJyrids(jyrid);
- } else {
- list = xkzbgService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if ((xkzbgService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || xkzbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- return sum;
- }
- // 许可证延续
- public int getXkzyxNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = xkzyxService.findByJyrids(jyrid);
- } else {
- list = xkzyxService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if ((xkzyxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || xkzyxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- return sum;
- }
- // 许可证注销
- public int getXkzzxNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = xkzzxService.findByJyrids(jyrid);
- } else {
- list = xkzzxService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if ((xkzzxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || xkzzxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- return sum;
- }
- // 理货申请
- public int getLhsqNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = dcsbService.findByJyrid(jyrid);
- } else {
- list = dcsbService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 理货变更
- public int getLhbgNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = dcsbService.findByJyrid(jyrid);
- } else {
- list = dcsbService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 理货延续
- public int getLhyxNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = dcsbService.findByJyrid(jyrid);
- } else {
- list = dcsbService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 建设进度初步设计地市
- public int getJsjdcbsjdsNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = jsjdcbsjdsService.findByJyrids(jyrid);
- } else {
- list = jsjdcbsjdsService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((jsjdcbsjdsService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || jsjdcbsjdsService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 建设进度初步设计变更地市
- public int getJsjdbgdsNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = jsjdbgdsService.findByJyrids(jyrid);
- } else {
- list = jsjdbgdsService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 竣工申请地市
- public int getJgsqdsNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = jgsqdsService.findByJyrids(jyrid);
- } else {
- list = jgsqdsService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 建设进度初步设计
- public int getJsjdcbsjNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = jsjdcbsjService.findByJyrids(jyrid);
- } else {
- list = jsjdcbsjService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 建设进度变更
- public int getJsjdbgNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = jsjdbgService.findByJyrids(jyrid);
- } else {
- list = jsjdbgService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- // 竣工申请
- public int getJgsqNum(String jyrid, String gqids) throws JsonProcessingException {
- List<Object> list = new ArrayList<Object>();
- if (!StringUtils.isEmpty(jyrid)) {
- list = jgsqService.findByJyrids(jyrid);
- } else {
- list = jgsqService.findByGqids(gqids);
- }
- int sum = 0;
- if (list != null && list.size() > 0) {
- for (Object id : list) {
- if (id != null) {
- if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
- sum++;
- }
- }
- }
- }
- return sum;
- }
- }
|