流程发布-保存前校验修改
This commit is contained in:
parent
79f24052db
commit
bf66607edb
@ -183,7 +183,7 @@ public class ProcesNumberUtil {
|
||||
String updateSql = "update BO_ACT_COE_PUBLISH_C set CHANGE_NUMBER = '%s' where ID = '%s'";
|
||||
rowMap = DBSql.getMap("SELECT PLVER,PLMETHODID FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"
|
||||
+ changAfterFileId + "' AND" + " ISUSE = 1 ");
|
||||
String name = "18R18";
|
||||
String name = "";
|
||||
String fileName = "file_number";
|
||||
String plver = "2.0";
|
||||
if (rowMap != null) {
|
||||
|
||||
@ -3407,78 +3407,100 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验发布相关数据是否在其它未办理完成的表单中存在
|
||||
* 只要有相同versionId的流程存在未办理情况,即校验不通过
|
||||
*/
|
||||
private void validPublisData(HashSet<String> set, String processInstId, String wsId, JSONArray array) {
|
||||
if (set.isEmpty()) return;
|
||||
Set<String> filter = new HashSet<>();
|
||||
List<BO> list = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH").addQuery("ISEND =", 0).list();
|
||||
if (list != null && list.size() > 0)
|
||||
/**
|
||||
* 校验发布相关数据是否在其它未办理完成的表单中存在 只要有相同versionId的流程存在未办理情况,即校验不通过
|
||||
*/
|
||||
private void validPublisData(HashSet<String> set, String processInstId, String wsId, JSONArray array) {
|
||||
if (set.isEmpty())
|
||||
return;
|
||||
Set<String> filter = new HashSet<>();
|
||||
List<BO> list = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH").addQuery("ISEND =", 0).list();
|
||||
if (list != null && list.size() > 0)
|
||||
for (BO bo : list) {
|
||||
if (bo.getBindId().equals(processInstId))
|
||||
ProcessInstance instanceById = SDK.getProcessAPI().getInstanceById(bo.getBindId());
|
||||
System.err.println("--------instanceById-------"+instanceById);
|
||||
if (instanceById != null) {
|
||||
if ("terminate".equals(instanceById.getControlState())) {
|
||||
continue;
|
||||
}
|
||||
TaskInstance instance = SDK.getTaskAPI().getInstanceById(instanceById.getStartTaskInstId());
|
||||
if (instance != null) {
|
||||
String controlState = instance.getControlState();
|
||||
if (!"complete".equals(controlState))
|
||||
continue;
|
||||
}
|
||||
|
||||
}else {
|
||||
continue;
|
||||
// 获取三个子表
|
||||
{// 发布表
|
||||
BO newBo = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N").detailByBindId(bo.getBindId());
|
||||
if (newBo != null) {
|
||||
PALRepositoryModel temp1 = PALRepositoryCache.getCache().get(newBo.getString("PUBLISHFILEID"));
|
||||
if (temp1 != null) {
|
||||
List<PALRepositoryModel> list1 = PALRepositoryCache.getByVersionId(wsId, temp1.getVersionId());
|
||||
for (PALRepositoryModel model : list1)
|
||||
}
|
||||
|
||||
if (bo.getBindId().equals(processInstId))
|
||||
continue;
|
||||
|
||||
// 获取三个子表
|
||||
{// 发布表
|
||||
BO newBo = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N").detailByBindId(bo.getBindId());
|
||||
if (newBo != null) {
|
||||
PALRepositoryModel temp1 = PALRepositoryCache.getCache().get(newBo.getString("PUBLISHFILEID"));
|
||||
if (temp1 != null) {
|
||||
List<PALRepositoryModel> list1 = PALRepositoryCache.getByVersionId(wsId,
|
||||
temp1.getVersionId());
|
||||
for (PALRepositoryModel model : list1)
|
||||
if (set.contains(model.getId()) && !filter.contains(model.getId())) {
|
||||
// 存在未办理完成的表单
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", "new");
|
||||
obj.put("id", model.getId());
|
||||
obj.put("name", model.getName());
|
||||
obj.put("version", VersionUtil.getVersionStr(model.getVersion()));
|
||||
array.add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{// 变更表
|
||||
BO changeBo = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C").detailByBindId(bo.getBindId());
|
||||
if (changeBo != null) {
|
||||
PALRepositoryModel temp2 = PALRepositoryCache.getCache().get(changeBo.getString("CHANGEFILEID"));
|
||||
if (temp2 != null) {
|
||||
List<PALRepositoryModel> list1 = PALRepositoryCache.getByVersionId(wsId, temp2.getVersionId());
|
||||
for (PALRepositoryModel model : list1)
|
||||
// 存在未办理完成的表单
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", "new");
|
||||
obj.put("id", model.getId());
|
||||
obj.put("name", model.getName());
|
||||
obj.put("version", VersionUtil.getVersionStr(model.getVersion()));
|
||||
array.add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{// 变更表
|
||||
BO changeBo = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C").detailByBindId(bo.getBindId());
|
||||
if (changeBo != null) {
|
||||
PALRepositoryModel temp2 = PALRepositoryCache.getCache()
|
||||
.get(changeBo.getString("CHANGEFILEID"));
|
||||
if (temp2 != null) {
|
||||
List<PALRepositoryModel> list1 = PALRepositoryCache.getByVersionId(wsId,
|
||||
temp2.getVersionId());
|
||||
for (PALRepositoryModel model : list1)
|
||||
if (set.contains(model.getId()) && !filter.contains(model.getId())) {
|
||||
// 存在未办理完成的表单
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", "change");
|
||||
obj.put("id", model.getId());
|
||||
obj.put("name", model.getName());
|
||||
obj.put("version", VersionUtil.getVersionStr(model.getVersion()));
|
||||
array.add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{// 停用表
|
||||
BO stopBo = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_S").detailByBindId(bo.getBindId());
|
||||
if (stopBo != null) {
|
||||
PALRepositoryModel temp3 = PALRepositoryCache.getCache().get(stopBo.getString("STOPFILEID"));
|
||||
if (temp3 != null) {
|
||||
List<PALRepositoryModel> list1 = PALRepositoryCache.getByVersionId(wsId, temp3.getVersionId());
|
||||
for (PALRepositoryModel model : list1)
|
||||
// 存在未办理完成的表单
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", "change");
|
||||
obj.put("id", model.getId());
|
||||
obj.put("name", model.getName());
|
||||
obj.put("version", VersionUtil.getVersionStr(model.getVersion()));
|
||||
array.add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{// 停用表
|
||||
BO stopBo = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_S").detailByBindId(bo.getBindId());
|
||||
if (stopBo != null) {
|
||||
PALRepositoryModel temp3 = PALRepositoryCache.getCache().get(stopBo.getString("STOPFILEID"));
|
||||
if (temp3 != null) {
|
||||
List<PALRepositoryModel> list1 = PALRepositoryCache.getByVersionId(wsId,
|
||||
temp3.getVersionId());
|
||||
for (PALRepositoryModel model : list1)
|
||||
if (set.contains(model.getId()) && !filter.contains(model.getId())) {
|
||||
// 存在未办理完成的表单
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", "stop");
|
||||
obj.put("id", model.getId());
|
||||
obj.put("name", model.getName());
|
||||
obj.put("version", VersionUtil.getVersionStr(model.getVersion()));
|
||||
array.add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 存在未办理完成的表单
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("type", "stop");
|
||||
obj.put("id", model.getId());
|
||||
obj.put("name", model.getName());
|
||||
obj.put("version", VersionUtil.getVersionStr(model.getVersion()));
|
||||
array.add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单保存/办理前执行(批量)
|
||||
|
||||
@ -2010,6 +2010,8 @@ function dealPublishCheck(isCheck, type) {
|
||||
|
||||
// 单独保存子表操作
|
||||
function saveFormData(type) {
|
||||
alert(1111111)
|
||||
debugger
|
||||
$.simpleAlert('正在保存', 'loading');
|
||||
var saveData = [];
|
||||
if (type == 'new') {
|
||||
@ -2040,7 +2042,7 @@ function saveFormData(type) {
|
||||
data : param,
|
||||
success : function(r) {
|
||||
if (r.result == 'error') {
|
||||
flag = false;
|
||||
flag = true;
|
||||
tempData = r.data.data;
|
||||
}
|
||||
},
|
||||
@ -2049,6 +2051,7 @@ function saveFormData(type) {
|
||||
}
|
||||
});
|
||||
$.simpleAlert('close');
|
||||
debugger
|
||||
if (flag) {
|
||||
var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
|
||||
if (tempData.length > 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user