浏览代码

施工交底

yue 5 年之前
父节点
当前提交
993074c4f1

+ 32 - 0
src/main/java/com/jeeplus/modules/act/service/ActTaskService.java

@@ -1035,6 +1035,38 @@ public class ActTaskService extends BaseService {
 
 	}
 
+	/**
+	 * 保存审核意见
+	 * @param act
+	 */
+	@Transactional(readOnly = false)
+	public void newAuditSave(Act act) {
+		// 设置意见
+		if ("yes".equals(act.getFlag())) {
+			act.setComment("[项目经理]");
+		} else if ("yes".equals(act.getFlag())) {
+			act.setComment("[施工单位]");
+		} else {
+			act.setComment("[驳回]");
+		}
+/*		act.setComment(("yes".equals(act.getFlag())?"[同意] ":"[驳回] ")+act.getComment());*/
+		act.preUpdate();
+		// 对不同环节的业务逻辑进行操作
+		String taskDefKey = act.getTaskDefKey();
+		// 提交流程任务
+		Map<String, Object> vars = Maps.newHashMap();
+		if ("manager".equals(act.getFlag())) {
+			vars.put("manager", "manager");
+		} else if ("company".equals(act.getFlag())) {
+			vars.put("company","company" );
+		} else {
+			vars.put("reject", "reject");
+		}
+		/*vars.put("pass", "yes".equals(act.getFlag())? true : false);*/
+		complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
+	}
+
+
 
 	/**
 	 * 判断下一个节点是互斥网关还是用户任务节点

+ 14 - 0
src/main/java/com/jeeplus/modules/act/web/ActTaskController.java

@@ -367,6 +367,20 @@ public class ActTaskController extends BaseController {
 	}
 
 	/**
+	 * 施工交底审批
+	 * @param act*/
+
+
+	@ResponseBody
+	@RequestMapping(value = "newAudit")
+	public AjaxJson newAuditTask(Act act) {
+		AjaxJson j = new AjaxJson();
+		actTaskService.newAuditSave(act);
+		j.setMsg("审批成功");
+		return j;
+	}
+
+	/**
 	 * 取回流程
 	 * @param taskId
 	 */

+ 3 - 1
src/main/java/com/jeeplus/modules/sg/managementcenter/activiti/service/ConstructionService.java

@@ -46,5 +46,7 @@ public class ConstructionService extends CrudService<ConstructionMapper, Constru
 	public void delete(Construction construction) {
 		super.delete(construction);
 	}
-	
+
+
+
 }

+ 4 - 8
src/main/webapp/webpage/modules/sg/managementcenter/activiti/constructionAudit.jsp

@@ -22,14 +22,14 @@
 
 			$("#agree").click(function () {
 				jp.prompt("同意, 审批意见", function (message) {
-					jp.post("${ctx}/act/task/audit",
+					jp.post("${ctx}/act/task/newAudit",
 							{
 								"taskId":"${construction.act.taskId}",
 								"taskName":"${construction.act.taskName}",
 								"taskDefKey":"${construction.act.taskDefKey}",
 								"procInsId":"${construction.act.procInsId}",
 								"procDefId":"${construction.act.procDefId}",
-								"flag":"yes",
+								"flag":"manager",
 								"comment":message
 
 							},
@@ -45,25 +45,21 @@
 
 			$("#reject").click(function () {
 				jp.prompt("驳回, 审批意见", function (message) {
-					jp.post("${ctx}/managementcenter/activiti/audit",
+					jp.post("${ctx}/act/task/newAudit",
 							{
 								"taskId":"${construction.act.taskId}",
 								"taskName":"${construction.act.taskName}",
 								"taskDefKey":"${construction.act.taskDefKey}",
 								"procInsId":"${construction.act.procInsId}",
 								"procDefId":"${construction.act.procDefId}",
-								"flag":"no",
+								"flag":"reject",
 								"comment":message
-
 							},
 							function (data) {
-
 								if(data.success){
 									jp.success(data.msg);
 									jp.go("${ctx}/act/task/todo")
 								}
-
-
 							})
 				})
 			})