MainCtl.java 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  1. package com.xt.jygl.sys.ctl;
  2. import java.util.ArrayList;
  3. import java.util.Calendar;
  4. import java.util.Date;
  5. import java.util.HashMap;
  6. import java.util.List;
  7. import java.util.Map;
  8. import javax.persistence.criteria.CriteriaBuilder;
  9. import javax.persistence.criteria.CriteriaBuilder.In;
  10. import javax.persistence.criteria.CriteriaQuery;
  11. import javax.persistence.criteria.Predicate;
  12. import javax.persistence.criteria.Root;
  13. import javax.persistence.criteria.Subquery;
  14. import javax.servlet.http.HttpServletRequest;
  15. import net.sf.json.JSONArray;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.data.jpa.domain.Specification;
  18. import org.springframework.stereotype.Controller;
  19. import org.springframework.ui.Model;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.web.bind.annotation.ResponseBody;
  22. import com.fasterxml.jackson.core.JsonProcessingException;
  23. import com.xt.jygl.common.BaseWebCtl;
  24. import com.xt.jygl.common.Constants;
  25. import com.xt.jygl.common.GlobalData;
  26. import com.xt.jygl.common.Utils;
  27. import com.xt.jygl.ggfwxxgl.jdtx.service.TxService;
  28. import com.xt.jygl.ggfwxxgl.tzgg.ggxx.entity.GgxxtxEntity;
  29. import com.xt.jygl.ggfwxxgl.tzgg.ggxx.service.GgxxtxService;
  30. import com.xt.jygl.gkjcxx.gk.service.GkService;
  31. import com.xt.jygl.gkjcxx.gq.service.GqService;
  32. import com.xt.jygl.gkjsgl.jgsq.service.JgsqService;
  33. import com.xt.jygl.gkjsgl.jgsq.service.JgsqdsService;
  34. import com.xt.jygl.gkjsgl.jsjdbg.service.JsjdbgService;
  35. import com.xt.jygl.gkjsgl.jsjdbg.service.JsjdbgdsService;
  36. import com.xt.jygl.gkjsgl.jsjdcbsj.service.JsjdcbsjService;
  37. import com.xt.jygl.gkjsgl.jsjdcbsj.service.JsjdcbsjdsService;
  38. import com.xt.jygl.gkjsgl.xmxxgl.entity.XmxxglEntity;
  39. import com.xt.jygl.gkjsgl.xmxxgl.service.XmxxglService;
  40. import com.xt.jygl.gkjsgl.xmxxgl.service.XmxxgljggzService;
  41. import com.xt.jygl.gkjygl.cghzyxxgl.dcsb.entity.DcsbEntity;
  42. import com.xt.jygl.gkjygl.cghzyxxgl.dcsb.service.DcsbService;
  43. import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
  44. import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzxxEntity;
  45. import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzxxService;
  46. import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkbg.entity.XkzbgEntity;
  47. import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkbg.service.XkzbgService;
  48. import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxksq.entity.XkzsqEntity;
  49. import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxksq.service.XkzsqService;
  50. import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkyx.entity.XkzyxEntity;
  51. import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkyx.service.XkzyxService;
  52. import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkzx.entity.XkzzxEntity;
  53. import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxkzx.service.XkzzxService;
  54. import com.xt.jygl.gkjygl.gklhxkgl.gkjylhbg.service.LhbgService;
  55. import com.xt.jygl.gkjygl.gklhxkgl.gkjylhsq.service.LhsqService;
  56. import com.xt.jygl.gkjygl.gklhxkgl.gkjylhyx.service.LhyxService;
  57. import com.xt.jygl.workflow.entity.TaskInfoEntity;
  58. import com.xt.jygl.workflow.param.WorkItem;
  59. import com.xt.jygl.workflow.service.TaskInfoService;
  60. import com.xt.jygl.workflow.service.WorkflowMangerService;
  61. import com.xtframe.core.base.ctl.WebJsonResult;
  62. import com.xtframe.sec.common.BaseEntity;
  63. import com.xtframe.sec.common.SimplePageRequest;
  64. import com.xtframe.sec.menu.entity.MenuEntity;
  65. import com.xtframe.sec.role.entity.RoleEntity;
  66. import com.xtframe.sec.user.entity.UserEntity;
  67. import com.xtframe.sec.utils.SecUtils;
  68. import com.xtframe.util.StringUtils;
  69. /**
  70. *
  71. * @author liangzan
  72. *
  73. */
  74. @Controller
  75. public class MainCtl extends BaseWebCtl {
  76. // @Autowired
  77. // private SecurityMgr securityMgr;
  78. @Autowired
  79. private WorkflowMangerService workflowMangerService;
  80. @Autowired
  81. private GkService gkService;
  82. @Autowired
  83. private GqService gqService;
  84. @Autowired
  85. private XkzxxService xkzxxService;
  86. @Autowired
  87. private DcsbService dcsbService;
  88. @Autowired
  89. private XmxxglService xmxxglService;
  90. @Autowired
  91. private XmxxgljggzService xmxxgljggzService;
  92. @Autowired
  93. private XkzsqService xkzsqService;
  94. @Autowired
  95. private XkzbgService xkzbgService;
  96. @Autowired
  97. private XkzyxService xkzyxService;
  98. @Autowired
  99. private XkzzxService xkzzxService;
  100. @Autowired
  101. private TaskInfoService taskInfoService;
  102. @Autowired
  103. private TxService txService;
  104. @Autowired
  105. private GgxxtxService ggxxtxService;
  106. @Autowired
  107. private LhsqService lhsqService;
  108. @Autowired
  109. private LhbgService lhbgService;
  110. @Autowired
  111. private LhyxService lhyxService;
  112. @Autowired
  113. private JsjdcbsjdsService jsjdcbsjdsService;
  114. @Autowired
  115. private JsjdbgdsService jsjdbgdsService;
  116. @Autowired
  117. private JgsqdsService jgsqdsService;
  118. @Autowired
  119. private JsjdcbsjService jsjdcbsjService;
  120. @Autowired
  121. private JsjdbgService jsjdbgService;
  122. @Autowired
  123. private JgsqService jgsqService;
  124. @RequestMapping(value = "/main")
  125. public String main(Model model) {
  126. List<MenuEntity> rootMenus = securityMgr.menuService().findAuthedMenuByPid(Constants.BLANK_UUID);
  127. if (null != rootMenus && rootMenus.size() > 0) {
  128. for (MenuEntity menuEntity : rootMenus) {
  129. menuEntity.setChildren(getChildren(menuEntity));
  130. }
  131. }
  132. Map<String, Object> map = new HashMap<String, Object>();
  133. String curruserid = securityMgr.getCurrUser().getId();
  134. List<RoleEntity> role = securityMgr.roleService().findByUserId(curruserid);
  135. for (RoleEntity entity : role) {
  136. String roleId = entity.getId();
  137. List<MenuEntity> menu = securityMgr.menuService().findValidMenuByRoleId(roleId);
  138. for (MenuEntity menuentity : menu) {
  139. String code = menuentity.getCode();
  140. map.put(menuentity.getId(), code);
  141. }
  142. }
  143. // 港口管理人员的权限设置,取得有权限的港区
  144. if (Constants.NO_ID.equals(securityMgr.getCurrUser().getSfjyr().getId()) && securityMgr.getCurrUser().getSsglbm() != null) {
  145. List<String> gqList = gqService.findGqListByUserId(securityMgr.getCurrUser().getId());
  146. Utils.getSession().setAttribute("gqList", gqList);
  147. if (gqList != null && gqList.size() > 0) {
  148. Utils.getSession().setAttribute("gkList", gkService.findByGqList(gqList));
  149. }
  150. }
  151. model.addAttribute("map", JSONArray.fromObject(map));
  152. model.addAttribute("cityname", GlobalData.CITY_NAME);
  153. model.addAttribute("menuData", JSONArray.fromObject(rootMenus).toString());
  154. model.addAttribute("username", SecUtils.getCurrUser().getName());
  155. model.addAttribute("isSSO", GlobalData.isSSO + "");
  156. return "sys/main";
  157. }
  158. public List<MenuEntity> getChildren(MenuEntity entity) {
  159. List<MenuEntity> children = securityMgr.menuService().findAuthedMenuByPid(entity.getId());
  160. if (null != children && children.size() > 0) {
  161. for (MenuEntity menuEntity : children) {
  162. menuEntity.setChildren(getChildren(menuEntity));
  163. }
  164. }
  165. return children;
  166. }
  167. @RequestMapping(value = "/favicon.ico")
  168. public String favicon(Model model) {
  169. return "forward:/static/favicon.ico";
  170. }
  171. @RequestMapping(value = "/todo")
  172. public String todo(Model model, String menuid, SimplePageRequest page, HttpServletRequest request, String type, Date begin, Date end) throws JsonProcessingException {
  173. /*
  174. * if (StringUtils.isEmpty(type)) { type = "dcsb"; }
  175. */
  176. /*
  177. * if (StringUtils.isNotEmpty(SearchCondition.type) && isGET(request)) {
  178. * type = SearchCondition.type; }
  179. */
  180. List<WorkItem> volist = new ArrayList<WorkItem>();
  181. if ("jsjd".equals(type)) {
  182. volist = getJsjdList();
  183. } else if ("dcsb".equals(type)) {
  184. volist = getDcsbList();
  185. } else if ("xkzsq".equals(type)) {
  186. volist = getXkzsqList();
  187. } else if ("xkzbg".equals(type)) {
  188. volist = getXkzbgList();
  189. } else if ("xkzyx".equals(type)) {
  190. volist = getXkzyxList();
  191. } else if ("xkzzx".equals(type)) {
  192. volist = getXkzzxList();
  193. }
  194. model.addAttribute("list", volist);
  195. model.addAttribute("menuid", menuid);
  196. model.addAttribute("type", type);
  197. return "sys/todo";
  198. }
  199. @RequestMapping(value = "/getDbNum")
  200. @ResponseBody
  201. public WebJsonResult getDbNum(Model model) throws JsonProcessingException {
  202. WebJsonResult ws = success();
  203. /* int jsjd = getJsjdNum(); */
  204. String jyrid = "";
  205. String gqids = "";
  206. if (isJyr()) {
  207. jyrid = getSsjyr().getId();
  208. gqids = getSsjyr().getSzgq();
  209. } else {
  210. List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
  211. if (gqlist != null && gqlist.size() > 0) {
  212. for (int i = 0; i < gqlist.size(); i++) {
  213. gqids = gqids + "'" + gqlist.get(i) + "'" + ",";
  214. }
  215. gqids = gqids.substring(0, gqids.length() - 1);
  216. }
  217. }
  218. // 判断省市区别
  219. if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
  220. int dcsb = getDcsbNum(jyrid, gqids);
  221. int xkzsq = getXkzsqNum(jyrid, gqids);
  222. int xkzbg = getXkzbgNum(jyrid, gqids);
  223. int xkzyx = getXkzyxNum(jyrid, gqids);
  224. int xkzzx = getXkzzxNum(jyrid, gqids);
  225. int jsjdcbsjds = getJsjdcbsjdsNum(jyrid, gqids);
  226. int jsjdbgds = getJsjdbgdsNum(jyrid, gqids);
  227. int jgsqds = getJgsqdsNum(jyrid, gqids);
  228. ws.setAttr("dcsb", dcsb);
  229. ws.setAttr("xkzsq", xkzsq);
  230. ws.setAttr("xkzbg", xkzbg);
  231. ws.setAttr("xkzyx", xkzyx);
  232. ws.setAttr("xkzzx", xkzzx);
  233. ws.setAttr("jsjdcbsjds", jsjdcbsjds);
  234. ws.setAttr("jsjdbgds", jsjdbgds);
  235. ws.setAttr("jgsqds", jgsqds);
  236. } else {
  237. int lhsq = getLhsqNum(jyrid, gqids);
  238. int lhbg = getLhbgNum(jyrid, gqids);
  239. int lhyx = getLhyxNum(jyrid, gqids);
  240. int jsjdcbsj = getJsjdcbsjNum(jyrid, gqids);
  241. int jsjdbg = getJsjdbgNum(jyrid, gqids);
  242. int jgsq = getJgsqNum(jyrid, gqids);
  243. ws.setAttr("lhsq", lhsq);
  244. ws.setAttr("lhbg", lhbg);
  245. ws.setAttr("lhyx", lhyx);
  246. ws.setAttr("jsjdcbsj", jsjdcbsj);
  247. ws.setAttr("jsjdbg", jsjdbg);
  248. ws.setAttr("jgsq", jgsq);
  249. }
  250. Calendar ca = Calendar.getInstance();
  251. ca.add(Calendar.MONTH, 1);
  252. ws.setAttr("warn", "");
  253. ws.setAttr("jdtxwarn", "");
  254. ws.setAttr("tzggwarn", "");
  255. if (getSsjyr() != null) {
  256. List<XkzxxEntity> list = xkzxxService.queryNeedWarn(ca.getTime(), getSsjyr().getId());
  257. List<Object> jdtxjyr = txService.findByJyrid(getSsjyr().getId());
  258. ws.setAttr("warn", "您有<span>" + list.size() + "</span>条许可证即将过期,请及时处理!");
  259. ws.setAttr("jdtxwarn", "您有<span>" + jdtxjyr.size() + "</span>条监督提醒即将过期,请及时处理!");
  260. // 通知公告
  261. List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(getSsjyr().getId(), "1");
  262. ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请及时查看!");
  263. } else if (SecUtils.getCurrUser().getSsglry() != null) {
  264. // 过滤掉自己所发布的监督提醒
  265. List<Object> jdtxzj = txService.findByXzryidAndCu(SecUtils.getCurrUser().getSsglry().getId());
  266. if (jdtxzj.size() > 0) {
  267. if (jdtxzj.get(0).equals(SecUtils.getCurrUser().getSsglry().getId())) {
  268. ws.setAttr("jdtxwarn", "");
  269. } else {
  270. List<Object> jdtxxzry = txService.findByXzryid(SecUtils.getCurrUser().getSsglry().getId());
  271. ws.setAttr("jdtxwarn", "您有<span>" + jdtxxzry.size() + "</span>条监督提醒即将过期,请及时处理!");
  272. }
  273. }
  274. // 通知公告,过滤自己所发布的监督提醒
  275. List<Object> tzggzj = ggxxtxService.findByJyridAndCu(SecUtils.getCurrUser().getSsglry().getId());
  276. if (tzggzj.size() > 0) {
  277. if (tzggzj.get(0).equals(SecUtils.getCurrUser().getName())) {
  278. ws.setAttr("jdtxwarn", "");
  279. } else {
  280. List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(SecUtils.getCurrUser().getSsglry().getId(), "0");
  281. ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请及时查看!");
  282. }
  283. } else {
  284. List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(SecUtils.getCurrUser().getSsglry().getId(), "0");
  285. ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请及时查看!");
  286. }
  287. }
  288. /* ws.setAttr("jsjd", jsjd); */
  289. return ws;
  290. }
  291. // 建设进度管理
  292. public List<WorkItem> getJsjdList() throws JsonProcessingException {
  293. List<WorkItem> volist = new ArrayList<WorkItem>();
  294. Specification<XmxxglEntity> spec = new Specification<XmxxglEntity>() {
  295. // 查询条件
  296. @Override
  297. public Predicate toPredicate(Root<XmxxglEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
  298. List<Predicate> list = new ArrayList<Predicate>();
  299. Subquery<TaskInfoEntity> subquery = query.subquery(TaskInfoEntity.class);
  300. Root<TaskInfoEntity> dpRoot = subquery.from(TaskInfoEntity.class);
  301. subquery.select(dpRoot);
  302. list.add(cb.exists(subquery));
  303. // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在港区的数据
  304. if (isJyr()) {
  305. list.add(cb.like(root.get("jyrid").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
  306. } else {
  307. In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
  308. @SuppressWarnings("unchecked")
  309. List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
  310. if (gqlist != null && gqlist.size() > 0) {
  311. for (int i = 0; i < gqlist.size(); i++) {
  312. in.value(gqlist.get(i));
  313. }
  314. list.add(in);
  315. }
  316. }
  317. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
  318. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_VALID));
  319. return cb.and(list.toArray(new Predicate[] {}));
  320. }
  321. };
  322. List<XmxxglEntity> list = query.findAll(spec, XmxxglEntity.class);
  323. if (list != null && list.size() > 0) {
  324. for (XmxxglEntity entity : list) {
  325. if (null != entity) {
  326. WorkItem item = new WorkItem();
  327. if (!isJyr()) {
  328. 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) {
  329. item.setProcessName("建设进度");
  330. item.setProcessKey("jsjd");
  331. item.setDescription(entity.getXmmc());
  332. item.setCreateTime(entity.getCreateDateTime().toString());
  333. item.setStatus("1");
  334. if (!StringUtils.isEmpty(entity.getCreateUser())) {
  335. UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
  336. item.setSenderName(user.getName());
  337. }
  338. item.setBusinessKey(entity.getId());
  339. volist.add(item);
  340. }
  341. } else {
  342. 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) {
  343. item.setProcessName("建设进度");
  344. item.setProcessKey("jsjd");
  345. item.setDescription(entity.getXmmc());
  346. item.setCreateTime(entity.getCreateDateTime().toString());
  347. item.setStatus("1");
  348. if (!StringUtils.isEmpty(entity.getCreateUser())) {
  349. UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
  350. item.setSenderName(user.getName());
  351. }
  352. item.setBusinessKey(entity.getId());
  353. volist.add(item);
  354. }
  355. }
  356. }
  357. }
  358. }
  359. return volist;
  360. }
  361. // 单船申报
  362. public List<WorkItem> getDcsbList() throws JsonProcessingException {
  363. List<WorkItem> volist = new ArrayList<WorkItem>();
  364. // 查询条件
  365. Specification<DcsbEntity> spec = new Specification<DcsbEntity>() {
  366. @Override
  367. public Predicate toPredicate(Root<DcsbEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
  368. List<Predicate> list = new ArrayList<Predicate>();
  369. if (isJyr()) {
  370. list.add(cb.like(root.get("ssjyr").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
  371. } else {
  372. In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
  373. @SuppressWarnings("unchecked")
  374. List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
  375. if (gqlist != null && gqlist.size() > 0) {
  376. for (int i = 0; i < gqlist.size(); i++) {
  377. in.value(gqlist.get(i));
  378. }
  379. list.add(in);
  380. }
  381. }
  382. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
  383. return cb.and(list.toArray(new Predicate[] {}));
  384. }
  385. };
  386. List<DcsbEntity> list = query.findAll(spec, DcsbEntity.class);
  387. if (list != null && list.size() > 0) {
  388. for (DcsbEntity entity : list) {
  389. if (entity != null) {
  390. WorkItem item = new WorkItem();
  391. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
  392. List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), DcsbEntity.PROCESS_DEFINITION_KEY);
  393. if (lists != null & lists.size() > 0) {
  394. TaskInfoEntity taskinfo = lists.get(0);
  395. if ("申请".equals(taskinfo.getCurrName())) {
  396. item.setStatus("1");
  397. } else {
  398. item.setStatus("0");
  399. }
  400. item.setProcessName("单船申报");
  401. item.setProcessKey("dcsb");
  402. item.setDescription(entity.getSsjyr().getGkjyr());
  403. item.setCreateTime(entity.getCreateDateTime().toString());
  404. if (!StringUtils.isEmpty(entity.getCreateUser())) {
  405. UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
  406. item.setSenderName(user.getName());
  407. }
  408. item.setBusinessKey(entity.getId());
  409. volist.add(item);
  410. }
  411. }
  412. }
  413. }
  414. }
  415. return volist;
  416. }
  417. // 许可证申请
  418. public List<WorkItem> getXkzsqList() throws JsonProcessingException {
  419. List<WorkItem> volist = new ArrayList<WorkItem>();
  420. // 查询条件
  421. Specification<XkzsqEntity> spec = new Specification<XkzsqEntity>() {
  422. @Override
  423. public Predicate toPredicate(Root<XkzsqEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
  424. List<Predicate> list = new ArrayList<Predicate>();
  425. // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
  426. if (isJyr()) {
  427. list.add(cb.like(root.get("jyrid").as(String.class), "%" + getSsjyr().getId() + "%"));
  428. } else {
  429. In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
  430. @SuppressWarnings("unchecked")
  431. List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
  432. if (gqlist != null && gqlist.size() > 0) {
  433. for (int i = 0; i < gqlist.size(); i++) {
  434. in.value(gqlist.get(i));
  435. }
  436. list.add(in);
  437. }
  438. }
  439. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
  440. return cb.and(list.toArray(new Predicate[] {}));
  441. }
  442. };
  443. List<XkzsqEntity> list = query.findAll(spec, XkzsqEntity.class);
  444. if (list != null && list.size() > 0) {
  445. for (XkzsqEntity entity : list) {
  446. if (entity != null) {
  447. if (entity.getRecordStatus() != 9) {
  448. WorkItem item = new WorkItem();
  449. if ((xkzsqService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xkzsqService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
  450. List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), XkzsqEntity.PROCESS_DEFINITION_KEY);
  451. if (lists != null & lists.size() > 0) {
  452. TaskInfoEntity taskinfo = lists.get(0);
  453. if ("申请".equals(taskinfo.getCurrName())) {
  454. item.setStatus("1");
  455. } else {
  456. item.setStatus("0");
  457. }
  458. item.setProcessName("许可证申请");
  459. item.setProcessKey("xkzsq");
  460. item.setDescription(entity.getJyrmc());
  461. item.setCreateTime(entity.getCreateDateTime() != null ? entity.getCreateDateTime().toString() : "");
  462. if (!StringUtils.isEmpty(entity.getCreateUser())) {
  463. UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
  464. item.setSenderName(user.getName());
  465. }
  466. item.setBusinessKey(entity.getId());
  467. volist.add(item);
  468. }
  469. }
  470. }
  471. }
  472. }
  473. }
  474. return volist;
  475. }
  476. // 许可证变更
  477. public List<WorkItem> getXkzbgList() throws JsonProcessingException {
  478. List<WorkItem> volist = new ArrayList<WorkItem>();
  479. // 查询条件
  480. Specification<XkzbgEntity> spec = new Specification<XkzbgEntity>() {
  481. @Override
  482. public Predicate toPredicate(Root<XkzbgEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
  483. List<Predicate> list = new ArrayList<Predicate>();
  484. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
  485. // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
  486. if (!isJyr()) {
  487. In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
  488. @SuppressWarnings("unchecked")
  489. List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
  490. if (gqlist != null && gqlist.size() > 0) {
  491. for (int i = 0; i < gqlist.size(); i++) {
  492. in.value(gqlist.get(i));
  493. }
  494. list.add(in);
  495. }
  496. } else {
  497. Subquery<GkjyrEntity> subquery = query.subquery(GkjyrEntity.class);
  498. Root<GkjyrEntity> dpRoot = subquery.from(GkjyrEntity.class);
  499. subquery.select(dpRoot);
  500. List<Predicate> subQueryPredicates = new ArrayList<Predicate>();
  501. subQueryPredicates.add(cb.equal(root.get("jyrid").as(String.class), dpRoot.get("id").as(String.class)));
  502. subQueryPredicates.add(cb.equal(dpRoot.get("yjyrid").as(String.class), getSsjyr().getId()));
  503. subquery.where(subQueryPredicates.toArray(new Predicate[] {}));
  504. list.add(cb.exists(subquery));
  505. }
  506. return cb.and(list.toArray(new Predicate[] {}));
  507. }
  508. };
  509. List<XkzbgEntity> list = query.findAll(spec, XkzbgEntity.class);
  510. if (list != null && list.size() > 0) {
  511. for (XkzbgEntity entity : list) {
  512. if (entity != null) {
  513. WorkItem item = new WorkItem();
  514. if (entity.getRecordStatus() != 9) {
  515. if ((xkzbgService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xkzbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
  516. List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), XkzbgEntity.PROCESS_DEFINITION_KEY);
  517. if (lists != null & lists.size() > 0) {
  518. TaskInfoEntity taskinfo = lists.get(0);
  519. if ("申请".equals(taskinfo.getCurrName())) {
  520. item.setStatus("1");
  521. } else {
  522. item.setStatus("0");
  523. }
  524. item.setProcessName("许可证变更");
  525. item.setProcessKey("xkzbg");
  526. item.setDescription(entity.getJyrmc());
  527. item.setCreateTime(entity.getCreateDateTime() != null ? entity.getCreateDateTime().toString() : "");
  528. if (!StringUtils.isEmpty(entity.getCreateUser())) {
  529. UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
  530. item.setSenderName(user.getName());
  531. }
  532. item.setBusinessKey(entity.getId());
  533. volist.add(item);
  534. }
  535. }
  536. }
  537. }
  538. }
  539. }
  540. return volist;
  541. }
  542. // 许可证延续
  543. public List<WorkItem> getXkzyxList() throws JsonProcessingException {
  544. List<WorkItem> volist = new ArrayList<WorkItem>();
  545. // 查询条件
  546. Specification<XkzyxEntity> spec = new Specification<XkzyxEntity>() {
  547. @Override
  548. public Predicate toPredicate(Root<XkzyxEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
  549. List<Predicate> list = new ArrayList<Predicate>();
  550. // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
  551. if (isJyr()) {
  552. list.add(cb.like(root.get("jyrid").as(String.class), "%" + getSsjyr().getId() + "%"));
  553. } else {
  554. In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
  555. @SuppressWarnings("unchecked")
  556. List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
  557. if (gqlist != null && gqlist.size() > 0) {
  558. for (int i = 0; i < gqlist.size(); i++) {
  559. in.value(gqlist.get(i));
  560. }
  561. list.add(in);
  562. }
  563. }
  564. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
  565. return cb.and(list.toArray(new Predicate[] {}));
  566. }
  567. };
  568. List<XkzyxEntity> list = query.findAll(spec, XkzyxEntity.class);
  569. if (list != null && list.size() > 0) {
  570. for (XkzyxEntity entity : list) {
  571. if (entity != null) {
  572. WorkItem item = new WorkItem();
  573. if (entity.getRecordStatus() != 9) {
  574. if ((xkzyxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xkzyxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
  575. List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), XkzyxEntity.PROCESS_DEFINITION_KEY);
  576. if (lists != null & lists.size() > 0) {
  577. TaskInfoEntity taskinfo = lists.get(0);
  578. if ("申请".equals(taskinfo.getCurrName())) {
  579. item.setStatus("1");
  580. } else {
  581. item.setStatus("0");
  582. }
  583. item.setProcessName("许可证延续");
  584. item.setProcessKey("xkzyx");
  585. item.setDescription(entity.getJyrmc());
  586. item.setCreateTime(entity.getCreateDateTime() != null ? entity.getCreateDateTime().toString() : "");
  587. if (!StringUtils.isEmpty(entity.getCreateUser())) {
  588. UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
  589. item.setSenderName(user.getName());
  590. }
  591. item.setBusinessKey(entity.getId());
  592. volist.add(item);
  593. }
  594. }
  595. }
  596. }
  597. }
  598. }
  599. return volist;
  600. }
  601. // 许可证注销
  602. public List<WorkItem> getXkzzxList() throws JsonProcessingException {
  603. List<WorkItem> volist = new ArrayList<WorkItem>();
  604. // 查询条件
  605. Specification<XkzzxEntity> spec = new Specification<XkzzxEntity>() {
  606. @Override
  607. public Predicate toPredicate(Root<XkzzxEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
  608. List<Predicate> list = new ArrayList<Predicate>();
  609. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
  610. // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
  611. if (!isJyr()) {
  612. In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
  613. @SuppressWarnings("unchecked")
  614. List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
  615. if (gqlist != null && gqlist.size() > 0) {
  616. for (int i = 0; i < gqlist.size(); i++) {
  617. in.value(gqlist.get(i));
  618. }
  619. list.add(in);
  620. }
  621. } else {
  622. Subquery<GkjyrEntity> subquery = query.subquery(GkjyrEntity.class);
  623. Root<GkjyrEntity> dpRoot = subquery.from(GkjyrEntity.class);
  624. subquery.select(dpRoot);
  625. List<Predicate> subQueryPredicates = new ArrayList<Predicate>();
  626. subQueryPredicates.add(cb.equal(root.get("jyrid").as(String.class), dpRoot.get("id").as(String.class)));
  627. subQueryPredicates.add(cb.equal(dpRoot.get("yjyrid").as(String.class), getSsjyr().getId()));
  628. subquery.where(subQueryPredicates.toArray(new Predicate[] {}));
  629. list.add(cb.exists(subquery));
  630. }
  631. return cb.and(list.toArray(new Predicate[] {}));
  632. }
  633. };
  634. List<XkzzxEntity> list = query.findAll(spec, XkzzxEntity.class);
  635. if (list != null && list.size() > 0) {
  636. for (XkzzxEntity entity : list) {
  637. if (entity != null) {
  638. WorkItem item = new WorkItem();
  639. if (entity.getRecordStatus() != 9) {
  640. if ((xkzzxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || xkzzxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
  641. List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), XkzzxEntity.PROCESS_DEFINITION_KEY);
  642. if (lists != null & lists.size() > 0) {
  643. TaskInfoEntity taskinfo = lists.get(0);
  644. if ("申请".equals(taskinfo.getCurrName())) {
  645. } else {
  646. item.setProcessName("许可证注销");
  647. item.setProcessKey("xkzzx");
  648. item.setDescription(entity.getJyrmc());
  649. item.setCreateTime(entity.getCreateDateTime() != null ? entity.getCreateDateTime().toString() : "");
  650. if (!StringUtils.isEmpty(entity.getCreateUser())) {
  651. UserEntity user = securityMgr.userService().findById(entity.getCreateUser());
  652. item.setSenderName(user.getName());
  653. }
  654. item.setBusinessKey(entity.getId());
  655. volist.add(item);
  656. }
  657. }
  658. }
  659. }
  660. }
  661. }
  662. }
  663. return volist;
  664. }
  665. // 建设进度管理
  666. public int getJsjdNum() throws JsonProcessingException {
  667. Specification<XmxxglEntity> spec = new Specification<XmxxglEntity>() {
  668. // 查询条件
  669. @Override
  670. public Predicate toPredicate(Root<XmxxglEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
  671. List<Predicate> list = new ArrayList<Predicate>();
  672. Subquery<TaskInfoEntity> subquery = query.subquery(TaskInfoEntity.class);
  673. Root<TaskInfoEntity> dpRoot = subquery.from(TaskInfoEntity.class);
  674. subquery.select(dpRoot);
  675. list.add(cb.exists(subquery));
  676. // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在港区的数据
  677. if (isJyr()) {
  678. list.add(cb.like(root.get("jyrid").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
  679. } else {
  680. In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
  681. @SuppressWarnings("unchecked")
  682. List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
  683. if (gqlist != null && gqlist.size() > 0) {
  684. for (int i = 0; i < gqlist.size(); i++) {
  685. in.value(gqlist.get(i));
  686. }
  687. list.add(in);
  688. }
  689. }
  690. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
  691. list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_VALID));
  692. return cb.and(list.toArray(new Predicate[] {}));
  693. }
  694. };
  695. List<XmxxglEntity> list = query.findAll(spec, XmxxglEntity.class);
  696. int sum = 0;
  697. if (list != null && list.size() > 0) {
  698. for (XmxxglEntity entity : list) {
  699. if (null != entity) {
  700. if (!isJyr()) {
  701. 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) {
  702. sum++;
  703. }
  704. } else {
  705. 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) {
  706. sum++;
  707. }
  708. }
  709. }
  710. }
  711. }
  712. return sum;
  713. }
  714. // 单船申报
  715. public int getDcsbNum(String jyrid, String gqids) throws JsonProcessingException {
  716. List<Object> list = new ArrayList<Object>();
  717. if (!StringUtils.isEmpty(jyrid)) {
  718. list = dcsbService.findByJyrid(jyrid);
  719. } else {
  720. list = dcsbService.findByGqids(gqids);
  721. }
  722. int sum = 0;
  723. if (list != null && list.size() > 0) {
  724. for (Object id : list) {
  725. if (id != null) {
  726. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  727. sum++;
  728. }
  729. }
  730. }
  731. }
  732. return sum;
  733. }
  734. // 许可证申请
  735. public int getXkzsqNum(String jyrid, String gqids) throws JsonProcessingException {
  736. List<Object> list = new ArrayList<Object>();
  737. if (!StringUtils.isEmpty(jyrid)) {
  738. list = xkzsqService.findByJyrids(jyrid);
  739. } else {
  740. list = xkzsqService.findByGqids(gqids);
  741. }
  742. int sum = 0;
  743. if (list != null && list.size() > 0) {
  744. for (Object id : list) {
  745. if (id != null) {
  746. if ((xkzsqService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || xkzsqService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  747. sum++;
  748. }
  749. }
  750. }
  751. }
  752. return sum;
  753. }
  754. // 许可证变更
  755. public int getXkzbgNum(String jyrid, String gqids) throws JsonProcessingException {
  756. List<Object> list = new ArrayList<Object>();
  757. if (!StringUtils.isEmpty(jyrid)) {
  758. list = xkzbgService.findByJyrids(jyrid);
  759. } else {
  760. list = xkzbgService.findByGqids(gqids);
  761. }
  762. int sum = 0;
  763. if (list != null && list.size() > 0) {
  764. for (Object id : list) {
  765. if ((xkzbgService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || xkzbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  766. sum++;
  767. }
  768. }
  769. }
  770. return sum;
  771. }
  772. // 许可证延续
  773. public int getXkzyxNum(String jyrid, String gqids) throws JsonProcessingException {
  774. List<Object> list = new ArrayList<Object>();
  775. if (!StringUtils.isEmpty(jyrid)) {
  776. list = xkzyxService.findByJyrids(jyrid);
  777. } else {
  778. list = xkzyxService.findByGqids(gqids);
  779. }
  780. int sum = 0;
  781. if (list != null && list.size() > 0) {
  782. for (Object id : list) {
  783. if ((xkzyxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || xkzyxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  784. sum++;
  785. }
  786. }
  787. }
  788. return sum;
  789. }
  790. // 许可证注销
  791. public int getXkzzxNum(String jyrid, String gqids) throws JsonProcessingException {
  792. List<Object> list = new ArrayList<Object>();
  793. if (!StringUtils.isEmpty(jyrid)) {
  794. list = xkzzxService.findByJyrids(jyrid);
  795. } else {
  796. list = xkzzxService.findByGqids(gqids);
  797. }
  798. int sum = 0;
  799. if (list != null && list.size() > 0) {
  800. for (Object id : list) {
  801. if ((xkzzxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || xkzzxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  802. sum++;
  803. }
  804. }
  805. }
  806. return sum;
  807. }
  808. // 理货申请
  809. public int getLhsqNum(String jyrid, String gqids) throws JsonProcessingException {
  810. List<Object> list = new ArrayList<Object>();
  811. if (!StringUtils.isEmpty(jyrid)) {
  812. list = dcsbService.findByJyrid(jyrid);
  813. } else {
  814. list = dcsbService.findByGqids(gqids);
  815. }
  816. int sum = 0;
  817. if (list != null && list.size() > 0) {
  818. for (Object id : list) {
  819. if (id != null) {
  820. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  821. sum++;
  822. }
  823. }
  824. }
  825. }
  826. return sum;
  827. }
  828. // 理货变更
  829. public int getLhbgNum(String jyrid, String gqids) throws JsonProcessingException {
  830. List<Object> list = new ArrayList<Object>();
  831. if (!StringUtils.isEmpty(jyrid)) {
  832. list = dcsbService.findByJyrid(jyrid);
  833. } else {
  834. list = dcsbService.findByGqids(gqids);
  835. }
  836. int sum = 0;
  837. if (list != null && list.size() > 0) {
  838. for (Object id : list) {
  839. if (id != null) {
  840. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  841. sum++;
  842. }
  843. }
  844. }
  845. }
  846. return sum;
  847. }
  848. // 理货延续
  849. public int getLhyxNum(String jyrid, String gqids) throws JsonProcessingException {
  850. List<Object> list = new ArrayList<Object>();
  851. if (!StringUtils.isEmpty(jyrid)) {
  852. list = dcsbService.findByJyrid(jyrid);
  853. } else {
  854. list = dcsbService.findByGqids(gqids);
  855. }
  856. int sum = 0;
  857. if (list != null && list.size() > 0) {
  858. for (Object id : list) {
  859. if (id != null) {
  860. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  861. sum++;
  862. }
  863. }
  864. }
  865. }
  866. return sum;
  867. }
  868. // 建设进度初步设计地市
  869. public int getJsjdcbsjdsNum(String jyrid, String gqids) throws JsonProcessingException {
  870. List<Object> list = new ArrayList<Object>();
  871. if (!StringUtils.isEmpty(jyrid)) {
  872. list = jsjdcbsjdsService.findByJyrids(jyrid);
  873. } else {
  874. list = jsjdcbsjdsService.findByGqids(gqids);
  875. }
  876. int sum = 0;
  877. if (list != null && list.size() > 0) {
  878. for (Object id : list) {
  879. if (id != null) {
  880. if ((jsjdcbsjdsService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || jsjdcbsjdsService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  881. sum++;
  882. }
  883. }
  884. }
  885. }
  886. return sum;
  887. }
  888. // 建设进度初步设计变更地市
  889. public int getJsjdbgdsNum(String jyrid, String gqids) throws JsonProcessingException {
  890. List<Object> list = new ArrayList<Object>();
  891. if (!StringUtils.isEmpty(jyrid)) {
  892. list = jsjdbgdsService.findByJyrids(jyrid);
  893. } else {
  894. list = jsjdbgdsService.findByGqids(gqids);
  895. }
  896. int sum = 0;
  897. if (list != null && list.size() > 0) {
  898. for (Object id : list) {
  899. if (id != null) {
  900. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  901. sum++;
  902. }
  903. }
  904. }
  905. }
  906. return sum;
  907. }
  908. // 竣工申请地市
  909. public int getJgsqdsNum(String jyrid, String gqids) throws JsonProcessingException {
  910. List<Object> list = new ArrayList<Object>();
  911. if (!StringUtils.isEmpty(jyrid)) {
  912. list = jgsqdsService.findByJyrids(jyrid);
  913. } else {
  914. list = jgsqdsService.findByGqids(gqids);
  915. }
  916. int sum = 0;
  917. if (list != null && list.size() > 0) {
  918. for (Object id : list) {
  919. if (id != null) {
  920. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  921. sum++;
  922. }
  923. }
  924. }
  925. }
  926. return sum;
  927. }
  928. // 建设进度初步设计
  929. public int getJsjdcbsjNum(String jyrid, String gqids) throws JsonProcessingException {
  930. List<Object> list = new ArrayList<Object>();
  931. if (!StringUtils.isEmpty(jyrid)) {
  932. list = jsjdcbsjService.findByJyrids(jyrid);
  933. } else {
  934. list = jsjdcbsjService.findByGqids(gqids);
  935. }
  936. int sum = 0;
  937. if (list != null && list.size() > 0) {
  938. for (Object id : list) {
  939. if (id != null) {
  940. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  941. sum++;
  942. }
  943. }
  944. }
  945. }
  946. return sum;
  947. }
  948. // 建设进度变更
  949. public int getJsjdbgNum(String jyrid, String gqids) throws JsonProcessingException {
  950. List<Object> list = new ArrayList<Object>();
  951. if (!StringUtils.isEmpty(jyrid)) {
  952. list = jsjdbgService.findByJyrids(jyrid);
  953. } else {
  954. list = jsjdbgService.findByGqids(gqids);
  955. }
  956. int sum = 0;
  957. if (list != null && list.size() > 0) {
  958. for (Object id : list) {
  959. if (id != null) {
  960. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  961. sum++;
  962. }
  963. }
  964. }
  965. }
  966. return sum;
  967. }
  968. // 竣工申请
  969. public int getJgsqNum(String jyrid, String gqids) throws JsonProcessingException {
  970. List<Object> list = new ArrayList<Object>();
  971. if (!StringUtils.isEmpty(jyrid)) {
  972. list = jgsqService.findByJyrids(jyrid);
  973. } else {
  974. list = jgsqService.findByGqids(gqids);
  975. }
  976. int sum = 0;
  977. if (list != null && list.size() > 0) {
  978. for (Object id : list) {
  979. if (id != null) {
  980. if ((dcsbService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
  981. sum++;
  982. }
  983. }
  984. }
  985. }
  986. return sum;
  987. }
  988. }