1.获取季度指标列表查询方法增加代办已办判断

2.pageUtil工具类新增map成员
3.季度指标审核时新增参数历史委托人,并将每一个人节点的委托人保存
4.新增dto ProjectAssessmentIndicatorsDto,成员代办已办标记
5.立项新增批量新增项目指标的时候,增加历史托人并指认第一个委托人一定是项目负责人
This commit is contained in:
zty 2024-07-31 16:15:01 +08:00
parent d7e18dac32
commit adceecb17a
8 changed files with 72 additions and 24 deletions

View File

@ -2,6 +2,7 @@ package com.xqopen.kehui.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.xqopen.kehui.project.dto.ProjectAssessmentIndicatorsDto;
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
@ -12,6 +13,6 @@ import java.util.Map;
public interface ProjectAssessmentIndicatorsDao extends BaseMapper<ProjectAssessmentIndicators> {
@Update("update project_assessment_indicators set is_deleted='1' where project_id =#{id}")
void updateByProjectId(Long id);
List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicators> page, @Param("indicators") ProjectAssessmentIndicators indicators,@Param("userId") String userId);
List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicatorsDto> page, @Param("indicators") ProjectAssessmentIndicatorsDto indicators, @Param("userId") String userId);
List<Map<String,Object>> getQuarterList(@Param("map") Map<String,Object> map);
}

View File

@ -32,19 +32,25 @@
is_deleted,project_id,quarter,
number
</sql>
<select id="getList" resultType="com.xqopen.kehui.project.entity.ProjectAssessmentIndicators">
<select id="getList" resultType="com.xqopen.kehui.project.dto.ProjectAssessmentIndicatorsDto">
select * from project_assessment_indicators
<where>
is_deleted='0' and ext_->> 'executor' like CONCAT('%', #{userId}, '%')
<if test="indicators.projectId!=null">
and project_id =#{indicators.projectId}
</if>
<if test="indicators.id!=null">
and id_=#{indicators.id}
</if>
<if test="indicators.quarter!=null">
and quarter=#{indicators.quarter}
</if>
is_deleted='0'
<if test="indicators.verifyStatus==1">
and ext_->> 'executor' like CONCAT('%', #{userId}, '%')
</if>
<if test="indicators.verifyStatus==2">
and ext_->> 'historyExecutor' like CONCAT('%', #{userId}, '%')
</if>
<if test="indicators.projectId!=null">
and project_id =#{indicators.projectId}
</if>
<if test="indicators.id!=null">
and id_=#{indicators.id}
</if>
<if test="indicators.quarter!=null">
and quarter=#{indicators.quarter}
</if>
</where>
</select>
<select id="getQuarterList" resultType="java.util.Map">
@ -53,7 +59,12 @@
right join(SELECT quarter, AVG((ext_ ->> 'sum')::FLOAT), project_id
from project_assessment_indicators
WHERE project_id = #{map.projectId}
and ext_ ->> 'executor' like CONCAT('%', #{map.userId}, '%')
<if test="map.verifyStatus==1">
and ext_ ->> 'executor' like CONCAT('%', #{map.userId}, '%')
</if>
<if test="map.verifyStatus==2">
and ext_ ->> 'historyExecutor' like CONCAT('%', #{map.userId}, '%')
</if>
GROUP BY quarter, project_id) b on a.project_id = b.project_id and a.quarter = b.quarter ORDER BY b.quarter desc
</select>
</mapper>

View File

@ -15,6 +15,7 @@ import com.xqopen.kehui.flows.entity.FlowsConfiguration;
import com.xqopen.kehui.flows.service.IFlowsConfigurationService;
import com.xqopen.kehui.personal.service.IPersonalMemberService;
import com.xqopen.kehui.project.api.ProjectAssessmentIndicatorsApi;
import com.xqopen.kehui.project.dto.ProjectAssessmentIndicatorsDto;
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
import com.xqopen.kehui.project.entity.ProjectInfo;
import com.xqopen.kehui.project.service.IProjectAssessmentIndicatorsService;
@ -31,6 +32,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
@ -80,13 +82,12 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
@Override
@PostMapping(Api.PROJECT_QUARTERLY_EVALUATION_LIST)
public String list(@RequestHeader Long userId, @RequestBody PageNoUtil<ProjectAssessmentIndicators> pageNoUtil) throws XQException {
public String list(@RequestHeader Long userId, @RequestBody PageNoUtil<ProjectAssessmentIndicatorsDto> pageNoUtil) throws XQException {
try {
Page<ProjectAssessmentIndicators> page = new Page<>(pageNoUtil.getPageNo(), pageNoUtil.getPageSize());
Page<ProjectAssessmentIndicatorsDto> page = new Page<>(pageNoUtil.getPageNo(), pageNoUtil.getPageSize());
List<ProjectAssessmentIndicators> indicatorsServiceList = indicatorsService.getList(page, pageNoUtil.getT(), String.valueOf(userId));
ResultListReqUtil<ProjectAssessmentIndicators> listReqUtil = new ResultListReqUtil<>();
listReqUtil.setLs(indicatorsServiceList);
;
listReqUtil.setPages(page.getPages());
listReqUtil.setTotal(page.getTotal());
return ApiResponse.fillSuccess(listReqUtil);
@ -149,6 +150,8 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
}
}
indicators.setUpdatedAt(new Timestamp(System.currentTimeMillis()));
indicators.setUpdatedBy(userId);
if (indicatorsService.updateById(indicators)) return ApiResponse.fillSuccess("操作成功!");
}
}
@ -178,7 +181,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
if (!ObjectUtils.isEmpty(ext)) {
String taskName = String.valueOf(ext.get("taskName"));//节点名称
String examine = String.valueOf(map.get("examine"));//通过or驳回
if(StringUtils.isEmpty(examine)){
if (StringUtils.isEmpty(examine)) {
return ApiResponse.fillFail("无法判断是提交还是驳回");
}
boolean isOffice = (boolean) map.get("isOffice");//项目负责人是否是办公室部门的
@ -186,6 +189,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
if (!ObjectUtils.isEmpty(ext.get("businessNumber"))) {
businessNumber = Integer.parseInt(String.valueOf(ext.get("businessNumber")));
}
map.put("userId", String.valueOf(userId));
switch (taskName) {
case "季度审核填报":
if ("1".equals(examine)) {
@ -203,7 +207,6 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
break;
case "部门主任评级":
if ("0".equals(examine)) {
map.put("userId", String.valueOf(userId));
map.put("isBusiness", true);//添加当前是部门主任的标记
Object o = businessNumber == 3 ? map.put("taskName", "管理员审核") : map.put("taskName", "部门主任评级");
// map.put("taskName","管理员审核");
@ -251,12 +254,12 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
map.put("MainLeaderSpyj", map.get("spyj"));
if ("0".equals(examine)) {
// ext.put("MainLeaderSpyj", map.get("spyj"));
map.put("executor", " ");
map.put("executor", "");
map.put("taskName", "流程结束");
// examine(userId, "流程结束", ext, "MainLeader", projectInfo);
} else if ("1".equals(examine)) {
map.put("taskName", "分管领导审核");
map.put("executor",ext.get("MainLeader"));
map.put("executor", ext.get("MainLeader"));
// examine(userId, "分管领导审核", ext, "branchLeaders", projectInfo);
}
default:
@ -346,6 +349,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
public void examine(Map<String, Object> map, List<ProjectAssessmentIndicators> list) {
if (!ObjectUtils.isEmpty(list)) {
String taskName = String.valueOf(map.get("taskName"));
String userId = String.valueOf(map.get("userId"));
if (!"部门主任评级".equals(taskName)) {
for (int i = 0; i < list.size(); i++) {
ProjectAssessmentIndicators indicators = list.get(i);
@ -358,6 +362,19 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
// ext.put("adminSpyj",map.get("adminSpyj"));
// ext.put("branchLeadersSpyj",map.get("branchLeadersSpyj"));
// ext.put("MainLeaderSpyj",map.get("MainLeaderSpyj"));
String historyExecutor = new String();
if (ext.containsKey("historyExecutor")) {
String str = String.valueOf(ext.get("historyExecutor"));
if (!ObjectUtils.isEmpty(map.get("executor"))) {
if (!str.contains(String.valueOf(map.get("executor")))) {
historyExecutor = str + "," + map.get("executor");
ext.put("historyExecutor", historyExecutor);
}
}
} else {
//历史委托人
ext.put("historyExecutor", map.get("executor"));
}
indicators.setExt(ext);
}
} else {
@ -399,7 +416,6 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
businessNumber = Integer.parseInt(String.valueOf(map.get("businessNumber")));
if (!ObjectUtils.isEmpty(businessNumber)) {
businessNumber += 1;
String userId = String.valueOf(map.get("userId"));
if (executor.contains(userId)) {
executor = executor.replace(userId, "");//删掉当前已提交的部门主任id
}
@ -411,6 +427,10 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
for (int i = 0; i < list.size(); i++) {
ProjectAssessmentIndicators indicators = list.get(i);
JSONObject ext = indicators.getExt();
String historyExecutor = String.valueOf(ext.get("historyExecutor"));
if (!StringUtils.isEmpty(historyExecutor) && !historyExecutor.contains(userId)) {
ext.put("historyExecutor", historyExecutor + "," + userId); //历史委托
}
ext.put("taskName", map.get("taskName"));
ext.put("businessNumber", businessNumber);
ext.put("executor", executor);
@ -421,6 +441,7 @@ public class ProjectAssessmentIndicatorsController implements ProjectAssessmentI
indicatorsService.updateAllColumnBatchById(list);
}
}
private SystemUserLogin getSystemUserLogin(String name) {
SystemUserLogin systemUserLogin = new SystemUserLogin();
if (!StringUtils.isEmpty(name)) {

View File

@ -2,6 +2,7 @@ package com.xqopen.kehui.project.api;
import com.xqopen.kehui.exception.XQException;
import com.xqopen.kehui.project.dto.ProjectAchievementResp;
import com.xqopen.kehui.project.dto.ProjectAssessmentIndicatorsDto;
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
import com.xqopen.kehui.util.Constants;
import com.xqopen.kehui.util.PageNoUtil;
@ -25,7 +26,7 @@ public interface ProjectAssessmentIndicatorsApi {
@ApiImplicitParam(name = "token", value = "登录标识符", required = true, paramType = "header", dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户id", required = true, paramType = "header", dataType = "Long"),
})
String list(Long userId, PageNoUtil<ProjectAssessmentIndicators> pageNoUtil) throws XQException;
String list(Long userId, PageNoUtil<ProjectAssessmentIndicatorsDto> pageNoUtil) throws XQException;
@ApiOperation(value = "修改季度考核指标(包含打分)", notes = "修改季度考核指标", response = ProjectAchievementResp.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "登录标识符", required = true, paramType = "header", dataType = "String"),

View File

@ -0,0 +1,9 @@
package com.xqopen.kehui.project.dto;
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
import lombok.Data;
@Data
public class ProjectAssessmentIndicatorsDto extends ProjectAssessmentIndicators {
private String verifyStatus;//代办/已办
}

View File

@ -2,6 +2,7 @@ package com.xqopen.kehui.project.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.xqopen.kehui.project.dto.ProjectAssessmentIndicatorsDto;
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
import java.util.List;
@ -13,7 +14,7 @@ public interface IProjectAssessmentIndicatorsService extends IService<ProjectAss
* @param id
*/
void updateByProjectId(Long id);
List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicators> page,ProjectAssessmentIndicators indicators,String userId);
List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicatorsDto> page, ProjectAssessmentIndicatorsDto indicators, String userId);
/**
* 通过项目id当前执行人拿到项目季度指标并进行平均分

View File

@ -3,6 +3,7 @@ package com.xqopen.kehui.project.service.impl;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.xqopen.kehui.mapper.ProjectAssessmentIndicatorsDao;
import com.xqopen.kehui.project.dto.ProjectAssessmentIndicatorsDto;
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
import com.xqopen.kehui.project.service.IProjectAssessmentIndicatorsService;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,7 +22,7 @@ public class IProjectInitServiceImpl extends ServiceImpl<ProjectAssessmentIndica
}
@Override
public List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicators> page, ProjectAssessmentIndicators indicators,String userId) {
public List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicatorsDto> page, ProjectAssessmentIndicatorsDto indicators, String userId) {
return indicatorsDao.getList(page,indicators,userId);
}

View File

@ -2,9 +2,12 @@ package com.xqopen.kehui.util;
import lombok.Data;
import java.util.Map;
@Data
public class PageNoUtil<T> {
private T t;
private Integer pageNo;
private Integer pageSize;
private Map map;
}