瀏覽代碼

流程办理提交驳回取回作废终止

4.0
郑根木 2 年之前
父節點
當前提交
87d1c3e570
共有 13 個文件被更改,包括 382 次插入132 次删除
  1. +5
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/FlowConst.java
  2. +0
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcHelper.java
  3. +5
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/CodeBuildHandler.java
  4. +5
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowHelper.java
  5. +217
    -57
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java
  6. +11
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowProvider.java
  7. +91
    -62
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/Task.java
  8. +16
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleService.java
  9. +28
    -3
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java
  10. +1
    -1
      smtweb-framework/bpm/src/main/resources/static/template/java_bean.ftl
  11. +1
    -1
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/jdbc/ISimpleWorker.java
  12. +1
    -2
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/jdbc/JdbcEngine.java
  13. +1
    -1
      smtweb-framework/core/src/main/resources/流程定义.json

+ 5
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/FlowConst.java 查看文件

@@ -66,9 +66,12 @@ public interface FlowConst {
public static IntEnumBean WAIT = instance.addEnum(0, "待办");
public static IntEnumBean HANDLE = instance.addEnum(1, "办理中");
public static IntEnumBean SUBMIT = instance.addEnum(2, "已提交");
public static IntEnumBean INTERRUPT = instance.addEnum(7, "已终止");
//审批不通过
public static IntEnumBean INTERRUPT = instance.addEnum(7, "已中止");
public static IntEnumBean DISUSE = instance.addEnum(8, "已作废");
public static IntEnumBean REJECT = instance.addEnum(9, "已驳回");
//并发流程中,因其他任务被驳回,导致该任务的停止
public static IntEnumBean STOP = instance.addEnum(6, "已停止");
}

/**
@@ -79,7 +82,7 @@ public interface FlowConst {
public static IntEnumBean BEGIN = instance.addEnum(1, "制单");
public static IntEnumBean RUNING = instance.addEnum(2, "审批中");
public static IntEnumBean FINISH = instance.addEnum(99, "生效");
public static IntEnumBean ABORTED = instance.addEnum(98, "中止");
public static IntEnumBean INTERRUPT = instance.addEnum(98, "中止");
public static IntEnumBean DISUSE = instance.addEnum(89, "作废");
}



+ 0
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcHelper.java 查看文件

@@ -130,7 +130,6 @@ public class ModelProcHelper {
return listRet;
}


/**
* 获取流程定义属性值
*


+ 5
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/CodeBuildHandler.java 查看文件

@@ -184,7 +184,11 @@ public class CodeBuildHandler extends AbstractHandler {
fields.add(fn);
fn.put("name", field.getName());
fn.put("title", field.getTitle());
fn.put("javaName", CodeGenUtil.getBeanName(field.getName()));
String javaName = CodeGenUtil.getBeanName(field.getName());
if (SwEnum.DataType.BOOL.value.equals(field.getDataType()) && javaName.startsWith("Is")) {
javaName = javaName.substring(2);
}
fn.put("javaName", javaName);
SwEnum.DataTypeBean dtb = SwEnum.DataType.instance.getByValue(field.getDataType());
fn.put("javaType", dtb.javaType);
fn.put("shortJavaType", dtb.shortJavaType);


+ 5
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowHelper.java 查看文件

@@ -47,6 +47,11 @@ public class FlowHelper {
" where r.trl_dst_task_id=? and t.tsk_handler=?", task_id, user_id);
}

public static void stopTask(long billId) {
DbEngine.getInstance().update("update " + EntityHelper.getSchemaTableName(Task.ENTITY_NAME) +
" set tsk_statu=? where tsk_pri_id=? and tsk_statu<?", FlowConst.ActivityStatu.STOP.value, billId, FlowConst.ActivityStatu.SUBMIT.value);
}

/**
* 得到指定活动的下一任务节点
*


+ 217
- 57
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java 查看文件

@@ -9,6 +9,7 @@ import cc.smtweb.framework.core.exception.SwException;
import cc.smtweb.framework.core.session.UserSession;
import cc.smtweb.framework.core.util.CommUtil;
import cc.smtweb.framework.core.util.DateUtil;
import cc.smtweb.framework.core.util.MathUtil;
import cc.smtweb.framework.core.util.NumberUtil;
import cc.smtweb.system.bpm.web.design.flow.FlowConst;
import cc.smtweb.system.bpm.web.design.flow.ModelProc;
@@ -157,7 +158,7 @@ public class FlowInstance {
*
* @throws Exception
*/
public void handler() {
public void handle() {
long user_id = us.getUserId();
//校验权限,当前人员有权限干不,没权限直接抛异常
// checkPermission();
@@ -341,7 +342,7 @@ public class FlowInstance {
* 返回页面前的设置
*/
public void setPageRetExtra(SwMap ret) {
SwMap extra = ret.computeMapIfAbsent("extra", k->new SwMap());
SwMap extra = ret.computeMapIfAbsent("extra", k -> new SwMap());

List<Task> listTask = adjustTasks();
//可选步骤
@@ -361,6 +362,36 @@ public class FlowInstance {
index++;
}
extra.put("tasks", tasks);

//前置动作
if (!actInst.isMake()) {
//前置动作
listTask = provider.findBeforeTasks(actInst.getId());
if (CommUtil.isEmpty(listTask)) throw new SwException("未发现前置动作!");
List<SwMap> bTasks = new ArrayList<>();
boolean hasMake = false;
for (Task act : listTask) {
SwMap row = new SwMap();
tasks.add(row);
row.put("id", act.getId());
row.put("label", procDef.getProcInfo().getActNameById(act.getActId()));
if (act.isMake()) {
row.put("type", 0);
hasMake = true;
} else {
row.put("type", 1);
}
}
if (!hasMake && procDef.getProcInfo().isRejectToMake()) {
SwMap row = new SwMap();
tasks.add(0, row);
Task act = provider.findMakeTask(procInst.getId());
row.put("id", act.getId());
row.put("label", procDef.getProcInfo().getActNameById(act.getActId()));
row.put("type", 0);
}
}
extra.put("preTasks", tasks);
resetButtons();
}

@@ -476,7 +507,10 @@ public class FlowInstance {
}
}

/*public void submitToEnd() {
/**
* 中止,不通过
*/
public void interrupt(String comment) {
long user_id = us.getUserId();
//校验权限,当前人员有权限干不,没权限直接抛异常
checkPermission();
@@ -488,51 +522,53 @@ public class FlowInstance {
throw new BizException("您不是当前任务的办理人,不允许提交");
}
//校验完毕,接下来干活。
List<Activity> new_acts = procDef.getProcInfo().findEndActivity();
if (CommUtil.isEmpty(new_acts)) {
throw new BizException("结束任务为空,不允许提交到结束!");
}
List<Activity> new_acts = getProcDef().getProcInfo().findEndActivity();
if (CommUtil.isEmpty(new_acts)) throw new SwException("该流程无结束节点!");

//待新增任务
List<Task> listInsertTask = new ArrayList<>();
List<TaskRel> listTaskRel = new ArrayList<>();
List<Comment> listTaskComment = new ArrayList<>();
//待新增任务候选人
List<Candidate> listInsertCand = new ArrayList<>();

for (Activity act : new_acts) {
buildTask(act, listInsertTask, listInsertCand, listTaskRel, user_id);
}
//只要一个就行
buildTask(new_acts.get(0), listInsertTask, listInsertCand, listTaskRel, listTaskComment);

actInst.setHandler(user_id);
actInst.setStartTime(DateUtil.nowDateTimeLong());
actInst.setStatu(FlowConst.ActivityStatu.SUBMIT.value);
actInst.setRetake(true);
actInst.setStatu(FlowConst.ActivityStatu.INTERRUPT.value);
actInst.setRetake(false);

if (listInsertTask.size() > 0) {
procInst.setTaskId(listInsertTask.get(0).getEntityId());
procInst.setActName(listInsertTask.get(0).getActName());
} else {
procInst.setTaskId(actInst.getEntityId());
procInst.setActName(actInst.getActName());
}

if (new_acts.size() == 1 && new_acts.get(0).getType() == FlowConst.ActivityType.END.value) {
procInst.setStatu(FlowConst.InstanceStatu.FINISH.value);
procInst.setEndTime(DateUtil.nowDateTimeLong());
} else {
procInst.setStatu(FlowConst.InstanceStatu.RUNING.value);
}

procInst.setStatu(FlowConst.InstanceStatu.INTERRUPT.value);
procInst.setEndTime(DateUtil.nowDateTimeLong());

//保存入库
if (!listInsertTask.isEmpty()) {
getTaskDao().batchInsertEntity(listInsertTask);
getCandidateDao().batchInsertEntity(listInsertCand);
getTaskRelDao().batchInsertEntity(listTaskRel);

if (!listTaskComment.isEmpty()) {
getCommentDao().batchInsertEntity(listTaskComment);
}
}
getTaskDao().updateEntity(actInst);
getProcInstDao().updateEntity(procInst);

buildBillLog(FlowConst.Button.SUBMIT.value, "TODO", actInst, listInsertTask);
listener.submit(actInst, listInsertTask);
}*/
updateComment(comment, FlowConst.Button.INTERRUPT.value);
buildBillLog(FlowConst.Button.INTERRUPT.value, comment, actInst, listInsertTask);
listener.afterSubmit(actInst, listInsertTask);
}


/**
@@ -608,7 +644,7 @@ public class FlowInstance {
*
* @throws Exception
*/
public void disuse() {
public void disuse(String comment) {
long user_id = us.getUserId();
//校验权限,当前人员有权限干不,没权限直接抛异常
checkPermission();
@@ -629,7 +665,8 @@ public class FlowInstance {
getTaskDao().updateEntity(actInst);
getProcInstDao().updateEntity(procInst);

buildBillLog(FlowConst.Button.DISUSE.value, "TODO", actInst, null);
updateComment(comment, FlowConst.Button.DISUSE.value);
buildBillLog(FlowConst.Button.DISUSE.value, comment, actInst, null);
listener.afterDisuse(actInst);
}

@@ -657,7 +694,7 @@ public class FlowInstance {
task.setSign(false);
task.setReject(false);
task.setRetake(false);
task.setIsAuto(false);
task.setAuto(false);

TaskRel rel = new TaskRel();
rel.setEntityId(DbEngine.getInstance().nextId());
@@ -764,7 +801,7 @@ public class FlowInstance {

taskDao.updateEntity(actInst);
taskDao.batchDelete(new_acts);
getCommentDao().deleteEntity("where cmt_tsk_id in ("+ EntityHelper.getSqlInIds(new_acts) + ")");
getCommentDao().deleteEntity("where cmt_tsk_id in (" + EntityHelper.getSqlInIds(new_acts) + ")");
getTaskRelDao().deleteEntity("where trl_src_task_id=?", actInst.getEntityId());
getProcInstDao().updateEntity(procInst);

@@ -779,7 +816,95 @@ public class FlowInstance {
*
* @throws Exception
*/
public void reject() {
public void reject(String comment, String toTasks) {
if (StringUtils.isEmpty(toTasks)) {
throw new BizException("未指定驳回的目标步骤!");
}
String[] dstTasks = toTasks.split(",");
if (dstTasks.length == 0) throw new BizException("未指定驳回的目标步骤!");

long user_id = us.getUserId();
//校验权限,当前人员有权限干不,没权限直接抛异常
checkPermission();
if (actInst.getStatu() == FlowConst.ActivityStatu.SUBMIT.value) {
throw new BizException("当前任务已经提交,不能驳回!");
}

if (actInst.getStatu() == FlowConst.ActivityStatu.WAIT.value && !FlowHelper.isMyWaitedTask(actInst.getEntityId(), user_id)) {
throw new BizException("您不是当前任务的办理人,不允许驳回!");
}

//待新增任务
List<Task> listInsertTask = new ArrayList<>();
List<TaskRel> listTaskRel = new ArrayList<>();
List<Comment> listTaskComment = new ArrayList<>();
//待新增任务候选人
List<Candidate> listInsertCand = new ArrayList<>();

//校验完毕,接下来干活。
//并发考虑:找到此任务的前置任务,创建对应的新任务,原流程其他未办理任务删除,办理中及已提交的,置为
for (String dstTaskId : dstTasks) {
//rejectTo(comment, NumberUtil.getLongIgnoreErr(dstTaskId), listInsertTask, listTaskRel, listTaskComment, listInsertCand);
long toTaskId = NumberUtil.getLongIgnoreErr(dstTaskId);
Task toTask = provider.findTask(toTaskId);
if (toTask == null) throw new SwException("没有找到驳回目标节点(" + toTaskId + ")!");

buildRejectTask(toTask, listInsertTask, listInsertCand, listTaskRel, listTaskComment);
}
//先停止其他待办或办理中的任务
FlowHelper.stopTask(procInst.getId());
//保存入库
if (!listInsertTask.isEmpty()) {
getTaskDao().batchInsertEntity(listInsertTask);
getCandidateDao().batchInsertEntity(listInsertCand);
getTaskRelDao().batchInsertEntity(listTaskRel);

if (!listTaskComment.isEmpty()) {
getCommentDao().batchInsertEntity(listTaskComment);
}
}
getTaskDao().updateEntity(actInst);
getProcInstDao().updateEntity(procInst);

updateComment(comment, FlowConst.Button.REJECT.value);
buildBillLog(FlowConst.Button.SUBMIT.value, comment, actInst, listInsertTask);
listener.afterSubmit(actInst, listInsertTask);
}

private void buildRejectTask(Task oldTask, List<Task> listInsertTask, List<Candidate> listInsertCand, List<TaskRel> listTaskRel, List<Comment> listTaskComment) {
Task task = new Task();
listInsertTask.add(task);
task.getData().putAll(oldTask.getData());
task.setEntityId(DbEngine.getInstance().nextId());

task.setStatu(FlowConst.ActivityStatu.WAIT.value);
task.setReject(true);

TaskRel rel = new TaskRel();
rel.setEntityId(DbEngine.getInstance().nextId());
rel.setPriId(task.getPriId());
rel.setDstTaskId(task.getId());
rel.setSrcTaskId(actInst.getId());
listTaskRel.add(rel);

Candidate cand = new Candidate();
cand.init();
cand.setEntityId(DbEngine.getInstance().nextId());
cand.setPriId(task.getPriId());
cand.setTskId(task.getId());
cand.setUserId(oldTask.getHandler());

listInsertCand.add(cand);

//创建新的审批意见
listTaskComment.add(createComment(task));
}

private void rejectTo(String comment, long toTaskId, List<Task> listInsertTask, List<TaskRel> listTaskRel, List<Comment> listTaskComment, List<Candidate> listInsertCand) {

}

public void rejectEx(String comment) {
long user_id = us.getUserId();
//校验权限,当前人员有权限干不,没权限直接抛异常
checkPermission();
@@ -787,7 +912,7 @@ public class FlowInstance {
throw new BizException("当前任务已提交,不能驳回!");
}

//获取前置任务,前置任务需要置为被驳回的办理状态,同时,前置任务的其他后置任务需要删除
//获取前置任务,前置任务需要置为被驳回的办理状态,为保证流程信息,复制一份,作为新建任务处理
List<Task> new_acts = provider.findBeforeTasks(actInst.getEntityId());
if (CommUtil.isEmpty(new_acts)) {
throw new BizException("没有找到前续任务,驳回失败!");
@@ -819,7 +944,7 @@ public class FlowInstance {
getTaskRelDao().deleteEntity("where trl_src_task_id in (" + sqlIn.substring(1) + ")");
getProcInstDao().updateEntity(procInst);

buildBillLog(FlowConst.Button.REJECT.value, "TODO", actInst, new_acts);
buildBillLog(FlowConst.Button.REJECT.value, comment, actInst, new_acts);
listener.afterReject(actInst, new_acts);
// comp.transCallback(FlowConst.FlowOptType.REJECT.value, actInst, new_acts);
}
@@ -928,35 +1053,6 @@ public class FlowInstance {
return bean;
}

protected void updateComment(String comment, String optType) {
Comment bean = provider.findTaskComment(actInst.getId());
if (bean == null) throw new SwException("没有找到对应的记录(comment)!");
//签收
if (FlowConst.Button.HANDLE.value.equals(optType)) {
bean.setStatu(FlowConst.ActivityStatu.HANDLE.value);
bean.setHandler(us.getUserId());
bean.setHandlerTime(DateUtil.nowDateTimeLong());
} else if (FlowConst.Button.SUBMIT.value.equals(optType)) {
if (bean.getHandlerTime() <= 0L) {
bean.setHandler(us.getUserId());
bean.setHandlerTime(DateUtil.nowDateTimeLong());
}
bean.setStatu(FlowConst.ActivityStatu.SUBMIT.value);
bean.setEndTime(DateUtil.nowDateTimeLong());
bean.setComment(comment);
} else if (FlowConst.Button.RETAKE.value.equals(optType)) {
if (bean.getHandlerTime() <= 0L) {
bean.setHandler(us.getUserId());
bean.setHandlerTime(DateUtil.nowDateTimeLong());
}
bean.setStatu(FlowConst.ActivityStatu.HANDLE.value);
bean.setHandlerTime(DateUtil.nowDateTimeLong());
bean.setEndTime(0L);
}
getCommentDao().updateEntity(bean);
}

private EntityDao<ProcInst> getProcInstDao() {
return DbEngine.getInstance().findDao(ProcInst.class);
}
@@ -984,4 +1080,68 @@ public class FlowInstance {
private EntityDao<TaskRel> getTaskRelDao() {
return DbEngine.getInstance().findDao(TaskRel.class);
}

interface ICommentWorker {
void work(Comment bean, String comment, long userId);
}

private static Map<String, ICommentWorker> mapComment;

static {
mapComment = new HashMap<>();
mapComment.put(FlowConst.Button.HANDLE.value, (bean, comment, userId) -> {
bean.setStatu(FlowConst.ActivityStatu.HANDLE.value);
bean.setHandler(userId);
bean.setHandlerTime(DateUtil.nowDateTimeLong());
});
mapComment.put(FlowConst.Button.SUBMIT.value, (bean, comment, userId) -> {
checkHandler(bean, userId);
bean.setStatu(FlowConst.ActivityStatu.SUBMIT.value);
bean.setEndTime(DateUtil.nowDateTimeLong());
bean.setComment(comment);
});
mapComment.put(FlowConst.Button.RETAKE.value, (bean, comment, userId) -> {
checkHandler(bean, userId);

bean.setStatu(FlowConst.ActivityStatu.HANDLE.value);
bean.setHandlerTime(DateUtil.nowDateTimeLong());
bean.setEndTime(0L);
});
mapComment.put(FlowConst.Button.REJECT.value, (bean, comment, userId) -> {
checkHandler(bean, userId);

bean.setStatu(FlowConst.ActivityStatu.REJECT.value);
bean.setHandlerTime(DateUtil.nowDateTimeLong());
bean.setEndTime(DateUtil.nowDateTimeLong());
bean.setComment(comment);
});
mapComment.put(FlowConst.Button.DISUSE.value, (bean, comment, userId) -> {
checkHandler(bean, userId);
bean.setStatu(FlowConst.ActivityStatu.DISUSE.value);
bean.setEndTime(DateUtil.nowDateTimeLong());
bean.setComment(comment);
});
mapComment.put(FlowConst.Button.INTERRUPT.value, (bean, comment, userId) -> {
checkHandler(bean, userId);
bean.setStatu(FlowConst.ActivityStatu.INTERRUPT.value);
bean.setEndTime(DateUtil.nowDateTimeLong());
bean.setComment(comment);
});
}

private static void checkHandler(Comment bean, long userId) {
if (bean.getHandlerTime() <= 0L) {
bean.setHandler(userId);
bean.setHandlerTime(DateUtil.nowDateTimeLong());
}
}

protected void updateComment(String comment, String optType) {
Comment bean = provider.findTaskComment(actInst.getId());
if (bean == null) throw new SwException("没有找到对应的记录(comment)!");
ICommentWorker worker = mapComment.get(optType);
if (worker == null) throw new SwException("该类型(" + optType + ")没有实现审批意见!");
worker.work(bean, comment, us.getUserId());
getCommentDao().updateEntity(bean);
}
}

+ 11
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowProvider.java 查看文件

@@ -97,9 +97,19 @@ public class FlowProvider extends AbstractCompProvider {
});
}

//获取流程所有任务
public List<Task> findTasks(long billId) {
return doGetData("aa_" + billId, () -> {
EntityDao<Task> bdao = DbEngine.getInstance().findDao(Task.class);
List<Task> list = bdao.queryWhere(" tsk_pri_id = ?", billId, FlowConst.ActivityStatu.SUBMIT.value);
if (list == null) return new ArrayList<>();
return list;
});
}

//寻找流程的制单任务
public Task findMakeTask(long bill_id) {
return DbEngine.getInstance().findDao(Task.class).queryEntityWhere(" tsk_pri_id = ? and is_make = 1 ", bill_id);
return DbEngine.getInstance().findDao(Task.class).queryEntityWhere(" tsk_pri_id = ? and is_make = 1 order by tsk_end_time desc", bill_id);
}

public List<Comment> findComment(long bill_id) {


+ 91
- 62
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/Task.java 查看文件

@@ -4,8 +4,8 @@ import cc.smtweb.framework.core.annotation.SwTable;
import cc.smtweb.framework.core.db.impl.DefaultEntity;

/**
* Created by Akmm at 2022/5/23 14:25
* 活动实例
* Created by 1 at 2022-09-05 15:43:43
* 实体【[流程活动实例](WF_TASK)】的Entity类
*/
@SwTable("WF_TASK")
public class Task extends DefaultEntity {
@@ -15,155 +15,184 @@ public class Task extends DefaultEntity {
super(ENTITY_NAME);
}

/** 主键 */
public long getId() {
return getLong("tsk_id");
}

public void setId(long tskId) {
put("tsk_id", tskId);
/** 主键 */
public void setId(long tsk_id) {
put("tsk_id", tsk_id);
}
/** 流程实例id */
public long getPriId() {
return getLong("tsk_pri_id");
}

public void setPriId(long tskPriId) {
put("tsk_pri_id", tskPriId);
/** 流程实例id */
public void setPriId(long tsk_pri_id) {
put("tsk_pri_id", tsk_pri_id);
}
/** 流程定义id */
public long getPrcId() {
return getLong("tsk_prc_id");
}

public void setPrcId(long tskPrcId) {
put("tsk_prc_id", tskPrcId);
/** 流程定义id */
public void setPrcId(long tsk_prc_id) {
put("tsk_prc_id", tsk_prc_id);
}
/** 活动定义id */
public String getActId() {
return getStr("tsk_act_id");
}

public void setActId(String tskActId) {
put("tsk_act_id", tskActId);
/** 活动定义id */
public void setActId(String tsk_act_id) {
put("tsk_act_id", tsk_act_id);
}
/** 活动名称 */
public String getActName() {
return getStr("tsk_act_name");
}

public void setActName(String tskActName) {
put("tsk_act_name", tskActName);
/** 活动名称 */
public void setActName(String tsk_act_name) {
put("tsk_act_name", tsk_act_name);
}
/** 主办人 */
public long getHandler() {
return getLong("tsk_handler");
}

public void setHandler(long tskHandler) {
put("tsk_handler", tskHandler);
/** 主办人 */
public void setHandler(long tsk_handler) {
put("tsk_handler", tsk_handler);
}
/** 开始时间 */
public long getStartTime() {
return getLong("tsk_start_time");
}

public void setStartTime(long tskStartTime) {
put("tsk_start_time", tskStartTime);
/** 开始时间 */
public void setStartTime(long tsk_start_time) {
put("tsk_start_time", tsk_start_time);
}
public long getHandler_time() {
/** 签收时间 */
public long getHandlerTime() {
return getLong("tsk_handler_time");
}

public void setHandler_time(long tsk_handler_time) {
/** 签收时间 */
public void setHandlerTime(long tsk_handler_time) {
put("tsk_handler_time", tsk_handler_time);
}
/** 结束时间 */
public long getEndTime() {
return getLong("tsk_end_time");
}

public void setEndTime(long tskEndTime) {
put("tsk_end_time", tskEndTime);
/** 结束时间 */
public void setEndTime(long tsk_end_time) {
put("tsk_end_time", tsk_end_time);
}
/** 状态 */
public int getStatu() {
return getInt("tsk_statu");
}

public void setStatu(int tskStatu) {
put("tsk_statu", tskStatu);
/** 状态 */
public void setStatu(int tsk_statu) {
put("tsk_statu", tsk_statu);
}
/** 审批意见 */
public String getComment() {
return getStr("comment");
return getStr("tsk_comment");
}

public void setComment(String comment) {
put("comment", comment);
/** 审批意见 */
public void setComment(String tsk_comment) {
put("tsk_comment", tsk_comment);
}
/** 是否制单步骤 */
public boolean isMake() {
return getBool("tsk_is_make");
}

public void setMake(boolean tskIsMake) {
setBool("tsk_is_make", tskIsMake);
/** 是否制单步骤 */
public void setMake(boolean tsk_is_make) {
setBool("tsk_is_make", tsk_is_make);
}
/** 是否需要会签 */
public boolean isSign() {
return getBool("tsk_is_sign");
}

public void setSign(boolean tskIsSign) {
setBool("tsk_is_sign", tskIsSign);
/** 是否需要会签 */
public void setSign(boolean tsk_is_sign) {
setBool("tsk_is_sign", tsk_is_sign);
}
public String getSignTotal() {
return getStr("tsk_sign_total");
/** 会签人数 */
public int getSignTotal() {
return getInt("tsk_sign_total");
}

public void setSignTotal(String tskSignTotal) {
put("tsk_sign_total", tskSignTotal);
/** 会签人数 */
public void setSignTotal(int tsk_sign_total) {
put("tsk_sign_total", tsk_sign_total);
}
/** 设置会签过关人数 */
public int getSignPass() {
return getInt("tsk_sign_pass");
}

public void setSignPass(int tskSignPass) {
put("tsk_sign_pass", tskSignPass);
/** 设置会签过关人数 */
public void setSignPass(int tsk_sign_pass) {
put("tsk_sign_pass", tsk_sign_pass);
}
/** 会签同意人数 */
public int getSignAgree() {
return getInt("tsk_sign_agree");
}

public void setSignAgree(int tskSignAgree) {
put("tsk_sign_agree", tskSignAgree);
/** 会签同意人数 */
public void setSignAgree(int tsk_sign_agree) {
put("tsk_sign_agree", tsk_sign_agree);
}
public boolean getIsReject() {
/** 是否被驳回 */
public boolean isReject() {
return getBool("tsk_is_reject");
}

public void setReject(boolean tskIsReject) {
setBool("tsk_is_reject", tskIsReject);
/** 是否被驳回 */
public void setReject(boolean tsk_is_reject) {
setBool("tsk_is_reject", tsk_is_reject);
}
/** 是否取回 */
public boolean isRetake() {
return getBool("tsk_is_retake");
}

public void setRetake(boolean tskIsRetake) {
setBool("tsk_is_retake", tskIsRetake);
/** 是否取回 */
public void setRetake(boolean tsk_is_retake) {
setBool("tsk_is_retake", tsk_is_retake);
}
/** 是否自动任务 */
public boolean isAuto() {
return getBool("tsk_is_auto");
}

public void setIsAuto(boolean tskIsAuto) {
setBool("tsk_is_auto", tskIsAuto);
/** 是否自动任务 */
public void setAuto(boolean tsk_is_auto) {
setBool("tsk_is_auto", tsk_is_auto);
}
/** 备注 */
public String getRemark() {
return getStr("tsk_remark");
}

/** 备注 */
public void setRemark(String tsk_remark) {
put("tsk_remark", tsk_remark);
}
}

+ 16
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleService.java 查看文件

@@ -56,4 +56,20 @@ public class FlowSingleService extends LCSingleService {
public R retake(@SwBody SwMap params, UserSession us) {
return flowHandler(params, us, FlowTransHandler::retake);
}

public R reject(@SwBody SwMap params, UserSession us) {
return flowHandler(params, us, FlowTransHandler::reject);
}

public R disuse(@SwBody SwMap params, UserSession us) {
return flowHandler(params, us, FlowTransHandler::disuse);
}

public R handle(@SwBody SwMap params, UserSession us) {
return flowHandler(params, us, FlowTransHandler::handle);
}

public R interrupt(@SwBody SwMap params, UserSession us) {
return flowHandler(params, us, FlowTransHandler::interrupt);
}
}

+ 28
- 3
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java 查看文件

@@ -4,9 +4,6 @@ import cc.smtweb.framework.core.common.R;
import cc.smtweb.framework.core.common.SwMap;
import cc.smtweb.framework.core.db.DbEngine;
import cc.smtweb.framework.core.db.impl.DefaultEntity;
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker;
import cc.smtweb.framework.core.db.jdbc.IDbSimpleWorker;
import cc.smtweb.framework.core.db.jdbc.IDbWorker;
import cc.smtweb.framework.core.mvc.service.SwListData;
import cc.smtweb.system.bpm.web.design.form.define.PageDataset;
import cc.smtweb.system.bpm.web.engine.dynPage.AbstractDynPageHandler;
@@ -66,4 +63,32 @@ public class FlowTransHandler<T extends DefaultEntity> extends AbstractDynPageHa

return R.success(buildRetData());
}

public R reject() {
load();
DbEngine.getInstance().doTrans(() -> flowInstance.reject(params.readString("comment"), params.readString("toTaskId")));

return R.success(buildRetData());
}

public R disuse() {
load();
DbEngine.getInstance().doTrans(() -> flowInstance.disuse(params.readString("comment")));

return R.success(buildRetData());
}

public R handle() {
load();
DbEngine.getInstance().doTrans(() -> flowInstance.handle());

return R.success(buildRetData());
}

public R interrupt() {
load();
DbEngine.getInstance().doTrans(() -> flowInstance.interrupt(params.readString("comment")));

return R.success(buildRetData());
}
}

+ 1
- 1
smtweb-framework/bpm/src/main/resources/static/template/java_bean.ftl 查看文件

@@ -24,7 +24,7 @@ public class ${beanName} extends DefaultEntity {
}

/** ${field.title} */
public void set${javaName}(boolean ${field.name}) {
public void set${field.javaName}(boolean ${field.name}) {
setBool("${field.name}", ${field.name});
}
<#else >


smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/jdbc/IDbSimpleWorker.java → smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/jdbc/ISimpleWorker.java 查看文件

@@ -3,6 +3,6 @@ package cc.smtweb.framework.core.db.jdbc;
/**
* Created by Akmm at 2022-09-05 09:42
*/
public interface IDbSimpleWorker {
public interface ISimpleWorker {
void work();
}

+ 1
- 2
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/jdbc/JdbcEngine.java 查看文件

@@ -20,7 +20,6 @@ import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Supplier;

/**
* JDBC访问类,包装了spring jdbcTemplate对象
@@ -346,7 +345,7 @@ public class JdbcEngine {
dbWorker.doAfterDbCommit();
}

public void doTrans(IDbSimpleWorker dbWorker) throws SwException {
public void doTrans(ISimpleWorker dbWorker) throws SwException {
beginTrans();
try {
dbWorker.work();


+ 1
- 1
smtweb-framework/core/src/main/resources/流程定义.json 查看文件

@@ -530,7 +530,7 @@
"model": {
"page": "默认表单定义",
"canEditOther": "bool是否允许编辑非本人单据",
"rejectToMake": "bool True-驳回到制单 False-逐级驳回",
"rejectToMake": "bool 是否允许驳回到制单",
"activities": [
{
"id": "唯一标识",


Loading…
取消
儲存