瀏覽代碼

代码修改

LAPTOP-KB9HII50\70708 8 月之前
父節點
當前提交
01f2c91498

+ 5 - 3
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/controller/ChronicDiseaseController.java

@ -412,12 +412,13 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
    @RequestMapping(value = "getLabelCount", method = RequestMethod.GET)
    @ApiOperation("获取红黄绿标高血压糖尿病的指标人数")
    public String getLabelCount(
            @ApiParam(name = "doctorId", value = "医生id") @RequestParam(value = "doctorId", required = false) String doctorId) {
            @ApiParam(name = "doctorId", value = "医生id") @RequestParam(value = "doctorId", required = false) String doctorId,
            @ApiParam(name = "diseaseCondition", value = "病情") @RequestParam(value = "diseaseCondition", required = false) String diseaseCondition) {
        try {
            if (StringUtils.isBlank(doctorId)) {
                doctorId = getUID();
            }
            HashMap<String, Object> result = doctorSchemeService.getLabelCount(doctorId);
            HashMap<String, Object> result = doctorSchemeService.getLabelCount(doctorId,diseaseCondition);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            return error(-1, e.getMessage());
@ -430,6 +431,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
            @ApiParam(name = "doctorId", value = "医生id") @RequestParam(value = "doctorId", required = false) String doctorId,
            @ApiParam(name = "labelType", value = "1高血压 2糖尿病 空全部") @RequestParam(value = "labelType", required = false) String labelType,
            @ApiParam(name = "searchContent", value = "检索内容") @RequestParam(value = "searchContent", required = false) String searchContent,
            @ApiParam(name = "diseaseCondition", value = "病情") @RequestParam(value = "diseaseCondition", required = false) String diseaseCondition,
            @ApiParam(name = "page", value = "页码") @RequestParam(value = "page", required = false) int page,
            @ApiParam(name = "pageSize", value = "数量") @RequestParam(value = "pageSize", required = false) int pageSize
    ) {
@ -437,7 +439,7 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
            if (StringUtils.isBlank(doctorId)) {
                doctorId = getUID();
            }
            List<Map<String, Object>> result = doctorSchemeService.getLabelDetail(doctorId, labelType, searchContent, page, pageSize);
            List<Map<String, Object>> result = doctorSchemeService.getLabelDetail(doctorId, labelType,diseaseCondition, searchContent, page, pageSize);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();

+ 21 - 33
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/scheme/DoctorSchemeService.java

@ -37,7 +37,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -464,7 +463,7 @@ public class DoctorSchemeService {
                "	base_patient a \n" +
                "	INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
                "WHERE 1=1\n" +
                "AND a.disease_condition IN('1','2','3')\n" +
                "AND a.disease_condition IN('1','2','0')\n" +
                "AND a.disease IN ('1','2','1,2','2,1')\n" +
                "AND b.doctor ='" + doctorcode + "'";
@ -2180,7 +2179,7 @@ public class DoctorSchemeService {
     *
     * @return
     */
    public HashMap<String, Object> getLabelCount(String doctorId) throws ExecutionException, InterruptedException {
    public HashMap<String, Object> getLabelCount(String doctorId,String diseaseCondition) throws ExecutionException, InterruptedException {
        // 高血压预警
        String sql01 = "SELECT count(DISTINCT  a.id)\n" +
                "FROM base_patient a \n" +
@ -2188,7 +2187,7 @@ public class DoctorSchemeService {
                "INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
                "WHERE 1=1\n" +
                "AND a.standard_status='1'\n" +
                "AND a.disease_condition IN('1','2','3')\n" +
                "AND a.disease_condition IN('1','2','0')\n" +
                "and l.label_name='高血压' " +
                "AND b.doctor ='" + doctorId + "'";
        // 高血压
@ -2197,7 +2196,7 @@ public class DoctorSchemeService {
                "INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
                "INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
                "WHERE 1=1\n" +
                "AND a.disease_condition IN('1','2','3')\n" +
                "AND a.disease_condition IN('1','2','0')\n" +
                "and l.label_name='高血压' " +
                "AND b.doctor ='" + doctorId + "'";
@ -2208,7 +2207,7 @@ public class DoctorSchemeService {
                "INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
                "WHERE 1=1\n" +
                "AND a.standard_status='1'\n" +
                "AND a.disease_condition IN('1','2','3')\n" +
                "AND a.disease_condition IN('1','2','0')\n" +
                "and l.label_name='糖尿病' " +
                "AND b.doctor ='" + doctorId + "'";
        // 糖尿病
@ -2217,33 +2216,19 @@ public class DoctorSchemeService {
                "INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
                "INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
                "WHERE 1=1\n" +
                "AND a.disease_condition IN('1','2','3')\n" +
                "AND a.disease_condition IN('1','2','0')\n" +
                "and l.label_name='糖尿病' " +
                "AND b.doctor ='" + doctorId + "'";
        CompletableFuture<Integer> future01 = CompletableFuture.supplyAsync(() -> {
            Integer count = jdbcTemplate.queryForObject(sql01, Integer.class);
            return count;
        }, execute);
        CompletableFuture<Integer> future02 = CompletableFuture.supplyAsync(() -> {
            Integer count = jdbcTemplate.queryForObject(sql02, Integer.class);
            return count;
        }, execute);
        CompletableFuture<Integer> future03 = CompletableFuture.supplyAsync(() -> {
            Integer count = jdbcTemplate.queryForObject(sql03, Integer.class);
            return count;
        }, execute);
        CompletableFuture<Integer> future04 = CompletableFuture.supplyAsync(() -> {
            Integer count = jdbcTemplate.queryForObject(sql04, Integer.class);
            return count;
        }, execute);
        CompletableFuture.allOf(future01, future02, future03, future04).get();
        Integer count1 = future01.get();// 高血压预警
        Integer count2 = future02.get();// 高血压
        Integer count3 = future03.get();// 糖尿病预警
        Integer count4 = future04.get();// 糖尿病
        if(StringUtils.isNotBlank(diseaseCondition)){
            sql01 += " and a.disease_condition = '"+diseaseCondition+"' ";
            sql02 += " and a.disease_condition = '"+diseaseCondition+"' ";
            sql03 += " and a.disease_condition = '"+diseaseCondition+"' ";
            sql04 += " and a.disease_condition = '"+diseaseCondition+"' ";
        }
        Integer count1 = jdbcTemplate.queryForObject(sql01, Integer.class);// 高血压预警
        Integer count2 = jdbcTemplate.queryForObject(sql02, Integer.class);// 高血压
        Integer count3 = jdbcTemplate.queryForObject(sql03, Integer.class);// 糖尿病预警
        Integer count4 = jdbcTemplate.queryForObject(sql04, Integer.class);// 糖尿病
        HashMap<String, Object> map = new HashMap<>();
        map.put("gxy_yj", count1);// 高血压预警
@ -2256,14 +2241,14 @@ public class DoctorSchemeService {
    /**
     * labelType 1高血压 2糖尿病
     */
    public List<Map<String, Object>> getLabelDetail(String doctorId, String labelType, String searchContent, int page, int pageSize) {
    public List<Map<String, Object>> getLabelDetail(String doctorId, String labelType,String diseaseCondition, String searchContent, int page, int pageSize) {
        String sql = "SELECT DISTINCT a.id,a.`name`,a.idcard,a.mobile,a.ssc, TIMESTAMPDIFF(YEAR, a.birthday, CURDATE()) AS age " +
                ",a.sex,a.disease,CAST(a.disease_condition AS CHAR) diseaseCondition,a.photo,CAST(a.standard_status AS CHAR) standardStatus " +
                "FROM base_patient a \n" +
                "INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
                "INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
                "WHERE 1=1\n" +
                "AND a.disease_condition IN('1','2','3') " +
                "AND a.disease_condition IN('1','2','0') " +
                "AND b.doctor ='" + doctorId + "'";
        if (StringUtils.isNotBlank(labelType)) {
            if ("1".equals(labelType)) {
@ -2273,6 +2258,9 @@ public class DoctorSchemeService {
                sql += "AND l.label_name='糖尿病' \n";
            }
        }
        if(StringUtils.isNotBlank(diseaseCondition)){
            sql += "AND a.disease_condition = '"+diseaseCondition+"' " ;
        }
        if (StringUtils.isNotBlank(searchContent)) {
            sql += " AND a.`name` LIKE '%" + searchContent + "%' ";
        }