|
@ -38,6 +38,7 @@ import com.yihu.wlyy.task.SignUploadTask;
|
|
|
import com.yihu.wlyy.util.*;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.NameValuePair;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
@ -168,6 +169,8 @@ public class FamilyContractService extends BaseService {
|
|
|
private TrackPatientDao trackPatientDao;
|
|
|
@Autowired
|
|
|
private WechatTemplateConfigDao templateConfigDao;
|
|
|
@Autowired
|
|
|
private PatientCertificateDao patientCertificateDao;
|
|
|
|
|
|
|
|
|
public SignFamily findSignFamilyByCode(String code) {
|
|
@ -371,9 +374,13 @@ public class FamilyContractService extends BaseService {
|
|
|
json.put("services", services);
|
|
|
|
|
|
//是否签约上限
|
|
|
JSONObject signLimit = signWebService.getSickFamilyDoctorSignLimit(doctor);
|
|
|
json.put("signTotal", signLimit.getInt("signTotal"));//签约总数
|
|
|
json.put("limitTotal", signLimit.getInt("limitTotal"));//限制总数
|
|
|
// JSONObject signLimit = signWebService.getSickFamilyDoctorSignLimit(doctor);
|
|
|
// json.put("signTotal", signLimit.getInt("signTotal"));//签约总数
|
|
|
// json.put("limitTotal", signLimit.getInt("limitTotal"));//限制总数
|
|
|
|
|
|
//上线记得切换正式
|
|
|
json.put("signTotal", 20);//签约总数
|
|
|
json.put("limitTotal", 1000);//限制总数
|
|
|
|
|
|
return json;
|
|
|
}
|
|
@ -526,7 +533,8 @@ public class FamilyContractService extends BaseService {
|
|
|
String idcard,
|
|
|
String ssc,
|
|
|
String mobile,
|
|
|
String emerMobile) throws Exception {
|
|
|
String emerMobile,
|
|
|
String sevId) throws Exception {
|
|
|
// 查询三师签约
|
|
|
JSONObject json = new JSONObject();
|
|
|
SignFamily sc = signFamilyDao.findByIdcard(idcard);
|
|
@ -612,6 +620,10 @@ public class FamilyContractService extends BaseService {
|
|
|
patient = p.getCode();
|
|
|
sf.setPatient(patient);
|
|
|
SignFamily temp = signFamilyDao.save(sf);
|
|
|
|
|
|
//1.4.9.1版本新增服务类型
|
|
|
signWebService.setSevId(temp,sevId);
|
|
|
|
|
|
if (temp != null) {
|
|
|
// 添加签约消息
|
|
|
Message message = new Message();
|
|
@ -671,7 +683,7 @@ public class FamilyContractService extends BaseService {
|
|
|
* @param patient 居民code
|
|
|
* @return
|
|
|
*/
|
|
|
public int sign(String doctor, String patient, String countryCode,String medicareNumber) throws Exception {
|
|
|
public int sign(String doctor, String patient, String countryCode,String medicareNumber,String sevId) throws Exception {
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
if (p == null) {
|
|
|
return -1;
|
|
@ -732,6 +744,10 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
SignFamily temp = signFamilyDao.save(sf);
|
|
|
|
|
|
//设置居民服务类型
|
|
|
//1.4.9.1版本
|
|
|
signWebService.setSevId(temp,sevId);
|
|
|
|
|
|
if (temp != null) {
|
|
|
// 添加签约消息
|
|
|
Message message = new Message();
|
|
@ -3505,6 +3521,7 @@ public class FamilyContractService extends BaseService {
|
|
|
* @param patient 居民code
|
|
|
* @return
|
|
|
*/
|
|
|
@Deprecated
|
|
|
@Transactional
|
|
|
public int signRenew(String doctor, String healthDoctor, String patient, String reason,String medicareNumber) throws Exception {
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
@ -3728,7 +3745,7 @@ public class FamilyContractService extends BaseService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
public int signRenewOverdue(String doctor, String healthDoctor, String patient, String reason, String countryCode,String medicareNumber) throws Exception {
|
|
|
public int signRenewOverdue(String doctor, String healthDoctor, String patient, String reason, String countryCode,String medicareNumber,String sevId) throws Exception {
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
if (p == null) {
|
|
|
return -1;
|
|
@ -3878,6 +3895,10 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
SignFamily temp = signFamilyDao.save(sf);
|
|
|
|
|
|
//设置居民服务类型
|
|
|
//1.4.9.1版本
|
|
|
signWebService.setSevId(temp,sevId);
|
|
|
|
|
|
if (temp != null) {
|
|
|
// 添加签约消息
|
|
|
Message message = new Message();
|
|
@ -3954,8 +3975,8 @@ public class FamilyContractService extends BaseService {
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONArray getSignDoctorMessageOverDue(String patientCode) {
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
public JSONObject getSignDoctorMessageOverDue(String patientCode) {
|
|
|
JSONObject obj = new JSONObject();
|
|
|
//找出患者的三师签约信息
|
|
|
Patient patient = patientDao.findByCode(patientCode);
|
|
|
|
|
@ -3967,8 +3988,8 @@ public class FamilyContractService extends BaseService {
|
|
|
|
|
|
if (jtSignFamily != null) {
|
|
|
//家庭签约只找全科医生
|
|
|
Doctor doctor = doctorDao.findByCode(jtSignFamily.getDoctor());
|
|
|
Doctor doctorHealth = doctorDao.findByCode(jtSignFamily.getDoctorHealth());
|
|
|
Doctor doctor = doctorDao.findByCodeAndDel(jtSignFamily.getDoctor(),"1");
|
|
|
Doctor doctorHealth = doctorDao.findByCodeAndDel(jtSignFamily.getDoctorHealth(),"1");
|
|
|
if (doctor != null) {
|
|
|
JSONObject jo = new JSONObject();
|
|
|
jo.put("code", doctor.getCode());
|
|
@ -3987,7 +4008,7 @@ public class FamilyContractService extends BaseService {
|
|
|
jo.put("qyDate", DateUtil.dateToStrShort(jtSignFamily.getBegin()));//签约时间
|
|
|
jo.put("endDate", DateUtil.dateToStrShort(jtSignFamily.getEnd()));//结束时间
|
|
|
}
|
|
|
jsonArray.put(jo);
|
|
|
obj.put("doctor",jo);
|
|
|
}
|
|
|
if (doctorHealth != null) {
|
|
|
JSONObject jo = new JSONObject();
|
|
@ -4007,10 +4028,10 @@ public class FamilyContractService extends BaseService {
|
|
|
jo.put("qyDate", DateUtil.dateToStrShort(jtSignFamily.getBegin()));//签约时间
|
|
|
jo.put("endDate", DateUtil.dateToStrShort(jtSignFamily.getEnd()));//结束时间
|
|
|
}
|
|
|
jsonArray.put(jo);
|
|
|
obj.put("doctorHealth",jo);
|
|
|
}
|
|
|
}
|
|
|
return jsonArray;
|
|
|
return obj;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -4512,4 +4533,39 @@ public class FamilyContractService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public String saveCertificate(String patient,String imgPath,String sevId){
|
|
|
try{
|
|
|
if (StringUtils.isNotBlank(sevId)) {
|
|
|
String[] sevIds = sevId.split(",");
|
|
|
for (int i = 0; i < sevIds.length; i++) {
|
|
|
String sql = "select d.name from wlyy_sign_dict d where d.code = '" + sevIds[i] + "' and d.year ='" + DateUtil.getSignYear() + "' ";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
|
|
|
String[] img = imgPath.split(",");
|
|
|
for(String im :img){
|
|
|
PatientCertificate patientCertificate = new PatientCertificate();
|
|
|
patientCertificate.setCode(getCode());
|
|
|
//设置患者
|
|
|
patientCertificate.setPatient(patient);
|
|
|
patientCertificate.setPatientName(p.getName());
|
|
|
//设置类型
|
|
|
Map<String, Object> map = list.get(0);
|
|
|
String serverName = (String) map.get("name");
|
|
|
patientCertificate.setSignDictName(serverName);
|
|
|
patientCertificate.setSignDictCode(sevIds[i]);
|
|
|
//设置路径
|
|
|
patientCertificate.setCertificatePath(im);
|
|
|
patientCertificate.setDel("1");
|
|
|
patientCertificate.setCreateTime(new Date());
|
|
|
patientCertificateDao.save(patientCertificate);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
logger.info(e.getMessage()+"___:"+e.toString());
|
|
|
}
|
|
|
return "1";
|
|
|
}
|
|
|
}
|