附件校验优化
This commit is contained in:
parent
c28416e7ab
commit
72271b8059
Binary file not shown.
@ -2610,19 +2610,30 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
//获取文件属性中支持文件
|
||||
if(propertyModel.getPropertyId().equals("support_files")){
|
||||
String relationFileId=JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId");
|
||||
String[] splitRelationFileId;
|
||||
if(relationFileId!=null){
|
||||
splitRelationFileId=relationFileId.split(",");
|
||||
//获取关联表单模型id
|
||||
List<Map<String, Object>> fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[0]);
|
||||
String[] splitRelationFileId = new String[0];
|
||||
//获取关联表单模型id
|
||||
List<Map<String, Object>> fileElements;
|
||||
if(UtilString.isNotEmpty(relationFileId)){
|
||||
if(relationFileId.contains(",")){
|
||||
splitRelationFileId=relationFileId.split(",");
|
||||
fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[0]);
|
||||
}else{
|
||||
fileElements = CoeDesignerUtil.getShapeMessageJson4(relationFileId);
|
||||
}
|
||||
for (Map<String, Object> shape : fileElements) {
|
||||
String tempShapeId = shape.get("id").toString();
|
||||
|
||||
UpFileDao dao = new UpFileDao();
|
||||
// 文件:根据relationFileId 和 文件类型 查询
|
||||
List<UpfileModel> list2 = dao.search(splitRelationFileId[0], tempShapeId, "s");
|
||||
List<UpfileModel> list2;
|
||||
if(relationFileId.contains(",")){
|
||||
list2= dao.search(splitRelationFileId[0], tempShapeId, "s");
|
||||
}else{
|
||||
list2= dao.search(relationFileId, tempShapeId, "s");
|
||||
}
|
||||
|
||||
if(list2.size()==0){
|
||||
sb.append("模型名称:").append(shape.get("plName")).append("中节点名称:").append("'"+shape.get("name")+"'").append("未上传附件,请检查").append(",").append("</br>");
|
||||
sb.append("模型名称:").append(shape.get("plName")).append("</br>").append("节点名称:").append("'"+shape.get("name")+"'").append("未上传附件,请检查").append(",").append("</br>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import com.actionsoft.bpms.bpmn.engine.listener.InterruptListener;
|
||||
import com.actionsoft.bpms.bpmn.engine.listener.InterruptListenerInterface;
|
||||
import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.exception.AWSException;
|
||||
import com.actionsoft.exception.BPMNError;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
@ -65,19 +66,30 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
|
||||
//获取文件属性中支持文件
|
||||
if(propertyModel.getPropertyId().equals("support_files")){
|
||||
String relationFileId=JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId");
|
||||
String[] splitRelationFileId;
|
||||
if(relationFileId!=null){
|
||||
splitRelationFileId=relationFileId.split(",");
|
||||
//获取关联表单模型id
|
||||
List<Map<String, Object>> fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[0]);
|
||||
String[] splitRelationFileId = new String[0];
|
||||
//获取关联表单模型id
|
||||
List<Map<String, Object>> fileElements;
|
||||
if(UtilString.isNotEmpty(relationFileId)){
|
||||
if(relationFileId.contains(",")){
|
||||
splitRelationFileId=relationFileId.split(",");
|
||||
fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[0]);
|
||||
}else{
|
||||
fileElements = CoeDesignerUtil.getShapeMessageJson4(relationFileId);
|
||||
}
|
||||
for (Map<String, Object> shape : fileElements) {
|
||||
String tempShapeId = shape.get("id").toString();
|
||||
|
||||
UpFileDao dao = new UpFileDao();
|
||||
// 文件:根据relationFileId 和 文件类型 查询
|
||||
List<UpfileModel> list2 = dao.search(splitRelationFileId[0], tempShapeId, "s");
|
||||
List<UpfileModel> list2;
|
||||
if(relationFileId.contains(",")){
|
||||
list2= dao.search(splitRelationFileId[0], tempShapeId, "s");
|
||||
}else{
|
||||
list2= dao.search(relationFileId, tempShapeId, "s");
|
||||
}
|
||||
|
||||
if(list2.size()==0){
|
||||
sb.append("模型名称:").append(shape.get("plName")).append("中节点名称:").append("'"+shape.get("name")+"'").append("未上传附件,请检查").append(",");
|
||||
sb.append("模型名称:").append(shape.get("plName")).append("</br>").append("节点名称:").append("'"+shape.get("name")+"'").append("未上传附件,请检查").append(",").append("</br>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user