|
@ -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) {
|