|
@@ -1140,8 +1140,12 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
List<TaskMemberBean> list = mems.stream().filter(e -> Integer.valueOf(
|
|
|
TaskMemberRelTypeEnum.Supervise.getKey()).equals(e.getRelationType())).toList();
|
|
|
setPids.addAll(getMemberPersonIds(list));
|
|
|
- //todo 领导秘书收到领导批示消息
|
|
|
- }else{
|
|
|
+ //领导秘书收到领导批示消息
|
|
|
+ List<Long> secretaryPersonIds = findSecretaryPersonIds(null, List.of(process.getPersonId()));
|
|
|
+ if(CollectionUtil.isNotEmpty(secretaryPersonIds)){
|
|
|
+ setPids.addAll(secretaryPersonIds);
|
|
|
+ }
|
|
|
+ } else{
|
|
|
setPids.addAll(getMemberPersonIds(mems));
|
|
|
}
|
|
|
pids = new ArrayList<Long>();
|
|
@@ -1228,6 +1232,28 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取某人的秘书
|
|
|
+ *
|
|
|
+ * @param cid
|
|
|
+ * @param pids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<Long> findSecretaryPersonIds(Long cid, List<Long> pids){
|
|
|
+ if(CollectionUtil.isEmpty(pids)){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ Criterion criterion =
|
|
|
+ pids.size() > 1 ? Restrictions.in("sourceId", pids) : Restrictions.eq("sourceId", pids.get(0));
|
|
|
+ criterion = Restrictions.and(criterion,
|
|
|
+ Restrictions.eq("targetCategory", ResourceEnum.ResourceTypeEnum.OrgPerson.getKey()));
|
|
|
+ criterion = Restrictions.and(criterion,
|
|
|
+ Restrictions.eq("relationCategory", com.minto.app.organization.OrgEnum.OrgRelationCategoryEnum.Secretary.getKey()));
|
|
|
+ IOrgManager orgManager = AppContext.getBean(IOrgManager.class);
|
|
|
+ List<OrgRelationBean> relationBeanList = orgManager.findOrgRelation(criterion, cid);
|
|
|
+ return relationBeanList.stream().map(OrgRelationBean::getTargetId).toList();
|
|
|
+ }
|
|
|
+
|
|
|
private Set<Long> getMemberPersonIds(List<TaskMemberBean> mems){
|
|
|
Set<Long> setPids = new HashSet<Long>();
|
|
|
// 查询扩展角色 Modifier: <Zhengyu.Hu> 2018/8/21 下午2:19 end.
|
|
@@ -1633,6 +1659,8 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
theActionTypes.add(BehSummaryBehTypeEnum.ViewTask.getKey());
|
|
|
} else if (Objects.equals(pType, "InstructionsAndLevmsg")) {
|
|
|
theActionTypes.add(BehSummaryBehTypeEnum.LevMsgTask.getKey());
|
|
|
+ } else if (Objects.equals(pType, "LevMsgTaskWithDraw")) {
|
|
|
+ theActionTypes.add(BehSummaryBehTypeEnum.LevMsgTaskWithDraw.getKey());
|
|
|
} else {
|
|
|
// 全部
|
|
|
theActionTypes.add(BehSummaryBehTypeEnum.LevMsgTask.getKey());
|
|
@@ -1716,7 +1744,9 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
Map<Long, Integer> idsMap = new HashMap<Long, Integer>();
|
|
|
for (int i = 0; i < result.getList().size(); i++) {
|
|
|
BehSummaryBean beh = (BehSummaryBean) result.getList().get(i);
|
|
|
- if (beh.getBehType().intValue() == BehSummaryBehTypeEnum.LevMsgTask.getKey()||beh.getBehType().intValue() == BehSummaryBehTypeEnum.InstructionsTaskLimitScope.getKey()) {
|
|
|
+ if(beh.getBehType() == BehSummaryBehTypeEnum.LevMsgTask.getKey()
|
|
|
+ || beh.getBehType() == BehSummaryBehTypeEnum.InstructionsTaskLimitScope.getKey()
|
|
|
+ || beh.getBehType() == BehSummaryBehTypeEnum.LevMsgTaskWithDraw.getKey()){
|
|
|
idsMap.put(Long.valueOf(beh.getExt1()), i);
|
|
|
}
|
|
|
}
|
|
@@ -8999,6 +9029,7 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
Criterion c = Restrictions.and(Restrictions.eq("taskId", taskId), Restrictions.eq("personId", pid));
|
|
|
c = Restrictions.and(c, Restrictions.eq("parentId", 0L));
|
|
|
c = Restrictions.and(c, Restrictions.eq("isPublished", 1));
|
|
|
+ c = Restrictions.and(c, Restrictions.eq("isDeleted", 0));
|
|
|
List<TaskProcessSummaryBean> processSummaryBeans = taskProcessSummaryDao.findTaskProcessBeans(c);
|
|
|
if (CollectionUtil.isNotEmpty(processSummaryBeans)) {
|
|
|
processSummaryBean = processSummaryBeans.get(0);
|
|
@@ -9021,6 +9052,7 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
|
|
|
c = Restrictions.and(c, Restrictions.eq("processResourceId", reportId));
|
|
|
c = Restrictions.and(c, Restrictions.eq("isPublished", 1));
|
|
|
+ c = Restrictions.and(c, Restrictions.eq("isDeleted", 0));
|
|
|
|
|
|
List<TaskProcessSummaryBean> processSummaryBeans = taskProcessSummaryDao.findTaskProcessBeans(c);
|
|
|
if (CollectionUtil.isNotEmpty(processSummaryBeans)) {
|
|
@@ -9046,6 +9078,7 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
}
|
|
|
c = Restrictions.and(c, Restrictions.eq("processStageId", phaseId));
|
|
|
c = Restrictions.and(c, Restrictions.eq("isPublished", 1));
|
|
|
+ c = Restrictions.and(c, Restrictions.eq("isDeleted", 0));
|
|
|
|
|
|
List<TaskProcessSummaryBean> processSummaryBeans = taskProcessSummaryDao.findTaskProcessBeans(c);
|
|
|
if (CollectionUtil.isNotEmpty(processSummaryBeans)) {
|
|
@@ -9064,6 +9097,7 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
TaskProcessSummaryBean processSummaryBean = null;
|
|
|
Criterion c = Restrictions.and( Restrictions.eq("processResourceId", reportId));
|
|
|
c = Restrictions.and(c, Restrictions.eq("isPublished", 1));
|
|
|
+ c = Restrictions.and(c, Restrictions.eq("isDeleted", 0));
|
|
|
|
|
|
List<TaskProcessSummaryBean> processSummaryBeans = taskProcessSummaryDao.findTaskProcessBeans(c);
|
|
|
if (CollectionUtil.isNotEmpty(processSummaryBeans)) {
|
|
@@ -9081,6 +9115,7 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
TaskProcessSummaryBean processSummaryBean = null;
|
|
|
Criterion c = Restrictions.and( Restrictions.eq("processResourceId", reportId));
|
|
|
c = Restrictions.and(c, Restrictions.eq("isPublished", 1));
|
|
|
+ c = Restrictions.and(c, Restrictions.eq("isDeleted", 0));
|
|
|
if(phaseId != null){
|
|
|
c = Restrictions.and(c,Restrictions.eq("processStageId",phaseId));
|
|
|
}
|
|
@@ -9099,6 +9134,7 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
TaskProcessSummaryBean processSummaryBean = null;
|
|
|
Criterion c = Restrictions.and( Restrictions.eq("processResourceId", reportId));
|
|
|
c = Restrictions.and(c, Restrictions.eq("isPublished", 1));
|
|
|
+ c = Restrictions.and(c, Restrictions.eq("isDeleted", 0));
|
|
|
if(phaseId != null){
|
|
|
c = Restrictions.and(c,Restrictions.eq("processStageId",phaseId));
|
|
|
}
|
|
@@ -20651,7 +20687,7 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void deleteTaskProcess(Long itemId, Long pid) throws Exception{
|
|
|
+ public void updateTaskProcessWithdraw(Long itemId, Long pid) throws Exception{
|
|
|
//移除附件
|
|
|
TaskProcessSummaryBean process = taskProcessSummaryDao.findTaskProcessById(itemId);
|
|
|
if(process == null){
|
|
@@ -20663,16 +20699,24 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
if(!pid.equals(process.getPersonId())){
|
|
|
throw new IllegalAccessException("不是批示/留言的发布者不能撤回!");
|
|
|
}
|
|
|
- if(new Date().compareTo(instance.getTime())>0){
|
|
|
+ if((!AppContext.getCurrentUser().hasRole("ShujQuzhang", "QuLingDao"))
|
|
|
+ && new Date().compareTo(instance.getTime()) > 0){
|
|
|
throw new IllegalAccessException("已发布超过30分钟不能撤回!");
|
|
|
}
|
|
|
//移除附件
|
|
|
- attachmentManager.deleteByReference(process.getTaskId(),itemId);
|
|
|
- //移除行为
|
|
|
- behManager.deleteByResTypeAndExt1(ResourceTypeEnum.Task.getKey(),String.valueOf(process.getTaskId()),
|
|
|
- String.valueOf(itemId));
|
|
|
- //移除批示留言
|
|
|
- taskProcessSummaryDao.delete(TaskProcessSummaryBean.class,itemId);
|
|
|
+ //attachmentManager.deleteByReference(process.getTaskId(),itemId);
|
|
|
+ //修改批示留言行为
|
|
|
+ List<BehSummaryBean> byResTypeAndExt1 = behManager.findByResTypeAndExt1(ResourceTypeEnum.Task.getKey(),
|
|
|
+ String.valueOf(process.getTaskId()), String.valueOf(itemId));
|
|
|
+ if(CollectionUtil.isNotEmpty(byResTypeAndExt1)){
|
|
|
+ byResTypeAndExt1.forEach(e->{
|
|
|
+ e.setBehType(BehSummaryBehTypeEnum.LevMsgTaskWithDraw.getKey());
|
|
|
+ e.setbState(1);
|
|
|
+ behManager.saveOrUpdateBehSummary(e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //逻辑删除批示留言
|
|
|
+ taskProcessSummaryDao.deleteByLogic(itemId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -20828,6 +20872,7 @@ public class TaskManagerImpl implements ITaskManager {
|
|
|
Criterion c = Restrictions.and(Restrictions.eq("taskId", taskId),
|
|
|
Restrictions.eq("ptype", TaskProcessTypeEnum.Instructions.getKey()),
|
|
|
Restrictions.eq("isPublished", BaseEnum.BooleanEnum.True.getKey()),
|
|
|
+ Restrictions.eq("isDeleted", BaseEnum.BooleanEnum.False.getKey()),
|
|
|
Restrictions.eq("visibilityScope", TaskProcessVisibilityScopeEnum.All.getKey()));
|
|
|
List<TaskProcessSummaryBean> taskProcessSummaryBeans = taskProcessSummaryDao.findBy(
|
|
|
TaskProcessSummaryBean.class, c);
|