提交 ff48c972 编写于 作者: minghao.wu's avatar minghao.wu

fix: app调用详情接口

上级 34517c01
......@@ -13,6 +13,7 @@ import com.pica.cloud.online.exam.analysis.server.configuration.PropertiesConfig
import com.pica.cloud.online.exam.analysis.server.entity.*;
import com.pica.cloud.online.exam.analysis.server.service.AntiSpamService;
import com.pica.cloud.online.exam.analysis.server.service.CHCAnalysisService;
import com.pica.cloud.online.exam.analysis.server.service.CHCRankingListService;
import com.pica.cloud.online.exam.analysis.server.service.DoctorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -49,6 +50,9 @@ public class AnalysisController {
@Autowired
private AntiSpamService antiSpamService;
@Autowired
private CHCRankingListService rankingListService;
@ApiOperation(value = "获取活动详情", response = PicaResponse.class)
@RequestMapping(value = "/activityDetail", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public PicaResponse<CHCAnalysisDto> getActivityDetail(@RequestParam(required = false) Integer id) {
......@@ -158,21 +162,20 @@ public class AnalysisController {
/**
* CHC 获取考试前两百名
*/
if (rankingListService.isRankingInTop200(doctor.getId())) {
examTitleReplyDto.setReplyStatus(analysisService.getReplyStatus(examTitleId, user.getId()));
}
} else if (analysis.getType() == 2) {
/**
* PSA 职务职称主任/副主任 院长/副院长 科长/副科长 管理人数100以上
*/
if (doctorService.isAuth(doctor.getId())) {
examTitleReplyDto.setReplyStatus(analysisService.getReplyStatus(examTitleId, user.getId()));
}
}
}
}
if (user == null || user.getId() == 0) {
examTitleReplyDto.setReplyStatus(0);
} else {
examTitleReplyDto.setReplyStatus(analysisService.getReplyStatus(examTitleId, user.getId()));
}
builder.setData(examTitleReplyDto);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -7,9 +7,9 @@ package com.pica.cloud.online.exam.analysis.server.entity;
public class CHCRankingList {
private Integer id;
private Integer doctor_id;
private Integer doctorId;
private String doctor_name;
private String doctorName;
public Integer getId() {
return id;
......@@ -19,19 +19,19 @@ public class CHCRankingList {
this.id = id;
}
public Integer getDoctor_id() {
return doctor_id;
public Integer getDoctorId() {
return doctorId;
}
public void setDoctor_id(Integer doctor_id) {
this.doctor_id = doctor_id;
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
public String getDoctor_name() {
return doctor_name;
public String getDoctorName() {
return doctorName;
}
public void setDoctor_name(String doctor_name) {
this.doctor_name = doctor_name;
public void setDoctorName(String doctorName) {
this.doctorName = doctorName;
}
}
package com.pica.cloud.online.exam.analysis.server.mapper;
/**
* @author wuminghao
* @date 2018/8/28 15:07
*/
public interface CHCRankingListMapper {
/**
* 根据医生id判断是否在200名范围内
* @param doctorId
* @return
*/
int selectRecordExistTop200(int doctorId);
}
package com.pica.cloud.online.exam.analysis.server.mapper;
import com.pica.cloud.online.exam.analysis.server.entity.Doctor;
import org.omg.CORBA.INTERNAL;
/**
* @author wuminghao
......@@ -13,4 +14,18 @@ public interface DoctorMapper {
* @return
*/
Doctor selectByPrimaryKey(int id);
/**
* 根据医生id获取是否有权限
* @param doctorId
* @return
*/
Integer selectAuthByDoctorId(Integer doctorId);
/**
* 根据医生id获取患者个数
* @param doctorId
* @return
*/
Integer selectPatientCountByDoctorId(Integer doctorId);
}
......@@ -13,4 +13,11 @@ public interface DoctorService {
* @return
*/
Doctor getDoctorById(Integer doctorId);
/**
* 根据医生的id获取医生的权限
* @param doctorId
* @return
*/
boolean isAuth(Integer doctorId);
}
package com.pica.cloud.online.exam.analysis.server.service.impl;
import com.pica.cloud.online.exam.analysis.server.mapper.CHCRankingListMapper;
import com.pica.cloud.online.exam.analysis.server.service.CHCRankingListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
......@@ -7,6 +10,12 @@ import org.springframework.stereotype.Service;
* @date 2018/8/28 13:57
*/
@Service
public class CHCRankingListServiceImpl {
public class CHCRankingListServiceImpl implements CHCRankingListService {
@Autowired
CHCRankingListMapper rankingListMapper;
@Override
public boolean isRankingInTop200(Integer doctorId) {
return rankingListMapper.selectRecordExistTop200(doctorId) > 0;
}
}
......@@ -19,4 +19,9 @@ public class DoctorServiceImpl implements DoctorService {
public Doctor getDoctorById(Integer doctorId) {
return doctorMapper.selectByPrimaryKey(doctorId);
}
@Override
public boolean isAuth(Integer doctorId) {
return doctorMapper.selectAuthByDoctorId(doctorId) > 0;
}
}
......@@ -18,4 +18,20 @@
limit 1
</select>
<select id="selectAuthByDoctorId" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
select
count(1)
from pica.p_doctor
where id = #{doctorId,jdbcType=INTEGER}
and delete_flag = 1
and (title_id in (101, 401) or administer_title_id in (101,102,103,104,105,106))
</select>
<select id="selectPatientCountByDoctorId" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
select
count(1)
from pica.p_doc_pat_mapping
where doctor_id = #{doctorId,jdbcType=INTEGER}
and delete_flag = 1
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册