Bläddra i källkod

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

 Conflicts:
	svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/WlyygcStatisticsService.java
LAPTOP-KB9HII50\70708 3 år sedan
förälder
incheckning
0cf0dd3c62

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java

@ -373,7 +373,7 @@ public class PatientDeviceController extends BaseController {
    @ApiOperation("获取getAqgDeviceInfo2定位数据")
    @RequestMapping(value = "getAqgDeviceInfo2",method = RequestMethod.GET)
    public String getAqgDeviceInfo2(@ApiParam(name = "deviceSn",value = "设备sn码")
                                 @RequestParam(value = "deviceSn",required = true)String deviceSn){
                                    @RequestParam(value = "deviceSn",required = true)String deviceSn){
        try {
            return write(200,"获取成功","data",patientDeviceService.getAqgDeviceInfo2(deviceSn));
        }catch (Exception e){

+ 52 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/wlyygc/WlyygcDataEndpoint.java

@ -15,6 +15,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
 * Created by yeshijie on 2022/1/18.
 */
@ -81,4 +84,53 @@ public class WlyygcDataEndpoint extends EnvelopRestEndpoint {
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "signOldList")
    @ApiOperation(value = "获取签约老人")
    public ListEnvelop signOldList(@ApiParam(name = "code", value = "社区编码")
                                   @RequestParam(value = "code", required = true) String code,
                                   @ApiParam(name = "page", value = "分页大小", required = true)
                                   @RequestParam(value = "page") Integer page,
                                   @ApiParam(name = "size", value = "页码", required = true)
                                   @RequestParam(value = "size") Integer size) {
        try {
            List<Map<String, Object>> maps = wlyygcStatisticsService.signOldList(code, page, size);
            return success(maps);
        } catch (Exception e) {
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "securityEmergencyList")
    @ApiOperation(value = "获取安防/监护")
    public ObjEnvelop securityEmergencyList(@ApiParam(name = "code", value = "社区编码")
                                            @RequestParam(value = "code", required = true) String code,
                                            @ApiParam(name = "page", value = "分页大小", required = true)
                                            @RequestParam(value = "page") Integer page,
                                            @ApiParam(name = "size", value = "页码", required = true)
                                            @RequestParam(value = "size") Integer size) {
        try {
            JSONObject jsonObject = wlyygcStatisticsService.securityEmergencyList(code,page,size);
            return success(jsonObject);
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
    }
    @GetMapping(value = "deviceList")
    @ApiOperation(value = "获取设备列表")
    public ListEnvelop deviceList(@ApiParam(name = "code", value = "社区编码")
                                  @RequestParam(value = "code", required = true) String code,
                                  @ApiParam(name = "page", value = "分页大小", required = true)
                                  @RequestParam(value = "page") Integer page,
                                  @ApiParam(name = "size", value = "页码", required = true)
                                  @RequestParam(value = "size") Integer size) {
        try {
            List<Map<String, Object>> maps = wlyygcStatisticsService.deviceList(code, page, size);
            return success(maps);
        } catch (Exception e) {
            return failedListEnvelopException2(e);
        }
    }
}

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

@ -535,7 +535,7 @@ public class DetectionPlatformService  {
    public List<Map<String,Object >> findSignOlder(String doctorId){
/*        String sql=  "SELECT p.id,p.name,p.photo,p.idcard,CAST(IFNULL(p.birthday,'') AS char ) birthday,p.residential_area residentialArea,p.sex, " +
        /*String sql=  "SELECT p.id,p.name,p.photo,p.idcard,CAST(IFNULL(p.birthday,'') AS char ) birthday,p.residential_area residentialArea,p.sex, " +
                " p.ykt_id yktId, case 1 WHEN p.openid is not null then 1 WHEN p.on_line = '1' then 1 ELSE 0 end as online,IFNULL(p.sign_status,0) signStatus "+
                " from base_service_package_sign_record sr,base_patient p,base_service_package_record r,base_team_member m " +
                "WHERE sr.status=1 and sr.patient = p.id and m.team_code = r.team_code and sr.id=r.sign_id " +

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

@ -209,7 +209,7 @@ public class WlyygcStatisticsService {
                ", base_service_package_record r, base_emergency_assistance_order o    " +
                "WHERE p.del = 1 and p.archive_type =1 and r.patient = p.id " +
                "and p.id = o.patient " + filter +
                " UNION ALL " +
                "UNION ALL " +
                "select o.id,p.name,p.idcard,p.residential_area,'2' type,o.serve_address,o.serve_desc,o.status,o.create_time FROM  " +
                "base_patient p INNER JOIN base_service_package_sign_record sr on p.id = sr.patient and sr.`status`=1 " +
                ", base_service_package_record r, base_security_monitoring_order o " +
@ -244,4 +244,107 @@ public class WlyygcStatisticsService {
        return jsonArray;
    }
    public List<Map<String, Object>> signOldList(String code, Integer page, Integer size) {
        if (page == null) {
            page = 1;
        }
        if (size == null) {
            size = 10;
        }
        String sql = "SELECT DISTINCT p.`name`, p.mobile, p.idcard,(CASE WHEN p.sex = 1 THEN  '男' ELSE '女' END ) AS sex,p.address, TIMESTAMPDIFF(YEAR, p.birthday, CURDATE()) years,p.residential_area AS residentialArea" +
                " FROM base_patient p INNER JOIN base_service_package_sign_record br ON p.id = br.patient, base_service_package_record r" +
                " WHERE p.del = 1 AND br.`status` = 1 AND p.archive_type = 1 AND r.patient = p.id ";
        if ("1".equals(code)) {
            //1华联社区
            sql += "  and r.team_code = '8a92aba97a9f6f49017ae4fdbdmqteam' ";
        } else {
            return null;
        }
        sql += "ORDER BY p.`name` desc limit " + (page - 1)*size + "," + size;
        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
        return maps;
    }
    public JSONObject securityEmergencyList(String code,Integer page,Integer size) {
        JSONObject jsonObject = new JSONObject();
        if (page == null) {
            page = 1;
        }
        if (size == null) {
            size = 10;
        }
        String jjsql = "SELECT DISTINCT " +
                "ord.patient_name," +
                "'紧急呼叫' AS serveDesc " +
                "FROM base_emergency_assistance_order ord ";
        String afsql ="SELECT DISTINCT " +
                "ord.patient_name AS NAME," +
                "ord.serve_desc AS serveDesc " +
                "FROM " +
                "base_security_monitoring_order ord " +
                "INNER JOIN base_service_package_sign_record br ON ord.patient = CONVERT (br.patient USING utf8) COLLATE utf8_unicode_ci," +
                " base_service_package_record r " +
                "WHERE " +
                "r.patient = ord.patient ";
        if ("1".equals(code)) {
                                             //808080eb78f276d40178f3373c8c000b
            jjsql += "WHERE ord.team_code ='8a92aba97a9f6f49017ae4fdbdmqteam'";
            afsql += "AND r.team_code ='8a92aba97a9f6f49017ae4fdbdmqteam'";
        }else {
            return jsonObject;
        }
        jjsql += " ORDER BY ord.patient_name DESC limit " + (page - 1)*size + "," + size;
        afsql += " ORDER BY ord.patient_name DESC limit " + (page - 1)*size + "," + size;
        List<Map<String, Object>> jj = jdbcTemplate.queryForList(jjsql);
        List<Map<String, Object>> af = jdbcTemplate.queryForList(afsql);
        jsonObject.put("Security", af);
        jsonObject.put("Emergency", jj);
        return jsonObject;
    }
    public List<Map<String, Object>> deviceList(String code,Integer page,Integer size){
        if (page == null) {
            page = 1;
        }
        if (size == null) {
            size = 10;
        }
        String filter ="";
        if ("1".equals(code)){
            filter += "AND r.team_code = '8a92aba97a9f6f49017ae4fdbdmqteam'";
        }else {
            return null;
        }
        String deviceSql = "SELECT DISTINCT" +
                " pd.device_name as deviceName," +
                "pd.device_type as deviceType," +
                "wd.collect_num as collectNum " +
                "FROM " +
                "base_patient p " +
                "INNER JOIN base_service_package_sign_record sr ON p.id = sr.patient " +
                "AND sr.`status` = 1," +
                " base_service_package_record r," +
                " wlyy_patient_device pd," +
                " wlyy_devices wd " +
                "WHERE " +
                "p.del = 1 " +
                "AND p.archive_type = 1 " +
                "AND r.patient = p.id " +
                "AND p.id = pd.`user` " +
                "AND pd.del = 0 "+
                "AND wd.device_code = pd.device_sn "+filter+" ORDER BY pd.device_name DESC limit " + (page - 1)*size + "," + size;
        List<Map<String, Object>> maps = jdbcTemplate.queryForList(deviceSql);
        return maps;
    }
}