Selaa lähdekoodia

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

叶仕杰 3 vuotta sitten
vanhempi
commit
c5624acd62

+ 24 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/sign/SignEndpoint.java

@ -233,15 +233,27 @@ public class SignEndpoint extends EnvelopRestEndpoint {
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return Envelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return Envelop.getSuccess("分配成功");
            return Envelop.getSuccess("签约成功");
        }catch (Exception e){
            if (e.getMessage().contains("重复签约服务项目")){
                return failed("分配失败,"+e.getMessage(),-1);
                return failed("签约失败,"+e.getMessage(),-1);
            }
            return failedException2(e);
        }
    }
    @GetMapping(value = "findServicePackageByOrgCode")
    @ApiOperation(value = "获取服务包")
    public ListEnvelop<List<Map<String,Object>>> findServicePackageByOrgCode (
            @ApiParam(name = "orgCode", value = "机构code", required = false)
            @RequestParam(value = "orgCode",required = false)  String orgCode) {
        try{
            return ListEnvelop.getSuccess("获取成功",servicePackageService.findServicePackageByOrgCode(orgCode));
        }catch (Exception e){
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "servicePackagePage")
    @ApiOperation(value = "获取服务包分页")
    public PageEnvelop<List<Map<String,Object>>> servicePackagePage (
@ -575,4 +587,14 @@ public class SignEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value="signPackageDoctorList")
    @ApiOperation(value = "签约服务包医生列表")
    public ListEnvelop signPackageDoctorList(@ApiParam(name="pateint",value = "姓名或身份证",required = true)
                                      @RequestParam(value = "pateint",required = true)String pateint){
        try {
            return ListEnvelop.getSuccess("查询成功",servicePackageService.signPackageDoctorList(pateint));
        }catch (Exception e){
            return failedListEnvelopException2(e);
        }
    }
}

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

@ -6,9 +6,7 @@ import com.yihu.jw.care.dao.sign.ArchiveDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.apply.PatientBedApplyDo;
import com.yihu.jw.entity.care.archive.ArchiveDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
@ -95,7 +93,7 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
            filters += " and a.sign_status = "+signStatus;
        }
        if(StringUtils.isNotBlank(name)){
            filters += " and p.name like '%"+name+"%'";
            filters += " and (p.name like '%"+name+"%' or p.idcard like '%"+name+"%')";
        }
        if (signStatus!=null&&signStatus==1){//已签约不按建档查询,只要该居民服务医生就在列表中
            filters+=" UNION " +

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

@ -273,6 +273,7 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
        JSONObject result = new JSONObject();
        ServicePackageSignRecordDO signRecordDO = objectMapper.readValue(jsonData, ServicePackageSignRecordDO.class);
        signRecordDO.setPatient(patientId);
        signRecordDO.setName(patientDO.getName());
        List<ServicePackageRecordDO> recordDOList = signRecordDO.getRecordDOList();
        String signId = signRecordDO.getId();
        List<String> idList = new ArrayList<>();
@ -335,12 +336,12 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
            ServicePackageRecordDO recordDO = iterator.next();
            recordDO.setPatient(patientId);
            recordDO.setSignId(signId);
            if (idList.contains(recordDO.getServicePackageId())) {
                iterator.remove();//使用迭代器的删除方法删除
            }
//            if (idList.contains(recordDO.getServicePackageId())) {
//                iterator.remove();//使用迭代器的删除方法删除
//            }
        }
        if(recordDOList.size()>0){
/*        if(recordDOList.size()>0){
            List<String> packages = recordDOList.stream().map(ServicePackageRecordDO::getServicePackageId).collect(Collectors.toList());
            String packagesId = packages.stream().map(String::valueOf).collect(Collectors.joining("','"));
            sqlItem = "select item.`code`,item.name from base_service_package_item item " +
@ -351,7 +352,7 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
               String message = "重复签约服务项目:"+newItem.get("emergencyAssistance").get(0).get("name").toString();
               throw new Exception(message);
           }
        }
        }*/
//        CapacityAssessmentRecordDO capacityAssessmentRecordDO = capacityAssessmentRecordService.findAssessmentByPatientId(patientId);
//        capacityAssessmentRecordDO.setServicePackageStatus(1);
//        capacityAssessmentRecordService.save(capacityAssessmentRecordDO);
@ -369,6 +370,20 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
        return result;
    }
    public List<ServicePackageDO> findServicePackageByOrgCode( String orgCode){
        String sql = "SELECT p.*  ";
        String filters = "from base_service_package p " +
                "WHERE p.del = 1 ";
        if(!StringUtil.isBlank(orgCode)){
            filters += " and p.org_code = '"+orgCode+"'";
        }
        filters += " ORDER BY p.create_time DESC ";
        List<ServicePackageDO> list = jdbcTemplate.query(sql+filters,new BeanPropertyRowMapper<>(ServicePackageDO.class));
        return list;
    }
    public PageEnvelop<List<Map<String,Object>>> servicePackagePage(int page, int size,String orgCode){
@ -542,7 +557,7 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
                " sr.id = r.sign_id and r.service_package_id = p.id " +
                "AND sr.patient = '"+patient+"' ORDER BY sr.create_time desc";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        String doctorSql = "SELECT d.name from base_team_member t,base_doctor d WHERE t.id = ? and t.doctor_code = d.id and d.del = 1 and t.del =1";
        String doctorSql = "SELECT d.name from base_team_member t,base_doctor d WHERE t.team_code = ? and t.doctor_code = d.id and d.del = 1 and t.del =1";
        for(Map<String,Object> map:list){
            List<String> doctorList = new ArrayList<>();
            if(map.get("teamCode")!=null){
@ -569,15 +584,28 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
                " base_service_package_record r, " +
                " base_service_package p " +
                "WHERE " +
                " p.org_code = o.id and r.service_package_id = p.id " +
                " p.org_code = o.code and r.service_package_id = p.id " +
                "AND r.id = '"+id+"' ";
        String doctorSql = "SELECT d.* from base_team_member t,base_doctor d,base_service_package_record r,base_service_package_sign_record sr" +
                " WHERE r.id = '"+id+"' and r.sign_id=sr.id and t.id = sr.team_code and t.doctor_code = d.id and d.del = 1 and t.del =1";
                " WHERE r.id = '"+id+"' and r.sign_id=sr.id and t.team_code = sr.team_code and t.doctor_code = d.id and d.del = 1 and t.del =1";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(orgSql);
        Map<String,Object> result = list.get(0);
        List<BaseDoctorDO> doctorDOList = jdbcTemplate.query(doctorSql, new BeanPropertyRowMapper<>(BaseDoctorDO.class));
        result.put("doctorDOList",doctorDOList);
        return result;
    }
    /**
     * 签约服务包医生列表
     */
    public List<Map<String,Object>> signPackageDoctorList(String pateint){
        String sql = "SELECT d.id,d.name,d.photo,r.id detailId,h.org_code orgCode,h.org_name orgName,d.job_title_code jobTitleCode,d.job_title_name jobTitleName" +
                " from base_team_member t,base_doctor d,base_service_package_record r,base_service_package_sign_record sr" +
                ",base_doctor_hospital h" +
                " WHERE sr.patient = '"+pateint+"'and sr.status=1  and r.sign_id=sr.id and t.team_code = sr.team_code " +
                " and t.doctor_code = d.id and d.del = 1 and t.del =1 and h.doctor_code = d.id and h.del=1";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}