Browse Source

撤销状态增加待停用概念

hujie 1 year ago
parent
commit
a20cd6454e

+ 1 - 1
cn.com.taiji.myapp/src/main/java/cn/com/taiji/quartz/common/job/DelayRemind.java

@@ -36,7 +36,7 @@ JobDataMap中是更新后的数据,而不是更新前的旧数据。
 因为当同一个job(JobDetail)的两个实例被并发执行时,由于竞争,JobDataMap中存储的数据很可能是不确定的。
  */
 @DisallowConcurrentExecution
-public class DelayRemind implements Job{
+public class DelayRemind implements Job {
 	 private static final Logger logger = LoggerFactory
 				.getLogger(DelayRemind.class);
 	@Override

+ 49 - 0
cn.com.taiji.system/src/main/java/cn/com/taiji/zhongxiao/service/DbdcUserService.java

@@ -20,6 +20,9 @@ import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import javax.sql.DataSource;
 
+import cn.com.taiji.zhongxiao.domain.TinfoClass;
+import cn.com.taiji.zhongxiao.domain.TshareApply;
+import cn.com.taiji.zhongxiao.domain.TshareApplyRepository;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -87,6 +90,8 @@ public class DbdcUserService {
 	@Inject
 	RoleMenuRepository roleMenuRepository;
 	@Inject
+	TshareApplyRepository tshareApplyRepository;
+	@Inject
 	MenuRepository menuRepository;
 	@Value("${xsjpg_roleid}")
 	private String xsjpg_roleid;
@@ -594,6 +599,7 @@ public class DbdcUserService {
 		boolean flag = false;
 		boolean flag_bmsh_role = false;
 		boolean flag_zgbmsh_role = false;
+		boolean flag_zgbmgl_role = false;
 		for (Role role : serRole) {
 			if (admin_id.equals(role.getRoleId())) {
 				flag = true;
@@ -604,6 +610,9 @@ public class DbdcUserService {
 			if (zgbmsh_role.equals(role.getRoleId())) {
 				flag_zgbmsh_role = true;
 			}
+			if (zgbmgl_role.equals(role.getRoleId())) {
+				flag_zgbmgl_role = true;
+			}
 		}
 		String deptids = "";
 		String xzqhcodes = "";
@@ -870,6 +879,46 @@ public class DbdcUserService {
 				if(ty.get("ZS")!=null&&!"0".equals(String.valueOf(ty.get("ZS"))))
 				infolist.add(resultMapa);
 			}
+			if (flag_zgbmgl_role || flag) {
+				// 到期未停用
+				List<TshareApply> tshareApplyList = tshareApplyRepository.findAll(new Specification<TshareApply>() {
+					  @Override
+					  public Predicate toPredicate(Root<TshareApply> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
+						  List<Predicate> pl = new ArrayList<Predicate>();
+						  pl.add(cb.isNull(root.get("isrevoke")));
+						  pl.add(cb.equal(root.<String>get("state"), "2"));
+						  pl.add(cb.equal(root.<String>get("actualize"), "2"));
+						  return cb.and(pl.toArray(new Predicate[0]));
+					  }
+				  });
+				Map resultMapa = new HashMap<String, Object>();
+				resultMapa.put("info", "您有<font color=\"red\">" + tshareApplyList.size()
+						+ "</font>个共享申请任务已到期,共享任务需停止,请到<a href-name=\"共享备案\" href-url=\"/tshareApply/tshareApply_balist\"> <font color=\"green\">数据共享管理-> 共享备案</font></a> 功能模块进行操作。");
+				resultMapa.put("message", tshareApplyList.size() + "个共享任务需要停止");
+				resultMapa.put("count", tshareApplyList.size());
+				if (tshareApplyList.size() > 0) {
+					infolist.add(resultMapa);
+				}
+				// 撤销未停用
+				tshareApplyList = tshareApplyRepository.findAll(new Specification<TshareApply>() {
+					@Override
+					public Predicate toPredicate(Root<TshareApply> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
+						List<Predicate> pl = new ArrayList<Predicate>();
+						pl.add(cb.isNotNull(root.get("isrevoke")));
+						pl.add(cb.equal(root.<String>get("state"), "2"));
+						pl.add(cb.equal(root.<String>get("actualize"), "2"));
+						return cb.and(pl.toArray(new Predicate[0]));
+					}
+				});
+				resultMapa = new HashMap<String, Object>();
+				resultMapa.put("info", "您有<font color=\"red\">" + tshareApplyList.size()
+						+ "</font>个共享申请任务撤销,共享任务需停止,请到<a href-name=\"共享备案\" href-url=\"/tshareApply/tshareApply_balist\"> <font color=\"green\">数据共享管理-> 共享备案</font></a> 功能模块进行操作。");
+				resultMapa.put("message", tshareApplyList.size() + "个共享任务需要停止");
+				resultMapa.put("count", tshareApplyList.size());
+				if (tshareApplyList.size() > 0) {
+					infolist.add(resultMapa);
+				}
+			}
 	        List<Map<String, Object>> hasPerssion = jdbcTemplate.queryForList("select m.menu_id from role_user p,ROLE_MENU q,menu m where p.user_id=? and p.ROLE_ID=q.role_id and m.menu_id=q.menu_id and m.MENU_URL=?", new Object[]{userInfo.getUserId(), "/tinfoclass/tinfoclass_hitchImplement"});
 	        if(hasPerssion!=null&&hasPerssion.size()>0) {
 	        	Map ty = jdbcTemplate.queryForMap("select count(1) ZS from t_infoclass where HITCH_STATUS=1 and inprocess='2' and latestversion='1' and  (implementation_state=0 or implementation_state is null)", new Object[] {});

+ 8 - 1
cn.com.taiji.system/src/main/java/cn/com/taiji/zhongxiao/web/TshareApplyController.java

@@ -471,10 +471,16 @@ public class TshareApplyController extends BaseAction{
 			  				dto.setActualize("-1");
 			  				dto.setState("2");
 			  			}
-			  			else if("isrevoke".equals(dto.getState())) {
+			  			else if("已撤销(待停用)".equals(dto.getState())) {
 			  				dto.setIsrevoke("0");
 				  			dto.setState("2");
+							dto.setActualize("2");
 				  		}
+						else if("已撤销(已停用)".equals(dto.getState())) {
+							dto.setIsrevoke("0");
+							dto.setState("2");
+							dto.setActualize("3");
+						}
 						else if("过期待停用".equals(dto.getState())) {
 							dto.setActualize("2");
 							dto.setState("2");
@@ -681,6 +687,7 @@ public class TshareApplyController extends BaseAction{
     	    TshareApplyDto tshareApply =  tshareApplyService.byone(id);
     	    //改成已撤销
     	    tshareApply.setIsrevoke("0");
+			tshareApply.setActualize("2");
     	    tshareApply.setRevoketime(ToolUtil.date2Str(new Date(), "yyyy-MM-dd"));
     	    tshareApplyService.TshareApplysave(tshareApply);
             map.put("remark", "success");

+ 9 - 6
cn.com.taiji.system/src/main/resources/static/theme/tshareapply/tshareapply_balist.js

@@ -52,11 +52,15 @@
         		return '保存';
         	}else if(res.state=='1'){
         		return '审核中'+ res.taskname;
-        	}else if(res.state=='2'){
-        		if(res.isrevoke=='0'){
-        			return '审核通过(已撤销)';
+        	}else if(res.state=='2') {
+        		if(res.isrevoke=='0') {
+				 	if(res.actualize=='3') {
+						return '已撤销(已停用)' + know;
+					} else {
+						return '已撤销(待停用)'+know;
+					}
         		}
-        		if(res.actualize=='0'){
+				else if (res.actualize=='0'){
         			return '审核通过(未实施)'+know;
         		}
         		else if(res.actualize=='1'){
@@ -71,8 +75,7 @@
         		else{
         			return '审核通过(待派发)'+know;
         		}
-        		
-        	}else if(res.state=='3'){
+        	}else if(res.state=='3') {
         		return '审核不通过';
         	}
          }}

+ 2 - 1
cn.com.taiji.system/src/main/resources/templates/thymeleaf/tshareapply/tshareapply_balist.html

@@ -105,7 +105,8 @@
                 <option value="未实施">未实施</option>
 				  <option value="过期待停用">过期待停用</option>
 				  <option value="过期已停用">过期已停用</option>
-                <option value="isrevoke">已撤销</option>
+                <option value="已撤销(待停用)">已撤销(待停用)</option>
+				  <option value="已撤销(已停用)">已撤销(已停用)</option>
               </select>
             </div>
           </div>