zhourui 5 лет назад
Родитель
Сommit
42edb2cc66

+ 14 - 13
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java

@@ -5,6 +5,8 @@ import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
+import org.apache.commons.lang3.StringUtils;
+
 import com.google.gson.JsonElement;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
@@ -46,8 +48,6 @@ import com.x.processplatform.core.express.service.processing.jaxrs.task.WrapUpda
 import com.x.processplatform.core.express.service.processing.jaxrs.task.WrapUpdatePrevTaskIdentity.PrevTask;
 import com.x.processplatform.core.express.service.processing.jaxrs.taskcompleted.WrapUpdateNextTaskIdentity;
 
-import org.apache.commons.lang3.StringUtils;
-
 class ActionProcessing extends BaseAction {
 
 	private static Logger logger = LoggerFactory.getLogger(ActionProcessing.class);
@@ -67,8 +67,8 @@ class ActionProcessing extends BaseAction {
 	private Record record;
 	private String series = StringTools.uniqueToken();
 
-	private final String TYPE_APPENDTASK = "appendTask";
-	private final String TYPE_TASK = "task";
+	private static final String TYPE_APPENDTASK = "appendTask";
+	private static final String TYPE_TASK = "task";
 
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
 		Audit audit = logger.audit(effectivePerson);
@@ -144,12 +144,12 @@ class ActionProcessing extends BaseAction {
 
 	private void processing() throws Exception {
 		switch (type) {
-			case TYPE_APPENDTASK:
-				this.processingAppendTask();
-				break;
-			default:
-				this.processingTask();
-				break;
+		case TYPE_APPENDTASK:
+			this.processingAppendTask();
+			break;
+		default:
+			this.processingTask();
+			break;
 		}
 	}
 
@@ -174,7 +174,7 @@ class ActionProcessing extends BaseAction {
 	private void processingTask() throws Exception {
 		this.taskCompletedId = this.processing_processingTask(TaskCompleted.PROCESSINGTYPE_TASK);
 		this.processing_processingWork(ProcessingAttributes.TYPE_TASK);
-		//流程流转到取消环节,此时工作已被删除
+		// 流程流转到取消环节,此时工作已被删除
 		boolean flag = true;
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			if ((emc.countEqual(Work.class, Work.job_FIELDNAME, task.getJob()) == 0)
@@ -182,11 +182,11 @@ class ActionProcessing extends BaseAction {
 				flag = false;
 			}
 		}
-		if(flag) {
+		if (flag) {
 			this.processing_record(Record.TYPE_TASK);
 			this.processing_updateTaskCompleted();
 			this.processing_updateTask();
-		}else{
+		} else {
 			record = new Record(workLog, task);
 			record.setCompleted(true);
 			record.setType(Record.TYPE_TASK);
@@ -315,6 +315,7 @@ class ActionProcessing extends BaseAction {
 			prevTask.setUnit(task.getUnit());
 			prevTask.setRouteName(task.getRouteName());
 			req.getPrevTaskIdentityList().add(prevTask.getIdentity());
+			req.setPrevTaskIdentity(prevTask.getIdentity());
 			req.getPrevTaskList().add(prevTask);
 			req.setPrevTask(prevTask);
 			// 去重

+ 13 - 0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/TaskProperties.java

@@ -10,7 +10,12 @@ import com.x.base.core.project.gson.GsonPropertyObject;
 
 public class TaskProperties extends JsonProperties {
 
+	private static final long serialVersionUID = 5628694071505848771L;
+
 	@FieldDescribe("上一人工环节处理人")
+	private String prevTaskIdentity;
+
+	@FieldDescribe("上一人工环节处理人列表")
 	private List<String> prevTaskIdentityList;
 
 	@FieldDescribe("标题")
@@ -59,6 +64,14 @@ public class TaskProperties extends JsonProperties {
 		this.opinion = opinion;
 	}
 
+	public String getPrevTaskIdentity() {
+		return prevTaskIdentity;
+	}
+
+	public void setPrevTaskIdentity(String prevTaskIdentity) {
+		this.prevTaskIdentity = prevTaskIdentity;
+	}
+
 	public static class PrevTask extends GsonPropertyObject {
 
 		private String routeName;

+ 23 - 5
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/WrapProcessing.java

@@ -5,15 +5,17 @@ import com.x.base.core.project.gson.GsonPropertyObject;
 
 public class WrapProcessing extends GsonPropertyObject {
 
+	private static final long serialVersionUID = -2272062779655632688L;
+
 	public static final String PROCESSINGTYPE_TASK = "task";
 
 	public static final String PROCESSINGTYPE_RESET = "reset";
 
-	// @FieldDescribe("当前处理人")
-	// private String person;
-
-	// @FieldDescribe("当前处理身份")
-	// private String identity;
+//	@FieldDescribe("当前处理人")
+//	private String processingPerson;
+//
+//	@FieldDescribe("当前处理身份")
+//	private String processingIdentity;
 
 	@FieldDescribe("流转类型.")
 	private String processingType;
@@ -26,4 +28,20 @@ public class WrapProcessing extends GsonPropertyObject {
 		this.processingType = processingType;
 	}
 
+//	public String getProcessingPerson() {
+//		return processingPerson;
+//	}
+//
+//	public void setProcessingPerson(String processingPerson) {
+//		this.processingPerson = processingPerson;
+//	}
+//
+//	public String getProcessingIdentity() {
+//		return processingIdentity;
+//	}
+//
+//	public void setProcessingIdentity(String processingIdentity) {
+//		this.processingIdentity = processingIdentity;
+//	}
+
 }

+ 13 - 0
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/WrapUpdatePrevTaskIdentity.java

@@ -9,9 +9,14 @@ import com.x.base.core.project.gson.GsonPropertyObject;
 
 public class WrapUpdatePrevTaskIdentity extends GsonPropertyObject {
 
+	private static final long serialVersionUID = 6036782582457148615L;
+
 	@FieldDescribe("上一人工环节处理人列表")
 	private List<String> prevTaskIdentityList = new ArrayList<>();
 
+	@FieldDescribe("上一人工环节处理人")
+	private String prevTaskIdentity;
+
 	@FieldDescribe("要更新的待办对象")
 	private List<String> taskList;
 
@@ -62,6 +67,14 @@ public class WrapUpdatePrevTaskIdentity extends GsonPropertyObject {
 		this.prevTask = prevTask;
 	}
 
+	public String getPrevTaskIdentity() {
+		return prevTaskIdentity;
+	}
+
+	public void setPrevTaskIdentity(String prevTaskIdentity) {
+		this.prevTaskIdentity = prevTaskIdentity;
+	}
+
 	public static class PrevTask extends GsonPropertyObject {
 
 		private String identity;

+ 55 - 52
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AeiObjects.java

@@ -11,6 +11,10 @@ import javax.script.Bindings;
 import javax.script.ScriptContext;
 import javax.script.SimpleScriptContext;
 
+import org.apache.commons.collections4.ListUtils;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+
 import com.google.gson.reflect.TypeToken;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.entity.JpaObject;
@@ -56,12 +60,10 @@ import com.x.processplatform.service.processing.WorkDataHelper;
 import com.x.processplatform.service.processing.configurator.ActivityProcessingConfigurator;
 import com.x.processplatform.service.processing.configurator.ProcessingConfigurator;
 
-import org.apache.commons.collections4.ListUtils;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.lang3.StringUtils;
-
 public class AeiObjects extends GsonPropertyObject {
 
+	private static final long serialVersionUID = -4125441813647193068L;
+
 	private static Logger logger = LoggerFactory.getLogger(AeiObjects.class);
 
 	public AeiObjects(Business business, Work work, Activity activity, ProcessingConfigurator processingConfigurator,
@@ -73,11 +75,11 @@ public class AeiObjects extends GsonPropertyObject {
 		this.activityProcessingConfigurator = processingConfigurator.get(activity.getActivityType());
 	}
 
-	private Business business;
+	private transient Business business;
 
 	private ProcessingConfigurator processingConfigurator;
 
-	private ActivityProcessingConfigurator activityProcessingConfigurator;
+	private transient ActivityProcessingConfigurator activityProcessingConfigurator;
 
 	private ProcessingAttributes processingAttributes;
 
@@ -85,44 +87,44 @@ public class AeiObjects extends GsonPropertyObject {
 
 	private Work work;
 
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Work> works = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Task> tasks = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<TaskCompleted> taskCompleteds = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Read> reads = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<ReadCompleted> readCompleteds = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Review> reviews = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<DocumentVersion> documentVersions = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Record> records = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Attachment> attachments = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<WorkLog> workLogs = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Route> routes = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private Process process = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private Application application = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Projection> projections = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private List<Mapping> mappings = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
 	private Activity activity = null;
-	/* 使用用懒加载,初始为null */
-	private WorkDataHelper workDataHelper = null;
-	/* 使用用懒加载,初始为null */
+	// 使用用懒加载,初始为null
+	private transient WorkDataHelper workDataHelper = null;
+	// 使用用懒加载,初始为null
 	private Data data = null;
-	/* 使用用懒加载,初始为null */
-	private ScriptContext scriptContext = null;
+	// 使用用懒加载,初始为null
+	private transient ScriptContext scriptContext = null;
 
 	private List<Work> createWorks = new ArrayList<>();
 	private List<Work> updateWorks = new ArrayList<>();
@@ -745,7 +747,7 @@ public class AeiObjects extends GsonPropertyObject {
 		if (ListTools.isNotEmpty(this.getCreateWorks()) || ListTools.isNotEmpty(this.getDeleteWorks())
 				|| ListTools.isNotEmpty(this.getUpdateWorks())) {
 			this.entityManagerContainer().beginTransaction(Work.class);
-			/* 保存工作 */
+			// 保存工作
 			this.getCreateWorks().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
@@ -753,7 +755,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 更新工作 */
+			// 更新工作
 			this.getUpdateWorks().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().check(o, CheckPersistType.all);
@@ -761,7 +763,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 删除工作 */
+			// 删除工作
 			this.getDeleteWorks().stream().forEach(o -> {
 				Work obj;
 				try {
@@ -780,7 +782,7 @@ public class AeiObjects extends GsonPropertyObject {
 		if (ListTools.isNotEmpty(this.getCreateWorkCompleteds()) || ListTools.isNotEmpty(this.getDeleteWorkCompleteds())
 				|| ListTools.isNotEmpty(this.getUpdateWorkCompleteds())) {
 			this.entityManagerContainer().beginTransaction(WorkCompleted.class);
-			/* 保存完成工作 */
+			// 保存完成工作
 			this.getCreateWorkCompleteds().stream().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
@@ -788,7 +790,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 更新完成工作 */
+			// 更新完成工作
 			this.getUpdateWorkCompleteds().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().check(o, CheckPersistType.all);
@@ -796,7 +798,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 删除完成工作 */
+			// 删除完成工作
 			this.getDeleteWorkCompleteds().stream().forEach(o -> {
 				WorkCompleted obj;
 				try {
@@ -815,7 +817,7 @@ public class AeiObjects extends GsonPropertyObject {
 		if (ListTools.isNotEmpty(this.getCreateWorkLogs()) || ListTools.isNotEmpty(this.getDeleteWorkLogs())
 				|| ListTools.isNotEmpty(this.getUpdateWorkLogs())) {
 			this.entityManagerContainer().beginTransaction(WorkLog.class);
-			/* 保存工作日志 */
+			// 保存工作日志
 			this.getCreateWorkLogs().stream().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
@@ -823,7 +825,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 更新工作日志 */
+			// 更新工作日志
 			this.getUpdateWorkLogs().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().check(o, CheckPersistType.all);
@@ -831,7 +833,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 删除工作日志 */
+			// 删除工作日志
 			this.getDeleteWorkLogs().stream().forEach(o -> {
 				WorkLog obj;
 				try {
@@ -864,6 +866,7 @@ public class AeiObjects extends GsonPropertyObject {
 			try {
 				// 写入当前处理人作为上一环节处理人
 				if (StringUtils.isNotEmpty(this.processingAttributes.getIdentity())) {
+					o.getProperties().setPrevTaskIdentity(this.processingAttributes.getIdentity());
 					o.getProperties()
 							.setPrevTaskIdentityList(ListTools.trim(o.getProperties().getPrevTaskIdentityList(), true,
 									true, this.processingAttributes.getIdentity()));
@@ -911,7 +914,7 @@ public class AeiObjects extends GsonPropertyObject {
 			commitTaskCompletedCreatePart();
 			// 更新已办
 			commitTaskCompletedUpdatePart();
-			// 删除已办 */
+			// 删除已办
 			commitTaskCompletedDeletePart();
 		}
 	}
@@ -919,11 +922,11 @@ public class AeiObjects extends GsonPropertyObject {
 	private void commitTaskCompletedCreatePart() {
 		this.getCreateTaskCompleteds().stream().forEach(o -> {
 			try {
-				/* 将相同用户的其他已办的lastest标记为false */
+				// 将相同用户的其他已办的lastest标记为false
 				this.getTaskCompleteds().stream().filter(p -> StringUtils.equals(o.getPerson(), p.getPerson()))
 						.forEach(p -> p.setLatest(false));
 				this.business.entityManagerContainer().persist(o, CheckPersistType.all);
-				/* 创建已办的参阅 */
+				// 创建已办的参阅
 				this.createReview(new Review(this.getWork(), o.getPerson()));
 			} catch (Exception e) {
 				logger.error(e);
@@ -945,7 +948,7 @@ public class AeiObjects extends GsonPropertyObject {
 		this.getDeleteTaskCompleteds().stream().forEach(o -> {
 			TaskCompleted obj;
 			try {
-				/* 要删除此已经办前此人其他的已办lastest标记为true */
+				// 要删除此已经办前此人其他的已办lastest标记为true
 				TaskCompleted lastest = this.getTaskCompleteds().stream()
 						.filter(p -> StringUtils.equals(o.getPerson(), p.getPerson())
 								&& (!StringUtils.equals(o.getId(), p.getId())))
@@ -1110,7 +1113,7 @@ public class AeiObjects extends GsonPropertyObject {
 											Comparator.nullsLast(String::compareTo))))
 							.findFirst().get();
 					try {
-						/* 参阅唯一 */
+						// 参阅唯一
 						Review existed = this.getReviews().stream()
 								.filter(p -> StringUtils.equals(obj.getJob(), p.getJob())
 										&& StringUtils.equals(obj.getPerson(), p.getPerson()))
@@ -1164,7 +1167,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 更新版式文件 */
+			// 更新版式文件
 			this.getUpdateDocumentVersions().stream().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().check(o, CheckPersistType.all);
@@ -1172,7 +1175,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 删除版式文件 */
+			// 删除版式文件
 			this.getDeleteDocumentVersions().stream().forEach(o -> {
 				DocumentVersion obj;
 				try {
@@ -1191,7 +1194,7 @@ public class AeiObjects extends GsonPropertyObject {
 		if (ListTools.isNotEmpty(this.getCreateRecords()) || ListTools.isNotEmpty(this.getDeleteRecords())
 				|| ListTools.isNotEmpty(this.getUpdateRecords())) {
 			this.entityManagerContainer().beginTransaction(Record.class);
-			/* 保存记录 */
+			// 保存记录
 			this.getCreateRecords().stream().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
@@ -1199,7 +1202,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 删除记录 */
+			// 删除记录
 			this.getUpdateRecords().stream().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().check(o, CheckPersistType.all);
@@ -1225,7 +1228,7 @@ public class AeiObjects extends GsonPropertyObject {
 		if (ListTools.isNotEmpty(this.getCreateAttachments()) || ListTools.isNotEmpty(this.getDeleteAttachments())
 				|| ListTools.isNotEmpty(this.getUpdateAttachments())) {
 			this.entityManagerContainer().beginTransaction(Attachment.class);
-			/* 保存,更新附件是不可能的,删除附件 */
+			// 保存,更新附件是不可能的,删除附件
 			this.getDeleteAttachments().stream().forEach(o -> {
 				Attachment obj;
 				try {
@@ -1261,7 +1264,7 @@ public class AeiObjects extends GsonPropertyObject {
 		if (ListTools.isNotEmpty(this.getCreateDynamicEntities())
 				|| ListTools.isNotEmpty(this.getDeleteDynamicEntities())
 				|| ListTools.isNotEmpty(this.getUpdateDynamicEntities())) {
-			/* 保存自定义对象 */
+			// 保存自定义对象
 			this.getCreateDynamicEntities().stream().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().beginTransaction(o.getClass());
@@ -1270,7 +1273,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 更新自定义对象 */
+			// 更新自定义对象
 			this.getUpdateDynamicEntities().stream().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().beginTransaction(o.getClass());
@@ -1279,7 +1282,7 @@ public class AeiObjects extends GsonPropertyObject {
 					logger.error(e);
 				}
 			});
-			/* 删除自定义对象 */
+			// 删除自定义对象
 			this.getDeleteDynamicEntities().stream().forEach(o -> {
 				try {
 					this.business.entityManagerContainer().beginTransaction(o.getClass());
@@ -1294,7 +1297,7 @@ public class AeiObjects extends GsonPropertyObject {
 
 	private void message() throws Exception {
 
-		/* 待办转已办处理 */
+		// 待办转已办处理
 		List<TaskCompleted> copyOfCreateTaskCompleteds = new ArrayList<>(this.getCreateTaskCompleteds());
 		List<Task> copyOfDeleteTasks = new ArrayList<>(this.getDeleteTasks());
 		for (Entry<TaskCompleted, Task> entry : ListTools.pairWithProperty(copyOfCreateTaskCompleteds,
@@ -1303,7 +1306,7 @@ public class AeiObjects extends GsonPropertyObject {
 			copyOfDeleteTasks.remove(entry.getValue());
 			MessageFactory.task_to_taskCompleted(entry.getKey());
 		}
-		/* 待阅转已阅处理 */
+		// 待阅转已阅处理
 		List<ReadCompleted> copyOfCreateReadCompleteds = new ArrayList<>(this.getCreateReadCompleteds());
 		List<Read> copyOfDeleteReads = new ArrayList<>(this.getDeleteReads());
 		for (Entry<ReadCompleted, Read> entry : ListTools.pairWithProperty(copyOfCreateReadCompleteds,
@@ -1313,7 +1316,7 @@ public class AeiObjects extends GsonPropertyObject {
 			MessageFactory.read_to_readCompleted(entry.getKey());
 		}
 
-		/* 工作转已完成工作 */
+		// 工作转已完成工作
 		List<WorkCompleted> copyOfCreateWorkCompleteds = new ArrayList<>(this.getCreateWorkCompleteds());
 		List<Work> copyOfDeleteWorks = new ArrayList<>(this.getDeleteWorks());
 		for (Entry<WorkCompleted, Work> entry : ListTools.pairWithProperty(copyOfCreateWorkCompleteds,