Просмотр исходного кода

git-svn-id: https://192.168.57.71/svn/jsgkj@1921 931142cf-59ea-a443-aa0e-51397b428577

ld_zhangdong 8 лет назад
Родитель
Сommit
3ab8dec75a

+ 132 - 77
gkjsjy/trunk/src/com/xt/jygl/sys/ctl/MainCtl.java

@@ -15,8 +15,8 @@ import javax.persistence.criteria.Root;
 import javax.persistence.criteria.Subquery;
 import javax.servlet.http.HttpServletRequest;
 
-import net.sf.json.JSONArray;
-
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Controller;
@@ -29,7 +29,6 @@ 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.jdtxxx.entity.JdtxxxEntity;
 import com.xt.jygl.ggfwxxgl.jdtxxx.service.JdtxxxService;
 import com.xt.jygl.ggfwxxgl.tzgg.ggxx.entity.GgxxtxEntity;
@@ -50,8 +49,7 @@ 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.jyrjbxx.service.GkjyrService;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.vo.GkjyrVo;
 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;
@@ -71,7 +69,6 @@ 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;
@@ -81,6 +78,8 @@ import com.xtframe.sec.user.entity.UserEntity;
 import com.xtframe.sec.utils.SecUtils;
 import com.xtframe.util.StringUtils;
 
+import net.sf.json.JSONArray;
+
 /**
  * 
  * @author liangzan
@@ -90,14 +89,11 @@ import com.xtframe.util.StringUtils;
 public class MainCtl extends BaseWebCtl {
 	// @Autowired
 	// private SecurityMgr securityMgr;
-
 	@Autowired
-	private WorkflowMangerService workflowMangerService;
+	protected RuntimeService runtimeService;
 	@Autowired
 	private GkService gkService;
 	@Autowired
-	private GkjyrService gkjyrService;
-	@Autowired
 	private GqService gqService;
 	@Autowired
 	private XkzxxService xkzxxService;
@@ -118,8 +114,6 @@ public class MainCtl extends BaseWebCtl {
 	@Autowired
 	private TaskInfoService taskInfoService;
 	@Autowired
-	private TxService txService;
-	@Autowired
 	private GgxxtxService ggxxtxService;
 	@Autowired
 	private LhsqService lhsqService;
@@ -271,6 +265,7 @@ public class MainCtl extends BaseWebCtl {
 		return ws;
 	}
 	
+	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/getDbNum")
 	@ResponseBody
 	public WebJsonResult getDbNum(Model model) throws JsonProcessingException {
@@ -283,19 +278,29 @@ public class MainCtl extends BaseWebCtl {
 		} else {
 			gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 		}
+		UserEntity userEntity = SecUtils.getCurrUser();
+		String id = userEntity.getId().toString();
 		// 判断省市区别
 		if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
-			int dcsb = getDcsbNum(jyrid, gqlist);
-
-			int xkzsq = getXkzsqNum(jyrid, gqlist);
-			int xkzbg = getXkzbgNum(jyrid, gqlist);
-			int xkzyx = getXkzyxNum(jyrid, gqlist);
-			int xkzzx = getXkzzxNum(jyrid, gqlist);
-
-			int jsjdcbsjds = getJsjdcbsjdsNum(jyrid, gqlist);
-			int jsjdbgds = getJsjdbgdsNum(jyrid, gqlist);
-			int jgsqds = getJgsqdsNum(jyrid, gqlist);
-			int jdtx = getJdtxNum(jyrid, gqlist);
+			int dcsb = getDcsbNum(id,jyrid, gqlist);
+			int xkzsq = getXkzsqNum(id,jyrid, gqlist);
+			int xkzbg = getXkzbgNum(id,jyrid, gqlist);
+			int xkzyx = getXkzyxNum(id,jyrid, gqlist);
+			int xkzzx = getXkzzxNum(id,jyrid, gqlist);
+
+			int jsjdcbsjds = getJsjdcbsjdsNum(id,jyrid, gqlist);
+			int jsjdbgds = getJsjdbgdsNum(id,jyrid, gqlist);
+			int jgsqds = getJgsqdsNum(id,jyrid, gqlist);
+			int jdtx = getJdtxNum(id,jyrid, gqlist);
+			
+//			int dcsb = dcsb;
+//			int xkzsq = xkzsq;
+//			int xkzbg = xkzbg;
+//			int xkzyx = xkzyx;
+//			int jsjdcbsjds = jsjdcbsjds;
+//			int jsjdbgds = jsjdbgds;
+//			int jgsqds = jgsqds;
+//			int jdtx = jdtx;
 			ws.setAttr("dcsb", dcsb);
 			ws.setAttr("xkzsq", xkzsq);
 			ws.setAttr("xkzbg", xkzbg);
@@ -307,12 +312,12 @@ public class MainCtl extends BaseWebCtl {
 			ws.setAttr("jdtx", jdtx);
 			ws.setAttr("ssflag", 1);
 		} else {
-			int lhsq = getLhsqNum();
-			int lhbg = getLhbgNum();
-			int lhyx = getLhyxNum();
-			int jsjdcbsj = getJsjdcbsjNum();
-			int jsjdbg = getJsjdbgNum();
-			int jgsq = getJgsqNum();
+			int lhsq = getLhsqNum(id);
+			int lhbg = getLhbgNum(id);
+			int lhyx = getLhyxNum(id);
+			int jsjdcbsj = getJsjdcbsjNum(id);
+			int jsjdbg = getJsjdbgNum(id);
+			int jgsq = getJgsqNum(id);
 			ws.setAttr("lhsq", lhsq);
 			ws.setAttr("lhbg", lhbg);
 			ws.setAttr("lhyx", lhyx);
@@ -329,33 +334,34 @@ public class MainCtl extends BaseWebCtl {
 		ws.setAttr("tzggwarn", "");
 
 		int messageNum = 0;
-		if (getSsjyr() != null) {
-			List<XkzxxEntity> list = xkzxxService.queryNeedWarn(ca.getTime(), getSsjyr().getId());
+		GkjyrVo gkjyrVo = getSsjyr();
+		if (gkjyrVo != null) {
+			List<XkzxxEntity> list = xkzxxService.queryNeedWarn(ca.getTime(), gkjyrVo.getId());
 			ws.setAttr("warn", "您有<span>" + list.size() + "</span>条许可证即将过期,请处理!");
 			// List<Object> jdtxjyr = txService.findByJyrid(getSsjyr().getId());
 			// ws.setAttr("jdtxwarn", "您有<span>" + jdtxjyr.size() +
 			// "</span>条监督提醒即将过期,请及时处理!");
 			// 通知公告
-			List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(getSsjyr().getId(), "1");
+			List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(gkjyrVo.getId(), "1");
 			ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请查看!");
 
 			// 初步设计 省通过 flowstatus 为2 ,不通过 flowstatus 为1
-			List<JsjdcbsjEntity> tlist = jsjdcbsjdsService.findByJyridAndFLowstatus(getSsjyr().getId(), "2");
-			List<JsjdcbsjEntity> flist = jsjdcbsjdsService.findByJyridAndFLowstatus(getSsjyr().getId(), "1");
+			List<JsjdcbsjEntity> tlist = jsjdcbsjdsService.findByJyridAndFLowstatus(gkjyrVo.getId(), "2");
+			List<JsjdcbsjEntity> flist = jsjdcbsjdsService.findByJyridAndFLowstatus(gkjyrVo.getId(), "1");
 			ws.setAttr("jsjdcbsjwarn", "项目初步设计申请<span>" + tlist.size() + "</span>条已通过,<span>" + flist.size() + "</span>条未通过请查看!");
 
 			// 初步设计变更 省通过 flowstatus 为2 ,不通过 flowstatus 为1
-			List<JsjdbgEntity> ttlist = jsjdbgdsService.findByJyridAndFLowstatus(getSsjyr().getId(), "2");
-			List<JsjdbgEntity> fflist = jsjdbgdsService.findByJyridAndFLowstatus(getSsjyr().getId(), "1");
+			List<JsjdbgEntity> ttlist = jsjdbgdsService.findByJyridAndFLowstatus(gkjyrVo.getId(), "2");
+			List<JsjdbgEntity> fflist = jsjdbgdsService.findByJyridAndFLowstatus(gkjyrVo.getId(), "1");
 			ws.setAttr("jsjdbgwarn", "项目初步设计变更<span>" + tlist.size() + "</span>条已通过,<span>" + flist.size() + "</span>条未通过请查看!");
 
 			// 竣工 省通过 flowstatus 为2 ,不通过 flowstatus 为1
-			List<JgsqEntity> jgtlist = jgsqdsService.findByJyridAndFLowstatus(getSsjyr().getId(), "2");
-			List<JgsqEntity> jgflist = jgsqdsService.findByJyridAndFLowstatus(getSsjyr().getId(), "1");
+			List<JgsqEntity> jgtlist = jgsqdsService.findByJyridAndFLowstatus(gkjyrVo.getId(), "2");
+			List<JgsqEntity> jgflist = jgsqdsService.findByJyridAndFLowstatus(gkjyrVo.getId(), "1");
 			ws.setAttr("jgsqwarn", "项目竣工验收申请<span>" + tlist.size() + "</span>条已通过,<span>" + flist.size() + "</span>条未通过请查看!");
 
 			messageNum = list.size() + ggtx.size();
-		} else if (SecUtils.getCurrUser().getSsglry() != null) {
+		} else if (userEntity.getSsglry() != null) {
 			// 过滤掉自己所发布的监督提醒
 			/*
 			 * List<Object> jdtxzj =
@@ -370,17 +376,17 @@ public class MainCtl extends BaseWebCtl {
 			 * "</span>条监督提醒即将过期,请及时处理!"); messageNum += jdtxxzry.size(); } }
 			 */
 			// 通知公告,过滤自己所发布的监督提醒
-			List<Object> tzggzj = ggxxtxService.findByJyridAndCu(SecUtils.getCurrUser().getSsglry().getId());
+			List<Object> tzggzj = ggxxtxService.findByJyridAndCu(userEntity.getSsglry().getId());
 			if (tzggzj.size() > 0) {
-				if (tzggzj.get(0).equals(SecUtils.getCurrUser().getName())) {
+				if (tzggzj.get(0).equals(userEntity.getName())) {
 					ws.setAttr("jdtxwarn", "");
 				} else {
-					List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(SecUtils.getCurrUser().getSsglry().getId(), "0");
+					List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(userEntity.getSsglry().getId(), "0");
 					ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请查看!");
 					messageNum += ggtx.size();
 				}
 			} else {
-				List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(SecUtils.getCurrUser().getSsglry().getId(), "0");
+				List<GgxxtxEntity> ggtx = ggxxtxService.findByJyridAndFlag(userEntity.getSsglry().getId(), "0");
 				ws.setAttr("tzggwarn", "您有<span>" + ggtx.size() + "</span>条通知公告尚未阅读,请查看!");
 				messageNum += ggtx.size();
 			}
@@ -475,6 +481,7 @@ public class MainCtl extends BaseWebCtl {
 		if (isJyr()) {
 			list = dcsbService.findByJyrid(getSsjyr().getId());
 		} else {
+			@SuppressWarnings("unchecked")
 			List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 			if (!StringUtils.isEmpty(gqlist) && gqlist.size() > 0) {
 				list = dcsbService.findByGqids(gqlist);
@@ -633,6 +640,7 @@ public class MainCtl extends BaseWebCtl {
 		if (isJyr()) {
 			list = jsjdcbsjdsService.findByJyrids(getSsjyr().getId());
 		} else {
+			@SuppressWarnings("unchecked")
 			List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 			if (gqlist != null && gqlist.size() > 0) {
 				list = jsjdcbsjdsService.findByGqids(gqlist);
@@ -717,6 +725,7 @@ public class MainCtl extends BaseWebCtl {
 		if (isJyr()) {
 			list = jsjdbgdsService.findByJyrids(getSsjyr().getId());
 		} else {
+			@SuppressWarnings("unchecked")
 			List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 			if (gqlist != null && gqlist.size() > 0) {
 				list = jsjdbgdsService.findByGqids(gqlist);
@@ -801,6 +810,7 @@ public class MainCtl extends BaseWebCtl {
 		if (isJyr()) {
 			list = jgsqdsService.findByJyrids(getSsjyr().getId());
 		} else {
+			@SuppressWarnings("unchecked")
 			List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 			if (gqlist != null && gqlist.size() > 0) {
 				list = jgsqdsService.findByGqids(gqlist);
@@ -925,6 +935,7 @@ public class MainCtl extends BaseWebCtl {
 		if (isJyr()) {
 			list = xkzsqService.findByJyrids(getSsjyr().getId());
 		} else {
+			@SuppressWarnings("unchecked")
 			List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 			if (gqlist != null && gqlist.size() > 0) {
 				list = xkzsqService.findByGqids(gqlist);
@@ -976,6 +987,7 @@ public class MainCtl extends BaseWebCtl {
 		if (isJyr()) {
 			list = xkzbgService.findByJyrids(getSsjyr().getId());
 		} else {
+			@SuppressWarnings("unchecked")
 			List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 			if (gqlist != null && gqlist.size() > 0) {
 				list = xkzbgService.findByGqids(gqlist);
@@ -1025,6 +1037,7 @@ public class MainCtl extends BaseWebCtl {
 		if (isJyr()) {
 			list = xkzyxService.findByJyrids(getSsjyr().getId());
 		} else {
+			@SuppressWarnings("unchecked")
 			List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 			if (gqlist != null && gqlist.size() > 0) {
 				list = xkzyxService.findByGqids(gqlist);
@@ -1075,6 +1088,7 @@ public class MainCtl extends BaseWebCtl {
 		if (isJyr()) {
 			list = xkzzxService.findByJyrids(getSsjyr().getId());
 		} else {
+			@SuppressWarnings("unchecked")
 			List<String> gqlist = (List<String>) Utils.getSession().getAttribute("gqList");
 			if (gqlist != null && gqlist.size() > 0) {
 				list = xkzzxService.findByGqids(gqlist);
@@ -1171,7 +1185,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 单船申报
-	public int getDcsbNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getDcsbNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
 			list = dcsbService.findByJyrid(jyrid);
@@ -1182,14 +1196,21 @@ public class MainCtl extends BaseWebCtl {
 		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) {
+					long time = new Date().getTime();
+					System.out.println(time);
+					Task task = dcsbService.getTaskByUserAndBusKey(userId, id.toString());
+//					Task task1 = dcsbService.getCandidateTaskByUserAndBusKey(userId, id.toString(),"dcsb");
+					long tempTime = new Date().getTime();
+					System.out.println(tempTime-time);
+					if (task !=null){
+//					if ((dcsbService.getTaskByUserAndBusKey(userId, id.toString()) != null) || dcsbService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), DcsbEntity.PROCESS_DEFINITION_KEY);
 						if (lists != null & lists.size() > 0) {
 							sum++;
 						}
 					}
+					System.out.println(new Date().getTime()-tempTime);
 				}
 			}
 		}
@@ -1198,7 +1219,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 许可证申请
-	public int getXkzsqNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getXkzsqNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
@@ -1210,7 +1231,7 @@ public class MainCtl extends BaseWebCtl {
 		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) {
+					if ((xkzsqService.getTaskByUserAndBusKey(userId, id.toString()) != null) || xkzsqService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), XkzsqEntity.PROCESS_DEFINITION_KEY);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1224,7 +1245,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 许可证变更
-	public int getXkzbgNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getXkzbgNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
 			list = xkzbgService.findByJyrids(jyrid);
@@ -1234,7 +1255,7 @@ public class MainCtl extends BaseWebCtl {
 		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) {
+				if ((xkzbgService.getTaskByUserAndBusKey(userId, id.toString()) != null) || xkzbgService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 					List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), XkzbgEntity.PROCESS_DEFINITION_KEY);
 					if (lists != null & lists.size() > 0) {
 
@@ -1248,7 +1269,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 许可证延续
-	public int getXkzyxNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getXkzyxNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
 			list = xkzyxService.findByJyrids(jyrid);
@@ -1258,7 +1279,7 @@ public class MainCtl extends BaseWebCtl {
 		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) {
+				if ((xkzyxService.getTaskByUserAndBusKey(userId, id.toString()) != null) || xkzyxService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 					List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), XkzyxEntity.PROCESS_DEFINITION_KEY);
 					if (lists != null & lists.size() > 0) {
 						sum++;
@@ -1271,7 +1292,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 许可证注销
-	public int getXkzzxNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getXkzzxNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
 			list = xkzzxService.findByJyrids(jyrid);
@@ -1279,13 +1300,49 @@ public class MainCtl extends BaseWebCtl {
 			list = xkzzxService.findByGqids(gqids);
 		}
 		int sum = 0;
+		/*List<Task> tasks = taskService.createTaskQuery().taskAssignee(userId).list();
+		if ( tasks !=null){
+			
+		} else {
+			
+		}
+		
+		List<Task> taskList = taskService.createTaskQuery().taskCandidateUser(userId.toString()).active().list();
+		for ( Task task : taskList){
+			ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
+			String businessKey = pi.getBusinessKey();
+			System.out.println(pi.getBusinessKey());
+			if ( StringUtils.isNotEmpty(businessKey)){
+				String[] temp = businessKey.split("-");
+				if (temp.length>1){
+					if (XkzzxEntity.PROCESS_DEFINITION_KEY.equals(temp[0])){
+						for (Object object : list){
+							if ( object.toString().equals(temp[1])){
+								List<TaskInfoEntity> taskInfolist  = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(temp[1].toString(), XkzzxEntity.PROCESS_DEFINITION_KEY);
+								if (taskInfolist != null & taskInfolist.size() > 0) {
+									sum++;
+								}
+								break;
+							} else {
+								continue;
+							}
+						}
+					} else {
+						continue;
+					}
+				} else{
+					continue;
+				}
+			} else {
+				continue;
+			}
+		}*/
+		//long count = taskService.createTaskQuery().taskCandidateUser(userId.toString()).active().processDefinitionKeyLike(XkzzxEntity.PROCESS_DEFINITION_KEY+"%").count();
 		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) {
+				if ((xkzzxService.getTaskByUserAndBusKey(userId, id.toString()) != null) || xkzzxService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 					List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), XkzzxEntity.PROCESS_DEFINITION_KEY);
 					if (lists != null & lists.size() > 0) {
-
 						sum++;
 					}
 				}
@@ -1295,14 +1352,13 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 理货申请
-	public int getLhsqNum() throws JsonProcessingException {
+	public int getLhsqNum(String id) throws JsonProcessingException {
 		List<LhsqEntity> list = lhsqService.findAll();
 		int sum = 0;
 		if (list != null && list.size() > 0) {
 			for (LhsqEntity entity : list) {
-
 				if (entity != null) {
-					if ((lhsqService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || lhsqService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
+					if ((lhsqService.getTaskByUserAndBusKey(id, entity.getId().toString()) != null) || lhsqService.getCandidateTaskByUserAndBusKey(id, entity.getId().toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(), LhsqEntity.PROCESS_DEFINITION_KEY);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1316,15 +1372,14 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 理货变更
-	public int getLhbgNum() throws JsonProcessingException {
+	public int getLhbgNum(String id) throws JsonProcessingException {
 
 		List<LhbgEntity> list = lhbgService.findAll();
 		int sum = 0;
 		if (list != null && list.size() > 0) {
 			for (LhbgEntity entity : list) {
-
 				if (entity != null) {
-					if ((lhbgService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || lhbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
+					if ((lhbgService.getTaskByUserAndBusKey(id, entity.getId().toString()) != null) || lhbgService.getCandidateTaskByUserAndBusKey(id, entity.getId().toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(), LhbgEntity.PROCESS_DEFINITION_KEY);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1338,7 +1393,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 理货延续
-	public int getLhyxNum() throws JsonProcessingException {
+	public int getLhyxNum(String id) throws JsonProcessingException {
 		List<LhyxEntity> list = lhyxService.findAll();
 		int sum = 0;
 		if (list != null && list.size() > 0) {
@@ -1358,7 +1413,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 建设进度初步设计地市
-	public int getJsjdcbsjdsNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getJsjdcbsjdsNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
 			list = jsjdcbsjdsService.findByJyrids(jyrid);
@@ -1371,7 +1426,7 @@ public class MainCtl extends BaseWebCtl {
 			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) {
+					if ((jsjdcbsjdsService.getTaskByUserAndBusKey(userId, id.toString()) != null) || jsjdcbsjdsService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), JsjdcbsjEntity.PROCESS_DEFINITION_KEYDS);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1385,7 +1440,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 建设进度初步设计变更地市
-	public int getJsjdbgdsNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getJsjdbgdsNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
 			list = jsjdbgdsService.findByJyrids(jyrid);
@@ -1398,7 +1453,7 @@ public class MainCtl extends BaseWebCtl {
 			for (Object id : list) {
 
 				if (id != null) {
-					if ((jsjdbgdsService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || jsjdbgdsService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
+					if ((jsjdbgdsService.getTaskByUserAndBusKey(userId, id.toString()) != null) || jsjdbgdsService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), JsjdbgEntity.PROCESS_DEFINITION_KEYDS);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1412,7 +1467,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 竣工申请地市
-	public int getJgsqdsNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getJgsqdsNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
 			list = jgsqdsService.findByJyrids(jyrid);
@@ -1425,7 +1480,7 @@ public class MainCtl extends BaseWebCtl {
 			for (Object id : list) {
 
 				if (id != null) {
-					if ((jgsqdsService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || jgsqdsService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
+					if ((jgsqdsService.getTaskByUserAndBusKey(userId, id.toString()) != null) || jgsqdsService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), JgsqEntity.PROCESS_DEFINITION_KEYDS);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1439,7 +1494,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 建设进度初步设计
-	public int getJsjdcbsjNum() throws JsonProcessingException {
+	public int getJsjdcbsjNum(String id) throws JsonProcessingException {
 		List<JsjdcbsjEntity> list = jsjdcbsjService.findAll();
 
 		int sum = 0;
@@ -1447,7 +1502,7 @@ public class MainCtl extends BaseWebCtl {
 			for (JsjdcbsjEntity entity : list) {
 
 				if (entity != null) {
-					if ((jsjdcbsjService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || jsjdcbsjService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
+					if ((jsjdcbsjService.getTaskByUserAndBusKey(id, entity.getId().toString()) != null) || jsjdcbsjService.getCandidateTaskByUserAndBusKey(id, entity.getId().toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(), JsjdcbsjEntity.PROCESS_DEFINITION_KEY);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1461,7 +1516,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 建设进度变更
-	public int getJsjdbgNum() throws JsonProcessingException {
+	public int getJsjdbgNum(String id) throws JsonProcessingException {
 		List<JsjdbgEntity> list = jsjdbgService.findAll();
 
 		int sum = 0;
@@ -1469,7 +1524,7 @@ public class MainCtl extends BaseWebCtl {
 			for (JsjdbgEntity entity : list) {
 
 				if (entity != null) {
-					if ((jsjdbgService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || jsjdbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
+					if ((jsjdbgService.getTaskByUserAndBusKey(id, entity.getId().toString()) != null) || jsjdbgService.getCandidateTaskByUserAndBusKey(id, entity.getId().toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(), JsjdbgEntity.PROCESS_DEFINITION_KEY);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1483,14 +1538,14 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 竣工申请
-	public int getJgsqNum() throws JsonProcessingException {
+	public int getJgsqNum(String id) throws JsonProcessingException {
 		List<JgsqEntity> list = jgsqService.findAll();
 		int sum = 0;
 		if (list != null && list.size() > 0) {
 			for (JgsqEntity entity : list) {
 
 				if (entity != null) {
-					if ((jgsqService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || jgsqService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
+					if ((jgsqService.getTaskByUserAndBusKey(id, entity.getId().toString()) != null) || jgsqService.getCandidateTaskByUserAndBusKey(id, entity.getId().toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(), JgsqEntity.PROCESS_DEFINITION_KEY);
 						if (lists != null & lists.size() > 0) {
 							sum++;
@@ -1504,7 +1559,7 @@ public class MainCtl extends BaseWebCtl {
 	}
 
 	// 监督提醒申请地市
-	public int getJdtxNum(String jyrid, List<String> gqids) throws JsonProcessingException {
+	public int getJdtxNum(String userId,String jyrid, List<String> gqids) throws JsonProcessingException {
 		List<Object> list = new ArrayList<Object>();
 		if (!StringUtils.isEmpty(jyrid)) {
 			list = jdtxxxService.findByJyrid(jyrid);
@@ -1517,7 +1572,7 @@ public class MainCtl extends BaseWebCtl {
 			for (Object id : list) {
 
 				if (id != null) {
-					if ((jdtxxxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) || jdtxxxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id.toString()) != null) {
+					if ((jdtxxxService.getTaskByUserAndBusKey(userId, id.toString()) != null) || jdtxxxService.getCandidateTaskByUserAndBusKey(userId, id.toString()) != null) {
 						List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id.toString(), JdtxxxEntity.PROCESS_DEFINITION_KEY);
 						if (lists != null & lists.size() > 0) {
 							sum++;

+ 0 - 30
gkjsjy/trunk/src/com/xt/jygl/workflow/service/impl/BaseWorkFlowServiceImpl.java

@@ -1,49 +1,20 @@
 package com.xt.jygl.workflow.service.impl;
 
-import java.io.IOException;
 import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.net.SocketTimeoutException;
-import java.net.URLEncoder;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
 import java.text.ParseException;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import javax.el.MethodNotFoundException;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSocket;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
 
 import org.activiti.engine.ActivitiException;
 import org.activiti.engine.impl.pvm.delegate.ActivityExecution;
 import org.activiti.engine.task.Task;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.conn.ConnectTimeoutException;
-import org.apache.http.conn.scheme.Scheme;
-import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.conn.ssl.X509HostnameVerifier;
-import org.apache.http.entity.ContentType;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.params.CoreConnectionPNames;
-import org.apache.http.util.EntityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.Assert;
 import org.springframework.util.StringUtils;
 
-import com.xt.jygl.common.GlobalData;
 import com.xt.jygl.common.service.JyglBaseService;
 import com.xt.jygl.workflow.entity.TaskInfoEntity;
 import com.xt.jygl.workflow.param.WorkFlowParam;
@@ -51,7 +22,6 @@ import com.xt.jygl.workflow.service.BaseWorkFlowService;
 import com.xt.jygl.workflow.service.TaskInfoService;
 import com.xt.jygl.workflow.service.WorkflowMangerService;
 import com.xtframe.sec.common.BaseEntity;
-import com.xtframe.sec.user.entity.UserEntity;
 import com.xtframe.sec.utils.SecUtils;
 
 /**

+ 3 - 5
gkjsjy/trunk/src/com/xtframe/core/wf/MyGroupEntityManager.java

@@ -15,7 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.xt.jygl.common.Constants;
-import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.common.Utils;
 import com.xtframe.core.support.SecurityMgr;
 import com.xtframe.sec.role.entity.RoleEntity;
 import com.xtframe.sec.user.entity.UserEntity;
@@ -30,8 +30,6 @@ public class MyGroupEntityManager extends GroupEntityManager {
 
 	@Autowired
 	private SecurityMgr securityMgr;
-	@Autowired
-	private GqService gqService;
 
 	@Override
 	public Group createNewGroup(String groupId) {
@@ -63,12 +61,14 @@ public class MyGroupEntityManager extends GroupEntityManager {
 		throw new ActivitiException("group manager doesn't support!");
 	}
 
+	@SuppressWarnings("unchecked")
 	@Override
 	public List<Group> findGroupsByUser(String userId) {
 		// Group List
 		List<Group> groupList = new ArrayList<Group>();
 		UserEntity user = securityMgr.userService().findById(userId);
 		List<RoleEntity> list = securityMgr.roleService().findByUserId(userId);
+		List<String> gqList = (List<String>)Utils.getSession().getAttribute("gqList");
 		if (list != null && list.size() > 0) {
 			for (RoleEntity role : list) {
 				groupList.add(new GroupEntity(role.getCode()));
@@ -82,8 +82,6 @@ public class MyGroupEntityManager extends GroupEntityManager {
 					// 港口管理人员的权限设置,取得有权限的港区
 					if (Constants.NO_ID.equals(user.getSfjyr().getId())
 							&& user.getSsglbm() != null) {
-						List<String> gqList = gqService
-								.findGqListByUserId(userId);
 						if (gqList != null && gqList.size() > 0) {
 							for (String gq : gqList) {
 								groupList.add(new GroupEntity(role.getCode()