吴世龙 3 years ago
parent
commit
b0bf54dfc4

+ 3 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/lifeCare/DoctorLifeCareEndpoint.java

@ -212,11 +212,9 @@ public class DoctorLifeCareEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping("wisdomCare")
    @GetMapping("wisdomCare")
    @ApiOperation(value = "医生端-智慧照护")
    public Envelop wisdomCare(@ApiParam(value = "医生code", name = "doctor")
                              @RequestParam(value = "doctor", required = true) String doctor,
                              @ApiParam(value = "医生id", name = "orgCode")
    public Envelop wisdomCare(@ApiParam(value = "医生id", name = "orgCode")
                              @RequestParam(value = "orgCode", required = true) String orgCode){
        JSONObject jsonObject = new JSONObject();
@ -226,7 +224,7 @@ public class DoctorLifeCareEndpoint extends EnvelopRestEndpoint {
        }
        try {
           return ObjEnvelop.getSuccess("获取成功",lifeCareOrderService.wisdomCare(doctor, orgCode),200) ;
           return ObjEnvelop.getSuccess("获取成功",lifeCareOrderService.wisdomCare(orgCode),200) ;
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }

+ 27 - 12
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -1061,18 +1061,33 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
     * 智慧照护
     */
    public JSONObject wisdomCare(String doctor,String orgCode){
        JSONObject jsonObject = new JSONObject();
        String sql = "SELECT DISTINCT id,`code`,`name`,pad_icon_img,life_care_img FROM base_life_care_item_dict WHERE org_code" +
                " = (SELECT DISTINCT org_code FROM base_team_member WHERE del =1 AND doctor_code = '"+doctor+"' )";
        List<Map<String, Object>> careList = jdbcTemplate.queryForList(sql);
        jsonObject.put("care",careList);
        String totalSql ="SELECT fd.`code` AS `code`,COUNT(fd.`code`) AS total ,fd.`name` AS `name` FROM base_life_care_order co LEFT JOIN " +
           " base_life_care_fee_detail fd ON co.id = fd.order_id WHERE co.hospital = '"+orgCode+"' AND co.status = -1 GROUP BY fd.`code`";
        List<Map<String, Object>> total = jdbcTemplate.queryForList(totalSql);
        jsonObject.put("total",total);
        return jsonObject;
    public List<Map<String, Object>> wisdomCare(String orgCode){
        String sql = "SELECT " +
                " dict. CODE, " +
                " dict. NAME, " +
                " dict.life_care_img, " +
                " dict.pad_icon_img, " +
                " A.* " +
                " FROM " +
                " base_life_care_item_dict dict " +
                " LEFT JOIN ( " +
                " SELECT " +
                " count(DISTINCT o.id) total, " +
                " fd. CODE " +
                " FROM " +
                " base_life_care_order o " +
                " INNER JOIN base_life_care_fee_detail fd ON o.id = fd.order_id " +
                " WHERE " +
                " o.`status` = 1 " +
                " AND o.hospital = '"+orgCode+"' " +
                " GROUP BY " +
                " fd.`code` " +
                " ) A ON dict. CODE = A. CODE " +
                " WHERE " +
                " dict.del = 1 " +
                " AND dict.org_code = '"+orgCode+"'";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}

+ 3 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/WlyygcStatisticsService.java

@ -754,7 +754,8 @@ public class WlyygcStatisticsService {
        String deviceSql ="SELECT COUNT(id) AS total, COUNT(IF(device_type = 0,device_type,NULL)) AS jk,COUNT(IF(device_type = 1,device_type,NULL)) AS af FROM wlyy_devices where 1=1 ";
        //医疗机构
        //养老机构
        String orgSql = "SELECT COUNT(IF(type = 2,type,null)) AS yl,COUNT(IF(type = 3,type,null)) AS yangl  FROM base_org WHERE del = 1 AND `code` NOT IN (SELECT DISTINCT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' and dict_code is not null) ";
        //日照中心
        String orgSql = "SELECT COUNT(IF(type = 2,type,null)) AS yl,COUNT(IF(type = 3,type,null)) AS yangl,COUNT(IF(type =6 ,type,NULL)) AS rz FROM base_org WHERE del = 1 AND `code` NOT IN (SELECT DISTINCT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' and dict_code is not null) ";
        //助老员
        //医护人员
        //社工
@ -779,6 +780,7 @@ public class WlyygcStatisticsService {
        List<Map<String, Object>> orgList = jdbcTemplate.queryForList(orgSql);
        res.put("yanglao",orgList.get(0).get("yangl"));
        res.put("yl",orgList.get(0).get("yl"));
        res.put("rz",orgList.get(0).get("rz"));
        List<Map<String, Object>> maps = jdbcTemplate.queryForList(zlSql);
        res.put("yh",maps.get(0).get("yh"));