Commit 1aeec180 authored by 徐俊's avatar 徐俊

xujun

parent a006d8d1
package com.yiboshi.science.dao;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yiboshi.science.base.BaseDAO;
import com.yiboshi.science.entity.ComTalentApply;
import com.yiboshi.science.param.dto.ComTalentApplyDTO;
import com.yiboshi.science.param.dto.DataStatisticsDTO;
import com.yiboshi.science.param.query.ComTalentApplyQueryVO;
import org.apache.ibatis.annotations.Param;
/**
* 人才申请表
*/
public interface ComTalentApplyDAO extends BaseMapper<ComTalentApply>, BaseDAO<ComTalentApplyQueryVO, ComTalentApplyDTO, ComTalentApply> {
DataStatisticsDTO getCount(@Param("ew") Wrapper<ComTalentApply> queryWrapper);
}
......@@ -42,4 +42,8 @@ public class ComPersonScientificGain extends BaseEntity {
@ApiModelProperty(value = "成果备注", position = 5)
@Length(max=200, message = "成果备注不能大于200")
private String gainRemark;
/** 排序 */
@ApiModelProperty(value = "排序", position = 6)
private Integer showIndex;
}
\ No newline at end of file
......@@ -21,11 +21,30 @@ import java.util.Date;
@ApiModel(description = "人才申请表VO")
public class ComTalentApply extends BaseEntity {
/** 申报人ID */
@ApiModelProperty(value = "申报人ID", position = 1)
@Length(max=36, message = "申报人ID不能大于36")
/** 人员ID */
@ApiModelProperty(value = "人员ID", position = 1)
@Length(max=36, message = "人员ID不能大于36")
private String personId;
/** 申报年度 */
@ApiModelProperty(value = "申报年度", position = 2)
private Integer reportYear;
/** 申报单位Id */
@ApiModelProperty(value = "申报单位Id", position = 2)
@Length(max=36, message = "申报单位Id不能大于36")
private String appUnitId;
/** 申报人Id */
@ApiModelProperty(value = "申报人Id", position = 2)
@Length(max=36, message = "申报人Id不能大于36")
private String appPersonId;
/** 人才类别 */
@ApiModelProperty(value = "人才类别", position = 2)
@Length(max=36, message = "人才类别不能大于36")
private String talentCategory;
/** 人才类型 */
@ApiModelProperty(value = "人才类型", position = 2)
@Length(max=36, message = "人才类型不能大于36")
......@@ -121,4 +140,8 @@ public class ComTalentApply extends BaseEntity {
/** 总经费 */
@ApiModelProperty(value = "总经费", position = 21)
private BigDecimal totalFund;
/** 人才申报状态 -10 起草,10 待提交, 20 已提交至依托单位,25 依托单位审核通过,请打印申请书,30 返回修改,40 未批准,50 批准 */
@ApiModelProperty(value = "人才申报状态 -10 起草,10 待提交, 20 已提交至依托单位,25 依托单位审核通过,请打印申请书,30 返回修改,40 未批准,50 批准", position = 7 )
private Integer talentState;
}
\ No newline at end of file
......@@ -54,4 +54,7 @@ public class ComTalentBudget extends BaseEntity {
@Length(max=100, message = "预算科目名称不能大于100")
private String budgetName;
/** 排序 */
@ApiModelProperty(value = "排序", position = 9)
private Integer showIndex;
}
\ No newline at end of file
......@@ -64,4 +64,8 @@ public class ComTalentMembers extends BaseEntity {
@ApiModelProperty(value = "备注", position = 9)
@Length(max=200, message = "备注不能大于200")
private String remark;
/** 排序 */
@ApiModelProperty(value = "排序", position = 10)
private Integer showIndex;
}
\ No newline at end of file
......@@ -35,4 +35,7 @@ public class ComPersonScientificGainDTO extends BaseDTO {
@ApiModelProperty(value = "成果备注")
private String gainRemark;
@ApiModelProperty(value = "排序")
private Integer showIndex;
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import java.math.BigDecimal;
import java.util.Date;
......@@ -23,9 +24,25 @@ public class ComTalentApplyDTO extends BaseDTO {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "申报人ID")
@ApiModelProperty(value = "人员ID")
private String personId;
/** 申报年度 */
@ApiModelProperty(value = "申报年度")
private Integer reportYear;
/** 申报单位Id */
@ApiModelProperty(value = "申报单位Id")
private String appUnitId;
/** 申报人Id */
@ApiModelProperty(value = "申报人Id")
private String appPersonId;
/** 人才类别 */
@ApiModelProperty(value = "人才类别")
private String talentCategory;
@ApiModelProperty(value = "人才类型")
private String talentType;
......@@ -88,6 +105,10 @@ public class ComTalentApplyDTO extends BaseDTO {
@ApiModelProperty(value = "总经费")
private BigDecimal totalFund;
/** 人才申报状态 -10 起草,10 待提交, 20 已提交至依托单位,25 依托单位审核通过,请打印申请书,30 返回修改,40 未批准,50 批准 */
@ApiModelProperty(value = "人才申报状态 -10 起草,10 待提交, 20 已提交至依托单位,25 依托单位审核通过,请打印申请书,30 返回修改,40 未批准,50 批准", position = 7 )
private Integer talentState;
@ApiModelProperty(value = "团队成员列表")
private List<ComTalentMembersDTO> membersList;
......
......@@ -42,4 +42,7 @@ public class ComTalentBudgetDTO extends BaseDTO {
@ApiModelProperty(value = "第五年预算")
private BigDecimal yearValue5;
@ApiModelProperty(value = "排序")
private Integer showIndex;
}
\ No newline at end of file
......@@ -47,4 +47,7 @@ public class ComTalentMembersDTO extends BaseDTO {
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "排序")
private Integer showIndex;
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import java.math.BigDecimal;
import java.util.Date;
......@@ -26,9 +27,41 @@ public class ComTalentApplyQueryVO extends PaginationVO {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "申报人ID")
@ApiModelProperty(value = "人员ID")
private String personId;
/** 证件号 */
@ApiModelProperty(value = "证件号")
private String certId;
/** 姓名 */
@ApiModelProperty(value = "姓名")
private String personName;
/** 性别 */
@ApiModelProperty(value = "性别", position = 5)
private String sex;
/** 出生日期 */
@ApiModelProperty(value = "出生日期", position = 6)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date birthday;
/** 申报年度 */
@ApiModelProperty(value = "申报年度")
private Integer reportYear;
/** 申报单位Id */
@ApiModelProperty(value = "申报单位Id")
private String appUnitId;
/** 申报人Id */
@ApiModelProperty(value = "申报人Id")
private String appPersonId;
/** 人才类别 */
@ApiModelProperty(value = "人才类别")
private String talentCategory;
@ApiModelProperty(value = "人才类型")
private String talentType;
......@@ -91,6 +124,10 @@ public class ComTalentApplyQueryVO extends PaginationVO {
@ApiModelProperty(value = "总经费")
private BigDecimal totalFund;
/** 人才申报状态 -10 起草,10 待提交, 20 已提交至依托单位,25 依托单位审核通过,请打印申请书,30 返回修改,40 未批准,50 批准 */
@ApiModelProperty(value = "人才申报状态 -10 起草,10 待提交, 20 已提交至依托单位,25 依托单位审核通过,请打印申请书,30 返回修改,40 未批准,50 批准", position = 7 )
private Integer talentState;
@ApiModelProperty(value = "团队成员列表")
private List<ComTalentMembersDTO> membersList;
......
package com.yiboshi.science.rest.v1;public class ComTalentApplyController {
package com.yiboshi.science.rest.v1;
import com.yiboshi.arch.base.ResponseDataModel;
import com.yiboshi.science.base.Pagination;
import com.yiboshi.science.config.security.SecurityUserHolder;
import com.yiboshi.science.entity.ComProject;
import com.yiboshi.science.entity.ComTalentApply;
import com.yiboshi.science.enumeration.CommonEnum;
import com.yiboshi.science.param.dto.ComTalentApplyDTO;
import com.yiboshi.science.param.dto.DataStatisticsDTO;
import com.yiboshi.science.param.query.ComTalentApplyQueryVO;
import com.yiboshi.science.rest.BaseController;
import com.yiboshi.science.service.ComTalentApplyService;
import com.yiboshi.science.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "com-talent-apply", description = "项目表")
@RestController
@RequestMapping("/v1/science-admin/com-talent-apply")
public class ComTalentApplyController extends BaseController<ComTalentApplyService, ComTalentApplyQueryVO, ComTalentApplyDTO, ComTalentApply> {
@Autowired
private ComTalentApplyService comTalentApplyService;
@ApiOperation(value = "分页查询", httpMethod = "GET", notes = "根据参数获取列表")
@GetMapping
@RequestMapping(value = "/getListByPage")
@PreAuthorize("hasAnyRole('REPORT','ADMIN')")
public ResponseDataModel<Pagination<ComTalentApplyDTO>> getListByPage(@Validated ComTalentApplyQueryVO vo, BindingResult bindingResult) {
if (!StringUtil.isContainsRole(SecurityUserHolder.getRoles(), CommonEnum.systemRole.sys.getCode().toString())) {
vo.setAppPersonId(SecurityUserHolder.getPersonId());
}
Pagination<ComTalentApplyDTO> page = comTalentApplyService.getListByPage(vo);
return ResponseDataModel.ok(page);
}
/**
* 获取统计数据
*/
@ApiOperation(value = "获取统计数据", httpMethod = "GET", notes = "获取统计数据")
@GetMapping
@RequestMapping("/getCount")
public ResponseDataModel<DataStatisticsDTO> getCount(@Validated ComTalentApply e) {
e.setAppPersonId(SecurityUserHolder.getPersonId());
return ResponseDataModel.ok(comTalentApplyService.getCount(e));
}
}
......@@ -3,6 +3,7 @@ package com.yiboshi.science.service;
import com.yiboshi.science.base.BaseService;
import com.yiboshi.science.entity.ComTalentApply;
import com.yiboshi.science.param.dto.ComTalentApplyDTO;
import com.yiboshi.science.param.dto.DataStatisticsDTO;
import com.yiboshi.science.param.query.ComTalentApplyQueryVO;
/**
......@@ -10,4 +11,10 @@ import com.yiboshi.science.param.query.ComTalentApplyQueryVO;
*/
public interface ComTalentApplyService extends BaseService<ComTalentApplyQueryVO, ComTalentApplyDTO, ComTalentApply> {
/**
* 获取统计数据
*
* @return
*/
DataStatisticsDTO getCount(ComTalentApply e);
}
package com.yiboshi.science.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yiboshi.science.base.BaseServiceImpl;
import com.yiboshi.science.base.Pagination;
import com.yiboshi.science.dao.ComTalentApplyDAO;
import com.yiboshi.science.entity.ComProject;
import com.yiboshi.science.entity.ComTalentApply;
import com.yiboshi.science.enumeration.CommonEnum;
import com.yiboshi.science.param.dto.ComProjectDTO;
import com.yiboshi.science.param.dto.ComTalentApplyDTO;
import com.yiboshi.science.param.dto.DataStatisticsDTO;
import com.yiboshi.science.param.query.ComProjectQueryVO;
import com.yiboshi.science.param.query.ComTalentApplyQueryVO;
import com.yiboshi.science.service.ComTalentApplyService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* 人才申请表 Service 实现类
* @author xujun
......@@ -26,6 +36,69 @@ public class ComTalentApplyServiceImpl extends BaseServiceImpl<ComTalentApplyDAO
@Override
protected void setCriteriaForQuery(ComTalentApplyQueryVO vo, QueryWrapper<ComTalentApplyQueryVO> criteria) {
if (Objects.nonNull(vo.getCertId())) {
criteria.like("b.cert_id", vo.getCertId());
}
if (Objects.nonNull(vo.getPersonName())) {
criteria.like("b.person_name", vo.getPersonName());
}
if (Objects.nonNull(vo.getSex())) {
criteria.eq("b.sex", vo.getSex());
}
if (Objects.nonNull(vo.getBirthday())) {
criteria.eq("b.birthday", vo.getBirthday());
}
if (Objects.nonNull(vo.getTalentState())) {
switch (vo.getTalentState()) {
case 1:
criteria.in("talent_state",
CommonEnum.projState.draft.getCode(),
CommonEnum.projState.waitSubmit.getCode());
break;
case 2:
criteria.eq("talent_state", CommonEnum.projState.returnModify.getCode());
break;
case 3:
criteria.in("talent_state",
CommonEnum.projState.toAudit.getCode(),
CommonEnum.projState.failed.getCode(),
CommonEnum.projState.pass.getCode(),
CommonEnum.projState.report.getCode(),
CommonEnum.projState.conclusion.getCode());
break;
case 4:
break;
case 5:
criteria.ge("talent_state", CommonEnum.projState.pass.getCode());
break;
case 6:
criteria.ge("talent_state", CommonEnum.projState.report.getCode());
break;
default:
criteria.eq("talent_state", vo.getTalentState());
break;
}
}
if (Objects.nonNull(vo.getAppUnitId())) {
criteria.eq("a.app_unit_id", vo.getAppUnitId());
}
if (Objects.nonNull(vo.getAppPersonId())) {
criteria.eq("a.app_person_id", vo.getAppPersonId());
}
}
@Override
public Pagination<ComTalentApplyDTO> getListByPage(ComTalentApplyQueryVO vo) {
QueryWrapper criteria = new QueryWrapper();
setCriteriaForQuery(vo, criteria);
Page<ComTalentApplyQueryVO> page = new Page<>(vo.getPageIndex(), vo.getPageSize());
List<ComTalentApplyDTO> dtoList = comTalentApplyDAO.getListByPage(page, criteria).getRecords();
return new Pagination<>(dtoList, page.getTotal(), vo.getPageSize());
}
public DataStatisticsDTO getCount(ComTalentApply e) {
QueryWrapper criteria = new QueryWrapper();
this.notNullField(e, criteria);
return comTalentApplyDAO.getCount(criteria);
}
}
......@@ -4,10 +4,7 @@
<!-- 人员表 -->
<mapper namespace="com.yiboshi.science.dao.ComPersonDAO">
<sql id="allColumns">
t
.
id
as id, t.cert_id as certId, t.cert_type as certType, t.person_name as personName, t.sex as sex, t.birthday as birthday, t.unit_id as unitId, t.note_state as noteState,
t.id, t.cert_id as certId, t.cert_type as certType, t.person_name as personName, t.sex as sex, t.birthday as birthday, t.unit_id as unitId, t.note_state as noteState,
t.degree as degree, t.duty as duty, t.title as title, t.spec as spec, t.email as email, t.mobile as mobile, t.photo as photo, t.address as address,
t.expert as expert, t.open_bank as openBank, t.open_acount as openAcount, t.remark as remark, t.created as created, t.updated as updated
</sql>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yiboshi.science.dao.ComTalentApplyMapper">
<mapper namespace="com.yiboshi.science.dao.ComTalentApplyDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.yiboshi.science.entity.ComTalentApply">
<id column="id" property="id"/>
<result column="person_id" property="personId"/>
<result column="talent_type" property="talentType"/>
<result column="honorary_title" property="honoraryTitle"/>
<result column="hold_post1" property="holdPost1"/>
<result column="hold_post2" property="holdPost2"/>
<result column="hold_post3" property="holdPost3"/>
<result column="supporting_conditions" property="supportingConditions"/>
<result column="research_type" property="researchType"/>
<result column="research_start" property="researchStart"/>
<result column="research_end" property="researchEnd"/>
<result column="support_fund" property="supportFund"/>
<result column="research_content" property="researchContent"/>
<result column="technical_skill" property="technicalSkill"/>
<result column="quality_target" property="qualityTarget"/>
<result column="research_condition" property="researchCondition"/>
<result column="research_progress" property="researchProgress"/>
<result column="plan_target" property="planTarget"/>
<result column="unit_advice" property="unitAdvice"/>
<result column="apply_fund" property="applyFund"/>
<result column="other_fund" property="otherFund"/>
<result column="total_fund" property="totalFund"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="create_user" property="createUser"/>
<result column="update_user" property="updateUser"/>
<result column="del_flag" property="delFlag"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, person_id, talent_type, honorary_title, hold_post1, hold_post2, hold_post3,
supporting_conditions, research_type, research_start, research_end, support_fund,
research_content, technical_skill, quality_target, research_condition, research_progress,
plan_target, unit_advice, apply_fund, other_fund, total_fund,
create_time, update_time, create_user, update_user, del_flag
<sql id="allColumns">
id,person_id,report_year,talent_type,honorary_title,hold_post1,hold_post2,hold_post3,supporting_conditions,
research_type,research_start,research_end,support_fund,research_content,technical_skill,quality_target,
research_condition,research_progress,plan_target,unit_advice,apply_fund,other_fund,total_fund,talent_state,
created,updated
</sql>
<!-- 分页查询 -->
<select id="selectPage" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM com_talent_apply
WHERE del_flag = 0
<if test="query.personId != null and query.personId != ''">
AND person_id = #{query.personId}
</if>
<if test="query.talentType != null and query.talentType != ''">
AND talent_type = #{query.talentType}
</if>
<if test="query.researchType != null and query.researchType != ''">
AND research_type = #{query.researchType}
</if>
ORDER BY create_time DESC
<select id="getListByPage" resultType="com.yiboshi.science.param.dto.ComTalentApplyDTO">
select a.id, a.person_id, a.report_year, a.app_unit_id, a.talent_type, a.talent_state, a.research_type,
a.apply_fund, a.other_fund, a.total_fund, b.cert_id, b.person_name, b.duty, b.title, b.spec
from com_talent_apply a
left join com_person b on a.person_id = b.id
left join com_unit d on a.app_unit_id = d.id
<where>
${ew.sqlSegment}
</where>
order by a.report_year, a.talent_type
</select>
<select id="getCount" resultType="com.yiboshi.science.param.dto.DataStatisticsDTO">
SELECT ifnull(sum(case when talent_state in(-10,10) then 1 else 0 end),0) count1,
ifnull(sum(case when talent_state =30 then 1 else 0 end),0) count2,
ifnull(sum(case when talent_state in(20,22,24,26,28,40,50) then 1 else 0 end),0) count3,
ifnull(sum(case when talent_state is not null then 1 else 0 end),0) count4
FROM com_talent_apply a
left join com_unit d on a.app_unit_id=d.id
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment