diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/PublisherController.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/PublisherController.java index 2c08c86b..ac422a10 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/PublisherController.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/PublisherController.java @@ -792,7 +792,6 @@ public class PublisherController { return publishWeb.getLevelByData(me, wsId, type, datas, processInstId); } - /** * 根据矩阵信息查询审批信息 * @@ -945,4 +944,10 @@ public class PublisherController { ProcessPublishWeb web = new ProcessPublishWeb(me); return web.createProcessTermination(palUUID,processDefId); } + + @Mapping("com.actionsoft.apps.coe.pal.publisher.getEditPalByUserId") + public String getEditPalByUserId(UserContext me,String type){ + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.getEditPalByUserId(type); + } } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java index 5bc31aef..e8a86160 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java @@ -5013,11 +5013,24 @@ public class ProcessPublishWeb extends ActionWeb { * @return */ public String createProcessTermination(String palUUID,String processDefId) { + //需要先判断是否有发布状态的版本,有则允许发布,否则提醒 ResponseObject responseObject = ResponseObject.newOkResponse(); + PALRepositoryModel thisModel = PALRepositoryCache.getCache().get(palUUID); + if (!thisModel.isPublish()) {//如果不是发布状态的 + List list = PALRepositoryCache.getByPlRid(thisModel.getPlRid()); + List publishList = list.stream() + .filter(PALRepositoryModel::isPublish) + .collect(Collectors.toList()); + if(publishList.isEmpty()){//整个pal组都是未发布的 + responseObject.err("本文件暂未发布,无需废止"); + return responseObject.toString(); + }else{ + thisModel = publishList.get(0);//换成这个发布的 + } + } String optionType = "流程制度废止"; String subBoName = "BO_ACT_COE_PUBLISH_S"; //获取文件属性 - PALRepositoryModel thisModel = PALRepositoryCache.getCache().get(palUUID); ProcessInstance processInstance = SDK.getProcessAPI().createProcessInstance(processDefId, _uc.getUID(), _uc.getUserName()+"发起流程发布流程"); BO bo =new BO(); BO subBO =new BO(); @@ -5054,4 +5067,65 @@ public class ProcessPublishWeb extends ActionWeb { bo.set("LEVEL_4_PROCESS_NAME",l4_name); } + /** + * 获取当前人最近编辑的前十条记录 + * @return + */ + public String getEditPalByUserId(String type){ + boolean oracle = SDK.getConfAPI().isOracle(); + String uid = _uc.getUID(); + String querySql =""; + if(type.equals("new")){ + //查询个人编辑的前十条记录 (mysql 语法) + querySql = "SELECT \n" + + " * \n" + + "FROM \n" + + " APP_ACT_COE_PAL_REPOSITORY A \n" + + "WHERE \n" + + " MODIFYUSER = ? \n" + + " AND isPublish = 0 \n" + + " AND PLMETHODID != 'default' \n" + + " AND NOT EXISTS ( \n" + + " SELECT \n" + + " 1 \n" + + " FROM \n" + + " APP_ACT_COE_PAL_REPOSITORY B \n" + + " WHERE \n" + + " B.PLRID = A.PLRID \n" + + " AND B.isPublish = 1 \n" + + " ) \n" + + "ORDER BY \n" + + " MODIFYDATE DESC \n"; + }else if(type.equals("change")){ + querySql = "SELECT a.* " + + "FROM APP_ACT_COE_PAL_REPOSITORY a " + + "WHERE a.isPublish = 1 " + + " AND EXISTS ( " + + " SELECT 1 " + + " FROM APP_ACT_COE_PAL_REPOSITORY b " + + " WHERE b.PLRID = a.PLRID " + + " AND b.isPublish = 0 " + + " )" + + " AND a.MODIFYUSER = ?" + + " AND a.PLMETHODID !='default'" + + " ORDER BY MODIFYDATE DESC"; + }else if(type.equals("change")){ + querySql = "SELECT a.* " + + "FROM APP_ACT_COE_PAL_REPOSITORY a " + + "WHERE a.isPublish = 1 " + + " AND a.MODIFYUSER = ?" + + " AND a.PLMETHODID !='default'" + + " ORDER BY MODIFYDATE DESC"; + } + if(oracle){ + querySql += " FETCH FIRST 10 ROWS ONLY"; + }else{ + querySql += " LIMIT 10 "; + } + List maps = DBSql.getMaps(querySql, new Object[]{uid}); + JSONArray list = (JSONArray) JSONArray.toJSON(maps); + ResponseObject ro = ResponseObject.newOkResponse(); + ro.put("list",list); + return ro.toString(); + } } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js index 580db539..9954300b 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js @@ -184,6 +184,81 @@ function initOptButton() { } } +function initHistoryInfo(type){ + var param = { + sid : sid, + type: type, + cmd : "com.actionsoft.apps.coe.pal.publisher.getEditPalByUserId" + } + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + data : param, + async: false, + success : function(r) { + debugger; + if (r.result == 'ok') { + debugger; + //需要先删除缓存 + $('[data-id="historyInfo"]').remove(); + $("#historyInfo").removeData('plugin_awsuiPopBox'); + $.data( $("#historyInfo"), 'plugin_awsuiPopBox',undefined); + $("#historyInfo").popBox({ + cache:false, + title:'我编辑的文件', + content: initContentHtml(r.data.list), + position:'bottom-left', + callback:function(item){ + debugger; + $("input[name='historyCheckBox']") + $("input[name='historyCheckBox']").check(); + $("input[name='historyCheckBox']").on("ifChanged",function(){ + debugger; + var historyCheckBoxArr = $('input[name="historyCheckBox"]:checked'); + var names = ''; + var nodes = []; + for (var i = 0; i < historyCheckBoxArr.size(); i++) { + var node = {}; + node.category = $(historyCheckBoxArr[i]).attr("pcategory"); + node.method = $(historyCheckBoxArr[i]).attr("pmethod"); + node.tempName = $(historyCheckBoxArr[i]).attr("ptempName"); + node.id = $(historyCheckBoxArr[i]).attr("pid"); + node.version = $(historyCheckBoxArr[i]).attr("pversion"); + nodes.push(node) + names += $(historyCheckBoxArr[i]).attr("plname"); + if (i < historyCheckBoxArr.size() - 1) { + names += ','; + } + } + $('#publisher_dialog_name').val(names); + if(searchType === "new"){ + getNewPublishBatchResult(searchType,nodes); + }else if(searchType === "change"){ + getChangeBatchResult(searchType,nodes); + }else if(searchType === "stop"){ + getStopBatchResult(searchType,nodes); + } + + + }); + } + }); + + } + } + }); +} +function initContentHtml(obj){ + var checkHtml = ''; + obj.forEach(function(model, index) { + checkHtml += '

'; + checkHtml += ''; + checkHtml += ''; + }); + return checkHtml; +} + // 初始化自定义内容,不能写到html 文件中,表单会被平台自动调整的不成样子 function initHtml() { var dialogHtml = ''; @@ -200,6 +275,7 @@ function initHtml() { dialogHtml += ''; dialogHtml += ''; dialogHtml += ''; + dialogHtml += ''; dialogHtml += ''; dialogHtml += ''; dialogHtml += '

'; @@ -239,7 +315,19 @@ function initHtml() { dialogHtml += '