Kaynağa Gözat

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

liubing 3 yıl önce
ebeveyn
işleme
2be919958f

+ 13 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -173,6 +173,19 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "findPatientLabelAndCar")
    @ApiOperation(value = "获取居民标签及能力评估结果信息")
    public Envelop findPatientLabelAndCar(@ApiParam(name = "patientId", value = "居民id")
                                    @RequestParam(value = "patientId", required = true)String patientId){
        try{
            return success("获取成功",patientService.findPatientLabelAndCar(patientId));
        }catch (Exception e){
            return failedException2(e);
        }
    }
    @PostMapping(value = "updPatientLabel")
    @ApiOperation(value = "修改居民标签信息")
    @ObserverRequired

+ 11 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/OpenStatisticsEndpoint.java

@ -80,6 +80,17 @@ public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "getAllDynamics")
    @ApiOperation(value = "综合动态v0.7.0")
    public PageEnvelop getAllDynamics(
            @RequestParam(required = true) Integer page,@RequestParam(required = true) Integer size) {
        try {
            return statisticsService.getAllDynamics(page,size);
        } catch (Exception e) {
            return failedPageEnvelopException2(e);
        }
    }
    @GetMapping(value = "serviceRankingAnalysis")
    @ApiOperation(value = "服务排名分析")
    public ListEnvelop serviceRankingAnalysis(

+ 13 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -101,6 +101,19 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return PageEnvelop.getSuccessListWithPage("success",list,page,size,count);
    }
    public JSONObject findPatientLabelAndCar(String patientId) throws Exception{
        JSONObject res = new JSONObject();
        List<WlyyPatientLabelDO> list = patientLabelDao.findByPatient(patientId);
        res.put("label",list);
        CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordService.findAssessmentByPatientId(patientId);
        if(recordDO==null){
            res.put("levelConclusionName","");
        }else{
            res.put("levelConclusionName",recordDO.getLevelConclusionName());
        }
        return res;
    }
    /**
     * 居民id
     * @param patientId

+ 9 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/OnlineContactService.java

@ -61,6 +61,9 @@ public class OnlineContactService extends BaseJpaService<BasePatientDO, BasePati
                list.add(helperObj);
                obj.put("helperObj",list);///助老员
            }
        } else {
            List list = new ArrayList();
            obj.put("helperObj",list);///助老员
        }
        if (jsList.size() > 0){
@ -94,6 +97,9 @@ public class OnlineContactService extends BaseJpaService<BasePatientDO, BasePati
                list.add(familyObj);
                obj.put("familyObj",list);
            }
        }else {
            List list = new ArrayList();
            obj.put("familyObj",list);
        }
        if (fwzList.size() > 0){
@ -108,6 +114,9 @@ public class OnlineContactService extends BaseJpaService<BasePatientDO, BasePati
                list.add(serStationObj);
                obj.put("serStationObj",list);
            }
        }else {
            List list = new ArrayList();
            obj.put("serStationObj",list);
        }
        return obj;
    }

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

@ -86,8 +86,10 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
    public CapacityAssessmentRecordDO findAssessmentByPatientId(String patient) throws Exception {
        Date assessmentTime =  DateUtil.dateTimeParse(DateUtil.getNowYear() + "-01-01 00:00:00");
        CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordDao.findByPatient(patient,assessmentTime);
        recordDO.setLevelConclusionName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getLevelConclusion())));
        return recordDO;
        if(recordDO!=null){
            recordDO.setLevelConclusionName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getLevelConclusion())));
        }
         return recordDO;
    }
    /**

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

@ -9,10 +9,13 @@ import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.es.util.ElasticsearchUtil;
import com.yihu.jw.es.util.SaveModel;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.collections.map.HashedMap;
@ -52,6 +55,8 @@ public class StatisticsService {
    private StatisticsUtilService statisticsUtilService;
    @Autowired
    private ImUtil imUtil;
    @Autowired
    private BasePatientDao patientDao;
    private static final String defalutArea = "330100";
@ -141,6 +146,56 @@ public class StatisticsService {
        return  res;
    }
    public PageEnvelop getAllDynamics(Integer page,Integer size){
        List result = new ArrayList<>();
        String sql = "select * from base_login_log order by create_time desc limit "+ (page-1)*size+","+size;
        String sqlCount = "select count(id) from base_login_log";
        Long count = jdbcTemplate.queryForObject(sqlCount,Long.class);
        List<BaseLoginLogDO> loginLogDOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(BaseLoginLogDO.class));
        for (BaseLoginLogDO log:loginLogDOs) {
            JSONObject object = new JSONObject();
            object.put("patient",log.getUserId());
            BasePatientDO patient = patientDao.findById(log.getUserId());
            if (patient != null){
                String archive_type = null;
                Integer onLineFlag =0;
                switch (patient.getArchiveType().toString()){
                    case "1":
                        archive_type = "older";//老人
                        break;
                    case "2":
                        archive_type = "child";//新生儿
                        break;
                }
                object.put("archiveType",patient.getArchiveType());
                String onLineStr = imUtil.findByUserIdAndType(log.getUserId().toString(),archive_type);
                JSONObject oneLineObj = JSONObject.parseObject(onLineStr);
                if (200 == oneLineObj.getInteger("status")){
                    if (oneLineObj.getInteger("data")>0){
                        onLineFlag=1;
                    }
                }
                object.put("onLineFlag", onLineFlag);
            } else {
                Integer onLineFlag =0;
                String onLineStr = imUtil.findByUserIdAndType(log.getUserId().toString(),"helper");
                JSONObject oneLineObj = JSONObject.parseObject(onLineStr);
                if (200 == oneLineObj.getInteger("status")){
                    if (oneLineObj.getInteger("data")>0){
                        onLineFlag=1;
                    }
                }
                object.put("onLineFlag", onLineFlag);
                object.put("archiveType","0");
            }
            object.put("name",log.getName());
            object.put("createTime", log.getCreateTime());
            object.put("clientType", log.getClientType());
            result.add(object);
        }
        return PageEnvelop.getSuccessListWithPage("查询成功",result,page,size,count);
    }
    /**
     * 服务排名分析
     * @param endDate