普通用户不允许删除已发布文件
This commit is contained in:
parent
5e099e480d
commit
22dcfe7a0e
@ -347,10 +347,12 @@ public class Report1Gener {
|
|||||||
indexOf2 = fileNamel.indexOf(":");
|
indexOf2 = fileNamel.indexOf(":");
|
||||||
}
|
}
|
||||||
String numberStr = fileNamel.substring(2,indexOf2);
|
String numberStr = fileNamel.substring(2,indexOf2);
|
||||||
if(isNumeric(numberStr)) {
|
if(isNumeric(numberStr)&&UtilString.isNotEmpty(numberStr)) {
|
||||||
isNumberAscArray.add("true");
|
isNumberAscArray.add("true");
|
||||||
int fileNumber = Integer.parseInt(numberStr);
|
int fileNumber = Integer.parseInt(numberStr);
|
||||||
object.put("file_number", fileNumber);
|
object.put("file_number", fileNumber);
|
||||||
|
}else {
|
||||||
|
isNumberAscArray.add("false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,21 +28,21 @@ public class ApplyTaskAfterCreated extends ExecuteListener implements ExecuteLis
|
|||||||
@Override
|
@Override
|
||||||
public void execute(ProcessExecutionContext ctx) throws Exception {
|
public void execute(ProcessExecutionContext ctx) throws Exception {
|
||||||
TaskInstance taskInstance = ctx.getTaskInstance();
|
TaskInstance taskInstance = ctx.getTaskInstance();
|
||||||
if((null!=ctx.getTaskInstance()&&!"00000000-0000-0000-0000-000000000000".equals(ctx.getTaskInstance().getParentTaskInstId())||taskInstance.getTitle().contains("撤销重办"))) {
|
if((null!=ctx.getTaskInstance()&&!"00000000-0000-0000-0000-000000000000".equals(ctx.getTaskInstance().getParentTaskInstId())||taskInstance.getTitle().contains("撤销重办")||taskInstance.getTitle().contains("收回"))) {
|
||||||
SDK.getLogAPI().consoleInfo("[任务创建]任务创建,涉及流程状态取消审批中状态,退回原有状态" + ctx.getTaskInstance().getTitle());
|
SDK.getLogAPI().consoleInfo("[任务创建]任务创建,涉及流程状态取消审批中状态,退回原有状态" + ctx.getTaskInstance().getTitle());
|
||||||
ProcessStatusAPIManager.getInstance().batchUpdateApprovalStatus(ctx.getTaskInstance().getProcessInstId(), false);
|
ProcessStatusAPIManager.getInstance().batchUpdateApprovalStatus(ctx.getTaskInstance().getProcessInstId(), false);
|
||||||
}
|
}
|
||||||
if("00000000-0000-0000-0000-000000000000".equals(ctx.getTaskInstance().getParentTaskInstId())) {
|
if("00000000-0000-0000-0000-000000000000".equals(ctx.getTaskInstance().getParentTaskInstId())) {
|
||||||
BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA);
|
BO boData = (BO) ctx.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA);
|
||||||
|
BO byProcess = SDK.getBOAPI().getByProcess("BO_ACT_COE_PUBLISH", ctx.getProcessInstance().getId());
|
||||||
Object variable = SDK.getProcessAPI().getVariable(ctx.getProcessInstance(), "createType");
|
Object variable = SDK.getProcessAPI().getVariable(ctx.getProcessInstance(), "createType");
|
||||||
if(boData==null&&variable==null) {
|
if(boData==null&&variable==null&&byProcess==null) {
|
||||||
System.err.println("任务创建后执行====>");
|
createData(ctx);
|
||||||
saveData(ctx);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveData(ProcessExecutionContext ctx) {
|
public void createData(ProcessExecutionContext ctx) {
|
||||||
UserContext userContext = ctx.getUserContext();
|
UserContext userContext = ctx.getUserContext();
|
||||||
Date date=new Date();//此时date为当前的时间
|
Date date=new Date();//此时date为当前的时间
|
||||||
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置当前时间的格式,为年-月-日
|
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置当前时间的格式,为年-月-日
|
||||||
|
|||||||
@ -1164,7 +1164,22 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
|||||||
|
|
||||||
bo_Read_log.set("STARTTIMES", startTime);
|
bo_Read_log.set("STARTTIMES", startTime);
|
||||||
bo_Read_log.set("ENDTIMES", endTimes);
|
bo_Read_log.set("ENDTIMES", endTimes);
|
||||||
bo_Read_log.set("TIMECOUNT", (endTimes - startTime) / 1000 / 60 + "分钟");
|
long time = endTimes - startTime;
|
||||||
|
long diffSeconds = time / 1000 % 60;
|
||||||
|
long diffMinutes = time / (60 * 1000) % 60;
|
||||||
|
long diffHours = time / (60 * 60 * 1000) % 24;
|
||||||
|
long diffDays = time / (24 * 60 * 60 * 1000);
|
||||||
|
String remainTime ="";
|
||||||
|
if(diffDays!=0&&diffHours!=0) {
|
||||||
|
remainTime = diffDays + "天" + diffHours + "小时"+diffMinutes + "分钟"+diffSeconds + "秒";
|
||||||
|
}else if(diffDays==0&&diffHours!=0&&diffMinutes!=0){
|
||||||
|
remainTime = diffHours + "小时"+diffMinutes + "分钟"+diffSeconds + "秒";
|
||||||
|
}else if(diffDays==0&&diffHours==0&&diffMinutes!=0) {
|
||||||
|
remainTime = diffMinutes + "分钟"+diffSeconds + "秒";
|
||||||
|
}else if(diffDays==0&&diffHours==0&&diffMinutes==0) {
|
||||||
|
remainTime = diffSeconds + "秒";
|
||||||
|
}
|
||||||
|
bo_Read_log.set("TIMECOUNT",remainTime);
|
||||||
// 文件发布成功回执流程
|
// 文件发布成功回执流程
|
||||||
ProcessInstance processInst = SDK.getProcessAPI().createProcessInstance("obj_b4700f89a7a144c086d047de0cfe9531",
|
ProcessInstance processInst = SDK.getProcessAPI().createProcessInstance("obj_b4700f89a7a144c086d047de0cfe9531",
|
||||||
"admin", jsonObject.get("title") + "成功发布回执单");
|
"admin", jsonObject.get("title") + "成功发布回执单");
|
||||||
|
|||||||
@ -293,7 +293,7 @@ public class UpfileWeb extends ActionWeb {
|
|||||||
r.put("uuids", uuids);
|
r.put("uuids", uuids);
|
||||||
return r.toString();
|
return r.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除tmp目录下对应文件
|
* 删除tmp目录下对应文件
|
||||||
* @param model
|
* @param model
|
||||||
|
|||||||
@ -11032,6 +11032,10 @@ public String deleteReply(String replyid, String messageid) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//普通用户不允许删除已发布的文件
|
||||||
|
if(model.isPublish()&&!"admin".equals(_uc.getUID())) {
|
||||||
|
return ResponseObject.newErrResponse("已发布文件不允许删除,请联系系统管理员!").toString();
|
||||||
|
}
|
||||||
String result = removeTreeNode(repositoryId, wsId);
|
String result = removeTreeNode(repositoryId, wsId);
|
||||||
JSONObject moveRo = JSONObject.parseObject(result);
|
JSONObject moveRo = JSONObject.parseObject(result);
|
||||||
if (!"ok".equals(moveRo.getString("result"))) {
|
if (!"ok".equals(moveRo.getString("result"))) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user