Bläddra i källkod

健康银行,设备服务包接口

huangwenjie 7 år sedan
förälder
incheckning
5cd9a3da06

+ 2 - 2
common/common-entity/src/main/java/com/yihu/wlyy/entity/device/PatientDevice.java

@ -15,7 +15,7 @@ public class PatientDevice extends IdEntity {
    // 设备ID
    private Long deviceId;
    // 设备标识 1血糖仪,2.血压计
    // 设备标识
    private String deviceSn;
    //sim卡号
    private String sim;
@ -23,7 +23,7 @@ public class PatientDevice extends IdEntity {
    private String deviceName;
    // 用户code
    private String user;
    // 设备类型标识
    // 设备类型标识 1血糖仪,2.血压计
    private String categoryCode;
    // 用户类型标准 -1代表单用户
    private String userType;

+ 36 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.address.Street;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.entity.charge.WlyyCharge;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
@ -27,6 +28,7 @@ import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.*;
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.common.SMSService;
@ -130,6 +132,8 @@ public class SignWebService extends BaseService {
    private ElasticsearchUtil elasticsearchUtil;
    @Autowired
    private WechatTemplateConfigDao templateConfigDao;
    @Autowired
    private PatientDeviceDao patientDeviceDao;
    /**
     * 厦门市
     */
@ -632,6 +636,7 @@ public class SignWebService extends BaseService {
            if (adminTeam == null) adminTeam = new AdminTeam();
            if (doctor == null) doctor = new Doctor();
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("dataType","sign");//家庭医生签约服务包
            jsonObject.put("hospitalName", renew.getHospitalName());
            jsonObject.put("hospital", renew.getHospital());
            jsonObject.put("code", renewCode);
@ -703,6 +708,7 @@ public class SignWebService extends BaseService {
            if (adminTeam == null) adminTeam = new AdminTeam();
            if (doctor == null) doctor = new Doctor();
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("dataType","sign");//家庭医生签约服务包
            jsonObject.put("hospitalName", signFamily.getHospitalName());
            jsonObject.put("hospital", signFamily.getHospital());
            jsonObject.put("code", signCode);
@ -763,6 +769,36 @@ public class SignWebService extends BaseService {
            jsonObject.put("statusName", statusName);
            jsonArray.add(jsonObject);
        }
        
        List<PatientDevice> patientDevices = patientDeviceDao.findByPatient(patient);
        for (PatientDevice patientDevice: patientDevices) {
            JSONObject jsonObject = new JSONObject();
            SignFamily signFamily = signFamilyDao.findByPatient(patient);//签约社区
            if(StringUtils.isNotBlank(patientDevice.getDoctor())){
                Doctor deviceDoctor = doctorService.findDoctorByCode(patientDevice.getDoctor());
                jsonObject.put("doctor",patientDevice.getDoctor());//操作医生代码
                jsonObject.put("doctorName",deviceDoctor.getName());//操作医生姓名
            }
            jsonObject.put("dataType","device");//家庭医生签约服务包
            jsonObject.put("deviceId",patientDevice.getDeviceId());//设备ID
            jsonObject.put("deviceSn",patientDevice.getDeviceSn());//设备SN码
            jsonObject.put("sim",patientDevice.getSim());//设备SIM卡号
            jsonObject.put("deviceName",patientDevice.getDeviceName());//设备名称
            jsonObject.put("user",patientDevice.getUser());//居民CODE
            jsonObject.put("categoryCode",patientDevice.getCategoryCode());//1血糖仪,2.血压计
            jsonObject.put("userType",patientDevice.getUserType());//-1代表单用户
            jsonObject.put("userIdcard",patientDevice.getUserIdcard());//用户身份证号
            jsonObject.put("agent",patientDevice.getAgent());//代绑人代码(家人)
            jsonObject.put("agentName",patientDevice.getAgentName());//代绑人姓名
            jsonObject.put("createTime",patientDevice.getCzrq());//操作时间
            jsonObject.put("agreementPhoto",patientDevice.getAgreementPhoto());//上传的协议图片地址
            jsonObject.put("hospitalName",signFamily.getHospitalName());//社区名称
            jsonArray.add(jsonObject);
        }
        
        
        
        Collections.sort(jsonArray, new Comparator<JSONObject>() {
            @Override
            public int compare(JSONObject o1, JSONObject o2) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignController.java

@ -301,7 +301,7 @@ public class PatientSignController extends BaseController {
    @RequestMapping("/signs")
    public String getSigns() {
        try {
            List<JSONObject> jsonArray = signWebService.getSigns(getRepUID());
            List<JSONObject> jsonArray = signWebService.getSigns("2369386673424a8e916d9389c97d66d0");
//			List<JSONObject> jsonArray  = signWebService.getSigns(getUID());
            //JSONArray jsonArray  = signWebService.getSigns("915cc456-5b1d-11e6-8344-fa163e8aee56");
            return write(200, "查询成功!", "data", new JSONArray(jsonArray));