Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

zd_123 7 years ago
parent
commit
988f5c82a3

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -1454,6 +1454,9 @@ public class ConsultTeamService extends ConsultService {
        // 生成提问日志,并推送相关消息
        ConsultTeamLog infoLog = new ConsultTeamLog();
        infoLog.setConsult(ct.getConsult());
        if(content.length()>2500){
            content = content.substring(0,2500);
        }
        infoLog.setContent(content);
        infoLog.setDel("1");
        infoLog.setType(0);

+ 27 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -209,7 +209,7 @@ public class PatientDeviceService extends BaseService {
//            }
        if(checkDeviceSn(sn)){
//            patientDeviceDao.save(patientDevice);
            savePatientDevice(patientDevice,patient.getAddress(),patient.getName());
            savePatientDevice(patientDevice,patient.getAddress(),patient.getName(),patient.getDiseaseCondition());
        }else {
            String message = "设备不存在";
            throw new Exception(message);
@ -222,9 +222,9 @@ public class PatientDeviceService extends BaseService {
     * 设备绑定
     * @param patientDevice
     */
    public void savePatientDevice(PatientDevice patientDevice,String address,String patientName){
    public void savePatientDevice(PatientDevice patientDevice,String address,String patientName,Integer diseaseCondition){
        if(iotDeviceService.isUploadIot()){
            iotDeviceService.saveDevice(patientDevice,address,patientName);
            iotDeviceService.saveDevice(patientDevice,address,patientName,diseaseCondition);
        }else {
            patientDeviceDao.save(patientDevice);
        }
@ -749,6 +749,30 @@ public class PatientDeviceService extends BaseService {
        return list;
    }
    /**
     * 居民 医生搜索
     * @param name
     * @param page
     * @param pageSize
     */
    public List<com.alibaba.fastjson.JSONObject> searchPatient(String name,Integer page,Integer pageSize){
        StringBuffer sql = new StringBuffer("SELECT p.code,p.name,p.address,p.idcard,p.sex,GROUP_CONCAT(label_name) labelName ");
        sql.append("FROM ( SELECT DISTINCT f.* FROM wlyy_patient_device d, wlyy_sign_family f ");
        sql.append("WHERE f.`status` > 0 AND f.patient = d.`user` ) t, wlyy_patient p LEFT JOIN ");
        sql.append("wlyy_sign_patient_label_info l on  p. CODE = l.patient and l.`status`=1 ");
        sql.append("AND l.label_type = 3 WHERE t.patient = p. CODE ");
        if(StringUtils.isNotBlank(name)){
            sql.append(" and (p.`name` like '%"+name+"%' or t.doctor_name like '%"+name+"%') ");
        }
        sql.append("GROUP BY p.code,p.name,p.address,p.idcard,p.sex LIMIT ?,? ");
        List<com.alibaba.fastjson.JSONObject> list = myJdbcTemplate.queryJson(sql.toString(),new Object[]{(page-1)*pageSize,pageSize});
        list.forEach(json->{
            json.put("age", IdCardUtil.getAgeForIdcard(String.valueOf(json.get("idcard"))));
        });
        return list;
    }
    /**
     * 判断当前值是否在区间内
     */

File diff suppressed because it is too large
+ 69 - 68
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/ImmuneService.java


+ 18 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/iot/IotDeviceService.java

@ -152,14 +152,17 @@ public class IotDeviceService {
     * 设备绑定
     * @param patientDevice
     * @param address
     * @param name
     * @param diseaseCondition 病情:0绿标,1黄标,2红标
     * @return
     */
    public String saveDevice(PatientDevice patientDevice,String address,String name){
    public String saveDevice(PatientDevice patientDevice,String address,String name,Integer diseaseCondition){
        JSONObject json = new JSONObject();
        json.put("categoryCode",patientDevice.getCategoryCode());
        json.put("address",address);
        json.put("patient",patientDevice.getUser());
        json.put("patientName",name);
        json.put("diseaseCondition",diseaseCondition);
        json.put("idcard",patientDevice.getUserIdcard());
        json.put("deviceId",patientDevice.getDeviceId());
        json.put("deviceName",patientDevice.getDeviceName());
@ -169,7 +172,7 @@ public class IotDeviceService {
        json.put("agent",patientDevice.getAgent());
        json.put("doctor",patientDevice.getDoctor());
        String url = baseUrl+"/patientDevice/addPatientDevice";
        String url = baseUrl+"wg/patientDevice/addPatientDevice";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("jsonData",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
@ -404,7 +407,7 @@ public class IotDeviceService {
        List<PatientDevice> list = patientDeviceDao.findAll();
        list.forEach(patientDevice -> {
            Patient patient = patientDao.findByCode(patientDevice.getUser());
            String response = saveDevice(patientDevice,patient.getAddress(),patient.getName());
            String response = saveDevice(patientDevice,patient.getAddress(),patient.getName(),patient.getDiseaseCondition());
            JSONObject re = JSONObject.parseObject(response);
            if(re.getInteger("status")!=200){
                logger.error("id:"+patientDevice.getId()+" "+re.getString("errorMsg"));
@ -412,6 +415,18 @@ public class IotDeviceService {
        });
    }
    /**
     * 测试设备绑定
     * @return
     */
    public String testSaveDevice(){
        List<PatientDevice> list = patientDeviceDao.findAll();
        PatientDevice patientDevice = list.get(0);
        Patient patient = patientDao.findByCode(patientDevice.getUser());
        String response = saveDevice(patientDevice,patient.getAddress(),patient.getName(),patient.getDiseaseCondition());
        return response;
    }
    /**
     * 初始化迁移数据
     * @return

+ 7 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -427,13 +427,13 @@ public class PatientInfoController extends BaseController {
            if (StringUtils.isNotEmpty(oldMobile)) {
                keyword = "原关联手机号码"+oldMobile+"变更为"+keyword;
            }
            String reg = "^1[34578][0-9]{9}$";
            Pattern pattern = Pattern.compile(reg);
            Matcher matcher = pattern.matcher(newMobile);
            Boolean flag = matcher.matches();
            if (!flag){
                return error(-1, "新手机号格式不正确!");
            }
//            String reg = "^1[34578][0-9]{9}$";
//            Pattern pattern = Pattern.compile(reg);
//            Matcher matcher = pattern.matcher(newMobile);
//            Boolean flag = matcher.matches();
//            if (!flag){
//                return error(-1, "新手机号格式不正确!");
//            }
            Patient patient1 = patientDao.findByCode(patient);
            String patientName = patient1.getName();
            String openid = patient1.getOpenid();

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/iot/IotMonitoringHealthController.java

@ -79,6 +79,30 @@ public class IotMonitoringHealthController extends BaseController {
    }
    @RequestMapping(value = "/searchPatient",method = RequestMethod.GET)
    @ApiOperation("居民搜索")
    public String searchPatient(
            @ApiParam(name="name",value="居民姓名")
            @RequestParam(value="name",required = false) String name,
            @ApiParam(name="page",value="第几页(默认第一页)",defaultValue = "1")
            @RequestParam(value="page",required = false) Integer page,
            @ApiParam(name="pageSize",value="每页几行(默认10条记录)",defaultValue = "10")
            @RequestParam(value="pageSize",required = false) Integer pageSize){
        try {
            if(page==null){
                page = 1;
            }
            if(pageSize==null){
                pageSize = 10;
            }
            return write(200,"查询成功","data",patientDeviceService.searchPatient(name,page,pageSize));
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @RequestMapping(value = "/deviceBinding",method = RequestMethod.GET)
    @ApiOperation("设备绑定情况")
    public String deviceBinding(

+ 12 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/iot/IotDeviceController.java

@ -112,6 +112,18 @@ public class IotDeviceController extends BaseController{
        }
    }
    @RequestMapping(value = "/testSaveDevice",method = RequestMethod.POST)
    @ApiOperation("测试设备绑定数据")
    public String testSaveDevice(){
        try {
            return iotDeviceService.testSaveDevice();
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
    @RequestMapping(value = "/findById",method = RequestMethod.GET)
    @ApiOperation("按id查询")
    public String findById(@ApiParam(name = "id",value = "id",defaultValue = "LggM5iaSi6u18TUmeDoaeSnyFxntPMA2NPGXBRyPTwFsg+oRn3bHgg==")