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= PROJECT_INIT+"/conclusion";
public static final String PROJECT_INIT_CONCLUSION_LIST= PROJECT_INIT_CONCLUSION+"/list"; 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_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(); JSONObject infoExt = projectInfo.getExt();
infoExt.put("taskName", "结项填报");//任务节点 infoExt.put("taskName", "结项填报");//任务节点
// infoExt.put("executor",executor);
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());//当前委托人 // infoExt.put("executor",getSystemUserLogin(projectManager).getId());//当前委托人
//判断项目负责人是否是办公室部门的 //判断项目负责人是否是办公室部门的
EntityWrapper<SystemOrg> orgEntityWrapper = new EntityWrapper<>(); 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 org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
@ -41,5 +42,5 @@ public interface ProjectInfoDao extends BaseMapper<ProjectInfo> {
ProjectInfo getInfoByProName(@Param("projectName") String projectName); ProjectInfo getInfoByProName(@Param("projectName") String projectName);
String getProId(@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 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 system_user_login ui on CAST(pi.created_by AS bigint)=ui.id_
LEFT JOIN personal_member pm on ui.userinfo_id=pm.id_ LEFT JOIN personal_member pm on ui.userinfo_id=pm.id_
WHERE pi.is_deleted=false and pi.ext_->>'taskName' !='结项完成' WHERE pi.is_deleted=false
<if test="projectInfo.createdBy!=null"> <if test="map.verifyStatus==1">
and pi.created_by=#{projectInfo.createdBy} or pi.ext_ ->> 'endExecutor' =CAST(#{projectInfo.createdBy} AS varchar) <if test="map.userId!=null">
-- and pi.ext_->>'taskName' !='结项完成'
and pi.ext_ ->> 'endExecutor' =CAST(#{map.userId} AS varchar)
</if> </if>
<if test="projectInfo.id!=null"> </if>
and pi.id_=#{projectInfo.id} <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> </if>
order by pi.created_at desc order by pi.created_at desc
</select> </select>

View File

@ -401,9 +401,9 @@ public class ProjectInitComtroller implements ProjectInitApi {
public String conclusionList(@RequestHeader Long userId, @RequestBody PageNoUtil<ProjectInfo> pageNoUtil) throws XQException { public String conclusionList(@RequestHeader Long userId, @RequestBody PageNoUtil<ProjectInfo> pageNoUtil) throws XQException {
try { try {
Page<ProjectInfo> page = new Page<>(pageNoUtil.getPageNo(), pageNoUtil.getPageSize()); Page<ProjectInfo> page = new Page<>(pageNoUtil.getPageNo(), pageNoUtil.getPageSize());
ProjectInfo info = pageNoUtil.getT(); Map map = pageNoUtil.getMap();
info.setCreatedBy(userId); map.put("userId",userId);
List<ProjectInfoListItemResp> list = infoService.conclusionList(page, info); List<ProjectInfoListItemResp> list = infoService.conclusionList(page, map);
return ApiResponse.fillSuccess(new ResultListReqUtil<ProjectInfoListItemResp>(list, page.getTotal(), page.getPages())); return ApiResponse.fillSuccess(new ResultListReqUtil<ProjectInfoListItemResp>(list, page.getTotal(), page.getPages()));
} catch (Exception e) { } catch (Exception e) {
log.error("ProjectInitController.conclusionList", e); log.error("ProjectInitController.conclusionList", e);
@ -450,75 +450,88 @@ public class ProjectInitComtroller implements ProjectInitApi {
return ApiResponse.fillFail("错误请联系管理员"); return ApiResponse.fillFail("错误请联系管理员");
} }
/**
* 结项审核(流程)
*
* @param userId
* @param map
* @return
* @throws XQException
*/
@Override @Override
@PostMapping(Api.PROJECT_INIT_CONCLUSION_EXAMINE)
public String examine(@RequestHeader Long userId, @RequestBody Map map) throws XQException { public String examine(@RequestHeader Long userId, @RequestBody Map map) throws XQException {
try { try {
if (!ObjectUtils.isEmpty(map.get("id"))) { 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<>(); EntityWrapper<ProjectInfo> infoEntityWrapper = new EntityWrapper<>();
infoEntityWrapper.eq(ProjectInfo.IS_DELETED, false); infoEntityWrapper.eq(ProjectInfo.IS_DELETED, false);
infoEntityWrapper.eq(ProjectInfo.ID_, id); infoEntityWrapper.eq(ProjectInfo.ID_, id);
ProjectInfo projectInfo = infoService.selectOne(infoEntityWrapper); ProjectInfo projectInfo = infoService.selectOne(infoEntityWrapper);
if (!ObjectUtils.isEmpty(projectInfo)) { if (!ObjectUtils.isEmpty(projectInfo)) {
JSONObject ext = projectInfo.getExt(); 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 examine = String.valueOf(map.get("examine"));//通过or驳回
String opinion = String.valueOf(map.get("opinion")); String opinion = String.valueOf(map.get("opinion"));//审核意见
if (!StringUtils.isEmpty(examine)) { if (StringUtils.isEmpty(examine)) {
return ApiResponse.fillFail("无法判断是提交还是驳回"); return ApiResponse.fillFail("无法判断是提交还是驳回");
} }
map.put("userId", String.valueOf(userId));//当前委托人id
switch (taskName) { switch (taskName) {
case "结项填报": case "结项填报":
if ("1".equals(examine)) { if ("1".equals(examine)) {
return ApiResponse.fillFail("结项填报无法驳回!"); return ApiResponse.fillFail("结项填报无法驳回!");
} else if ("0".equals(examine)) { } else if ("0".equals(examine)) {
JSONArray projectManagerData = (JSONArray) ext.get("projectManagerData"); JSONArray projectManagerData = (JSONArray) ext.get("projectManagerData");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectManagerData.get(1)))); map.put("endExecutor", getSystemUserLogin(String.valueOf(projectManagerData.get(1))).getId());
map.put("taskName", "项目负责人审核"); map.put("taskName", "项目负责人");
} }
break; break;
case "项目负责人审核": case "项目负责人":
map.put("projectManagerOpinion", opinion); map.put("projectManagerOpinion", opinion);
if ("1".equals(examine)) { if ("1".equals(examine)) {
JSONArray draftManId = (JSONArray) ext.get("draftManId"); String draftManId = String.valueOf(ext.get("draftManId"));
map.put("endExecutor", getSystemUserLogin(String.valueOf(draftManId.get(1)))); map.put("endExecutor", getSystemUserLogin(draftManId).getId());
map.put("taskName", "结项填报"); map.put("taskName", "结项填报");
} else if ("0".equals(examine)) { } else if ("0".equals(examine)) {
JSONArray projectAdmin = (JSONArray) ext.get("projectAdmin"); JSONArray projectAdmin = (JSONArray) ext.get("projectAdmin");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectAdmin.get(1)))); map.put("endExecutor", projectAdmin.get(0));
map.put("taskName", "项目管理员审核"); map.put("taskName", "项目管理员");
} }
break; break;
case "项目管理员审核": case "项目管理员":
map.put("projectAdminOpinion", opinion);
if ("1".equals(examine)) { if ("1".equals(examine)) {
JSONArray projectManagerData = (JSONArray) ext.get("projectManagerData"); JSONArray projectManagerData = (JSONArray) ext.get("projectManagerData");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectManagerData.get(1)))); map.put("endExecutor", getSystemUserLogin(String.valueOf(projectManagerData.get(1))).getId());
map.put("taskName", "项目负责人审核"); map.put("taskName", "项目负责人");
} else if ("0".equals(examine)) { } else if ("0".equals(examine)) {
JSONArray branchLeaders = (JSONArray) ext.get("branchLeaders"); JSONArray branchLeaders = (JSONArray) ext.get("branchLeaders");
map.put("endExecutor", getSystemUserLogin(String.valueOf(branchLeaders.get(1)))); map.put("endExecutor", branchLeaders.get(0));
map.put("taskName", "分管领导审核"); map.put("taskName", "分管领导");
} }
break; break;
case "分管领导审核": case "分管领导":
map.put("branchLeaderOpinion", opinion);
if ("1".equals(examine)) { if ("1".equals(examine)) {
JSONArray projectAdmin = (JSONArray) ext.get("projectAdmin"); JSONArray projectAdmin = (JSONArray) ext.get("projectAdmin");
map.put("endExecutor", getSystemUserLogin(String.valueOf(projectAdmin.get(1)))); map.put("endExecutor", projectAdmin.get(0));
map.put("taskName", "项目管理员审核"); map.put("taskName", "项目管理员");
} else if ("0".equals(examine)) { } else if ("0".equals(examine)) {
JSONArray MainLeader = (JSONArray) ext.get("MainLeader"); JSONArray MainLeader = (JSONArray) ext.get("MainLeader");
map.put("endExecutor", getSystemUserLogin(String.valueOf(MainLeader.get(1)))); map.put("endExecutor", MainLeader.get(0));
map.put("taskName", "主要领导批准"); map.put("taskName", "主要领导");
} }
break; break;
case "主要领导批准": case "主要领导":
map.put("mainLeaderOpinion", opinion);
if ("1".equals(examine)) { if ("1".equals(examine)) {
JSONArray branchLeaders = (JSONArray) ext.get("branchLeaders");
map.put("endExecutor", branchLeaders.get(0));
map.put("taskName", "分管领导");
} else if ("0".equals(examine)) {
map.put("endExecutor", ""); map.put("endExecutor", "");
map.put("taskName", "结项完成"); 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", "分管领导审核");
} }
break; break;
} }
@ -552,6 +565,19 @@ public class ProjectInitComtroller implements ProjectInitApi {
String taskName = String.valueOf(map.get("taskName")); String taskName = String.valueOf(map.get("taskName"));
ext.put("taskName", taskName); ext.put("taskName", taskName);
ext.put("endExecutor", map.get("endExecutor")); 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); 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 com.xqopen.kehui.project.entity.ProjectInfo;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
@ -32,8 +33,8 @@ public interface IProjectInfoService extends IService<ProjectInfo> {
/** /**
* 根据创建id拿到结项列表其实也就是立项人是谁谁就能结项 * 根据创建id拿到结项列表其实也就是立项人是谁谁就能结项
* @param page * @param page
* @param projectInfo * @param map
* @return * @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 org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
@ -55,7 +56,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoDao, ProjectI
} }
@Override @Override
public List<ProjectInfoListItemResp> conclusionList(Page<ProjectInfo> page,ProjectInfo projectInfo) { public List<ProjectInfoListItemResp> conclusionList(Page<ProjectInfo> page, Map map) {
return infoDao.conclusionList(page,projectInfo); return infoDao.conclusionList(page,map);
} }
} }