获取wsid/版本更新校验伴随发布
This commit is contained in:
parent
598976016d
commit
23bc93931d
Binary file not shown.
@ -500,6 +500,23 @@ public class PublisherController {
|
||||
return web.queryMaPublishTreeData(type, wsId, teamId, flag, pid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据当前环境返回wsid
|
||||
* @param me
|
||||
* @param type new change stop
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.publisher_publish_getWsId")
|
||||
public String queryMaPublishTreeData(UserContext me) {
|
||||
ProcessPublishWeb web = new ProcessPublishWeb(me);
|
||||
return web.queryMaPublishGetWsId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 快速查询定位到需要的发布流程
|
||||
*
|
||||
|
||||
@ -2117,6 +2117,29 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据当前许可环境获取当前wsid
|
||||
* @return
|
||||
*/
|
||||
public String queryMaPublishGetWsId(){
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
String wsId = null;
|
||||
boolean dev = Quota.isDEV();
|
||||
if(dev==true){
|
||||
wsId="0285ff6a-e418-4d8b-a5b1-22240296f769";
|
||||
}
|
||||
boolean prd=Quota.isPRD();
|
||||
if(prd==true){
|
||||
wsId="7d3ca852-a0bd-42e6-80b1-3dcea6f55083";
|
||||
}
|
||||
boolean qas=Quota.isQAS();
|
||||
if(qas==true){
|
||||
wsId="7d3ca852-a0bd-42e6-80b1-3dcea6f55083";
|
||||
}
|
||||
ro.put("wsId", wsId);
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 快速查询定位树节点
|
||||
*
|
||||
|
||||
@ -43,12 +43,12 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
|
||||
@Override
|
||||
public boolean execute(ProcessExecutionContext param) throws Exception {
|
||||
|
||||
List<BO> gridData=SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(param.getProcessInstance().getId()).list();
|
||||
List<BO> gridNData=SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(param.getProcessInstance().getId()).list();
|
||||
String bindid=param.getProcessInstance().getId();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb1 = new StringBuilder();
|
||||
if (gridData.size() > 0) {
|
||||
for (BO rowData : gridData) {
|
||||
if (gridNData.size() > 0) {
|
||||
for (BO rowData : gridNData) {
|
||||
//下面一行示例代码,可以获取Ajax子表的每行记录的新建状态
|
||||
String publishfileid = String.valueOf(rowData.getString("PUBLISHFILEID"));//注意:isCreate并不是BO的一个字段,该字段是有接口上层赋值的
|
||||
|
||||
@ -117,9 +117,87 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
|
||||
sb1 = sb.deleteCharAt(sb.length() - 1);
|
||||
throw new BPMNError("0313", sb1.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//发布变更
|
||||
List<BO> gridCData=SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(param.getProcessInstance().getId()).list();
|
||||
StringBuilder sb2 = new StringBuilder();
|
||||
StringBuilder sb3 = new StringBuilder();
|
||||
if (gridCData.size() > 0) {
|
||||
for (BO rowData : gridCData) {
|
||||
//下面一行示例代码,可以获取Ajax子表的每行记录的新建状态
|
||||
String publishfileid = String.valueOf(rowData.getString("CHANGEDFILEIDNEW"));//注意:isCreate并不是BO的一个字段,该字段是有接口上层赋值的
|
||||
|
||||
// 校验
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(publishfileid);
|
||||
if (model == null) {
|
||||
throw new AWSException("没有找到文件:" + publishfileid);
|
||||
}
|
||||
PALRepositoryPropertyDao repositoryPropertyDao = new PALRepositoryPropertyDao();
|
||||
List<PALRepositoryPropertyModel> oldPropertyList = repositoryPropertyDao.getPropertysByPlid(publishfileid, "");
|
||||
if (oldPropertyList != null && oldPropertyList.size() > 0) {
|
||||
for (PALRepositoryPropertyModel propertyModel : oldPropertyList) {
|
||||
|
||||
//获取文件属性中支持文件
|
||||
if(propertyModel.getPropertyId().equals("support_files")){
|
||||
String relationFileId=JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId");
|
||||
String[] splitRelationFileId = new String[0];
|
||||
//获取关联表单模型id
|
||||
List<Map<String, Object>> fileElements;
|
||||
if(UtilString.isNotEmpty(relationFileId)){
|
||||
RowMap rerowMap= DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=?",relationFileId);
|
||||
|
||||
if(relationFileId.contains(",")){
|
||||
splitRelationFileId=relationFileId.split(",");
|
||||
fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[0]);
|
||||
|
||||
RowMap rowMap=DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_C T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.CHANGEDFILEIDNEW=T2.ID WHERE T1.BINDID=? AND T1.CHANGEDFILEIDNEW=? AND T2.ISPUBLISH=0",bindid,splitRelationFileId[0]);
|
||||
if(rowMap==null) {
|
||||
sb2.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(rerowMap.getString("PLNAME")).append("需进行选择发布!").append("</br>");
|
||||
}
|
||||
|
||||
}else{
|
||||
fileElements = CoeDesignerUtil.getShapeMessageJson4(relationFileId);
|
||||
|
||||
RowMap rowMap=DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_C T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.CHANGEDFILEIDNEW=T2.ID WHERE T1.BINDID=? AND T1.CHANGEDFILEIDNEW=? AND T2.ISPUBLISH=0",bindid,relationFileId);
|
||||
if(rowMap==null) {
|
||||
sb2.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(rerowMap.getString("PLNAME")).append("需进行选择发布!").append("</br>");
|
||||
}
|
||||
}
|
||||
|
||||
for (Map<String, Object> shape : fileElements) {
|
||||
String tempShapeId = shape.get("id").toString();
|
||||
|
||||
|
||||
UpFileDao dao = new UpFileDao();
|
||||
// 文件:根据relationFileId 和 文件类型 查询
|
||||
List<UpfileModel> list2;
|
||||
if(relationFileId.contains(",")){
|
||||
list2= dao.search(splitRelationFileId[0], tempShapeId, "s");
|
||||
}else{
|
||||
list2= dao.search(relationFileId, tempShapeId, "s");
|
||||
}
|
||||
|
||||
if(list2.size()==0){
|
||||
sb2.append(rowData.getString("PUBLISHFILENAME")).append("关联模型名称:").append("【").append(shape.get("plName")).append("】").append("节点名称:").append("【"+shape.get("name")+"】").append("未上传附件,请检查!!!").append(",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (sb2.length() > 0) {
|
||||
sb3 = sb2.deleteCharAt(sb2.length() - 1);
|
||||
throw new BPMNError("0313", sb3.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ var stopPageSetting = {
|
||||
}
|
||||
var isHighSecurity;
|
||||
$(document).ready(function(){
|
||||
getWsId();
|
||||
$('td,th').css('padding-top','0px');
|
||||
$('td,th').css('padding-bottom','0px');
|
||||
// $('#alertMsg').css('background', '#fff');
|
||||
@ -49,9 +50,31 @@ $(document).ready(function(){
|
||||
initPagination();// 初始化页码
|
||||
initOptButton();
|
||||
// listenCloseEvent();// 关闭窗口执行,关闭窗口/刷新都会造成流程实例被删除,注释掉
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
//获取wsid
|
||||
function getWsId() {
|
||||
var param = {
|
||||
sid : $("#sid").val(),
|
||||
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_getWsId"
|
||||
}
|
||||
$.ajax({
|
||||
url : "./jd",
|
||||
type : "POST",
|
||||
dataType : "JSON",
|
||||
data : param,
|
||||
success : function(r) {
|
||||
if (r.result == 'ok') {
|
||||
var wsId=$("#WSID").val();
|
||||
if(wsId==""){
|
||||
$("#WSID").val(r.data.wsId);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var paginationSetting = {
|
||||
pageLimit: pageLimit,
|
||||
showItem: 10,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user