1.项目结项审核时新增流转记录
This commit is contained in:
parent
6a5dfc4b59
commit
3ce8e1970a
@ -1,5 +1,6 @@
|
|||||||
package com.xqopen.kehui.project.action;
|
package com.xqopen.kehui.project.action;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.fastjson.support.spring.FastJsonJsonView;
|
import com.alibaba.fastjson.support.spring.FastJsonJsonView;
|
||||||
@ -12,6 +13,9 @@ import com.xqopen.kehui.common.entity.SystemUserLogin;
|
|||||||
import com.xqopen.kehui.common.service.*;
|
import com.xqopen.kehui.common.service.*;
|
||||||
import com.xqopen.kehui.exception.ErrorCode;
|
import com.xqopen.kehui.exception.ErrorCode;
|
||||||
import com.xqopen.kehui.exception.XQException;
|
import com.xqopen.kehui.exception.XQException;
|
||||||
|
import com.xqopen.kehui.flows.dto.FlowsRecordList;
|
||||||
|
import com.xqopen.kehui.flows.dto.FlowsRecordResp;
|
||||||
|
import com.xqopen.kehui.flows.dto.FlowsTaskItem;
|
||||||
import com.xqopen.kehui.flows.service.BaseActivitiApi;
|
import com.xqopen.kehui.flows.service.BaseActivitiApi;
|
||||||
import com.xqopen.kehui.flows.service.IFlowsCategoryService;
|
import com.xqopen.kehui.flows.service.IFlowsCategoryService;
|
||||||
import com.xqopen.kehui.flows.service.IFlowsService;
|
import com.xqopen.kehui.flows.service.IFlowsService;
|
||||||
@ -680,6 +684,23 @@ public class ProjectInitComtroller implements ProjectInitApi {
|
|||||||
return ApiResponse.fillFail("操作失败!");
|
return ApiResponse.fillFail("操作失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过账号id拿到人事对象
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private PersonalMember getPersonalByUserLogin(Long userId) {
|
||||||
|
EntityWrapper<SystemUserLogin> userLoginEntityWrapper = new EntityWrapper<>();
|
||||||
|
userLoginEntityWrapper.eq(SystemUserLogin.ID_, userId);
|
||||||
|
userLoginEntityWrapper.eq(SystemUserLogin.IS_DELETED, false);
|
||||||
|
SystemUserLogin systemUserLogin = userLoginService.selectOne(userLoginEntityWrapper);
|
||||||
|
EntityWrapper<PersonalMember> personalMemberEntityWrapper = new EntityWrapper<>();
|
||||||
|
personalMemberEntityWrapper.eq(PersonalMember.ID_, systemUserLogin.getUserinfoId());
|
||||||
|
personalMemberEntityWrapper.eq(PersonalMember.IS_DELETED, false);
|
||||||
|
return personalMemberService.selectOne(personalMemberEntityWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核方法体
|
* 审核方法体
|
||||||
*
|
*
|
||||||
@ -693,13 +714,11 @@ public class ProjectInitComtroller implements ProjectInitApi {
|
|||||||
if (!ObjectUtils.isEmpty(ext)) {
|
if (!ObjectUtils.isEmpty(ext)) {
|
||||||
if (!ObjectUtils.isEmpty(map)) {
|
if (!ObjectUtils.isEmpty(map)) {
|
||||||
String taskName = String.valueOf(map.get("taskName"));
|
String taskName = String.valueOf(map.get("taskName"));
|
||||||
ext.put("taskName", taskName);
|
|
||||||
ext.put("endExecutor", map.get("endExecutor"));
|
|
||||||
//添加审核意见
|
//添加审核意见
|
||||||
Object projectManagerOpinion = map.get("projectManagerOpinion") != null ? ext.put("projectManagerOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
|
// Object projectManagerOpinion = map.get("projectManagerOpinion") != null ? ext.put("projectManagerOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
|
||||||
Object projectAdminOpinion = map.get("projectAdminOpinion") != null ? ext.put("projectAdminOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
|
// Object projectAdminOpinion = map.get("projectAdminOpinion") != null ? ext.put("projectAdminOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
|
||||||
Object branchLeaderOpinion = map.get("branchLeaderOpinion") != null ? ext.put("branchLeaderOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
|
// Object branchLeaderOpinion = map.get("branchLeaderOpinion") != null ? ext.put("branchLeaderOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
|
||||||
Object mainLeaderOpinion = map.get("mainLeaderOpinion") != null ? ext.put("mainLeaderOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
|
// Object mainLeaderOpinion = map.get("mainLeaderOpinion") != null ? ext.put("mainLeaderOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
|
||||||
if (ext.containsKey("endHistorical")) {//结项历史委托
|
if (ext.containsKey("endHistorical")) {//结项历史委托
|
||||||
String endHistorical = String.valueOf(ext.get("endHistorical"));
|
String endHistorical = String.valueOf(ext.get("endHistorical"));
|
||||||
if (!endHistorical.contains(String.valueOf(map.get("userId")))) {
|
if (!endHistorical.contains(String.valueOf(map.get("userId")))) {
|
||||||
@ -707,6 +726,58 @@ public class ProjectInitComtroller implements ProjectInitApi {
|
|||||||
ext.put("endHistorical", endHistorical);
|
ext.put("endHistorical", endHistorical);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//流转记录
|
||||||
|
FlowsRecordResp record = new FlowsRecordResp();
|
||||||
|
List<FlowsRecordList> ls = new ArrayList<>();
|
||||||
|
FlowsRecordList taskItemsList = new FlowsRecordList();
|
||||||
|
List<FlowsTaskItem> taskItems = new ArrayList<>();
|
||||||
|
String examine = String.valueOf(map.get("examine"));
|
||||||
|
String opinion = String.valueOf(map.get("opinion"));
|
||||||
|
if (ext.containsKey("endRecord")) {
|
||||||
|
record = ((JSONObject) ext.get("endRecord")).toJavaObject(FlowsRecordResp.class);;
|
||||||
|
ls = record.getLs();
|
||||||
|
taskItemsList=ls.get(0);
|
||||||
|
taskItems = taskItemsList.getTaskItems();
|
||||||
|
Collections.reverse(taskItems);
|
||||||
|
// taskItemsList = l.getTaskItems();
|
||||||
|
FlowsTaskItem taskItem = taskItems.get(taskItems.size()-1);
|
||||||
|
taskItem.setDueDate(new Date());
|
||||||
|
taskItem.setActionName("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
if (StringUtils.isEmpty(opinion) ||"null".equals(opinion)) {//审批意见
|
||||||
|
taskItem.setActionReason("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
} else taskItem.setActionReason(String.valueOf(map.get("opinion")));
|
||||||
|
taskItems.set(taskItems.size() - 1, taskItem);
|
||||||
|
FlowsTaskItem taskItem1 = new FlowsTaskItem();
|
||||||
|
taskItem1.setNodeName(taskName);
|
||||||
|
taskItem1.setAssigneeName(getPersonalByUserLogin(Long.parseLong(String.valueOf(map.get("endExecutor")))).getPersonName());
|
||||||
|
taskItems.add(taskItem1);
|
||||||
|
Collections.reverse(taskItems);
|
||||||
|
taskItemsList.setTaskItems(taskItems);
|
||||||
|
ls.set(0, taskItemsList);
|
||||||
|
record.setLs(ls);
|
||||||
|
} else {
|
||||||
|
FlowsTaskItem taskItem = new FlowsTaskItem();
|
||||||
|
taskItem.setDueDate(new Date());
|
||||||
|
taskItem.setAssigneeName(getPersonalByUserLogin(Long.parseLong(ext.getString("endExecutor"))).getPersonName());
|
||||||
|
taskItem.setNodeName(ext.getString("taskName"));
|
||||||
|
taskItem.setActionName("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
if (StringUtils.isEmpty(opinion) || "null".equals(opinion)) {//审批意见
|
||||||
|
taskItem.setActionReason("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
} else taskItem.setActionReason(String.valueOf(map.get("opinion")));
|
||||||
|
taskItems.add(taskItem);
|
||||||
|
FlowsTaskItem taskItem1 = new FlowsTaskItem();
|
||||||
|
taskItem1.setNodeName(taskName);
|
||||||
|
taskItem1.setAssigneeName(getPersonalByUserLogin(Long.parseLong(String.valueOf(map.get("endExecutor")))).getPersonName());
|
||||||
|
taskItems.add(taskItem1);
|
||||||
|
Collections.reverse(taskItems);//倒转
|
||||||
|
taskItemsList.setTaskItems(taskItems);
|
||||||
|
ls.add(taskItemsList);
|
||||||
|
record.setLs(ls);
|
||||||
|
}
|
||||||
|
ext.put("endRecord", record);
|
||||||
|
ext.put("taskName", taskName);
|
||||||
|
ext.put("endExecutor", map.get("endExecutor"));
|
||||||
projectInfo.setExt(ext);
|
projectInfo.setExt(ext);
|
||||||
return infoService.updateById(projectInfo);
|
return infoService.updateById(projectInfo);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user