Parcourir la source

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing il y a 3 ans
Parent
commit
a56d7cfba7

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/activity/ChildActivityEndpoint.java

@ -32,7 +32,7 @@ public class ChildActivityEndpoint  extends EnvelopRestEndpoint {
    public PageEnvelop childActivityRegistrationList(
            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patient,
            @ApiParam(name = "activityType", value = "活动类型 1小鬼来当家 2秋游去 3我喜欢我自己 4乡村音乐") @RequestParam(value = "activityType", required = false) String status,
            @ApiParam(name = "orgCode", value = "orgCode", required = false, defaultValue = "orgCode") @RequestParam(value = "orgCode") String orgCode,
            @ApiParam(name = "orgCode", value = "orgCode", required = false, defaultValue = "orgCode") @RequestParam(value = "orgCode",required = false) String orgCode,
            @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{

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

@ -155,46 +155,59 @@ public class OnlineContactService extends BaseJpaService<BasePatientDO, BasePati
        if (families.size()>0){
            List<String> familyIds = families.stream().map(item->((JSONObject)item).getString("id")).collect(Collectors.toList());
            if(patientArr.size()>0){
                JSONObject tmp = patientArr.getJSONObject(0);
                JSONArray participantsTimeArray = tmp.getJSONArray("participantsTimeArray");
                for (int i=0;i<participantsTimeArray.size();i++){
                    JSONObject tmpObj = participantsTimeArray.getJSONObject(i);
                    String id =  tmpObj.getString("id");
                    BasePatientDO patientDO = patientDao.findById(id);
                    if (patientDO.getArchiveType()==3){
                        continue;
                    }
                    if (!id.equals(patient)&&familyIds.contains(id)){
                        tmp.put("avatar",tmp.getString("photo"));
                        tmp.put("patientId",id);
                        String sql = " select family_relation from base_patient_family_member where " +
                                " patient = '"+patient+"' and family_member='"+id+"' " +
                                " and (del=1 or del is null) ";
                        List<Integer> relations = jdbcTemplate.queryForList(sql,Integer.class);
                        if(relations.size()>0){
                            tmp.put("relationName",familyMemberService.relations.get(relations.get(0)));
                        }else {
                            tmp.put("relationName","其他");
                boolean findFlag = false;//有会话的展示会话中的一条 且不为家属
                for (int i=0;i<patientArr.size();i++){
                    JSONObject tmp = patientArr.getJSONObject(i);
                    JSONArray participantsTimeArray = tmp.getJSONArray("participantsTimeArray");
                    for (int j=0;j<participantsTimeArray.size();j++){
                        JSONObject tmpObj = participantsTimeArray.getJSONObject(j);
                        String id =  tmpObj.getString("id");
                        BasePatientDO patientDO = patientDao.findById(id);
                        if (patientDO.getArchiveType()==3){
                            continue;
                        }
                        if (!id.equals(patient)&&familyIds.contains(id)){
                            tmp.put("avatar",tmp.getString("photo"));
                            tmp.put("patientId",id);
                            String sql = " select family_relation from base_patient_family_member where " +
                                    " patient = '"+patient+"' and family_member='"+id+"' " +
                                    " and (del=1 or del is null) ";
                            List<Integer> relations = jdbcTemplate.queryForList(sql,Integer.class);
                            if(relations.size()>0){
                                tmp.put("relationName",familyMemberService.relations.get(relations.get(0)));
                            }else {
                                tmp.put("relationName","其他");
                            }
                            patientResult.add(tmp);
                            findFlag=true;
                            break;
                        }
                        patientResult.add(tmp);
                    }
                    if (findFlag){
                        break;
                    }
                }
            }
            if (patientResult.size()==0){
                if (families.size()>0){
                    JSONObject tmp = families.getJSONObject(0);
                    JSONObject tmpObj = new JSONObject();
                    tmpObj.put("name",tmp.getString("name"));
                    tmpObj.put("unread_count","0");
                    tmpObj.put("avatar",tmp.getString("photo"));
                    tmpObj.put("userType","2");
                    tmpObj.put("patientId",tmp.get("id"));
                    tmpObj.put("relationName",tmp.get("familyRelationName"));
                    patientResult.add(tmpObj);
                    for (int i=0;i<families.size();i++){
                        JSONObject tmp = families.getJSONObject(i);
                        JSONObject tmpObj = new JSONObject();
                        tmpObj.put("name",tmp.getString("name"));
                        tmpObj.put("unread_count","0");
                        tmpObj.put("avatar",tmp.getString("photo"));
                        tmpObj.put("userType","2");
                        BasePatientDO patientDO = patientDao.findById(tmp.get("id").toString());
                        if (patientDO.getArchiveType()==3){
                            continue;
                        }
                        tmpObj.put("patientId",tmp.get("id"));
                        tmpObj.put("relationName",tmp.get("familyRelationName"));
                        patientResult.add(tmpObj);
                        break;
                    }
                }
            }
        }
        result.put("doctors",doctorResult);