Commit 649d72c7 authored by 徐俊's avatar 徐俊

xujun

parent 3c57e0bc
......@@ -2,11 +2,14 @@ package com.yiboshi.science.dao;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yiboshi.science.base.BaseDAO;
import com.yiboshi.science.entity.ComExpert;
import com.yiboshi.science.entity.SystemMenu;
import com.yiboshi.science.param.dto.ComExpertDTO;
import com.yiboshi.science.param.dto.ComProjectAuditDTO;
import com.yiboshi.science.param.query.ComExpertQueryVO;
import com.yiboshi.science.param.query.ComProjectAuditQueryVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -18,4 +21,6 @@ public interface ComExpertDAO extends BaseMapper<ComExpert>, BaseDAO<ComExpertQu
ComExpertDTO getExpertByCertId(String certId);
List<ComExpertDTO> getExpertListByIdList(@Param("ew") Wrapper<SystemMenu> queryWrapper);
Page<ComExpertDTO> getEcaluationStatisticListByPage(Page<ComExpertQueryVO> page, @Param("ew") Wrapper<ComExpertQueryVO> queryWrapper);
}
......@@ -138,4 +138,10 @@ public class ComExpertDTO extends BaseDTO {
/** 是否财务专家 */
@ApiModelProperty(value = "是否财务专家", position = 30)
private Integer isFinance;
/** 年度 */
@ApiModelProperty(value = "年度", position = 30)
private Integer groupYear;
/** 评审项目数 */
@ApiModelProperty(value = "评审项目数", position = 30)
private Integer projectCount;
}
......@@ -119,4 +119,7 @@ public class ComExpertQueryVO extends PaginationVO {
/** 角色Id */
@ApiModelProperty(value = "角色Id", position = 7)
private String roleId;
/** 年度 */
@ApiModelProperty(value = "年度", position = 30)
private Integer groupYear;
}
......@@ -64,7 +64,10 @@ public class ComExpertController extends BaseController<ComExpertService, ComExp
List<ComExpertSpecDTO> ExpertSpecList = comExpertSpecService.getListByExpertId(e.getId());
e.setSpecList(ExpertSpecList);
ExpertSpecList.forEach((p) -> {
e.setSpecName(e.getSpecName() + p.getSpecName() + "、");
if (Objects.isNull(e.getSpecName()))
e.setSpecName(p.getSpecName() + "、");
else
e.setSpecName(e.getSpecName() + p.getSpecName() + "、");
});
if (StringUtils.isNotBlank(e.getSpecName()))
e.setSpecName(e.getSpecName().substring(0, e.getSpecName().length() - 1));
......@@ -73,6 +76,30 @@ public class ComExpertController extends BaseController<ComExpertService, ComExp
return ResponseDataModel.ok(page);
}
@ApiOperation(value = "获取专家评审统计列表", httpMethod = "GET", notes = "获取专家评审统计列表")
@GetMapping
@RequestMapping("/getEcaluationStatisticListByPage")
@PreAuthorize("hasAnyRole('GOV')")
public ResponseDataModel<Pagination<ComExpertDTO>> getEcaluationStatisticListByPage(@Validated ComExpertQueryVO vo, BindingResult bindingResult) {
Pagination<ComExpertDTO> page = comExpertService.getEcaluationStatisticListByPage(vo);
if (null != page && null != page.getDataList() && page.getDataList().size() != 0) {
page.getDataList().forEach((e) -> {
e.setExpertStateName(CommonEnum.loginState.getEnum(e.getExpertState()).getDescription());
List<ComExpertSpecDTO> ExpertSpecList = comExpertSpecService.getListByExpertId(e.getId());
ExpertSpecList.forEach((p) -> {
if (Objects.isNull(e.getSpecName()))
e.setSpecName(p.getSpecName() + "、");
else
e.setSpecName(e.getSpecName() + p.getSpecName() + "、");
});
if (StringUtils.isNotBlank(e.getSpecName()))
e.setSpecName(e.getSpecName().substring(0, e.getSpecName().length() - 1));
});
}
return ResponseDataModel.ok(page);
}
@ApiOperation(value = "获取专家列表(分页)", httpMethod = "GET", notes = "获取专家列表(分页)")
@GetMapping
@RequestMapping("/getAssignExpertList")
......
package com.yiboshi.science.service;
import com.yiboshi.science.base.BaseService;
import com.yiboshi.science.base.Pagination;
import com.yiboshi.science.entity.ComExpert;
import com.yiboshi.science.entity.SelectListItem;
import com.yiboshi.science.param.dto.ComExpertDTO;
......@@ -70,4 +71,10 @@ public interface ComExpertService extends BaseService<ComExpertQueryVO, ComExper
*/
List<SelectListItem> getExpertListByIdList(Map<String, Object> idList);
/**
* 获取专家列表
* @param vo
* @return
*/
Pagination<ComExpertDTO> getEcaluationStatisticListByPage(ComExpertQueryVO vo);
}
......@@ -46,6 +46,9 @@ public class ComExpertServiceImpl extends BaseServiceImpl<ComExpertDAO, ComExper
@Override
protected void setCriteriaForQuery(ComExpertQueryVO vo, QueryWrapper<ComExpertQueryVO> criteria) {
if (Objects.nonNull(vo.getGroupYear())) {
criteria.eq("g.group_year", vo.getGroupYear());
}
if (Objects.nonNull(vo.getUnitId())) {
criteria.eq("e.unit_id", vo.getUnitId());
}
......@@ -96,6 +99,14 @@ public class ComExpertServiceImpl extends BaseServiceImpl<ComExpertDAO, ComExper
return new Pagination<>(dtoList, page.getTotal(), vo.getPageSize());
}
public Pagination<ComExpertDTO> getEcaluationStatisticListByPage(ComExpertQueryVO vo) {
QueryWrapper criteria = new QueryWrapper();
setCriteriaForQuery(vo, criteria);
Page<ComExpertQueryVO> page = new Page<>(vo.getPageIndex(), vo.getPageSize());
List<ComExpertDTO> dtoList = comExpertDAO.getEcaluationStatisticListByPage(page, criteria).getRecords();
return new Pagination<>(dtoList, page.getTotal(), vo.getPageSize());
}
public ComExpertDTO getExpertById(String id) {
ComExpertDTO dto = comExpertDAO.getExpertById(id);
if (null != dto) {
......
......@@ -28,6 +28,26 @@
</where>
ORDER BY d.tree_code ASC
</select>
<select id="getEcaluationStatisticListByPage" resultType="com.yiboshi.science.param.dto.ComExpertDTO">
SELECT a.id, e.person_name,e.cert_id,e.mobile,e.email,e.unit_id,e.work_unit,d.unit_name,d.unit_type,i.name title_name,f.username,f.password,
g.group_year, count(c.proj_id) as projectCount
FROM com_expert a
left join com_project_group_assign b on a.id = b.expert_id
left join com_project_group_detail c on b.group_id = c.group_id
left join com_project_group g on b.group_id = g.id
left join com_person e on a.person_id = e.id
left join com_unit d on e.unit_id = d.id
left join system_user f on f.person_id = e.id
left join system_parameter i on e.title=i.id and i.type_id=7
left join com_expert_spec p on a.id=p.expert_id
left join system_parameter j on p.spec_id=j.id
left join system_parameter k on j.parent_id = k.id
left join system_parameter m on k.parent_id = m.id
<where>
${ew.sqlSegment}
</where>
group by a.id, g.group_year
</select>
<select id="getExpertById" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComExpertDTO">
SELECT x.*,a.person_name,a.cert_id,a.sex,a.birthday,a.mobile,a.email,a.education,a.title,a.unit_id,a.work_unit,a.degree
,b.tree_code,b.unit_name,d.name education_name,e.name title_name,f.name degree_name
......
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