Explorar el Código

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

Conflicts:
	common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationTemplateDetailDO.java
yeshijie hace 4 años
padre
commit
c76f4545e2

+ 16 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorEndpoint.java

@ -1,6 +1,7 @@
package com.yihu.jw.care.endpoint.doctor;
package com.yihu.jw.care.endpoint.doctor;
import com.yihu.jw.care.service.doctor.CareDoctorService;
import com.yihu.jw.care.service.doctor.CareDoctorService;
import com.yihu.jw.care.service.sign.CapacityAssessmentRecordService;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
@ -29,6 +30,8 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
    private BaseDoctorDao doctorDao;
    private BaseDoctorDao doctorDao;
    @Autowired
    @Autowired
    private CareDoctorService doctorService;
    private CareDoctorService doctorService;
    @Autowired
    private CapacityAssessmentRecordService capacityAssessmentRecordService;
    @GetMapping(value = "doctorPage")
    @GetMapping(value = "doctorPage")
    @ApiOperation(value = "获取医生记录分页")
    @ApiOperation(value = "获取医生记录分页")
@ -63,4 +66,17 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError("查询失败");
            return ObjEnvelop.getError("查询失败");
        }
        }
    }
    }
    @GetMapping(value = "patientCount")
    @ApiOperation(value = "获取我的居民统计数量")
    public ObjEnvelop patientCount (
            @ApiParam(name = "doctorId", value = "医生id", required = true)
            @RequestParam(value = "doctorId",required = true) String doctorId) throws Exception {
        try{
            return ObjEnvelop.getSuccess("查询成功",capacityAssessmentRecordService.getPatientNum(doctorId));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
}
}

+ 16 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/sign/SignEndpoint.java

@ -80,6 +80,22 @@ public class SignEndpoint extends EnvelopRestEndpoint {
        }
        }
    }
    }
    @GetMapping(value = "getSignNum")
    @ApiOperation(value = "签约管理-获取签约")
    public ObjEnvelop getSignTNum(
            @ApiParam(name = "doctorId", value = "医生id", required = true)
            @RequestParam String doctorId) {
        try{
            int signTotal = servicePackageService.getSignTotal(doctorId);
            JSONObject json = new JSONObject();
            json.put("signTotal",signTotal);
            return ObjEnvelop.getSuccess("查询成功",json);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "getSignTopNum")
    @GetMapping(value = "getSignTopNum")
    @ApiOperation(value = "签约管理-获取签约/未签约总数")
    @ApiOperation(value = "签约管理-获取签约/未签约总数")
    public ObjEnvelop servicePackageSign(
    public ObjEnvelop servicePackageSign(

+ 3 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ArchiveService.java

@ -50,7 +50,7 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
    }
    }
    public PageEnvelop<List<Map<String,Object>>> archiveList(String doctorId, int page, int size,Integer signStatus){
    public PageEnvelop<List<Map<String,Object>>> archiveList(String doctorId, int page, int size,Integer signStatus){
        String sql = "SELECT a.archive_time,p.idcard,p.mobile,p.name,p.sex,p.id ";
        String sql = "SELECT a.create_time,p.idcard,p.mobile,p.name,p.sex,p.id ";
        String countSql = "SELECT count(*) ";
        String countSql = "SELECT count(*) ";
        String filters = "from wlyy_archive a,base_patient p " +
        String filters = "from wlyy_archive a,base_patient p " +
@ -60,13 +60,13 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
            filters += " and a.sign_status = "+signStatus;
            filters += " and a.sign_status = "+signStatus;
        }
        }
        String orderBy = " ORDER BY a.archive_time DESC " +
        String orderBy = " ORDER BY a.create_time DESC " +
                "LIMIT "+ (page - 1) * size + "," + size;
                "LIMIT "+ (page - 1) * size + "," + size;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql+filters+orderBy);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql+filters+orderBy);
        for (Map<String,Object> map :list){
        for (Map<String,Object> map :list){
            String idcard = map.get("idcard").toString();
            String idcard = map.get("idcard").toString();
            map.put("archiveTime", map.get("archive_time").toString().substring(0,19));
            map.put("createTime", map.get("create_time").toString().substring(0,19));
            map.put("age", IdCardUtil.getAgeForIdcard(idcard));
            map.put("age", IdCardUtil.getAgeForIdcard(idcard));
        }
        }
        Long count = jdbcTemplate.queryForObject(countSql+filters,Long.class);
        Long count = jdbcTemplate.queryForObject(countSql+filters,Long.class);

+ 40 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/CapacityAssessmentRecordService.java

@ -13,13 +13,12 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.sign.*;
import com.yihu.jw.entity.care.sign.*;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.recycler.Recycler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
@ -56,6 +55,45 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
    @Autowired
    @Autowired
    private CapacityAssessmentSocialAbilityDao CASocialAbilityDao;
    private CapacityAssessmentSocialAbilityDao CASocialAbilityDao;
    /**
     * 获取居民统计
     * @param doctorId
     * @return
     */
    public Map<String,Object> getPatientNum(String doctorId){
        Map<String,Object> res = new HashedMap();
        //能力完好(0级) 轻度失能(1级) 中度失能(2级) 重度失能(3级) 新生儿 10
        res.put("0",0);
        res.put("1",0);
        res.put("2",0);
        res.put("3",0);
        String sql = "SELECT COUNT(DISTINCT ar.patient),level_conclusion from  " +
                "base_capacity_assessment_record ar, " +
                "base_service_package_sign_record sr,base_service_package_record r,  " +
                "                base_service_package_item i,base_team_member m  " +
                "                WHERE sr.id = r.sign_id and r.service_package_id = i.service_package_id  " +
                "                and i.del = 1 and m.team_code = i.team_code and ar.patient = sr.patient " +
                "                and m.doctor_code = '"+doctorId+"' and m.del = '1' and sr.`status`=1 " +
                "GROUP BY ar.level_conclusion" ;
        List<Map<String,Object>> countMapList = jdbcTemplate.queryForList(sql);
        for(Map<String,Object> map:countMapList){
            int c = Integer.valueOf(map.get("count").toString());
            res.put(String.valueOf(map.get("status")),c);
        }
        String sql2 = "SELECT COUNT(DISTINCT ar.id) from base_patient ar, " +
                "base_service_package_sign_record sr,base_service_package_record r,  " +
                "                base_service_package_item i,base_team_member m  " +
                "                WHERE sr.id = r.sign_id and r.service_package_id = i.service_package_id  " +
                "                and i.del = 1 and m.team_code = i.team_code and ar.id = sr.patient and ar.archive_type = 2 " +
                "                and m.doctor_code = '"+doctorId+"' and m.del = '1' and sr.`status`=1";
        Integer count = jdbcTemplate.queryForObject(sql2,Integer.class);
        res.put("10",count);
        return res;
    }
    public PageEnvelop<List<Map<String,Object>>> assessmentPage(String doctorId,String name, int page, int size,
    public PageEnvelop<List<Map<String,Object>>> assessmentPage(String doctorId,String name, int page, int size,
                    Integer status,Integer levelConclusion,Integer servicePackageStatus){
                    Integer status,Integer levelConclusion,Integer servicePackageStatus){
        String sql = "SELECT c.id,c.patient,c.assessment_time,c.service_package_status servicePackageStatus, " +
        String sql = "SELECT c.id,c.patient,c.assessment_time,c.service_package_status servicePackageStatus, " +