Commit e0f18764 authored by wangxl's avatar wangxl

1

parent 9aecca80
......@@ -25,6 +25,4 @@ public interface ComTalentAssignDAO extends BaseMapper<ComTalentAssign>, BaseDAO
List<AssignCount> getAssignCount(String expertId);
List<ComTalentGroupDTO> getTalentGroupAssignById(String id, String expertId);
Page<ComTalentAssignDTO> getTalentAssignListByPage(Page<ComTalentAssignQueryVO> page, @Param("ew") Wrapper<ComTalentAssignQueryVO> queryWrapper);
}
......@@ -36,6 +36,8 @@ public class ComTalentAssignDTO extends BaseDTO {
@ApiModelProperty(value = "备注", position =10)
@Length(max=65535, message = "备注不能大于65535")
private String remark;
/** 证件号 */
@ExcelProperty("证件号")
@ApiModelProperty(value = "证件号", position = 1)
......
......@@ -9,7 +9,9 @@ import com.yiboshi.science.enumeration.CommonEnum;
import com.yiboshi.science.param.dto.ComTalentAssignDTO;
import com.yiboshi.science.param.query.ComTalentAssignQueryVO;
import com.yiboshi.science.rest.BaseController;
import com.yiboshi.science.service.ComExpertSpecService;
import com.yiboshi.science.service.ComTalentAssignService;
import com.yiboshi.science.service.SystemParameterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,6 +32,12 @@ public class ComTalentAssignController extends BaseController<ComTalentAssignSer
@Autowired
private ComTalentAssignService comTalentAssignService;
@Autowired
private ComExpertSpecService comExpertSpecService;
@Autowired
private SystemParameterService systemParameterService;
@ApiOperation(value = "1.02 分页查询", httpMethod = "GET", notes = "1.02 根据参数获取列表")
@GetMapping
@RequestMapping("/getListByPage")
......@@ -45,26 +53,17 @@ public class ComTalentAssignController extends BaseController<ComTalentAssignSer
return getPaginationResponseDataModel(vo);
}
@ApiOperation(value = "1.02 分页查询", httpMethod = "GET", notes = "1.02 根据参数获取列表")
@GetMapping
@RequestMapping("/getTalentAssignListByPage")
public ResponseDataModel<Pagination<ComTalentAssignDTO>> getTalentAssignListByPage(@Validated ComTalentAssignQueryVO vo, BindingResult bindingResult) {
Pagination<ComTalentAssignDTO> page = comTalentAssignService.getTalentAssignListByPage(vo);
if (null != page && null != page.getDataList() && page.getDataList().size() != 0) {
page.getDataList().forEach((e) -> {
e.setCertId(hideAllIdCardNum(e.getCertId()));
e.setStateName(e.getAuditState().equals(2) ? "已评审" : e.getAuditState().equals(1) ? "未提交" : "未评审");
});
}
return ResponseDataModel.ok(page);
}
private ResponseDataModel<Pagination<ComTalentAssignDTO>> getPaginationResponseDataModel(@Validated ComTalentAssignQueryVO vo) {
Pagination<ComTalentAssignDTO> page = comTalentAssignService.getListByPage(vo);
if (null != page && null != page.getDataList() && page.getDataList().size() != 0) {
page.getDataList().forEach((e) -> {
e.setSpecList(comExpertSpecService.getListByExpertId(e.getExpertId()));
e.setCertId(hideAllIdCardNum(e.getCertId()));
e.setStateName(e.getAuditState().equals(2) ? "已评审" : e.getAuditState().equals(1) ? "未提交" : "未评审");
e.setTalentCategoryName(systemParameterService.getParaName(e.getTalentCategory()));
e.setTitleName(systemParameterService.getParaName(e.getTitle()));
e.setProfessionName(systemParameterService.getParaName(e.getProfession()));
});
}
return ResponseDataModel.ok(page);
......
......@@ -16,13 +16,6 @@ import java.util.Map;
*/
public interface ComTalentAssignService extends BaseService<ComTalentAssignQueryVO, ComTalentAssignDTO, ComTalentAssign> {
/**
* 多表分页查询
*
* @param vo 查询条件
* @return 分页对象
*/
Pagination<ComTalentAssignDTO> getTalentAssignListByPage(ComTalentAssignQueryVO vo);
/**
* 分配项目
*
......
......@@ -16,6 +16,12 @@ import java.util.Map;
* @version 2021-08-26
*/
public interface SystemParameterService extends BaseService<SystemParameterQueryVO, SystemParameterDTO, SystemParameter>{
/** 根据id获取参数
*
* @param Id
* @return
*/
String getParaName(String Id);
/** 根据id获取参数
*
* @param Id
......
......@@ -41,14 +41,16 @@ public class ComTalentAssignServiceImpl extends BaseServiceImpl<ComTalentAssignD
private ComTalentAssignDAO comTalentAssignDAO;
@Autowired
private ComBatchService comBatchService;
@Autowired
private ComExpertSpecService comExpertSpecService;
@Autowired
private ComTalentApplyService comTalentApplyService;
@Autowired
private ComEvaluationValueService comEvaluationValueService;
@Autowired
private ComExpertSpecService comExpertSpecService;
@Autowired
private SystemParameterService systemParameterService;
......@@ -60,26 +62,26 @@ public class ComTalentAssignServiceImpl extends BaseServiceImpl<ComTalentAssignD
if (Objects.nonNull(vo.getTalentId())) {
criteria.eq("a.talent_id", vo.getTalentId());
}
if (Objects.nonNull(vo.getGroupId())) {
criteria.eq("k.id", vo.getGroupId());
}
if (Objects.nonNull(vo.getAssignYear())) {
criteria.eq("assign_year", vo.getAssignYear());
criteria.eq("a.assign_year", vo.getAssignYear());
}
if (Objects.nonNull(vo.getAuditState())) {
criteria.eq("a.audit_state", vo.getAuditState());
}
if (Objects.nonNull(vo.getCertId())) {
criteria.like("c.cert_id", vo.getCertId());
criteria.like("f.cert_id", vo.getCertId());
}
if (Objects.nonNull(vo.getPersonName())) {
criteria.like("c.person_name", vo.getPersonName());
criteria.like("f.person_name", vo.getPersonName());
}
if (Objects.nonNull(vo.getSex())) {
criteria.eq("c.sex", vo.getSex());
criteria.eq("f.sex", vo.getSex());
}
if (Objects.nonNull(vo.getAppUnitName())) {
criteria.like("i.unit_name", vo.getAppUnitName());
criteria.like("g.unit_name", vo.getAppUnitName());
}
if (Objects.nonNull(vo.getGroupId())) {
criteria.eq("i.id", vo.getGroupId());
}
}
......@@ -89,22 +91,6 @@ public class ComTalentAssignServiceImpl extends BaseServiceImpl<ComTalentAssignD
setCriteriaForQuery(vo, criteria);
Page<ComTalentAssignQueryVO> page = new Page<>(vo.getPageIndex(), vo.getPageSize());
List<ComTalentAssignDTO> dtoList = comTalentAssignDAO.getListByPage(page, criteria).getRecords();
dtoList.forEach(e -> {
e.setSpecList(comExpertSpecService.getListByExpertId(e.getExpertId()));
e.setTalentCategoryName(systemParameterService.getParameterById(e.getTalentCategory()).getName());
});
return new Pagination<>(dtoList, page.getTotal(), vo.getPageSize());
}
@Override
public Pagination<ComTalentAssignDTO> getTalentAssignListByPage(ComTalentAssignQueryVO vo) {
QueryWrapper criteria = new QueryWrapper();
setCriteriaForQuery(vo, criteria);
Page<ComTalentAssignQueryVO> page = new Page<>(vo.getPageIndex(), vo.getPageSize());
List<ComTalentAssignDTO> dtoList = comTalentAssignDAO.getTalentAssignListByPage(page, criteria).getRecords();
dtoList.forEach(e -> {
e.setSpecList(comExpertSpecService.getListByExpertId(e.getExpertId()));
});
return new Pagination<>(dtoList, page.getTotal(), vo.getPageSize());
}
......
......@@ -79,6 +79,15 @@ public class SystemParameterServiceImpl extends BaseServiceImpl<SystemParameterD
return new Pagination<>(dtoList, page.getTotal(), vo.getPageSize());
}
@Override
public String getParaName(String Id) {
String name = "";
SystemParameter systemParameter = getParameterById(Id);
if (null != systemParameter && Objects.nonNull(systemParameter.getName()))
name = systemParameter.getName();
return name;
}
/**
* 根据参数Id获取参数
*
......@@ -444,12 +453,12 @@ public class SystemParameterServiceImpl extends BaseServiceImpl<SystemParameterD
public List<SpecDTO> getParameterArray(Integer typeId) {
List<SpecDTO> list = null;
Object obj = redisUtils.get(RedisKey.SpecArrayList+ typeId);
Object obj = redisUtils.get(RedisKey.SpecArrayList + typeId);
if (null != obj)
list = (List<SpecDTO>) redisUtils.get(RedisKey.SpecArrayList+ typeId);
list = (List<SpecDTO>) redisUtils.get(RedisKey.SpecArrayList + typeId);
if (null == list || list.size() == 0) {
list = systemParameterDAO.getParameterArray(typeId);
redisUtils.set(RedisKey.SpecArrayList+ typeId, list, 7, TimeUnit.DAYS);
redisUtils.set(RedisKey.SpecArrayList + typeId, list, 7, TimeUnit.DAYS);
}
return list;
}
......
......@@ -9,6 +9,6 @@
<select id="getEvaluation" resultType="com.yiboshi.science.param.dto.ComEvaluationDTO">
select *
from com_evaluation
order by updated desc, batch desc limit 1
order by updated desc limit 1
</select>
</mapper>
......@@ -7,7 +7,7 @@
t.user_id as userId, t.role_id as roleId, t.login_time as loginTime, t.login_ip as loginIp, t.remark as remark
</sql>
<select id="getListByAssignId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComEvaluationValueDTO">
SELECT b.*,a.item_id,a.assign_id,a.detail,a.count,a.score
SELECT b.*,a.item_id,a.assign_id,a.detail,a.count,a.score,
c.content content2, c.id pId,d.content content1, d.id ppId
FROM com_evaluation_value a
left join com_evaluation_item b on a.item_id=b.id
......
......@@ -6,65 +6,40 @@
t.id as id, t.expert_id as expertId, t.talent_id as talentId, t.assign_year as assignYear, t.total_score as gradeScore, t.remark as remark, t.created as created, t.updated as updated
</sql>
<select id="getListByPage" resultType="com.yiboshi.science.param.dto.ComTalentAssignDTO">
SELECT a.*, c.person_name as expertName,c.cert_id as expertCertId,c.sex,c.birthday,c.mobile,c.email,c.education,c.title,c.spec,
g.unit_name as expertUnitName,d.name education_name,e.name title_name,k.group_name, l.cert_id,l.person_name,i.unit_name as app_unit_name,f.talent_category
SELECT a.*,c.person_name as expert_name,c.cert_id as expert_cert_id,c.sex expert_sex,
e.talent_category,
g.unit_name expert_unit_name,
f.cert_id, f.person_name, f.sex, f.mobile, f.duty, f.title, f.profession,
i.group_name
FROM com_talent_assign a
LEFT JOIN com_expert b ON a.expert_id = b.id
LEFT JOIN com_person c ON b.person_id = c.id
LEFT JOIN com_unit g ON c.unit_id = g.id
left join system_parameter d on c.education=d.id and d.type_id=8
left join system_parameter e on c.title=e.id and e.type_id=7
left join com_talent_apply f on a.talent_id=f.id
left join com_unit i on f.app_unit_id = i.id
left join com_talent_group_detail j on f.id = j.talent_id
left join com_talent_group k on j.group_id = k.id
left join com_person l ON f.person_id = l.id
LEFT JOIN com_unit d ON c.unit_id = d.id
left join com_talent_apply e on a.talent_id=e.id
left join com_person f on e.app_person_id = f.id
left join com_unit g on f.unit_id = g.id
left join com_talent_group_detail h on h.id = a.talent_id
left join com_talent_group i on h.group_id = i.id
<where>
${ew.sqlSegment}
</where>
ORDER BY f.id,a.created ASC
</select>
<select id="getTalentAssignListByPage" resultType="com.yiboshi.science.param.dto.ComProjectAssignDTO">
SELECT a.*, c.cert_id, c.person_name, c.sex, c.mobile, c.duty, c.title, c.profession, i.name as title_name, j.name as professionName
FROM com_talent_assign a
left join com_talent_apply b on a.talent_id=b.id
left join com_person c on b.app_person_id = b.id
left join system_parameter i on c.title = i.id and i.type_id = 7
left join system_parameter j on c.profession = j.id and j.type_id = 69
<where>
${ew.sqlSegment}
</where>
order by a.created
</select>
<select id="getAssignExpertListByTalentId" resultType="com.yiboshi.science.param.dto.ComTalentAssignDTO">
SELECT a.*, c.person_name,c.cert_id,c.sex,c.birthday,c.mobile,c.email,c.education,c.title,g.unit_name
,d.name education_name,e.name title_name
FROM com_talent_assign a
LEFT JOIN com_expert b ON a.expert_id = b.id
LEFT JOIN com_person c ON b.person_id = c.id
LEFT JOIN com_unit g ON c.unit_id = g.id
left join system_parameter d on c.education=d.id and d.type_id=8
left join system_parameter e on c.title=e.id and e.type_id=7
where a.talent_id = #{talentId}
</select>
<select id="getAssignExpertList" resultType="com.yiboshi.science.param.dto.ComTalentAssignDTO">
SELECT a.*, c.person_name as personName,c.work_unit
FROM com_talent_assign a
LEFT JOIN com_expert b ON a.expert_id = b.id
LEFT JOIN com_person c ON b.person_id = c.id
LEFT JOIN com_expert b ON a.expert_id = b.id
LEFT JOIN com_person c ON b.person_id = c.id
where a.talent_id = #{talentId} order by c.person_name, a.total_score desc,c.person_name asc
</select>
<select id="getAssignExpertById" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComTalentAssignDTO">
SELECT a.*, c.person_name,c.cert_id,c.sex,c.birthday,c.mobile,c.email,c.education,c.title,g.unit_name
,d.name education_name,e.name title_name,f.cert_id as appCertId,f.person_name as appPersonName
SELECT a.*, c.cert_id, c.person_name, c.sex, c.mobile, c.duty, c.title, c.profession, i.name as title_name, j.name as professionName
FROM com_talent_assign a
LEFT JOIN com_expert b ON a.expert_id = b.id
LEFT JOIN com_person c ON b.person_id = c.id
LEFT JOIN com_unit g ON c.unit_id = g.id
left join system_parameter d on c.education=d.id and d.type_id=8
left join system_parameter e on c.title=e.id and e.type_id=7
left join com_talent_apply f on a.talent_id=f.id
where a.id = #{id}
LEFT JOIN com_talent_apply b on a.talent_id=b.id
LEFT JOIN com_person c on b.app_person_id = c.id
LEFT JOIN system_parameter i on c.title = i.id and i.type_id = 7
LEFT JOIN system_parameter j on c.profession = j.id and j.type_id = 69
WHERE a.id = #{id}
</select>
<select id="getAssignCount" parameterType="java.lang.String" resultType="com.yiboshi.science.entity.AssignCount">
SELECT assign_year year,count(*) assignCount
......
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