1.季度审核A表流转记录修改,B表流转记录添加
This commit is contained in:
parent
a25f980118
commit
0c5ccceec4
@ -29,6 +29,7 @@ import com.xqopen.kehui.util.ApiResponse;
|
|||||||
import com.xqopen.kehui.util.PageNoUtil;
|
import com.xqopen.kehui.util.PageNoUtil;
|
||||||
import com.xqopen.kehui.util.ResultListReqUtil;
|
import com.xqopen.kehui.util.ResultListReqUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections.list.TransformedList;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
@ -194,6 +195,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
if (!ObjectUtils.isEmpty(ext.get("businessNumber"))) {
|
if (!ObjectUtils.isEmpty(ext.get("businessNumber"))) {
|
||||||
businessNumber = Integer.parseInt(String.valueOf(ext.get("businessNumber")));
|
businessNumber = Integer.parseInt(String.valueOf(ext.get("businessNumber")));
|
||||||
}
|
}
|
||||||
|
map.put("businessNumber", businessNumber);
|
||||||
map.put("userId", String.valueOf(userId));
|
map.put("userId", String.valueOf(userId));
|
||||||
switch (taskName) {
|
switch (taskName) {
|
||||||
case "季度审核填报":
|
case "季度审核填报":
|
||||||
@ -213,9 +215,15 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
case "部门主任评级":
|
case "部门主任评级":
|
||||||
if ("0".equals(examine)) {
|
if ("0".equals(examine)) {
|
||||||
map.put("isBusiness", true);//添加当前是部门主任的标记
|
map.put("isBusiness", true);//添加当前是部门主任的标记
|
||||||
Object o = businessNumber == 3 ? map.put("taskName", "管理员审核") : map.put("taskName", "部门主任评级");
|
if(businessNumber==3){
|
||||||
|
map.put("taskName", "管理员审核");
|
||||||
|
map.put("businessNumber", 0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
map.put("taskName", "部门主任评级");
|
||||||
|
}
|
||||||
|
// Object o = businessNumber == 3 ? map.put("taskName", "管理员审核") : map.put("taskName", "部门主任评级");
|
||||||
// map.put("taskName","管理员审核");
|
// map.put("taskName","管理员审核");
|
||||||
map.put("businessNumber", businessNumber);
|
|
||||||
map.put("executor", ext.get("projectAdmin"));
|
map.put("executor", ext.get("projectAdmin"));
|
||||||
// examine(userId, "管理员审核", ext, "projectAdmin", projectInfo);
|
// examine(userId, "管理员审核", ext, "projectAdmin", projectInfo);
|
||||||
} else if ("1".equals(examine)) {
|
} else if ("1".equals(examine)) {
|
||||||
@ -227,6 +235,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
case "管理员审核":
|
case "管理员审核":
|
||||||
// ext.put("adminSpyj", map.get("spyj"));
|
// ext.put("adminSpyj", map.get("spyj"));
|
||||||
// map.put("adminSpyj", map.get("spyj"));
|
// map.put("adminSpyj", map.get("spyj"));
|
||||||
|
map.put("businessNumber", 0);
|
||||||
if ("0".equals(examine)) {
|
if ("0".equals(examine)) {
|
||||||
map.put("taskName", "分管领导审核");
|
map.put("taskName", "分管领导审核");
|
||||||
map.put("executor", ext.get("branchLeaders"));
|
map.put("executor", ext.get("branchLeaders"));
|
||||||
@ -234,6 +243,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
} else if ("1".equals(examine)) {
|
} else if ("1".equals(examine)) {
|
||||||
if (isOffice) {
|
if (isOffice) {
|
||||||
map.put("taskName", "部门主任评级");
|
map.put("taskName", "部门主任评级");
|
||||||
|
map.put("businessNumber", 0);
|
||||||
// examine(userId, "部门主任评级", ext, "", projectInfo);
|
// examine(userId, "部门主任评级", ext, "", projectInfo);
|
||||||
} else {
|
} else {
|
||||||
map.put("taskName", "季度审核填报");
|
map.put("taskName", "季度审核填报");
|
||||||
@ -243,6 +253,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "分管领导审核":
|
case "分管领导审核":
|
||||||
|
map.put("businessNumber", 0);
|
||||||
// map.put("branchLeadersSpyj", map.get("spyj"));
|
// map.put("branchLeadersSpyj", map.get("spyj"));
|
||||||
// ext.put("branchLeadersSpyj", map.get("spyj"));
|
// ext.put("branchLeadersSpyj", map.get("spyj"));
|
||||||
if ("0".equals(examine)) {
|
if ("0".equals(examine)) {
|
||||||
@ -256,6 +267,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "主要领导审核":
|
case "主要领导审核":
|
||||||
|
map.put("businessNumber", 0);
|
||||||
// map.put("MainLeaderSpyj", map.get("spyj"));
|
// map.put("MainLeaderSpyj", map.get("spyj"));
|
||||||
if ("0".equals(examine)) {
|
if ("0".equals(examine)) {
|
||||||
// ext.put("MainLeaderSpyj", map.get("spyj"));
|
// ext.put("MainLeaderSpyj", map.get("spyj"));
|
||||||
@ -358,10 +370,10 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
String examine = String.valueOf(map.get("examine"));
|
String examine = String.valueOf(map.get("examine"));
|
||||||
String spyj = String.valueOf(map.get("spyj"));
|
String spyj = String.valueOf(map.get("spyj"));
|
||||||
|
|
||||||
FlowsRecordResp quarterRecord=new FlowsRecordResp();
|
FlowsRecordResp quarterRecord = new FlowsRecordResp();
|
||||||
List<FlowsRecordList> ls=new ArrayList<>();
|
List<FlowsRecordList> ls = new ArrayList<>();
|
||||||
FlowsRecordList taskItemsList=new FlowsRecordList();
|
FlowsRecordList taskItemsList = new FlowsRecordList();
|
||||||
List<FlowsTaskItem> taskItems=new ArrayList<>();
|
List<FlowsTaskItem> taskItems = new ArrayList<>();
|
||||||
|
|
||||||
if (!"部门主任评级".equals(taskName)) {
|
if (!"部门主任评级".equals(taskName)) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
@ -369,22 +381,24 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
JSONObject ext = indicators.getExt();
|
JSONObject ext = indicators.getExt();
|
||||||
|
|
||||||
//流转
|
//流转
|
||||||
if(ext.containsKey("quarterRecord")){
|
if (!"3".equals(map.get("businessNumber").toString())) {//如果不是B表(办公室)走普通流程
|
||||||
|
if (ext.containsKey("quarterRecord")) {
|
||||||
quarterRecord = ((JSONObject) ext.get("quarterRecord")).toJavaObject(FlowsRecordResp.class);
|
quarterRecord = ((JSONObject) ext.get("quarterRecord")).toJavaObject(FlowsRecordResp.class);
|
||||||
ls = quarterRecord.getLs();
|
ls = quarterRecord.getLs();
|
||||||
taskItemsList = ls.get(0);
|
taskItemsList = ls.get(0);
|
||||||
taskItems = taskItemsList.getTaskItems();
|
taskItems = taskItemsList.getTaskItems();
|
||||||
Collections.reverse(taskItems);
|
Collections.reverse(taskItems);
|
||||||
FlowsTaskItem taskItem = taskItems.get(taskItems.size()-1);
|
FlowsTaskItem taskItem = taskItems.get(taskItems.size() - 1);
|
||||||
taskItem.setDueDate(new Date());
|
taskItem.setDueDate(new Date());
|
||||||
taskItem.setActionName("0".equals(examine) ? "同意" : "驳回");
|
taskItem.setActionName("0".equals(examine) ? "同意" : "驳回");
|
||||||
if (StringUtils.isEmpty(spyj) ||"null".equals(spyj)) {//审批意见
|
if (StringUtils.isEmpty(spyj) || "null".equals(spyj)) {//审批意见
|
||||||
taskItem.setActionReason("0".equals(examine) ? "同意" : "驳回");
|
taskItem.setActionReason("0".equals(examine) ? "同意" : "驳回");
|
||||||
} else taskItem.setActionReason(spyj);
|
} else taskItem.setActionReason(spyj);
|
||||||
taskItems.set(taskItems.size() - 1, taskItem);
|
taskItems.set(taskItems.size() - 1, taskItem);
|
||||||
if(!"流程结束".equals(taskName)){
|
if (!"流程结束".equals(taskName)) {
|
||||||
FlowsTaskItem taskItem1 = new FlowsTaskItem();
|
FlowsTaskItem taskItem1 = new FlowsTaskItem();
|
||||||
taskItem1.setNodeName(taskName);
|
taskItem1.setNodeName(taskName);
|
||||||
|
taskItem1.setAssigneeId(String.valueOf(map.get("executor")));
|
||||||
taskItem1.setAssigneeName(getPersonalByUserLogin(Long.parseLong(String.valueOf(map.get("executor")))).getPersonName());
|
taskItem1.setAssigneeName(getPersonalByUserLogin(Long.parseLong(String.valueOf(map.get("executor")))).getPersonName());
|
||||||
taskItems.add(taskItem1);
|
taskItems.add(taskItem1);
|
||||||
}
|
}
|
||||||
@ -392,9 +406,11 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
taskItemsList.setTaskItems(taskItems);
|
taskItemsList.setTaskItems(taskItems);
|
||||||
ls.set(0, taskItemsList);
|
ls.set(0, taskItemsList);
|
||||||
quarterRecord.setLs(ls);
|
quarterRecord.setLs(ls);
|
||||||
}else {
|
}
|
||||||
|
else {
|
||||||
FlowsTaskItem taskItem = new FlowsTaskItem();
|
FlowsTaskItem taskItem = new FlowsTaskItem();
|
||||||
taskItem.setDueDate(new Date());
|
taskItem.setDueDate(new Date());
|
||||||
|
taskItem.setAssigneeId(userId);
|
||||||
taskItem.setAssigneeName(getPersonalByUserLogin(Long.parseLong(ext.getString("executor"))).getPersonName());
|
taskItem.setAssigneeName(getPersonalByUserLogin(Long.parseLong(ext.getString("executor"))).getPersonName());
|
||||||
taskItem.setNodeName(ext.getString("taskName"));
|
taskItem.setNodeName(ext.getString("taskName"));
|
||||||
taskItem.setActionName("0".equals(examine) ? "同意" : "驳回");
|
taskItem.setActionName("0".equals(examine) ? "同意" : "驳回");
|
||||||
@ -404,6 +420,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
taskItems.add(taskItem);
|
taskItems.add(taskItem);
|
||||||
FlowsTaskItem taskItem1 = new FlowsTaskItem();
|
FlowsTaskItem taskItem1 = new FlowsTaskItem();
|
||||||
taskItem1.setNodeName(taskName);
|
taskItem1.setNodeName(taskName);
|
||||||
|
taskItem1.setAssigneeId(String.valueOf(map.get("executor")));
|
||||||
taskItem1.setAssigneeName(getPersonalByUserLogin(Long.parseLong(String.valueOf(map.get("executor")))).getPersonName());
|
taskItem1.setAssigneeName(getPersonalByUserLogin(Long.parseLong(String.valueOf(map.get("executor")))).getPersonName());
|
||||||
taskItems.add(taskItem1);
|
taskItems.add(taskItem1);
|
||||||
Collections.reverse(taskItems);//倒转
|
Collections.reverse(taskItems);//倒转
|
||||||
@ -411,7 +428,34 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
ls.add(taskItemsList);
|
ls.add(taskItemsList);
|
||||||
quarterRecord.setLs(ls);
|
quarterRecord.setLs(ls);
|
||||||
}
|
}
|
||||||
ext.put("quarterRecord",quarterRecord);
|
} else {
|
||||||
|
quarterRecord = ((JSONObject) ext.get("quarterRecord")).toJavaObject(FlowsRecordResp.class);
|
||||||
|
ls = quarterRecord.getLs();
|
||||||
|
taskItemsList = ls.get(0);
|
||||||
|
taskItems = taskItemsList.getTaskItems();
|
||||||
|
Collections.reverse(taskItems);
|
||||||
|
int fromIndex = taskItems.size() - 4;
|
||||||
|
List<FlowsTaskItem> flowsTaskItems = taskItems.subList(fromIndex, taskItems.size());//四个主任
|
||||||
|
flowsTaskItems.forEach(a -> {
|
||||||
|
if (userId.equals(a.getAssigneeId())) {//判断当前是哪个主任执行任务
|
||||||
|
a.setDueDate(new Date());
|
||||||
|
a.setActionName("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
if (StringUtils.isEmpty(spyj) || "null".equals(spyj)) {//审批意见
|
||||||
|
a.setActionReason("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
} else a.setActionReason(spyj);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
FlowsTaskItem taskItem = new FlowsTaskItem();
|
||||||
|
taskItem.setNodeName(taskName);
|
||||||
|
taskItem.setAssigneeId(String.valueOf(map.get("executor")));
|
||||||
|
taskItem.setAssigneeName(getPersonalByUserLogin(Long.parseLong(String.valueOf(map.get("executor")))).getPersonName());
|
||||||
|
taskItems.add(taskItem);
|
||||||
|
Collections.reverse(taskItems);
|
||||||
|
taskItemsList.setTaskItems(taskItems);
|
||||||
|
ls.set(0, taskItemsList);
|
||||||
|
quarterRecord.setLs(ls);
|
||||||
|
}
|
||||||
|
ext.put("quarterRecord", quarterRecord);
|
||||||
|
|
||||||
ext.put("executor", map.get("executor"));
|
ext.put("executor", map.get("executor"));
|
||||||
ext.put("taskName", taskName);
|
ext.put("taskName", taskName);
|
||||||
@ -430,9 +474,9 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean isOffice = (boolean) map.get("isOffice");
|
boolean isOffice = (boolean) map.get("isOffice");
|
||||||
if(isOffice & "管理员审核".equals(taskName)){
|
if (isOffice & "管理员审核".equals(taskName)) {
|
||||||
if (!ObjectUtils.isEmpty(ext.get("businessNumber")) & "3".equals(String.valueOf(map.get("businessNumber")))) {
|
if (!ObjectUtils.isEmpty(ext.get("businessNumber")) & "3".equals(String.valueOf(map.get("businessNumber")))) {
|
||||||
if(!str.contains(String.valueOf(userId))){
|
if (!str.contains(String.valueOf(userId))) {
|
||||||
historyExecutor = str + "," + userId;
|
historyExecutor = str + "," + userId;
|
||||||
ext.put("historyExecutor", historyExecutor);
|
ext.put("historyExecutor", historyExecutor);
|
||||||
}
|
}
|
||||||
@ -474,6 +518,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
userLoginEntityWrapper.in("userinfo_id", longs);
|
userLoginEntityWrapper.in("userinfo_id", longs);
|
||||||
userLoginEntityWrapper.setSqlSelect("string_agg(id_::text,',')");
|
userLoginEntityWrapper.setSqlSelect("string_agg(id_::text,',')");
|
||||||
String executor = String.valueOf(userLoginService.selectObj(userLoginEntityWrapper));
|
String executor = String.valueOf(userLoginService.selectObj(userLoginEntityWrapper));
|
||||||
|
String[] executorList = executor.split(",");
|
||||||
boolean isBusiness = false;
|
boolean isBusiness = false;
|
||||||
if (!ObjectUtils.isEmpty(map.get("isBusiness"))) {
|
if (!ObjectUtils.isEmpty(map.get("isBusiness"))) {
|
||||||
isBusiness = (boolean) map.get("isBusiness");
|
isBusiness = (boolean) map.get("isBusiness");
|
||||||
@ -496,6 +541,79 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
if (!StringUtils.isEmpty(historyExecutor) && !historyExecutor.contains(userId)) {
|
if (!StringUtils.isEmpty(historyExecutor) && !historyExecutor.contains(userId)) {
|
||||||
ext.put("historyExecutor", historyExecutor + "," + userId); //历史委托
|
ext.put("historyExecutor", historyExecutor + "," + userId); //历史委托
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (businessNumber == 0) {
|
||||||
|
quarterRecord = new FlowsRecordResp();
|
||||||
|
ls = new ArrayList<>();
|
||||||
|
taskItems = new ArrayList<>();
|
||||||
|
taskItemsList = new FlowsRecordList();
|
||||||
|
if (ext.containsKey("quarterRecord")) {
|
||||||
|
quarterRecord = ((JSONObject) ext.get("quarterRecord")).toJavaObject(FlowsRecordResp.class);
|
||||||
|
ls = quarterRecord.getLs();
|
||||||
|
taskItemsList = ls.get(0);
|
||||||
|
taskItems = taskItemsList.getTaskItems();
|
||||||
|
Collections.reverse(taskItems);
|
||||||
|
FlowsTaskItem taskItem = taskItems.get(taskItems.size() - 1);
|
||||||
|
taskItem.setDueDate(new Date());
|
||||||
|
taskItem.setActionName("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
if (StringUtils.isEmpty(spyj) || "null".equals(spyj)) {//审批意见
|
||||||
|
taskItem.setActionReason("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
} else taskItem.setActionReason(spyj);
|
||||||
|
taskItems.set(taskItems.size()-1,taskItem);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
FlowsTaskItem taskItem = new FlowsTaskItem();
|
||||||
|
taskItem.setDueDate(new Date());
|
||||||
|
taskItem.setNodeName(ext.getString("taskName"));
|
||||||
|
taskItem.setAssigneeId(userId);
|
||||||
|
taskItem.setAssigneeName(getPersonalByUserLogin(Long.valueOf(userId)).getPersonName());
|
||||||
|
taskItem.setActionName("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
if (StringUtils.isEmpty(spyj) || "null".equals(spyj)) {//审批意见
|
||||||
|
taskItem.setActionReason("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
} else taskItem.setActionReason(spyj);
|
||||||
|
taskItems.add(taskItem);
|
||||||
|
}
|
||||||
|
//添加部门数据
|
||||||
|
for (int j = 0; j < executorList.length; j++) {
|
||||||
|
FlowsTaskItem taskItem1 = new FlowsTaskItem();
|
||||||
|
taskItem1.setNodeName(taskName);
|
||||||
|
taskItem1.setAssigneeId(executorList[j]);
|
||||||
|
taskItem1.setAssigneeName(getPersonalByUserLogin(Long.parseLong(executorList[j])).getPersonName());
|
||||||
|
taskItems.add(taskItem1);
|
||||||
|
}
|
||||||
|
Collections.reverse(taskItems);
|
||||||
|
taskItemsList.setTaskItems(taskItems);
|
||||||
|
if (ext.containsKey("quarterRecord")) {
|
||||||
|
ls.set(0, taskItemsList);
|
||||||
|
} else {
|
||||||
|
ls.add(taskItemsList);
|
||||||
|
}
|
||||||
|
quarterRecord.setLs(ls);
|
||||||
|
ext.put("quarterRecord", quarterRecord);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
quarterRecord = ((JSONObject) ext.get("quarterRecord")).toJavaObject(FlowsRecordResp.class);
|
||||||
|
ls = quarterRecord.getLs();
|
||||||
|
taskItemsList = ls.get(0);
|
||||||
|
taskItems = taskItemsList.getTaskItems();
|
||||||
|
Collections.reverse(taskItems);
|
||||||
|
int fromIndex = taskItems.size() - 4;
|
||||||
|
List<FlowsTaskItem> flowsTaskItems = taskItems.subList(fromIndex, taskItems.size());//四个主任
|
||||||
|
flowsTaskItems.forEach(a -> {
|
||||||
|
if (userId.equals(a.getAssigneeId())) {//判断当前是哪个主任执行任务
|
||||||
|
a.setDueDate(new Date());
|
||||||
|
a.setActionName("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
if (StringUtils.isEmpty(spyj) || "null".equals(spyj)) {//审批意见
|
||||||
|
a.setActionReason("0".equals(examine) ? "同意" : "驳回");
|
||||||
|
} else a.setActionReason(spyj);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Collections.reverse(taskItems);
|
||||||
|
taskItemsList.setTaskItems(taskItems);
|
||||||
|
ls.set(0, taskItemsList);
|
||||||
|
quarterRecord.setLs(ls);
|
||||||
|
ext.put("quarterRecord", quarterRecord);
|
||||||
|
}
|
||||||
ext.put("taskName", map.get("taskName"));
|
ext.put("taskName", map.get("taskName"));
|
||||||
ext.put("businessNumber", businessNumber);
|
ext.put("businessNumber", businessNumber);
|
||||||
ext.put("executor", executor);
|
ext.put("executor", executor);
|
||||||
@ -516,6 +634,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
|
|||||||
}
|
}
|
||||||
return systemUserLogin;
|
return systemUserLogin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过账号id拿到人事对象
|
* 通过账号id拿到人事对象
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user