Browse Source

Merge remote-tracking branch 'origin/dev' into dev

LAPTOP-KB9HII50\70708 3 years ago
parent
commit
b18ca7db2a

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/admin/CommonEndpoint.java

@ -196,7 +196,7 @@ public class CommonEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "open/shuiBiaoInit")
    @ApiOperation(value = "微信模板消息推送")
    @ApiOperation(value = "水表用户初始化")
    public Envelop setRedisEnable() {
        try {
            commomService.shuiBiaoInit();

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

@ -239,11 +239,11 @@ public class DoctorLifeCareEndpoint extends EnvelopRestEndpoint {
    public ListEnvelop findPatientItemDict(@ApiParam(value = "patient", name = "patient")
                                           @RequestParam(value = "patient", required = false) String patient) {
        try {
//            JSONObject jsonObject = new JSONObject();
//            jsonObject.put("doctorId",permissionService.getUID());
//            if (permissionService.noPermission(1, jsonObject)) {
//                return ListEnvelop.getError("该操作没有权限");
//            }
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("doctorId",permissionService.getUID());
            if (permissionService.noPermission(1, jsonObject)) {
                return ListEnvelop.getError("该操作没有权限");
            }
            return ListEnvelop.getSuccess("查询成功",lifeCareOrderService.findPatientItemDict(patient));
        }catch (Exception e){
            return failedListEnvelopException2(e);

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/lifeCare/PadLifeCareEndpoint.java

@ -89,7 +89,7 @@ public class PadLifeCareEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size) {
        try {
            JSONObject result = lifeCareOrderService.queryInfoList(patient, status, page, size);
            JSONObject result = lifeCareOrderService.queryInfoList(patient, status,null, page, size);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return PageEnvelop.getError(result.getString(ResponseContant.resultMsg), -1);
            }

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

@ -89,10 +89,11 @@ public class PatientLifeCareEndpoint  extends EnvelopRestEndpoint {
    public PageEnvelop page(
            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = true) String patient,
            @ApiParam(name = "status", value = "工单状态,状态为全部时不传") @RequestParam(value = "status", required = false) Integer status,
            @ApiParam(name = "fedCode", value = "生活工单服务项") @RequestParam(value = "fedCode", required = false) String fedCode,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size) {
        try {
            JSONObject result = lifeCareOrderService.queryInfoList(patient, status, page, size);
            JSONObject result = lifeCareOrderService.queryInfoList(patient, status,fedCode, page, size);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return PageEnvelop.getError(result.getString(ResponseContant.resultMsg), -1);
            }
@ -106,9 +107,10 @@ public class PatientLifeCareEndpoint  extends EnvelopRestEndpoint {
    @GetMapping(value = "infoCount")
    @ApiOperation(value = "查询工单数量")
    public ObjEnvelop infoCount(
            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = true) String patient) {
            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = true) String patient,
            @ApiParam(name = "fedCode", value = "生活工单服务项") @RequestParam(value = "fedCode", required = false) String fedCode) {
        try {
            JSONObject allResult = lifeCareOrderService.queryInfoList(patient, null, 1, 5);
            JSONObject allResult = lifeCareOrderService.queryInfoList(patient, null,fedCode, 1, 5);
            if (allResult.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(allResult.getString(ResponseContant.resultMsg), -1);
            }
@ -116,14 +118,14 @@ public class PatientLifeCareEndpoint  extends EnvelopRestEndpoint {
            JSONObject object = new JSONObject();
            object.put("allCount",allCount);
            JSONObject qxResult = lifeCareOrderService.queryInfoList(patient, -1, 1, 5);
            JSONObject qxResult = lifeCareOrderService.queryInfoList(patient, -1, fedCode,1, 5);
            if (qxResult.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(qxResult.getString(ResponseContant.resultMsg), -1);
            }
            int qxCount = qxResult.getIntValue(ResponseContant.count);
            object.put("qxCount",qxCount);
            JSONObject wcResult = lifeCareOrderService.queryInfoList(patient, 2, 1, 5);
            JSONObject wcResult = lifeCareOrderService.queryInfoList(patient, 2, fedCode,1, 5);
            if (wcResult.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(wcResult.getString(ResponseContant.resultMsg), -1);
            }

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/common/CommomService.java

@ -45,7 +45,7 @@ public class CommomService {
    private PatientDeviceDao patientDeviceDao;
    //模板消息测试
    //水表用户初始化
    public void shuiBiaoInit(){
        String sql = " select id,user_id,idcard from base_patient where user_id is NOT null and user_id<>'' ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);

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

@ -501,16 +501,22 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
     *
     * @return
     */
    public JSONObject queryInfoList(String patient,Integer status, int page, int size) {
    public JSONObject queryInfoList(String patient,Integer status,String fedCode ,int page, int size) {
        JSONObject result = new JSONObject();
        status = null == status ? -100 : status;
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : size;
        String fedSql = " ";
        if (StringUtils.isNotBlank(fedCode)){
            fedSql = " and EXISTS ( " +
                    " select 1 from base_life_care_fee_detail fed where fed.order_id = o.id and fed.code='"+fedCode+"' " +
                    " )  ";
        }
        String sql = "SELECT *  FROM  base_life_care_order o " +
                " WHERE (o.patient = '{patient}' or o.proxy_patient = '{patient}') "+
                " AND (o.`status` = {status} or -100 = {status})" +
                " AND (o.`status` = {status} or -100 = {status})" +fedSql+
                "  group by o.id " +
                " ORDER BY o.create_time desc" +
                " LIMIT {start},{end} ";
@ -523,7 +529,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        String countSql = "SELECT count(DISTINCT o.id) FROM base_life_care_order o " +
                " WHERE  " +
                "  (o.patient = '{patient}' or o.proxy_patient = '{patient}') " +
                " AND (o.`status` = {status} or -100 = {status})";
                " AND (o.`status` = {status} or -100 = {status})"+fedSql;
        String finqlCountSql = countSql.replace("{patient}", patient)
                .replace("{status}", String.valueOf(status));

+ 3 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/BaseServiceNewsService.java

@ -77,7 +77,7 @@ public class BaseServiceNewsService {
     * @return
     */
    public List<Map<String,Object>> findPatinetByName(String name){
        String sql = "SELECT p.id,p.`name`,p.address,p.photo,p.mobile,p.lat_lon latLon,sex,idcard,p.pad_imei,p.openid,CAST(archive_type AS char) type from base_patient p\n" +
        String sql = "SELECT p.id,p.`name`,p.address,p.photo,p.mobile,p.lat_lon latLon,sex,idcard,p.pad_imei,p.openid,CAST(archive_type AS char) type,p.sign_status as signStatus from base_patient p\n" +
                "WHERE p.del = 1 and p.name like '%"+name+"%'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        List<DevicePatientDevice> feeDetail = patientDeviceDao.findByAll();
@ -202,10 +202,10 @@ public class BaseServiceNewsService {
        String sql = "SELECT p.id,p.`name`,p.address,p.photo,p.mobile,p.lat_lon latLon,sex,idcard,archive_type type,p.pad_imei,p.openid " +
                " from base_patient p " +
                "WHERE  p.del =1 and p.archive_type=1 and p.sign_status=0 "+filter+" limit "+page*size+","+size;
                "WHERE  p.del =1 and p.archive_type=1 and p.sign_status=0 and p.lat_lon is not null "+filter+" limit "+page*size+","+size;
        String sqlCount = "SELECT count(p.id) " +
                " from base_patient p " +
                "WHERE  p.del =1 and p.archive_type=1 and p.sign_status=0 "+filter ;
                "WHERE  p.del =1 and p.archive_type=1 and p.sign_status=0 and p.lat_lon is not null "+filter ;
        Long count = jdbcTemplate.queryForObject(sqlCount,Long.class);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> map:list){

+ 4 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -1675,7 +1675,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                    }
                    break;
                case "dailyWater":
                    if (patientDeviceService.patientDeviceListByTopic(patient,"preventOutOfBed").size()==0){
                    if (patientDeviceService.patientDeviceListByTopic(patient,"dailyWater").size()==0){
                        result.put("dailyWater", null);
                    }else {
                        Integer count = Integer.parseInt(tmp.get("total").toString());
@ -1767,12 +1767,12 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                    }
                    break;
                case "dailyWater":
                    devices = patientDeviceService.patientDeviceListByTopic(patient,"preventLost");
                    devices = patientDeviceService.patientDeviceListByTopic(patient,"dailyWater");
                    if (devices.size()>0){
                        tmp.put("band", true);
                        tmp.put("devices", devices);
                    }else {
                        tmp.put("band", true);
                        tmp.put("band", false);
                        tmp.put("devices", null);
                    }
                    break;
@ -2946,6 +2946,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> tmp:list){
            Map<String,Object> mapTmp = new HashMap<>();
            mapTmp.put("categoryCode",tmp.get("category_code").toString());
            switch (tmp.get("category_code").toString()){
                case "4":
                    mapTmp.put("deviceSn",tmp.get("device_sn").toString());

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ServicePackageService.java

@ -399,7 +399,7 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
     */
    public int getSignTotal(String doctorId){
        String sql = "SELECT COUNT(DISTINCT sr.patient) from base_service_package_sign_record sr,base_service_package_record r, " +
                " base_team_member m " +
                " base_team_member m,base_patient p " +
                "WHERE sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id and p.id = sr.patient and p.del=1  " +
                "and m.doctor_code = '"+doctorId+"' and m.del = '1' ";

+ 11 - 13
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -2365,11 +2365,10 @@ public class StatisticsService {
            Integer count = jdbcTemplate.queryForObject(sql,Integer.class);
            map.put("doctorCount",count);
            sql = " SELECT count(o.bussiness_id) " +
                    "FROM ( SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " +
                    "FROM base_security_monitoring_order o UNION ALL  " +
                    "SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " +
                    "FROM base_emergency_assistance_order o " +
                    ") o WHERE 1=1  and dept='"+teamId+"' and `status` in (-2,0,1) ";
                    "FROM (  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_security_monitoring_order o  " +
                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  " +
                    " UNION ALL  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_emergency_assistance_order o " +
                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  )o  ";
            Long emeAssistanceCount = jdbcTemplate.queryForObject(sql,Long.class);
            map.put("emeAssistanceCount",emeAssistanceCount);
            sql = " SELECT count(o.id) FROM base_life_care_order o WHERE o.status<>0 and o.status<>-1  and EXISTS ( " +
@ -2401,11 +2400,11 @@ public class StatisticsService {
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and a.id not in ('"+orgCodes+"')";
            }
            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' ";
            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.sign_status=1 and a.del = '1' ";
            sql += " and EXISTS ( select 1 from " +
                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " +
                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " +
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+teamId+"' ) "+filter;
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8) = a.id and r.team_code='"+teamId+"' ) "+filter;
            count =  jdbcTemplate.queryForObject(sql,Integer.class);
            map.put("oldTotal",count);
            //照护老人数量
@ -2464,11 +2463,10 @@ public class StatisticsService {
            Integer count = jdbcTemplate.queryForObject(sql,Integer.class);
            map.put("doctorCount",count);
            sql = " SELECT count(o.bussiness_id) " +
                    "FROM ( SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " +
                    "FROM base_security_monitoring_order o UNION ALL  " +
                    "SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " +
                    "FROM base_emergency_assistance_order o " +
                    ") o WHERE 1=1  and dept='"+teamId+"' and `status` in (-2,0,1) ";
                    "FROM (  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_security_monitoring_order o  " +
                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  " +
                    " UNION ALL  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_emergency_assistance_order o " +
                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  )o  ";
            Long emeAssistanceCount = jdbcTemplate.queryForObject(sql,Long.class);
            map.put("emeAssistanceCount",emeAssistanceCount);//救助服务
            sql = " SELECT count(o.id) FROM base_life_care_order o WHERE o.status<>0 and o.status<>-1  and EXISTS ( " +
@ -2501,7 +2499,7 @@ public class StatisticsService {
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and a.id not in ('"+orgCodes+"')";
            }
            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' ";
            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.sign_status=1 and a.del = '1' ";
            sql += " and EXISTS ( select 1 from " +
                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " +
                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " +

+ 7 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -649,17 +649,18 @@ public class PatientInfoPlatFormService {
            orgCodes = orgCodes.replaceAll(",","','");
            filter = " and ord.patient not in ('"+orgCodes+"') ";
        }
        String sqlCount = " select count(ord.id) from base_emergency_assistance_order ord INNER JOIN base_patient p on ord.patient = p.id where 1=1 ";
        String sql = " select '20' as OrderType,p.archive_type archiveType,p.residential_area residentialArea,ord.id,ord.patient, " +
                "p.name,'紧急呼叫' as serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time,ord.`status`," +
                " case p.sex when 1 then '男' when 2 then '女' else p.sex end as sex,TIMESTAMPDIFF(YEAR,p.birthday,now()) as age \n" +
                "from base_emergency_assistance_order ord INNER JOIN base_patient p on ord.patient = p.id " ;
                "from base_emergency_assistance_order ord INNER JOIN base_patient p on ord.patient = p.id and p.del=1 where 1=1 " ;
        if (StringUtils.isNotBlank(patient)){
            sql +=" and ord.patient='"+patient+"' ";
            filter +=" and ord.patient='"+patient+"' ";
        }
        sql +=  filter + "  order by create_time desc ";
        String countSql = "select count(id) from ("+sql+")A ";
        long count = jdbcTemplate.queryForObject(countSql,long.class);
        sql +=  filter + "  order by create_time desc";
        sqlCount  +=filter;
        long count = jdbcTemplate.queryForObject(sqlCount,long.class);
        sql +=" limit "+page*pageSize+","+pageSize;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);