Commit 602d9030 authored by 徐俊's avatar 徐俊

xujun

parent ce62988b
......@@ -6,9 +6,12 @@ import com.yiboshi.science.entity.ComPersonResume;
import com.yiboshi.science.param.dto.ComPersonResumeDTO;
import com.yiboshi.science.param.query.ComPersonResumeQueryVO;
import java.util.List;
/**
* 申报人学习、研修与工作简历表
*/
public interface ComPersonResumeDAO extends BaseMapper<ComPersonResume>, BaseDAO<ComPersonResumeQueryVO, ComPersonResumeDTO, ComPersonResume> {
List<ComPersonResumeDTO> getListByTaltentId(String TalentId);
}
......@@ -6,9 +6,12 @@ import com.yiboshi.science.entity.ComPersonScientificGain;
import com.yiboshi.science.param.dto.ComPersonScientificGainDTO;
import com.yiboshi.science.param.query.ComPersonScientificGainQueryVO;
import java.util.List;
/**
* 申报人科研学术成绩表
*/
public interface ComPersonScientificGainDAO extends BaseMapper<ComPersonScientificGain>, BaseDAO<ComPersonScientificGainQueryVO, ComPersonScientificGainDTO, ComPersonScientificGain> {
List<ComPersonScientificGainDTO> getListByTaltentId(String TalentId);
}
......@@ -15,4 +15,6 @@ import org.apache.ibatis.annotations.Param;
public interface ComTalentApplyDAO extends BaseMapper<ComTalentApply>, BaseDAO<ComTalentApplyQueryVO, ComTalentApplyDTO, ComTalentApply> {
DataStatisticsDTO getCount(@Param("ew") Wrapper<ComTalentApply> queryWrapper);
ComTalentApplyDTO getById(String id);
}
......@@ -6,9 +6,12 @@ import com.yiboshi.science.entity.ComTalentBudget;
import com.yiboshi.science.param.dto.ComTalentBudgetDTO;
import com.yiboshi.science.param.query.ComTalentBudgetQueryVO;
import java.util.List;
/**
* 申报人培养经费预算表
*/
public interface ComTalentBudgetDAO extends BaseMapper<ComTalentBudget>, BaseDAO<ComTalentBudgetQueryVO, ComTalentBudgetDTO, ComTalentBudget> {
List<ComTalentBudgetDTO> getListByTaltentId(String talentId);
}
......@@ -6,10 +6,13 @@ import com.yiboshi.science.entity.ComTalentMembers;
import com.yiboshi.science.param.dto.ComTalentMembersDTO;
import com.yiboshi.science.param.query.ComTalentMembersQueryVO;
import java.util.List;
/**
* 人才团队成员表
*/
public interface ComTalentMembersDAO extends BaseMapper<ComTalentMembers>, BaseDAO<ComTalentMembersQueryVO, ComTalentMembersDTO, ComTalentMembers> {
List<ComTalentMembersDTO> getListByTaltentId(String talentId);
}
......@@ -18,10 +18,10 @@ import java.util.Date;
@ApiModel(description = "申报人员简历表VO")
public class ComPersonResume extends BaseEntity {
/** 人Id */
@ApiModelProperty(value = "人Id", position = 2)
@Length(max=36, message = "人Id不能大于36")
private String personId;
/** 人才申请Id */
@ApiModelProperty(value = "人才申请Id", position = 2)
@Length(max=36, message = "人才申请Id不能大于36")
private String talentId;
/** 简历类型(系统参数18) */
@ApiModelProperty(value = "简历类型", position = 3)
@Length(max=36, message = "简历类型不能大于36")
......@@ -46,4 +46,7 @@ public class ComPersonResume extends BaseEntity {
@ApiModelProperty(value = "简历备注", position = 8)
@Length(max=100, message = "简历备注不能大于100")
private String resumeRemark;
/** 排序 */
@ApiModelProperty(value = "排序", position = 9)
private Integer showIndex;
}
\ No newline at end of file
......@@ -17,7 +17,12 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "申报人科研学术成绩表VO")
public class ComPersonScientificGain extends BaseEntity {
/** 人才申请Id */
@ApiModelProperty(value = "人才申请Id", position = 2)
@Length(max=36, message = "人才申请Id不能大于36")
private String talentId;
/** 成果类型(系统参数) */
@ApiModelProperty(value = "成果类型", position = 1)
@Length(max=36, message = "成果类型不能大于36")
......
......@@ -59,6 +59,39 @@ public class CommonEnum {
}
}
public enum timeType implements INumberEnum {
projApply(1, "项目申报"),
taskReport(2, "任务书上报"),
middleCheck(3, "中期考核"),
talentApply(4, "人才申报");
timeType(int number, String description) {
this.code = number;
this.description = description;
}
private Integer code;
private String description;
@Override
public Integer getCode() {
return code;
}
@Override
public String getDescription() {
return description;
}
public static timeType getEnum(Integer value) {
for (timeType e : timeType.values()) {
if (e.getCode().equals(value))
return e;
}
return timeType.projApply;//For values out of enum scope
}
}
public enum projType implements INumberEnum {
num(1, "卫生健康领域科技计划项目"),
key(2, "公立医院高水平临床专科建设科技项目");
......@@ -661,7 +694,8 @@ public class CommonEnum {
parameterDelete("parameterDelete", "删除字典"),
auditRecordDelete("auditRecordSave", "删除评审记录"),
auditRecordSave("auditRecordSave", "修改/添加评审记录");
auditRecordSave("auditRecordSave", "修改/添加评审记录"),
talentApply("talentApply", "人才申报保存");
logType(String key, String description) {
this.key = key;
......@@ -698,7 +732,8 @@ public class CommonEnum {
project(10, "项目附件"),
Conclusion(20, "结题附件"),
reviewOpinions(30, "学术委员会审查意见"),
projectTask(40, "任务书文件");
projectTask(40, "任务书文件"),
talentApply(50, "人才申报");
fileType(int number, String description) {
this.code = number;
......
......@@ -6,6 +6,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.util.Date;
......@@ -19,12 +20,16 @@ public class ComPersonResumeDTO extends BaseDTO {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "人员Id")
private String personId;
/** 人才申请Id */
@ApiModelProperty(value = "人才申请Id")
private String talentId;
@ApiModelProperty(value = "简历类型")
private String resumeType;
@ApiModelProperty(value = "简历类型名称")
private String resumeTypeName;
@ApiModelProperty(value = "起始日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
......@@ -42,4 +47,7 @@ public class ComPersonResumeDTO extends BaseDTO {
@ApiModelProperty(value = "简历备注")
private String resumeRemark;
@ApiModelProperty(value = "序号")
private Integer showIndex;
}
\ No newline at end of file
......@@ -6,6 +6,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.util.Date;
......@@ -19,9 +20,16 @@ public class ComPersonScientificGainDTO extends BaseDTO {
@ApiModelProperty(value = "主键")
private String id;
/** 人才申请Id */
@ApiModelProperty(value = "人才申请Id")
private String talentId;
@ApiModelProperty(value = "成果类型")
private String gainType;
@ApiModelProperty(value = "成果类型名称")
private String gainTypeName;
@ApiModelProperty(value = "成果日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
......
......@@ -145,28 +145,43 @@ public class ComTalentApplyDTO extends BaseDTO {
/** 职称 */
@ApiModelProperty(value = "职称", position = 13)
private String title;
/** 职称名称 */
@ApiModelProperty(value = "职称名称", position = 13)
private String titleName;
/** 专业 */
@ApiModelProperty(value = "专业", position = 14)
private String spec;
/** 专业名称 */
@ApiModelProperty(value = "专业名称", position = 14)
private String specName;
/** 二级学科名称 */
@ApiModelProperty(value = "二级学科名称", position = 14)
private String parentName;
/** 邮箱 */
@ApiModelProperty(value = "邮箱", position = 15)
private String email;
/** 电话 */
@ApiModelProperty(value = "电话", position = 9)
private String telephone;
private String mobile;
/** 传真 */
@ApiModelProperty(value = "传真", position = 9)
private String fax;
@ApiModelProperty(value = "团队成员列表")
/** 职务名称 */
@ApiModelProperty(value = "职务名称", position = 15)
private String dutyName;
/** 团队成员列表 */
private List<ComTalentMembersDTO> membersList;
@ApiModelProperty(value = "预算列表")
/** 预算列表 */
private List<ComTalentBudgetDTO> budgetList;
@ApiModelProperty(value = "简历列表")
/** 简历列表 */
private List<ComPersonResumeDTO> resumeList;
@ApiModelProperty(value = "科研学术成绩")
private List<ComPersonScientificGain> scientificList;
/** 科研学术成绩 */
private List<ComPersonScientificGainDTO> scientificList;
/** 附件列表 */
private List<ComFileDTO> fileList;
}
\ No newline at end of file
......@@ -35,9 +35,15 @@ public class ComTalentMembersDTO extends BaseDTO {
@ApiModelProperty(value = "专业")
private String spec;
@ApiModelProperty(value = "专业名称")
private String specName;
@ApiModelProperty(value = "职务")
private String duty;
@ApiModelProperty(value = "职务名称")
private String dutyName;
@ApiModelProperty(value = "工作单位")
private String workUnit;
......
......@@ -6,6 +6,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.util.Date;
......@@ -19,9 +20,9 @@ public class ComPersonResumeQueryVO extends PaginationVO {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "人Id")
private String personId;
@ApiModelProperty(value = "人才申请Id")
private String talentId;
@ApiModelProperty(value = "简历类型")
private String resumeType;
......@@ -42,4 +43,8 @@ public class ComPersonResumeQueryVO extends PaginationVO {
@ApiModelProperty(value = "简历备注")
private String resumeRemark;
/** 排序 */
@ApiModelProperty(value = "排序", position = 9)
private Integer showIndex;
}
\ No newline at end of file
......@@ -6,6 +6,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.util.Date;
......@@ -20,6 +21,9 @@ public class ComPersonScientificGainQueryVO extends PaginationVO {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "人才申请Id")
private String talentId;
@ApiModelProperty(value = "成果类型")
private String gainType;
......
......@@ -70,7 +70,6 @@ public class ComBatchController extends BaseController<ComBatchService, ComBatch
return ResponseDataModel.ok(comBatchService.deleteBatch(id));
}
@ApiOperation(value = "获取当前申报或审核时间", httpMethod = "GET", notes = "获取当前申报或审核时间")
@GetMapping
@RequestMapping("/getCurrentYearBatch")
......@@ -109,4 +108,11 @@ public class ComBatchController extends BaseController<ComBatchService, ComBatch
public ResponseDataModel<List<ComBatchDTO>> getBatchList(@Validated ComBatch entity) {
return ResponseDataModel.ok(comBatchService.getBatchList(entity));
}
@ApiOperation(value = "获取当前申报或审核时间", httpMethod = "GET", notes = "获取当前申报或审核时间")
@GetMapping
@RequestMapping("/getCurrentYearTalentBatch")
public ResponseDataModel<ComBatchDTO> getCurrentYearTalentBatch(int type) {
return ResponseDataModel.ok(comBatchService.getCurrentYearTalentBatch(type));
}
}
\ No newline at end of file
......@@ -2,10 +2,11 @@ package com.yiboshi.science.rest.v1;
import com.yiboshi.arch.base.ResponseDataModel;
import com.yiboshi.science.base.Pagination;
import com.yiboshi.science.config.annotation.Logs;
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.ComProjectDTO;
import com.yiboshi.science.param.dto.ComTalentApplyDTO;
import com.yiboshi.science.param.dto.DataStatisticsDTO;
import com.yiboshi.science.param.query.ComTalentApplyQueryVO;
......@@ -18,9 +19,7 @@ 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;
import org.springframework.web.bind.annotation.*;
@Api(tags = "com-talent-apply", description = "项目表")
@RestController
......@@ -54,4 +53,38 @@ public class ComTalentApplyController extends BaseController<ComTalentApplyServi
e.setAppPersonId(SecurityUserHolder.getPersonId());
return ResponseDataModel.ok(comTalentApplyService.getCount(e));
}
/**
* 根据id获取人才申报信息
*
* @param id 查询条件
*/
@ApiOperation(value = "根据id获取人才申报信息", httpMethod = "GET", notes = "根据id获取人才申报信息")
@GetMapping
@RequestMapping("/getTalentApplyById")
public ResponseDataModel<ComTalentApplyDTO> getTalentApplyById(@Validated String id) {
return ResponseDataModel.ok(comTalentApplyService.getTalentApplyById(id));
}
/**
* 创建基础人才申报信息
*/
@ApiOperation(value = "创建基础人才申报信息", httpMethod = "GET", notes = "创建基础人才申报信息")
@GetMapping
@RequestMapping("/getNewTalentApply")
public ResponseDataModel<ComTalentApplyDTO> getNewTalentApply() {
return ResponseDataModel.ok(comTalentApplyService.getNewTalentApply());
}
@ApiOperation(value = "保存人才申报信息", httpMethod = "POST", notes = "保存人才申报信息")
@PostMapping
@RequestMapping("/save")
@PreAuthorize("hasAnyRole('REPORT','GOV','ADMIN')")
@Logs(value = CommonEnum.logType.talentApply)
public ResponseDataModel<String> save(@RequestBody ComTalentApplyDTO comTalentApplyDTO, BindingResult bindingResult) {
comTalentApplyDTO.setAppPersonId(SecurityUserHolder.getPersonId());
comTalentApplyDTO.setAppUnitId(SecurityUserHolder.getUnitId());
return ResponseDataModel.ok(comTalentApplyService.save(comTalentApplyDTO));
}
}
......@@ -101,14 +101,16 @@ public class StatisticalController {
DataStatisticsDTO count= comProjectAuditService.getFirstAuditPassCount(v);
return ResponseDataModel.ok(count);
}
@ApiOperation(value = "科研项目分配人次", httpMethod = "GET", notes = "科研项目分配人次")
@GetMapping
@RequestMapping("/getAssignPersonCount")
@PreAuthorize("hasAnyRole('GOV')")
public ResponseDataModel<DataStatisticsDTO> getAssignPersonCount(Integer projType) {
Integer assignYear = comBatchService.getReportYear(projType);
Integer assignYear = comBatchService.getReportYear(projType, null);
return ResponseDataModel.ok(comProjectAuditService.getAssignPersonCount(assignYear, projType));
}
/**
* 获取统计数据
*/
......
......@@ -42,7 +42,7 @@ public interface ComBatchService extends BaseService<ComBatchQueryVO, ComBatchDT
*/
ComBatchDTO getBatchById(String id);
/**
* 获取当前申报批次
* 获取当前项目申报批次
*
* @param type
* @param projType
......@@ -60,5 +60,12 @@ public interface ComBatchService extends BaseService<ComBatchQueryVO, ComBatchDT
*
* @param projType
*/
Integer getReportYear(Integer projType);
Integer getReportYear(Integer projType, Integer timeType);
/**
* 获取当前人才申报批次
* @param type
* @return
*/
ComBatchDTO getCurrentYearTalentBatch(int type);
}
\ No newline at end of file
......@@ -5,9 +5,14 @@ import com.yiboshi.science.entity.ComPersonResume;
import com.yiboshi.science.param.dto.ComPersonResumeDTO;
import com.yiboshi.science.param.query.ComPersonResumeQueryVO;
import java.util.List;
/**
* 申报人学习、研修与工作简历表
*/
public interface ComPersonResumeService extends BaseService<ComPersonResumeQueryVO, ComPersonResumeDTO, ComPersonResume> {
void insertList(List<ComPersonResumeDTO> list, String PersonId, String TypeId);
List<ComPersonResumeDTO> getListByTaltentId(String TalentId);
}
......@@ -5,9 +5,14 @@ import com.yiboshi.science.entity.ComPersonScientificGain;
import com.yiboshi.science.param.dto.ComPersonScientificGainDTO;
import com.yiboshi.science.param.query.ComPersonScientificGainQueryVO;
import java.util.List;
/**
* 申报人科研学术成绩表
*/
public interface ComPersonScientificGainService extends BaseService<ComPersonScientificGainQueryVO, ComPersonScientificGainDTO, ComPersonScientificGain> {
void insertList(List<ComPersonScientificGainDTO> list, String TalentId, String TypeId);
List<ComPersonScientificGainDTO> getListByTaltentId(String TalentId);
}
......@@ -13,8 +13,13 @@ public interface ComTalentApplyService extends BaseService<ComTalentApplyQueryVO
/**
* 获取统计数据
*
* @return
*/
DataStatisticsDTO getCount(ComTalentApply e);
String save(ComTalentApplyDTO dto);
ComTalentApplyDTO getNewTalentApply();
ComTalentApplyDTO getTalentApplyById(String id);
}
......@@ -2,12 +2,20 @@ package com.yiboshi.science.service;
import com.yiboshi.science.base.BaseService;
import com.yiboshi.science.entity.ComTalentBudget;
import com.yiboshi.science.param.dto.ComProjectBudgetDTO;
import com.yiboshi.science.param.dto.ComTalentBudgetDTO;
import com.yiboshi.science.param.query.ComTalentBudgetQueryVO;
import java.util.List;
/**
*申报人培养经费预算表
*/
public interface ComTalentBudgetService extends BaseService<ComTalentBudgetQueryVO, ComTalentBudgetDTO, ComTalentBudget> {
void insertList(List<ComTalentBudgetDTO> list, String TalentId);
List<ComTalentBudgetDTO> getListByTaltentId(String talentId);
List<ComTalentBudgetDTO> getList();
}
......@@ -5,9 +5,14 @@ import com.yiboshi.science.entity.ComTalentMembers;
import com.yiboshi.science.param.dto.ComTalentMembersDTO;
import com.yiboshi.science.param.query.ComTalentMembersQueryVO;
import java.util.List;
/**
* 人才团队成员表
*/
public interface ComTalentMembersService extends BaseService<ComTalentMembersQueryVO, ComTalentMembersDTO, ComTalentMembers> {
void insertList(List<ComTalentMembersDTO> list, String TalentId);
List<ComTalentMembersDTO> getListByTaltentId(String talentId);
}
......@@ -142,6 +142,7 @@ public class ComBatchServiceImpl extends BaseServiceImpl<ComBatchDAO, ComBatchQu
*
* @param type 1:项目申报时间 2:州市级及以下单位上报时间 3:州市级行政单位审核时间 4:省直单位上报时间 5:专家评审时间
* @param projType 1.科研项目申报 2.重点项目申报
* @param timeType 1.项目申报 2.任务书上报 3.中期考核 4.人才申报
* @return
*/
public ComBatchDTO getCurrentYearBatch(int type, Integer projType, Integer timeType) {
......@@ -177,8 +178,8 @@ public class ComBatchServiceImpl extends BaseServiceImpl<ComBatchDAO, ComBatchQu
return comBatch;
}
public Integer getReportYear(Integer projType) {
ComBatchDTO comBatch = this.getCurrentBatch(projType, null);
public Integer getReportYear(Integer projType, Integer timeType) {
ComBatchDTO comBatch = this.getCurrentBatch(projType, timeType);
if (null != comBatch)
return comBatch.getYear();
else
......@@ -225,4 +226,32 @@ public class ComBatchServiceImpl extends BaseServiceImpl<ComBatchDAO, ComBatchQu
}
return flag;
}
/**
* 获取当前申报或审核时间
* @param type 1:项目申报时间 2:审核时间
* @return
*/
public ComBatchDTO getCurrentYearTalentBatch(int type) {
ComBatchDTO comBatch = this.getCurrentBatch(null, CommonEnum.timeType.talentApply.getCode());
Date date = new Date();// 获取当前时间
if (null != comBatch) {
switch (type) {
case 1:// 人才申报时间(人才申报项目上报单位时间)
comBatch.setDisabled(judgementDateTimeDisabled(date, comBatch.getReportStart(), comBatch.getReportEnd()));
comBatch.setDescription(judgementDateTimeStr(date, comBatch.getReportStart(), comBatch.getReportEnd(), comBatch.getBatch(), comBatch.getYear()));
break;
case 2:// 审核时间
comBatch.setDisabled(judgementDateTimeDisabled(date, comBatch.getAuditStart(), comBatch.getAuditEnd()));
comBatch.setDescription(judgementDateTimeStr(date, comBatch.getAuditStart(), comBatch.getAuditEnd(), comBatch.getBatch(), comBatch.getYear()));
break;
}
} else {
comBatch = new ComBatchDTO();
comBatch.setDisabled(false);
comBatch.setDescription(type == 1 ? "未设置填报时间!" : "未设置审核时间!");
}
return comBatch;
}
}
\ No newline at end of file
......@@ -11,6 +11,9 @@ import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 申报人学习、研修与工作简历表 Service 实现类
* @author xujun
......@@ -28,4 +31,26 @@ public class ComPersonResumeServiceImpl extends BaseServiceImpl<ComPersonResumeD
protected void setCriteriaForQuery(ComPersonResumeQueryVO vo, QueryWrapper<ComPersonResumeQueryVO> criteria) {
}
public void insertList(List<ComPersonResumeDTO> list, String TalentId, String TypeId) {
ComPersonResume resume = new ComPersonResume();
resume.setTalentId(TalentId);
resume.setResumeType(TypeId);
this.delete(resume);
if (null != list) {
List<ComPersonResume> iList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
ComPersonResume item = convert2Entity(list.get(i));
item.setTalentId(TalentId);
item.setResumeType(TypeId);
iList.add(item);
}
this.insertBatch(iList);
}
}
public List<ComPersonResumeDTO> getListByTaltentId(String TalentId) {
return comPersonResumeDAO.getListByTaltentId(TalentId);
}
}
......@@ -11,6 +11,9 @@ import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 申报人科研学术成绩表 Service 实现类
* @author xujun
......@@ -28,4 +31,26 @@ public class ComPersonScientificGainServiceImpl extends BaseServiceImpl<ComPerso
protected void setCriteriaForQuery(ComPersonScientificGainQueryVO vo, QueryWrapper<ComPersonScientificGainQueryVO> criteria) {
}
public void insertList(List<ComPersonScientificGainDTO> list, String TalentId, String TypeId) {
ComPersonScientificGain ScientificGain = new ComPersonScientificGain();
ScientificGain.setTalentId(TalentId);
ScientificGain.setGainType(TypeId);
this.delete(ScientificGain);
if (null != list) {
List<ComPersonScientificGain> iList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
ComPersonScientificGain item = convert2Entity(list.get(i));
item.setTalentId(TalentId);
item.setGainType(TypeId);
iList.add(item);
}
this.insertBatch(iList);
}
}
public List<ComPersonScientificGainDTO> getListByTaltentId(String TalentId) {
return comPersonScientificGainDAO.getListByTaltentId(TalentId);
}
}
......@@ -117,7 +117,7 @@ public class ComProjectAssignServiceImpl extends BaseServiceImpl<ComProjectAssig
}
experts = (List<String>) map.get("experts");
projects = (List<String>) map.get("projects");
Integer reportYear = comBatchService.getReportYear(projType);
Integer reportYear = comBatchService.getReportYear(projType, null);
if (null == projects || projects.size() == 0 || null == experts || experts.size() == 0)
throw new BusinessException("参数错误");
return this.assignProject(reportYear, projects, experts);
......
......@@ -300,7 +300,7 @@ public class ComProjectGroupServiceImpl extends BaseServiceImpl<ComProjectGroupD
});
List<ComProjectGroupDetailDTO> ProjectInfoList = comProjectGroupDetailService.getProjectListByGroupIds(GroupList);
Integer reportYear = comBatchService.getReportYear(projType);
Integer reportYear = comBatchService.getReportYear(projType, null);
List<String> ProjectList = new ArrayList<>();
ProjectInfoList.forEach(p -> {
ProjectList.add(p.getProjId());
......
......@@ -298,7 +298,7 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
List<ComFileDTO> fileList = configureFileList(projType);
dto.setFileList(fileList);
dto.setReportYear(comBatchService.getReportYear(projType));
dto.setReportYear(comBatchService.getReportYear(projType, CommonEnum.timeType.projApply.getCode()));
dto.setProjState(CommonEnum.projState.draft.getCode());
dto.setAppPersonId(SecurityUserHolder.getPersonId());
dto.setAppUnitId(SecurityUserHolder.getUnitId());
......
......@@ -2,20 +2,16 @@ 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.arch.exception.BusinessException;
import com.yiboshi.science.base.BaseServiceImpl;
import com.yiboshi.science.base.Pagination;
import com.yiboshi.science.dao.ComTalentApplyDAO;
import com.yiboshi.science.entity.ComPerson;
import com.yiboshi.science.entity.ComProject;
import com.yiboshi.science.entity.ComTalentApply;
import com.yiboshi.science.entity.SystemParameter;
import com.yiboshi.science.enumeration.CommonEnum;
import com.yiboshi.science.param.dto.ComPersonDTO;
import com.yiboshi.science.param.dto.ComTalentApplyDTO;
import com.yiboshi.science.param.dto.DataStatisticsDTO;
import com.yiboshi.science.param.dto.*;
import com.yiboshi.science.param.query.ComTalentApplyQueryVO;
import com.yiboshi.science.service.ComPersonService;
import com.yiboshi.science.service.ComTalentApplyService;
import com.yiboshi.science.utils.StringUtil;
import com.yiboshi.science.service.*;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -23,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 人才申请表 Service 实现类
......@@ -40,6 +37,27 @@ public class ComTalentApplyServiceImpl extends BaseServiceImpl<ComTalentApplyDAO
@Autowired
private ComPersonService comPersonService;
@Autowired
private ComPersonResumeService comPersonResumeService;
@Autowired
private ComPersonScientificGainService comPersonScientificGainService;
@Autowired
private ComTalentMembersService comTalentMembersService;
@Autowired
private ComTalentBudgetService comTalentBudgetService;
@Autowired
private SystemParameterService systemParameterService;
@Autowired
private ComFileService comFileService;
@Autowired
private ComBatchService comBatchService;
@Override
protected void setCriteriaForQuery(ComTalentApplyQueryVO vo, QueryWrapper<ComTalentApplyQueryVO> criteria) {
if (Objects.nonNull(vo.getCertId())) {
......@@ -108,6 +126,57 @@ public class ComTalentApplyServiceImpl extends BaseServiceImpl<ComTalentApplyDAO
return comTalentApplyDAO.getCount(criteria);
}
public ComTalentApplyDTO getNewTalentApply() {
ComTalentApplyDTO dto = new ComTalentApplyDTO();
dto.setReportYear(comBatchService.getReportYear(null, CommonEnum.timeType.talentApply.getCode()));
dto.setCompleteStatus("0,0,0,0,0,0");
List<ComTalentBudgetDTO> bugetList = comTalentBudgetService.getList();
dto.setBudgetList(bugetList);
return dto;
}
public ComTalentApplyDTO getTalentApplyById(String id) {
ComTalentApplyDTO dto = comTalentApplyDAO.getById(id);
if (null == dto)
throw new BusinessException("人才申报记录不存在或已删除!");
// 申报人
ComPersonDTO comPersonDTO = comPersonService.getPersonById(dto.getAppPersonId());
if (null != comPersonDTO) {
loadPersonInfo(dto, comPersonDTO);
}
List<ComTalentMembersDTO> memList = comTalentMembersService.getListByTaltentId(dto.getId());
dto.setMembersList(memList);
List<ComTalentBudgetDTO> bugetList = comTalentBudgetService.getListByTaltentId(dto.getId());
dto.setBudgetList(bugetList);
List<ComPersonResumeDTO> resumeList = comPersonResumeService.getListByTaltentId(dto.getId());
dto.setResumeList(resumeList);
List<ComPersonScientificGainDTO> scientificList = comPersonScientificGainService.getListByTaltentId(dto.getId());
dto.setScientificList(scientificList);
return dto;
}
private void loadPersonInfo(ComTalentApplyDTO dto, ComPersonDTO comPersonDTO) {
dto.setPersonName(comPersonDTO.getPersonName());
dto.setCertId(comPersonDTO.getCertId());
dto.setSex(comPersonDTO.getSex());
dto.setBirthday(comPersonDTO.getBirthday());
//dto.setNationName(comPersonDTO.getNationName());
//dto.setDegreeName(comPersonDTO.getDegreeName());
dto.setTitleName(comPersonDTO.getTitleName());
dto.setDutyName(comPersonDTO.getDuty());
dto.setSpecName(comPersonDTO.getSpecName());
dto.setMobile(comPersonDTO.getMobile());
dto.setEmail(comPersonDTO.getEmail());
}
public String save(ComTalentApplyDTO dto) {
String id = "";
switch (dto.getStep()) {
......@@ -115,14 +184,19 @@ public class ComTalentApplyServiceImpl extends BaseServiceImpl<ComTalentApplyDAO
id = talentSaveStep0(dto);
break;
case 1://申报人简历
id = talentSaveStep1(dto);
break;
case 2://申报人科研成绩
id = talentSaveStep2(dto);
break;
case 3://科学研究规划及团队人员名单
id = talentSaveStep3(dto);
break;
case 4://经费预算及培养计划和目标
id = talentSaveStep4(dto);
break;
case 5://附件
id = talentSaveStep5(dto);
break;
}
return id;
......@@ -142,6 +216,76 @@ public class ComTalentApplyServiceImpl extends BaseServiceImpl<ComTalentApplyDAO
return id;
}
@Transactional
public String talentSaveStep1(ComTalentApplyDTO dto) {
ComTalentApply comTalentApply = convert2Entity(dto);
this.update(comTalentApply);
List<ComPersonResumeDTO> ResumeList = dto.getResumeList();
List<SystemParameter> ParameterList = systemParameterService.getListByType(18);
for (SystemParameter p : ParameterList) {
List<ComPersonResumeDTO> FindList = ResumeList.stream().filter(e -> p.getId().equals(e.getResumeType())).collect(Collectors.toList());
if (null != FindList && FindList.size() > 0) {
comPersonResumeService.insertList(FindList, dto.getId(), p.getId());
}
}
return dto.getId();
}
@Transactional
public String talentSaveStep2(ComTalentApplyDTO dto) {
ComTalentApply comTalentApply = convert2Entity(dto);
this.update(comTalentApply);
List<ComPersonScientificGainDTO> ScientificGainList = dto.getScientificList();
List<SystemParameter> ParameterList = systemParameterService.getListByType(19);
for (SystemParameter p : ParameterList) {
List<ComPersonScientificGainDTO> FindList = ScientificGainList.stream().filter(e -> p.getId().equals(e.getGainType())).collect(Collectors.toList());
if (null != FindList && FindList.size() > 0) {
comPersonScientificGainService.insertList(FindList, dto.getId(), p.getId());
}
}
return dto.getId();
}
@Transactional
public String talentSaveStep3(ComTalentApplyDTO dto) {
ComTalentApply comTalentApply = convert2Entity(dto);
this.update(comTalentApply);
List<ComTalentMembersDTO> MemberList = dto.getMembersList();
comTalentMembersService.insertList(MemberList, dto.getId());
return dto.getId();
}
@Transactional
public String talentSaveStep4(ComTalentApplyDTO dto) {
ComTalentApply comTalentApply = convert2Entity(dto);
this.update(comTalentApply);
List<ComTalentBudgetDTO> BudgetList = dto.getBudgetList();
comTalentBudgetService.insertList(BudgetList, dto.getId());
return dto.getId();
}
@Transactional
public String talentSaveStep5(ComTalentApplyDTO dto) {
ComTalentApply comTalentApply = convert2Entity(dto);
this.update(comTalentApply);
// 附件
comFileService.insertList(dto.getFileList(), dto.getId(), CommonEnum.fileType.talentApply.getCode());
return dto.getId();
}
private String InsertTalentBaseInfo(ComTalentApplyDTO dto) {
String PersonID = comPersonService.insertOrUpdate(dto);
......
......@@ -4,13 +4,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yiboshi.science.base.BaseServiceImpl;
import com.yiboshi.science.dao.ComTalentBudgetDAO;
import com.yiboshi.science.entity.ComTalentBudget;
import com.yiboshi.science.entity.SystemParameter;
import com.yiboshi.science.param.dto.ComProjectBudgetDTO;
import com.yiboshi.science.param.dto.ComTalentBudgetDTO;
import com.yiboshi.science.param.query.ComTalentBudgetQueryVO;
import com.yiboshi.science.service.ComTalentBudgetService;
import com.yiboshi.science.service.SystemParameterService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 申报人培养经费预算表 Service 实现类
* @author xujun
......@@ -24,8 +32,52 @@ public class ComTalentBudgetServiceImpl extends BaseServiceImpl<ComTalentBudgetD
@Autowired
private ComTalentBudgetDAO comTalentBudgetDAO;
@Autowired
private SystemParameterService systemParameterService;
@Override
protected void setCriteriaForQuery(ComTalentBudgetQueryVO vo, QueryWrapper<ComTalentBudgetQueryVO> criteria) {
}
public void insertList(List<ComTalentBudgetDTO> list, String TalentId) {
ComTalentBudget budget = new ComTalentBudget();
budget.setTalentId(TalentId);
this.delete(budget);
if (null != list) {
List<ComTalentBudget> iList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
ComTalentBudget item = convert2Entity(list.get(i));
item.setTalentId(TalentId);
iList.add(item);
}
this.insertBatch(iList);
}
}
public List<ComTalentBudgetDTO> getListByTaltentId(String talentId) {
return comTalentBudgetDAO.getListByTaltentId(talentId);
}
public List<ComTalentBudgetDTO> getList() {
List<ComTalentBudgetDTO> budgetList = new ArrayList<>();
List<SystemParameter> list = systemParameterService.getListByType(20);
int i = 1;
for (SystemParameter p : list) {
ComTalentBudgetDTO newVO = new ComTalentBudgetDTO();
newVO.setBudgetId(p.getId());
newVO.setYearValue1(new BigDecimal(0.00));
newVO.setYearValue2(new BigDecimal(0.00));
newVO.setYearValue3(new BigDecimal(0.00));
newVO.setYearValue4(new BigDecimal(0.00));
newVO.setYearValue5(new BigDecimal(0.00));
newVO.setBudgetName(p.getName());
newVO.setShowIndex(i);
budgetList.add(newVO);
i++;
}
return budgetList;
}
}
......@@ -11,6 +11,9 @@ import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 人才团队成员表 Service 实现类
* @author xujun
......@@ -28,4 +31,24 @@ public class ComTalentMembersServiceImpl extends BaseServiceImpl<ComTalentMember
protected void setCriteriaForQuery(ComTalentMembersQueryVO vo, QueryWrapper<ComTalentMembersQueryVO> criteria) {
}
public void insertList(List<ComTalentMembersDTO> list, String TalentId) {
ComTalentMembers menber = new ComTalentMembers();
menber.setTalentId(TalentId);
this.delete(menber);
if (null != list) {
List<ComTalentMembers> iList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
ComTalentMembers item = convert2Entity(list.get(i));
item.setTalentId(TalentId);
iList.add(item);
}
this.insertBatch(iList);
}
}
public List<ComTalentMembersDTO> getListByTaltentId(String talentId) {
return comTalentMembersDAO.getListByTaltentId(talentId);
}
}
......@@ -19,9 +19,17 @@
from com_batch
where year = #{year} and proj_type = #{projType}
</select>
<select id="getCurrentBatch" parameterType="java.util.Map" resultType="com.yiboshi.science.param.dto.ComBatchDTO">
<select id="getCurrentBatch" parameterType="java.util.Map" resultType="com.yiboshi.science.param.dto.ComBatchDTO">
select *
from com_batch
where proj_type = #{projType} and time_type=#{timeType} order by year desc, batch desc limit 1
<where>
<if test="projType != null and projType != ''">
and proj_type = #{projType}
</if>
<if test="timeType != null and timeType != ''">
and time_type = #{timeType}
</if>
</where>
order by year desc, batch desc limit 1
</select>
</mapper>
\ No newline at end of file
......@@ -42,4 +42,11 @@
</if>
ORDER BY resume_start DESC
</select>
<select id="getListByTalentId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComPersonResumeDTO">
SELECT a.*,b.name as resumeTypeName,b.code,b.gb_code type,b.tree_code level,b.system_code
FROM com_person_resume a
left join system_parameter b on a.resume_type = b.id and b.type_id = 18
where talent_id=#{talentId} order by a.resume_type, a.show_index asc
</select>
</mapper>
\ No newline at end of file
......@@ -37,4 +37,11 @@
</if>
ORDER BY gain_date DESC
</select>
<select id="getListByTalentId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComPersonScientificGainDTO">
SELECT a.*,b.name as gainTypeName,b.code,b.gb_code type,b.tree_code level,b.system_code
FROM com_person_scientific_gain a
left join system_parameter b on a.gain_type = b.id and b.type_id = 19
where talent_id=#{talentId} order by a.gain_type, a.show_index asc
</select>
</mapper>
\ No newline at end of file
......@@ -32,4 +32,15 @@
${ew.sqlSegment}
</where>
</select>
<select id="getById" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComTalentApplyDTO">
SELECT a.*,b.cert_id,b.person_name,b.sex,b.birthday,b.title,b.spec,b.mobile,
i.name as title_name, j.name as spec_name, k.name as parent_name
from com_talent_apply a
left join com_person b on a.person_id = b.id
left join system_parameter i on b.title=i.id and i.type_id=7
left join system_parameter j on b.spec=j.id and j.type_id=68
left join system_parameter k on j.parent_id = k.id
where a.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -43,4 +43,12 @@
</if>
ORDER BY create_time DESC
</select>
<select id="getListByTalentId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComTalentBudgetDTO">
SELECT a.*,b.name as budgetName,b.code,b.gb_code type,b.tree_code level,b.system_code
FROM com_project_budget a
left join system_parameter b on a.budget_id = b.id and b.type_id = 20
where talent_id=#{talentId} order by b.show_index asc
</select>
</mapper>
\ No newline at end of file
......@@ -44,4 +44,13 @@
</if>
ORDER BY create_time DESC
</select>
<select id="getListByTaltentId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComTalentMembersDTO">
SELECT a.*,d.name duty_name,f.name spec_name
FROM com_talent_members a
left join system_parameter d on a.duty = d.id and d.type_id = 62
left join system_parameter f on a.spec = f.id and f.type_id = 68
where talnet_id=#{talnetId}
order by a.show_index asc
</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