|
@ -116,7 +116,7 @@ public class SignWebService extends BaseService {
|
|
|
/**
|
|
|
* 厦门市
|
|
|
*/
|
|
|
public static String city ="350200";
|
|
|
public static String city = "350200";
|
|
|
|
|
|
/**
|
|
|
* 根据医生代码及签约状态编码 获取该医生签约患者的信息列表
|
|
@ -129,11 +129,11 @@ public class SignWebService extends BaseService {
|
|
|
*/
|
|
|
public List<Map<String, Object>> getSignWebByDoctor(String doctor, int status, int page, int pageSize) {
|
|
|
|
|
|
Doctor d =doctorDao.findByCode(doctor);
|
|
|
String sql ;
|
|
|
if(d!=null&&d.getLevel()==3){
|
|
|
Doctor d = doctorDao.findByCode(doctor);
|
|
|
String sql;
|
|
|
if (d != null && d.getLevel() == 3) {
|
|
|
// 如果医生是健管师
|
|
|
sql = "select " +
|
|
|
sql = "select " +
|
|
|
" a.code " +
|
|
|
" ,a.doctor " +
|
|
|
" ,b.code as patient" +
|
|
@ -157,9 +157,9 @@ public class SignWebService extends BaseService {
|
|
|
(status == 3 ? " and expenses_status = '1'" : "") + " order by begin desc ) a " +
|
|
|
" ,wlyy_patient b " +
|
|
|
" where a.patient = b.code order by applyDate desc limit " + page * pageSize + "," + pageSize;
|
|
|
}else{
|
|
|
} else {
|
|
|
// 查询语句
|
|
|
sql = "select " +
|
|
|
sql = "select " +
|
|
|
" a.code " +
|
|
|
" ,a.doctor " +
|
|
|
" ,b.code as patient" +
|
|
@ -273,13 +273,13 @@ public class SignWebService extends BaseService {
|
|
|
patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 2});
|
|
|
break;
|
|
|
case 3:// 已签约
|
|
|
patients = jdbcTemplate.queryForList(isSignSql, new Object[]{doctor,doctor, 1});
|
|
|
patients = jdbcTemplate.queryForList(isSignSql, new Object[]{doctor, doctor, 1});
|
|
|
break;
|
|
|
case 4:// 4已经解约
|
|
|
patients = jdbcTemplate.queryForList(surrSql, new Object[]{doctor,doctor, -3, -4});
|
|
|
patients = jdbcTemplate.queryForList(surrSql, new Object[]{doctor, doctor, -3, -4});
|
|
|
break;
|
|
|
case 5: // 未缴费
|
|
|
patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor,doctor, 0});
|
|
|
patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, doctor, 0});
|
|
|
}
|
|
|
|
|
|
return patients;
|
|
@ -720,7 +720,7 @@ public class SignWebService extends BaseService {
|
|
|
}
|
|
|
jsonObject.put("statusName", statusName);
|
|
|
// 增加支付流水号
|
|
|
if (charge!=null) {
|
|
|
if (charge != null) {
|
|
|
String chargeCode = charge.getCode();
|
|
|
jsonObject.put("chargeCode", chargeCode);
|
|
|
}
|
|
@ -2383,7 +2383,7 @@ public class SignWebService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public int updateSignServerByCode(String signCode,String sevId) {
|
|
|
public int updateSignServerByCode(String signCode, String sevId) {
|
|
|
|
|
|
if (StringUtils.isNotBlank(sevId)) {
|
|
|
|
|
@ -2408,43 +2408,47 @@ public class SignWebService extends BaseService {
|
|
|
}
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
//1.3.5居委会相关接口---
|
|
|
public JSONArray getTownList(){
|
|
|
public JSONArray getTownList() {
|
|
|
List<Town> towns = townDao.findByCityCode(city);
|
|
|
return new JSONArray(towns);
|
|
|
}
|
|
|
public JSONArray getStreetListByTown(String town){
|
|
|
|
|
|
public JSONArray getStreetListByTown(String town) {
|
|
|
List<Street> streets = streetDao.findListByTown(town);
|
|
|
return new JSONArray(streets);
|
|
|
}
|
|
|
public JSONArray getCountryListByStreet(String street){
|
|
|
|
|
|
public JSONArray getCountryListByStreet(String street) {
|
|
|
List<Country> countrys = countryDao.findByStreet(street);
|
|
|
return new JSONArray(countrys);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存居委会字段
|
|
|
*
|
|
|
* @param countryCode 居委会Code
|
|
|
* @param patientCode 患者Code
|
|
|
* @return
|
|
|
*/
|
|
|
public int setPatientCountry(String countryCode,String patientCode){
|
|
|
if(StringUtils.isBlank(countryCode)){
|
|
|
public int setPatientCountry(String countryCode, String patientCode) {
|
|
|
if (StringUtils.isBlank(countryCode)) {
|
|
|
return -1;
|
|
|
}
|
|
|
Country country = countryDao.findByCode(countryCode);
|
|
|
if(country==null){
|
|
|
if (country == null) {
|
|
|
return -1;
|
|
|
}
|
|
|
Patient patient = patientService.findByCode(patientCode);
|
|
|
if(patient==null){
|
|
|
if (patient == null) {
|
|
|
return -1;
|
|
|
}
|
|
|
patient.setSickVillage(countryCode);
|
|
|
patient.setSickVillageName(country.getName());
|
|
|
patientService.save(patient);
|
|
|
SignFamily signFamily = signFamilyDao.findByPatientCodeStatus2(patientCode,0);
|
|
|
if(signFamily!=null){
|
|
|
SignFamily signFamily = signFamilyDao.findByPatientCodeStatus2(patientCode, 0);
|
|
|
if (signFamily != null) {
|
|
|
signFamily.setSickVillage(countryCode);
|
|
|
signFamily.setSickVillageName(country.getName());
|
|
|
signFamilyDao.save(signFamily);
|
|
@ -2454,20 +2458,21 @@ public class SignWebService extends BaseService {
|
|
|
|
|
|
/**
|
|
|
* 设置居委会字段
|
|
|
*
|
|
|
* @param countryCode
|
|
|
* @param signFamily
|
|
|
* @return
|
|
|
*/
|
|
|
public int setPatientCountryFamily(String countryCode,SignFamily signFamily){
|
|
|
if(StringUtils.isBlank(countryCode)){
|
|
|
public int setPatientCountryFamily(String countryCode, SignFamily signFamily) {
|
|
|
if (StringUtils.isBlank(countryCode)) {
|
|
|
return -1;
|
|
|
}
|
|
|
Country country = countryDao.findByCode(countryCode);
|
|
|
if(country==null){
|
|
|
if (country == null) {
|
|
|
return -1;
|
|
|
}
|
|
|
Patient patient = patientService.findByCode(signFamily.getPatient());
|
|
|
if(patient==null){
|
|
|
if (patient == null) {
|
|
|
return -1;
|
|
|
}
|
|
|
patient.setSickVillage(countryCode);
|
|
@ -2479,4 +2484,9 @@ public class SignWebService extends BaseService {
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
public List<String> findOpenidsByTown(String town) {
|
|
|
String sql = "select w.openid from wlyy_sign_family w ,dm_hospital d where w.hospital=d.`code` and d.town='" + town + "' and w.openid is not null and w.openid !=''";
|
|
|
return jdbcTemplate.queryForList(sql, String.class);
|
|
|
}
|
|
|
}
|