1.api增加结项审核路由

2.项目结项列表增加代办/已办判断
3.项目结项审核方法修改,增加历史委托人字段
4.项目立项监控器增加结项委托人、历史委托人字段
This commit is contained in:
zty 2024-08-02 16:05:57 +08:00
parent 1bc8939482
commit 28a8756f83
7 changed files with 87 additions and 50 deletions

View File

@ -374,6 +374,7 @@ public class Api {
public static final String PROJECT_INIT_CONCLUSION= PROJECT_INIT+"/conclusion";
public static final String PROJECT_INIT_CONCLUSION_LIST= PROJECT_INIT_CONCLUSION+"/list";
public static final String PROJECT_INIT_CONCLUSION_UPDATE= PROJECT_INIT_CONCLUSION+"/update";
public static final String PROJECT_INIT_CONCLUSION_EXAMINE= PROJECT_INIT_CONCLUSION+"/examine";
/***
* 周报填报管理
*/

View File

@ -147,8 +147,9 @@ public class ProjectInitListener implements ExecutionListener {
//添加季度审核的状态
JSONObject infoExt = projectInfo.getExt();
infoExt.put("taskName", "结项填报");//任务节点
// infoExt.put("executor",executor);
infoExt.put("executor", executor);
infoExt.put("endExecutor",String.valueOf(projectInfo.getCreatedBy()));//结项的第一个节点的委托人一定是项目专员也就是立项的创建人
infoExt.put("endHistorical",infoExt.get("endExecutor"));//添加第一个历史委托人
// infoExt.put("executor",getSystemUserLogin(projectManager).getId());//当前委托人
//判断项目负责人是否是办公室部门的
EntityWrapper<SystemOrg> orgEntityWrapper = new EntityWrapper<>();

View File

@ -8,6 +8,7 @@ import com.xqopen.kehui.project.entity.ProjectInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -41,5 +42,5 @@ public interface ProjectInfoDao extends BaseMapper<ProjectInfo> {
ProjectInfo getInfoByProName(@Param("projectName") String projectName);
String getProId(@Param("projectName") String projectName);
List<ProjectInfoListItemResp> conclusionList(Page<ProjectInfo> page,@Param("projectInfo") ProjectInfo projectInfo);
List<ProjectInfoListItemResp> conclusionList(Page<ProjectInfo> page,@Param("map") Map map);
}

View File

@ -170,12 +170,18 @@
select pm.person_name as projectManagerData,pi.* from project_info pi
LEFT JOIN system_user_login ui on CAST(pi.created_by AS bigint)=ui.id_
LEFT JOIN personal_member pm on ui.userinfo_id=pm.id_
WHERE pi.is_deleted=false and pi.ext_->>'taskName' !='结项完成'
<if test="projectInfo.createdBy!=null">
and pi.created_by=#{projectInfo.createdBy} or pi.ext_ ->> 'endExecutor' =CAST(#{projectInfo.createdBy} AS varchar)
WHERE pi.is_deleted=false
<if test="map.verifyStatus==1">
<if test="map.userId!=null">
-- and pi.ext_->>'taskName' !='结项完成'
and pi.ext_ ->> 'endExecutor' =CAST(#{map.userId} AS varchar)
</if>
<if test="projectInfo.id!=null">
and pi.id_=#{projectInfo.id}
</if>
<if test="map.verifyStatus==2">
and pi.ext_ ->> 'endHistorical' like CONCAT('%', #{map.userId}, '%')
</if>
<if test="map.id!=null">
and CAST(pi.id_ AS varchar)=#{map.id}
</if>
order by pi.created_at desc
</select>

View File

@ -145,9 +145,9 @@ public class ProjectInitComtroller implements ProjectInitApi {
//项目编号:年份-部门-类别-序号
StringBuffer buffer = new StringBuffer();
buffer.append(year).append("-");
ArrayList signedDepts= (ArrayList) infoExt.get("signedDepts");//获取立项部门
String orgId= String.valueOf(signedDepts.get(0));//获取立项Id//根据项目名称拼接
switch (orgId){
ArrayList signedDepts = (ArrayList) infoExt.get("signedDepts");//获取立项部门
String orgId = String.valueOf(signedDepts.get(0));//获取立项Id//根据项目名称拼接
switch (orgId) {
case "1215549953418465281":
buffer.append("BGS");//办公室
break;
@ -167,7 +167,7 @@ public class ProjectInitComtroller implements ProjectInitApi {
//项目类别
buffer.append("-");
String openRange = String.valueOf(infoExt.get("openRange"));
switch (openRange){
switch (openRange) {
case "1":
buffer.append("TT");
break;
@ -195,8 +195,8 @@ public class ProjectInitComtroller implements ProjectInitApi {
}
//序号
EntityWrapper<ProjectInfo> infoEntityWrapper = new EntityWrapper<>();
infoEntityWrapper.eq(ProjectInfo.IS_DELETED,false);
infoEntityWrapper.like(ProjectInfo.PROJECT_NO,buffer.toString());
infoEntityWrapper.eq(ProjectInfo.IS_DELETED, false);
infoEntityWrapper.like(ProjectInfo.PROJECT_NO, buffer.toString());
int count = infoService.selectCount(infoEntityWrapper); //条数
count++;
buffer.append("-").append(String.format("%03d", count)); //生成编号
@ -213,7 +213,7 @@ public class ProjectInitComtroller implements ProjectInitApi {
if (!membersList.isEmpty()) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("executor", getSystemUserLogin(projectManagerData).getId());//第一个节点执行人一定是项目负责人
jsonObject.put("historyExecutor",jsonObject.get("executor"));
jsonObject.put("historyExecutor", jsonObject.get("executor"));
jsonObject.put("taskName", "季度审核填报");
jsonObject.put("projectManager", jsonObject.get("executor"));
// jsonObject.put("projectAdmin", getSystemUserLogin(projectAdmin).getId());
@ -401,9 +401,9 @@ public class ProjectInitComtroller implements ProjectInitApi {
public String conclusionList(@RequestHeader Long userId, @RequestBody PageNoUtil<ProjectInfo> pageNoUtil) throws XQException {
try {
Page<ProjectInfo> page = new Page<>(pageNoUtil.getPageNo(), pageNoUtil.getPageSize());
ProjectInfo info = pageNoUtil.getT();
info.setCreatedBy(userId);
List<ProjectInfoListItemResp> list = infoService.conclusionList(page, info);
Map map = pageNoUtil.getMap();
map.put("userId",userId);
List<ProjectInfoListItemResp> list = infoService.conclusionList(page, map);
return ApiResponse.fillSuccess(new ResultListReqUtil<ProjectInfoListItemResp>(list, page.getTotal(), page.getPages()));
} catch (Exception e) {
log.error("ProjectInitController.conclusionList", e);
@ -450,75 +450,88 @@ public class ProjectInitComtroller implements ProjectInitApi {
return ApiResponse.fillFail("错误请联系管理员");
}
/**
* 结项审核(流程)
*
* @param userId
* @param map
* @return
* @throws XQException
*/
@Override
@PostMapping(Api.PROJECT_INIT_CONCLUSION_EXAMINE)
public String examine(@RequestHeader Long userId, @RequestBody Map map) throws XQException {
try {
if (!ObjectUtils.isEmpty(map.get("id"))) {
Long id = Long.parseLong(String.valueOf(map.get("id")));//项目di
Long id = Long.parseLong(String.valueOf(map.get("id")));//项目id
EntityWrapper<ProjectInfo> infoEntityWrapper = new EntityWrapper<>();
infoEntityWrapper.eq(ProjectInfo.IS_DELETED, false);
infoEntityWrapper.eq(ProjectInfo.ID_, id);
ProjectInfo projectInfo = infoService.selectOne(infoEntityWrapper);
if (!ObjectUtils.isEmpty(projectInfo)) {
JSONObject ext = projectInfo.getExt();
String taskName = String.valueOf(ext.get("taskName"));
String taskName = String.valueOf(ext.get("taskName"));//节点名称
String examine = String.valueOf(map.get("examine"));//通过or驳回
String opinion = String.valueOf(map.get("opinion"));
if (!StringUtils.isEmpty(examine)) {
String opinion = String.valueOf(map.get("opinion"));//审核意见
if (StringUtils.isEmpty(examine)) {
return ApiResponse.fillFail("无法判断是提交还是驳回");
}
map.put("userId", String.valueOf(userId));//当前委托人id
switch (taskName) {
case "结项填报":
if ("1".equals(examine)) {
return ApiResponse.fillFail("结项填报无法驳回!");
} else if ("0".equals(examine)) {
JSONArray projectManagerData = (JSONArray) ext.get("projectManagerData");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectManagerData.get(1))));
map.put("taskName", "项目负责人审核");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectManagerData.get(1))).getId());
map.put("taskName", "项目负责人");
}
break;
case "项目负责人审核":
map.put("projectManagerOpinion",opinion);
case "项目负责人":
map.put("projectManagerOpinion", opinion);
if ("1".equals(examine)) {
JSONArray draftManId = (JSONArray) ext.get("draftManId");
map.put("endExecutor", getSystemUserLogin(String.valueOf(draftManId.get(1))));
String draftManId = String.valueOf(ext.get("draftManId"));
map.put("endExecutor", getSystemUserLogin(draftManId).getId());
map.put("taskName", "结项填报");
} else if ("0".equals(examine)) {
JSONArray projectAdmin = (JSONArray) ext.get("projectAdmin");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectAdmin.get(1))));
map.put("taskName", "项目管理员审核");
map.put("endExecutor", projectAdmin.get(0));
map.put("taskName", "项目管理员");
}
break;
case "项目管理员审核":
case "项目管理员":
map.put("projectAdminOpinion", opinion);
if ("1".equals(examine)) {
JSONArray projectManagerData = (JSONArray) ext.get("projectManagerData");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectManagerData.get(1))));
map.put("taskName", "项目负责人审核");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectManagerData.get(1))).getId());
map.put("taskName", "项目负责人");
} else if ("0".equals(examine)) {
JSONArray branchLeaders = (JSONArray) ext.get("branchLeaders");
map.put("endExecutor", getSystemUserLogin(String.valueOf(branchLeaders.get(1))));
map.put("taskName", "分管领导审核");
map.put("endExecutor", branchLeaders.get(0));
map.put("taskName", "分管领导");
}
break;
case "分管领导审核":
case "分管领导":
map.put("branchLeaderOpinion", opinion);
if ("1".equals(examine)) {
JSONArray projectAdmin = (JSONArray) ext.get("projectAdmin");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectAdmin.get(1))));
map.put("taskName", "项目管理员审核");
map.put("endExecutor", projectAdmin.get(0));
map.put("taskName", "项目管理员");
} else if ("0".equals(examine)) {
JSONArray MainLeader = (JSONArray) ext.get("MainLeader");
map.put("endExecutor", getSystemUserLogin(String.valueOf(MainLeader.get(1))));
map.put("taskName", "主要领导批准");
map.put("endExecutor", MainLeader.get(0));
map.put("taskName", "主要领导");
}
break;
case "主要领导批准":
case "主要领导":
map.put("mainLeaderOpinion", opinion);
if ("1".equals(examine)) {
map.put("endExecutor", " ");
map.put("taskName", "结项完成");
JSONArray branchLeaders = (JSONArray) ext.get("branchLeaders");
map.put("endExecutor", branchLeaders.get(0));
map.put("taskName", "分管领导");
} else if ("0".equals(examine)) {
JSONArray projectAdmin = (JSONArray) ext.get("projectAdmin");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectAdmin.get(1))));
map.put("taskName", "分管领导审核");
map.put("endExecutor", "");
map.put("taskName", "结项完成");
}
break;
}
@ -552,6 +565,19 @@ public class ProjectInitComtroller implements ProjectInitApi {
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 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 mainLeaderOpinion = map.get("mainLeaderOpinion") != null ? ext.put("mainLeaderOpinion", String.valueOf(map.get("projectManagerOpinion"))) : null;
if (ext.containsKey("endHistorical")) {//结项历史委托
String endHistorical = String.valueOf(ext.get("endHistorical"));
if (!endHistorical.contains(String.valueOf(map.get("userId")))) {
endHistorical = endHistorical + "," + map.get("userId");
ext.put("endHistorical", endHistorical);
}
}
projectInfo.setExt(ext);
return infoService.updateById(projectInfo);
}
}

View File

@ -7,6 +7,7 @@ import com.xqopen.kehui.project.dto.ProjectInfoListItemResp;
import com.xqopen.kehui.project.entity.ProjectInfo;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -32,8 +33,8 @@ public interface IProjectInfoService extends IService<ProjectInfo> {
/**
* 根据创建id拿到结项列表其实也就是立项人是谁谁就能结项
* @param page
* @param projectInfo
* @param map
* @return
*/
List<ProjectInfoListItemResp> conclusionList(Page<ProjectInfo> page, ProjectInfo projectInfo);
List<ProjectInfoListItemResp> conclusionList(Page<ProjectInfo> page, Map map);
}

View File

@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -55,7 +56,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoDao, ProjectI
}
@Override
public List<ProjectInfoListItemResp> conclusionList(Page<ProjectInfo> page,ProjectInfo projectInfo) {
return infoDao.conclusionList(page,projectInfo);
public List<ProjectInfoListItemResp> conclusionList(Page<ProjectInfo> page, Map map) {
return infoDao.conclusionList(page,map);
}
}