1.季度考核增加api路径
2.新增方法根据项目id拿到季度指标表集合 3.季度指标表增加ext-json字段 4.projectinfo增加通过ids获取集合 5.ProjectQuarterlyEvaluation去掉mybatis id自增 6.ResultListReqUtil工具类增加有参构造 7.季度考核指标增加api、控制层、xml文件
This commit is contained in:
parent
3d105b0c4d
commit
8ecab5d026
@ -381,6 +381,11 @@ public class Api {
|
||||
季度考核管理
|
||||
*/
|
||||
public static final String PROJECT_QUARTERLY_EVALUATION=PROJECT_PREFIX+"/quarterExamine";
|
||||
public static final String PROJECT_QUARTERLY_EVALUATION_LIST=PROJECT_QUARTERLY_EVALUATION+"/list";
|
||||
|
||||
|
||||
|
||||
|
||||
public static final String PROJECT_INFO_GET_ACCEPT_PROJECTS = PROJECT_INFO + "/accept";
|
||||
|
||||
public static final String PROJECT_INFO_MODEL = PROJECT_INFO + "/model";
|
||||
|
@ -1,10 +1,15 @@
|
||||
package com.xqopen.kehui.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProjectAssessmentIndicatorsDao extends BaseMapper<ProjectAssessmentIndicators> {
|
||||
@Update("update project_assessment_indicators set is_deleted=true where project_id =#{id}")
|
||||
void updateByProjectId(Long id);
|
||||
List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicators> page, @Param("indicators") ProjectAssessmentIndicators indicators);
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
package com.xqopen.kehui.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.xqopen.kehui.project.dto.ProjectInfoBase;
|
||||
import com.xqopen.kehui.project.dto.ProjectInfoListItemResp;
|
||||
import com.xqopen.kehui.project.entity.ProjectInfo;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 项目管理 Mapper 接口
|
||||
@ -36,4 +36,5 @@ public interface ProjectInfoDao extends BaseMapper<ProjectInfo> {
|
||||
);
|
||||
|
||||
List<ProjectInfoBase> getAcceptNameList();
|
||||
List<ProjectInfoListItemResp> getListByIds(Page<ProjectInfo> page,@Param("list") List list);
|
||||
}
|
@ -2,10 +2,10 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace=".mapper.ProjectAssessmentIndicatorsMapper">
|
||||
<mapper namespace="com.xqopen.kehui.mapper.ProjectAssessmentIndicatorsDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type=".domain.ProjectAssessmentIndicators">
|
||||
<id property="id" column="id_" jdbcType="BIGINT"/>
|
||||
<resultMap id="BaseResultMap" type="com.xqopen.kehui.project.entity.ProjectAssessmentIndicators">
|
||||
<result property="id" column="id_" jdbcType="BIGINT"/>
|
||||
<result property="indexName" column="index_name" jdbcType="VARCHAR"/>
|
||||
<result property="levelA" column="level_a" jdbcType="VARCHAR"/>
|
||||
<result property="levelB" column="level_b" jdbcType="VARCHAR"/>
|
||||
@ -17,7 +17,7 @@
|
||||
<result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
|
||||
<result property="updatedBy" column="updated_by" jdbcType="BIGINT"/>
|
||||
<result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="BOOLEAN"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="VARCHAR"/>
|
||||
<result property="projectId" column="project_id" jdbcType="BIGINT"/>
|
||||
<result property="quarter" column="quarter" jdbcType="VARCHAR"/>
|
||||
<result property="number" column="number" jdbcType="BIGINT"/>
|
||||
@ -31,4 +31,11 @@
|
||||
is_deleted,project_id,quarter,
|
||||
number
|
||||
</sql>
|
||||
<select id="getList" resultType="com.xqopen.kehui.project.entity.ProjectAssessmentIndicators">
|
||||
select * from project_assessment_indicators where 1=1
|
||||
<if test="indicators.projectId!=null">
|
||||
and project_id =#{indicators.projectId}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
@ -145,6 +145,15 @@
|
||||
AND (f.id_ is NULL OR f.id_ in (select MAX(id_) from flows where is_deleted=FALSE group BY business_id))
|
||||
AND f.activiti_status=2 AND f.is_deleted=FALSE
|
||||
</select>
|
||||
<select id="getListByIds" resultMap="ProjectInfoList">
|
||||
select * from project_info where 1=1
|
||||
<if test="list!=null">
|
||||
and cast(id_ as varchar) in
|
||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<sql id="com">
|
||||
AND (
|
||||
|
@ -0,0 +1,40 @@
|
||||
package com.xqopen.kehui.project.action;
|
||||
|
||||
import com.alibaba.fastjson.support.spring.FastJsonJsonView;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.xqopen.kehui.Api;
|
||||
import com.xqopen.kehui.exception.ErrorCode;
|
||||
import com.xqopen.kehui.exception.XQException;
|
||||
import com.xqopen.kehui.project.api.ProjectAssessmentIndicatorsApi;
|
||||
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
|
||||
import com.xqopen.kehui.project.service.IProjectAssessmentIndicatorsService;
|
||||
import com.xqopen.kehui.util.ApiResponse;
|
||||
import com.xqopen.kehui.util.PageNoUtil;
|
||||
import com.xqopen.kehui.util.ResultListReqUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(produces = FastJsonJsonView.DEFAULT_CONTENT_TYPE)
|
||||
public class ProjectAssessmentIndicatorsController implements ProjectAssessmentIndicatorsApi {
|
||||
@Autowired
|
||||
IProjectAssessmentIndicatorsService indicatorsService;
|
||||
|
||||
@Override
|
||||
@PostMapping(Api.PROJECT_QUARTERLY_EVALUATION_LIST)
|
||||
public String list(@RequestHeader Long userId, @RequestBody PageNoUtil<ProjectAssessmentIndicators> pageNoUtil) throws XQException {
|
||||
try {
|
||||
Page<ProjectAssessmentIndicators> page = new Page<>(pageNoUtil.getPageNo(),pageNoUtil.getPageSize());
|
||||
List<ProjectAssessmentIndicators> indicatorsServiceList = indicatorsService.getList(page, pageNoUtil.getT());
|
||||
ResultListReqUtil<ProjectAssessmentIndicators> listReqUtil = new ResultListReqUtil<>(indicatorsServiceList,pageNoUtil.getPageNo(),pageNoUtil.getPageSize());
|
||||
return ApiResponse.fillSuccess(listReqUtil);
|
||||
}catch (Exception e){
|
||||
log.error("ProjectAssessmentIndicatorsController.list", e);
|
||||
throw new XQException(ErrorCode.PROJECTINFO_EXCEPTION_ERROR, null);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +1,18 @@
|
||||
package com.xqopen.kehui.project.action;
|
||||
|
||||
import com.alibaba.fastjson.support.spring.FastJsonJsonView;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.xqopen.kehui.Api;
|
||||
import com.xqopen.kehui.common.entity.SystemUserLogin;
|
||||
import com.xqopen.kehui.common.service.ISystemUserLoginService;
|
||||
import com.xqopen.kehui.exception.ErrorCode;
|
||||
import com.xqopen.kehui.exception.XQException;
|
||||
import com.xqopen.kehui.project.api.ProjectQuarterlyEvaluationApi;
|
||||
import com.xqopen.kehui.project.dto.ProjectQuarterlyEvaluationListDto;
|
||||
import com.xqopen.kehui.project.dto.ProjectInfoListItemResp;
|
||||
import com.xqopen.kehui.project.entity.ProjectInfo;
|
||||
import com.xqopen.kehui.project.entity.ProjectQuarterlyEvaluation;
|
||||
import com.xqopen.kehui.project.service.IProjectInfoService;
|
||||
import com.xqopen.kehui.project.service.ProjectQuarterlyEvaluationService;
|
||||
import com.xqopen.kehui.util.ApiResponse;
|
||||
import com.xqopen.kehui.util.PageNoUtil;
|
||||
@ -24,15 +29,29 @@ import java.util.List;
|
||||
public class ProjectQuarterlyEvaluationController implements ProjectQuarterlyEvaluationApi {
|
||||
@Autowired
|
||||
ProjectQuarterlyEvaluationService quarterlyEvaluationService;
|
||||
@Autowired
|
||||
ISystemUserLoginService userLoginService;
|
||||
@Autowired
|
||||
IProjectInfoService projectInfoService;
|
||||
|
||||
@Override
|
||||
@PostMapping(Api.PROJECT_QUARTERLY_EVALUATION)
|
||||
public String list(@RequestHeader Long userId, @RequestBody PageNoUtil<ProjectQuarterlyEvaluation> pageNoUtil) throws XQException {
|
||||
try {
|
||||
Page<ProjectQuarterlyEvaluation> page = new Page<>(pageNoUtil.getPageNo(),pageNoUtil.getPageSize());
|
||||
ProjectQuarterlyEvaluation evaluation = pageNoUtil.getT();
|
||||
List<ProjectQuarterlyEvaluationListDto> list = quarterlyEvaluationService.getList(page, evaluation);
|
||||
ResultListReqUtil<ProjectQuarterlyEvaluationListDto> listReqUtil = new ResultListReqUtil<>();
|
||||
//先拿到季度审核表数据
|
||||
EntityWrapper<SystemUserLogin> userLoginEntityWrapper = new EntityWrapper<>();
|
||||
userLoginEntityWrapper.eq("id_",userId);
|
||||
SystemUserLogin systemUserLogin = userLoginService.selectOne(userLoginEntityWrapper);
|
||||
EntityWrapper<ProjectQuarterlyEvaluation> evaluationEntityWrapper = new EntityWrapper<>();
|
||||
evaluationEntityWrapper.eq("is_deleted","0");
|
||||
evaluationEntityWrapper.eq("created_by",String.valueOf(systemUserLogin.getUserinfoId()));
|
||||
evaluationEntityWrapper.setSqlSelect("project_id");
|
||||
List<Object> evaluationList = quarterlyEvaluationService.selectObjs(evaluationEntityWrapper);
|
||||
Page<ProjectInfo> page = new Page<>(pageNoUtil.getPageNo(),pageNoUtil.getPageSize());
|
||||
|
||||
//通过季度审核表的项目id集合,查询到当前负责人下面的项目列表
|
||||
List<ProjectInfoListItemResp> list = projectInfoService.getListByIds(page, evaluationList);
|
||||
ResultListReqUtil<ProjectInfoListItemResp> listReqUtil = new ResultListReqUtil<>();
|
||||
listReqUtil.setLs(list);
|
||||
listReqUtil.setPages(page.getPages());
|
||||
listReqUtil.setTotal(page.getTotal());
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.xqopen.kehui.project.api;
|
||||
|
||||
import com.xqopen.kehui.exception.XQException;
|
||||
import com.xqopen.kehui.project.dto.ProjectAchievementResp;
|
||||
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
|
||||
import com.xqopen.kehui.util.Constants;
|
||||
import com.xqopen.kehui.util.PageNoUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@Api(value = "季度考核指标管理", tags = Constants.MODULE_PROJECT, description = "项目模块")
|
||||
public interface ProjectAssessmentIndicatorsApi {
|
||||
@ApiOperation(value = "获取季度考核指标列表", notes = "获取季度考核指标列表", response = ProjectAchievementResp.class)
|
||||
@ApiImplicitParams({
|
||||
@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;
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package com.xqopen.kehui.project.entity;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.annotations.TableField;
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
@ -35,4 +37,6 @@ public class ProjectAssessmentIndicators {
|
||||
private String quarter;
|
||||
@ApiModelProperty("序号")
|
||||
private Long number;
|
||||
@TableField("ext_")
|
||||
private JSON ext;
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.xqopen.kehui.project.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -16,6 +18,7 @@ public class ProjectQuarterlyEvaluation implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id_", type = IdType.AUTO)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
|
@ -1,12 +1,16 @@
|
||||
package com.xqopen.kehui.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.xqopen.kehui.project.entity.ProjectAssessmentIndicators;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IProjectAssessmentIndicatorsService extends IService<ProjectAssessmentIndicators> {
|
||||
/**
|
||||
* 通过项目id,批量逻辑删除数据,方便新增
|
||||
* @param id
|
||||
*/
|
||||
void updateByProjectId(Long id);
|
||||
List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicators> page,ProjectAssessmentIndicators indicators);
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.xqopen.kehui.project.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.xqopen.kehui.project.dto.ProjectInfoBase;
|
||||
import com.xqopen.kehui.project.dto.ProjectInfoListItemResp;
|
||||
import com.xqopen.kehui.project.entity.ProjectInfo;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -23,4 +23,5 @@ public interface IProjectInfoService extends IService<ProjectInfo> {
|
||||
List<ProjectInfoBase> getNameList(String projectStep, String projectCategory, String NprojectStep);
|
||||
|
||||
List<ProjectInfoBase> getAcceptNameList();
|
||||
List<ProjectInfoListItemResp> getListByIds(Page<ProjectInfo> page,List list);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
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.entity.ProjectAssessmentIndicators;
|
||||
@ -7,6 +8,8 @@ import com.xqopen.kehui.project.service.IProjectAssessmentIndicatorsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class IProjectInitServiceImpl extends ServiceImpl<ProjectAssessmentIndicatorsDao, ProjectAssessmentIndicators> implements IProjectAssessmentIndicatorsService {
|
||||
@Autowired
|
||||
@ -15,4 +18,9 @@ public class IProjectInitServiceImpl extends ServiceImpl<ProjectAssessmentIndica
|
||||
public void updateByProjectId(Long id) {
|
||||
indicatorsDao.updateByProjectId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectAssessmentIndicators> getList(Page<ProjectAssessmentIndicators> page, ProjectAssessmentIndicators indicators) {
|
||||
return indicatorsDao.getList(page,indicators);
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,18 @@
|
||||
package com.xqopen.kehui.project.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.xqopen.kehui.mapper.ProjectInfoDao;
|
||||
import com.xqopen.kehui.project.dto.ProjectInfoBase;
|
||||
import com.xqopen.kehui.project.dto.ProjectInfoListItemResp;
|
||||
import com.xqopen.kehui.project.entity.ProjectInfo;
|
||||
import com.xqopen.kehui.mapper.ProjectInfoDao;
|
||||
import com.xqopen.kehui.project.service.IProjectInfoService;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 项目管理 服务实现类
|
||||
@ -39,4 +38,9 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoDao, ProjectI
|
||||
public List<ProjectInfoBase> getAcceptNameList() {
|
||||
return infoDao.getAcceptNameList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectInfoListItemResp> getListByIds(Page<ProjectInfo> page, List list) {
|
||||
return infoDao.getListByIds(page,list);
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,13 @@ public class ResultListReqUtil<T>{
|
||||
|
||||
@ApiModelProperty(value = "总页数", required = true, position = 3)
|
||||
private int pages;
|
||||
|
||||
public ResultListReqUtil(List<T> ls, long total, int pages) {
|
||||
this.ls = ls;
|
||||
this.total = total;
|
||||
this.pages = pages;
|
||||
}
|
||||
|
||||
public ResultListReqUtil() {
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user