浏览代码

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

hzp 8 年之前
父节点
当前提交
7b82548106

+ 1 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/Patient.java

@ -174,6 +174,7 @@ public class Patient extends IdEntity implements Serializable {
		this.ssc = ssc;
	}
	@Column(name = "photo", insertable = false)
	public String getPhoto() {
		return photo;
	}

+ 48 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -917,15 +917,15 @@ public class DoctorInfoService extends BaseService {
            return -3;
        }
        //修改密码
        String oldPassword=doc.getPassword();
        String oldPassword = doc.getPassword();
        //判断旧的密码是不是手机号码后六位
        String oldMobile=doc.getMobile();
        if(!org.springframework.util.StringUtils.isEmpty(oldMobile)){
            String passwordTemp=oldMobile.substring(5);
            passwordTemp=MD5.GetMD5Code(passwordTemp+doc.getSalt());
            if(passwordTemp.equals(oldPassword)){
        String oldMobile = doc.getMobile();
        if (!org.springframework.util.StringUtils.isEmpty(oldMobile)) {
            String passwordTemp = oldMobile.substring(5);
            passwordTemp = MD5.GetMD5Code(passwordTemp + doc.getSalt());
            if (passwordTemp.equals(oldPassword)) {
                //如果密码是原来的电话号码后留位改成现在号码的后留位
                String newPassword=MD5.GetMD5Code(mobile.substring(5)+doc.getSalt());
                String newPassword = MD5.GetMD5Code(mobile.substring(5) + doc.getSalt());
                doc.setPassword(newPassword);
            }
        }
@ -991,4 +991,45 @@ public class DoctorInfoService extends BaseService {
            return 0;
        }
    }
    @Transactional
    public void updateTeamDoctors(String newDoctorCode, String oldDoctorCode, String patients) throws Exception {
        String[] patiensString = patients.split(",");
        for (int i = 0; i < patiensString.length; i++) {
            updateTeamDoctor(newDoctorCode, oldDoctorCode, patiensString[i]);
        }
    }
    private void updateTeamDoctor(String newDoctorCode, String oldDoctorCode, String patient) throws Exception {
        //得到患者的签约信息
        SignFamily signFamily = signFamilyDao.findByPatient(patient);
        //判断患者对旧的全科医生是否存在健康咨询
        ConsultTeam consultTeam = consultTeamDao.findByParientCodeAndSignTypeAndDoctor(patient, oldDoctorCode, 2);
        if (consultTeam != null) {
            throw new Exception("存在没有关闭的健康咨询");
        }
        //修改医生服务团队 删除旧的全科医生
        DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findMemberByTeamAndQkCode(signFamily.getTeamCode(), oldDoctorCode);
        if (doctorTeamMember != null) {
            doctorTeamMember.setDel("0");
        }
        Doctor newD = doctorDao.findByCode(newDoctorCode);
        //修改签约中的全科医生
        signFamily.setDoctor(newD.getCode());
        signFamily.setDoctorName(newD.getName());
        //添加新的全科医生到服务团队里
        DoctorTeamMember newDoctorTeamMember = new DoctorTeamMember();
        newDoctorTeamMember.setTeam(signFamily.getTeamCode());
        newDoctorTeamMember.setCzrq(new Date());
        newDoctorTeamMember.setName(newD.getName());
        newDoctorTeamMember.setMemberCode(newD.getCode());
        newDoctorTeamMember.setType(2);
        newDoctorTeamMember.setSignType("2");
        newDoctorTeamMember.setDel("1");
        newDoctorTeamMember.setCode(UUID.randomUUID().toString().replace("-", ""));
        doctorTeamDoctor.save(newDoctorTeamMember);
    }
}

+ 138 - 107
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -29,7 +29,7 @@ import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.task.SignUploadTask;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.*;
import org.apache.commons.beanutils.converters.IntegerConverter;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -52,9 +52,6 @@ import org.springside.modules.persistence.SearchFilter.Operator;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdcardInfoExtractor;
import com.yihu.wlyy.util.MessageType;
/**
 * 家庭签约业务处理类
@ -843,7 +840,6 @@ public class FamilyContractService extends BaseService {
            patient.setPassword(MD5.GetMD5Code(password + salt));
            patient.setStatus(1);
            patient.setDisease(0);
            patient.setPhoto("");
        }
        // 保存用户信息
@ -1723,68 +1719,94 @@ public class FamilyContractService extends BaseService {
        return result;
    }
    public Map<String, Object> findNoHealthSignFamilyHealth(String doctor, Integer page, Integer pagesize, String patientName, String patientAddr) {
        Map<String, Object> returnMap = new HashMap();
        if (pagesize == null || pagesize <= 0) {
            pagesize = 10;
        }
        if (page == null || page <= 0) {
            page = 1;
        }
        int start = (page - 1) * pagesize;
        //先找出该医生下面没有健康管理师的患者 然后在去患者表找出该患者
        StringBuffer sql = new StringBuffer("" +
                " select p.* from wlyy_patient p where p.code in " +
                " (select a.patient code from wlyy_sign_family a where a.type = 2 and a.status >= 1 and a.doctor_health is null and a.doctor='" + doctor + "' order by a.czrq desc ) ");
        StringBuffer countSql = new StringBuffer("" +
                " select count(*) from wlyy_patient p where p.code in " +
                " (select a.patient code from wlyy_sign_family a where a.type = 2 and a.status >= 1 and a.doctor_health is null and a.doctor='" + doctor + "' order by a.czrq desc ) ");
        if (!org.springframework.util.StringUtils.isEmpty(patientName)) {
            sql.append(" and name like '%" + patientName + "%'");
            countSql.append(" and name like '%" + patientName + "%'");
        }
        if (!org.springframework.util.StringUtils.isEmpty(patientAddr)) {
            sql.append(" and address like '%" + patientAddr + "%'");
            countSql.append(" and address like '%" + patientAddr + "%'");
        }
        sql.append(" limit " + start + "," + pagesize + "");
        List<Patient> returnList = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper(Patient.class));
        //得到疾病标签
        StringBuffer dieaseSql = new StringBuffer("" +
                " select p.* from wlyy_sign_patient_label_info p where p.label_type='2' and p.status=1 and  p.patient in " +
                " (select a.patient code from wlyy_sign_family a where a.type = 2 and a.status >= 1 and a.doctor_health is null and a.doctor='" + doctor + "' order by a.czrq desc ) ");
        List<SignPatientLabelInfo> dieaseList = jdbcTemplate.query(dieaseSql.toString(), new BeanPropertyRowMapper(SignPatientLabelInfo.class));
        Map<String, List<SignPatientLabelInfo>> diseaseMap = new HashMap<>();
        if (dieaseList != null && dieaseList.size() > 0) {
            for (SignPatientLabelInfo signPatientLabelInfo : dieaseList) {
                List<SignPatientLabelInfo> signPatientLabelInfoTemp = diseaseMap.get(signPatientLabelInfo.getPatient());
                if (signPatientLabelInfoTemp != null) {
                    signPatientLabelInfoTemp.add(signPatientLabelInfo);
                } else {
                    signPatientLabelInfoTemp = new ArrayList<>();
                    signPatientLabelInfoTemp.add(signPatientLabelInfo);
                }
                diseaseMap.put(signPatientLabelInfo.getPatient(), signPatientLabelInfoTemp);
    public JSONArray findNoHealthSignFamilyHealthByParams(String doctorCode, String patientAddr, String patientName) throws Exception {
        JSONArray returnMap = new JSONArray();
        String sql = "select a.signcode,a.name,a.address,a.code,a.hasopenid,a.idcard from( SELECT " +
                "  sf.CODE signcode, " +
                "  p.name name, " +
                "  p.address address, " +
                "  p.code code, " +
                "  CASE WHEN p.openid is null THEN '0' WHEN p.openid='' THEN '0' else 1 END hasopenid, " +
                "  p.idcard idcard " +
                " FROM " +
                " wlyy_sign_family sf " +
                " JOIN wlyy_patient p ON sf.patient = p.CODE " +
                " WHERE " +
                " sf.type = 2 " +
                " AND sf. STATUS >= 0 " +
                " and sf.doctor = ? "+
                " AND ( sf.doctor_health is null or sf.doctor_health ='' ) ) a where 1=1" ;
        if(!org.springframework.util.StringUtils.isEmpty(patientAddr)){
            sql+= " AND a.address like '%"+patientAddr+"%'";
        }
        if(!org.springframework.util.StringUtils.isEmpty(patientName)){
            sql+= " AND a.name like '%"+patientName+"%'";
        }
        List<Map<String, Object>> datas =  jdbcTemplate.queryForList(sql, doctorCode );
        if(datas!=null&&datas.size()>0){
            for(Map<String, Object> map:datas){
                JSONObject jo=new JSONObject();
                jo.put("signcode",map.get("signcode"));
                jo.put("name",map.get("name"));
                jo.put("code",map.get("code"));
                jo.put("hasopenid",map.get("hasopenid"));
                jo.put("age", IdCardUtil.getAgeForIdcard(map.get("idcard").toString()));
                jo.put("sex", IdCardUtil.getSexForIdcard_new(map.get("idcard").toString()));
                returnMap.put(jo);
            }
        }
        if (returnList != null && returnList.size() > 0) {
            for (Patient patient : returnList) {
                List<SignPatientLabelInfo> signPatientLabelInfoTemp = diseaseMap.get(patient.getCode());
                patient.setLabelInfos(signPatientLabelInfoTemp);
        return returnMap;
    }
    public JSONObject findNoHealthSignFamilyHealth(String doctorCode, String labelType, String patientName) throws  Exception{
        JSONObject returnMap = new JSONObject();
        //健康管理师
        String sql = "SELECT " +
                "  sf. CODE signcode, " +
                "  p.name name, " +
                "  p.code code, " +
                "  CASE WHEN p.openid is null THEN '0' WHEN p.openid='' THEN '0' else 1 END hasopenid, " +
                "  sp.id labelid, " +
                "  CASE WHEN sp.label_name is null THEN '未标注' WHEN sp.label_name='' THEN '未标注' else sp.label_name END labelname, "+
                "  sp.label_type labeltype, " +
                "  p.idcard idcard " +
         " FROM " +
                " wlyy_sign_family sf " +
                " JOIN wlyy_patient p ON sf.patient = p.CODE " +
                " left JOIN wlyy_sign_patient_label_info sp ON sf.patient = sp.patient AND sp.label_type = ? AND sp.`status` = 1 " +
          " WHERE " +
                " sf.type = 2 " +
                " AND sf. STATUS >= 0 " +
                " and sf.doctor = ? "+
                " AND ( sf.doctor_health is null or sf.doctor_health ='' ) " ;
        List<Map<String, Object>> datas = null;
        //查找居民
        datas = jdbcTemplate.queryForList(sql,labelType , doctorCode );
        //根据类别查找标签
        List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatus(labelType, 1);
        if (s != null && s.size() > 0) {
            for (SignPatientLabel one : s) {
                returnMap.put(one.getLabelName(), new JSONArray());
            }
            if (datas != null && datas.size() > 0) {
                for (Map<String, Object> map : datas) {
                    JSONObject jo=new JSONObject();
                    jo.put("signcode",map.get("signcode"));
                    jo.put("name",map.get("name"));
                    jo.put("code",map.get("code"));
                    jo.put("hasopenid",map.get("hasopenid"));
                    jo.put("age", IdCardUtil.getAgeForIdcard(map.get("idcard").toString()));
                    jo.put("sex", IdCardUtil.getSexForIdcard_new(map.get("idcard").toString()));
                    JSONArray jr = returnMap.getJSONArray(map.get("labelname").toString());
                    //判断是否为空
                    if (jr == null) {
                        jr = new JSONArray();
                    }
                    jr.put(jo);
                    returnMap.put(map.get("labelname").toString(), jr);
                }
            }
        }
        Integer allCount = jdbcTemplate.queryForObject(countSql.toString(), Integer.class);
        if (allCount % pagesize == 0) {
            returnMap.put("count", allCount / pagesize);
        } else {
            returnMap.put("count", (allCount / pagesize) + 1);
        }
        returnMap.put("returnList", returnList);
        return returnMap;
    }
@ -2039,71 +2061,80 @@ public class FamilyContractService extends BaseService {
        List<Map<String, Object>> datas = null;
        if (doctor.getLevel() == 3) {
            //健康管理师
            String sql = "SELECT sf. CODE signcode, " +
                    " p.`name` name, " +
                    " p. CODE `code`, " +
                    " case p.openid when null then 0 when \"\" then 0 else 1 end hasopenid, "+
                    " sp.id labelid, " +
                    " sp.label_name labelname, " +
                    " sp.label_type labeltype, "+
                    " p.idcard idcard " +
           " FROM " +
                    " wlyy_sign_family sf, " +
                    " wlyy_patient p, " +
                    " wlyy_sign_patient_label_info sp " +
           " WHERE" +
                    " sf.patient = p.CODE " +
                    " AND p. CODE = sp.patient " +
                    " AND sf.type = 2 " +
            String sql = "SELECT " +
                    "  sf. CODE signcode, " +
                    "  p.name name, " +
                    "  p.code code, " +
                    "  CASE WHEN p.openid is null THEN '0' WHEN p.openid='' THEN '0' else 1 END hasopenid, " +
                    "  sp.id labelid, " +
                     " CASE WHEN sp.label_name is null THEN '未标注' WHEN sp.label_name='' THEN '未标注' else sp.label_name END labelname, "+
                    "  sp.label_type labeltype, " +
                    "  p.idcard idcard " +
                    " FROM " +
                    " wlyy_sign_family sf " +
                    " JOIN wlyy_patient p ON sf.patient = p.CODE " +
                    " left JOIN wlyy_sign_patient_label_info sp ON sf.patient = sp.patient AND sp.label_type = ? AND sp.`status` = 1 " +
                    " WHERE " +
                    " sf.type = 2 " +
                    " AND sf. STATUS >= 0 " +
                    " and sp.`status`=1 " +
                    " and sf.doctor_health = ? " +
                    " and sp.label_type= ?";
                    " and sf.doctor_health = ? ";
            //查找居民
            datas = jdbcTemplate.queryForList(sql, doctorCode, labelType);
            datas = jdbcTemplate.queryForList(sql, labelType, doctorCode);
        } else if (doctor.getLevel() == 2) {
            //健康管理师
            String sql = "SELECT sf. CODE signcode, " +
                    " p.`name` name, " +
                    " p. CODE `code`, " +
                    " sp.id labelid, " +
                    " sp.label_name labelname, " +
                    " case p.openid when null then 0 when \"\" then 0 else 1 end hasopenid, "+
                    " sp.label_type labeltype, "+
                    " p.idcard idcard " +
            " FROM " +
                    " wlyy_sign_family sf, " +
                    " wlyy_patient p, " +
                    " wlyy_sign_patient_label_info sp " +
            " WHERE" +
                    " sf.patient = p.CODE " +
                    " AND p. CODE = sp.patient " +
                    " AND sf.type = 2 " +
            String sql = "SELECT " +
                    "  sf. CODE signcode, " +
                    "  p.name name, " +
                    "  p.code code, " +
                    "  CASE WHEN p.openid is null THEN '0' WHEN p.openid='' THEN '0' else 1 END hasopenid, " +
                    "  sp.id labelid, " +
                    " CASE WHEN sp.label_name is null THEN '未标注' WHEN sp.label_name='' THEN '未标注' else sp.label_name END labelname, "+
                    "  sp.label_type labeltype, " +
                    "  p.idcard idcard " +
                    " FROM " +
                    " wlyy_sign_family sf " +
                    " JOIN wlyy_patient p ON sf.patient = p.CODE " +
                    " left JOIN wlyy_sign_patient_label_info sp ON sf.patient = sp.patient AND sp.label_type = ? AND sp.`status` = 1 " +
                    " WHERE " +
                    " sf.type = 2 " +
                    " AND sf. STATUS >= 0 " +
                    " and sp.`status`=1 " +
                    " and ( sf.doctor = ? or sf.doctor_health = ? ) " +
                    " and sp.label_type= ?";
                    " and ( sf.doctor = ? or sf.doctor_health = ? ) ";
            //查找居民
            datas = jdbcTemplate.queryForList(sql, doctorCode,doctorCode, labelType);
            datas = jdbcTemplate.queryForList(sql, labelType, doctorCode, doctorCode);
        } else {
            throw new Exception("参数错误");
            throw new Exception("参数错误!");
        }
        //根据类别查找标签
        List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatus(labelType, 1);
        if (s != null && s.size() > 0) {
            for (SignPatientLabel one : s) {
                returnMap.put(one.getLabelCode(), new JSONArray());
                returnMap.put(one.getLabelName(), new JSONArray());
            }
            if (datas != null && datas.size() > 0) {
                for (Map<String, Object> map : datas) {
                    JSONObject jo=new JSONObject(map);
                    returnMap.getJSONArray(jo.get("labeltype").toString()).put(jo);;
                    JSONObject jo=new JSONObject();
                    jo.put("signcode",map.get("signcode"));
                    jo.put("name",map.get("name"));
                    jo.put("code",map.get("code"));
                    jo.put("hasopenid",map.get("hasopenid"));
                    jo.put("age", IdCardUtil.getAgeForIdcard(map.get("idcard").toString()));
                    jo.put("sex", IdCardUtil.getSexForIdcard_new(map.get("idcard").toString()));
                    //判断name是否为空 为空就是未标注
                    //把患者添加到对应的组
                    JSONArray jr = returnMap.getJSONArray(map.get("labelname").toString());
                    if (jr == null) {
                        jr = new JSONArray();
                    }
                    jr.put(jo);
                    returnMap.put(map.get("labelname").toString(), jr);
                }
            }
        }
        return returnMap;
    }
}

+ 108 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsAllService.java

@ -126,6 +126,66 @@ public class StatisticsAllService extends BaseService {
        return total;
    }
    /**
     * 获取三师转签或高危人群签约
     *
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @return
     */
    public JSONObject getSszqAndGwrq(String endDate, String area, int level, String index) {
        JSONObject json = new JSONObject();
        // 查询语句
        String sql = " select " +
                "     ifnull(result,'0') amount" +
                " from  " +
                "     wlyy_quota_result " +
                " where " +
                "     quato_code = ? " +
                "   and level1_type = ? and del = '1'" +
                "   and quota_date = ? ";
        if (level == 4) {
            // 市级别
            sql += " and city = ? ";
        } else if (level == 3) {
            // 区、城镇级别
            sql += " and town = ? ";
        } else if (level == 2) {
            // 机构级别
            sql += " and org_code = ? ";
        } else if (level == 1) {
            sql += " and qkdoctor_code = ?";
        }
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{index, level, endDate, area});
        if (result != null && result.size() > 0) {
            String total = (result.get(0).get("amount") != null ? result.get(0).get("amount").toString() : "0");
            if (total.equals("0")) {
                json.put("amount", 0L);
                json.put("num", 0L);
                json.put("rate", 0.0000D);
            } else {
                DecimalFormat df = new DecimalFormat("0.0000");
                String[] args = total.split("/");
                json.put("amount", Long.valueOf(args[0]));
                json.put("num", Long.valueOf(args[1]));
                json.put("rate", df.format(Long.valueOf(args[0]) * 1.0000 / Long.valueOf(args[1]) * 100));
            }
        } else {
            json.put("amount", 0L);
            json.put("num", 0L);
            json.put("rate", 0.0000D);
        }
        return json;
    }
    /**
     * 获取缴费
     *
@ -568,8 +628,19 @@ public class StatisticsAllService extends BaseService {
    }
    /**
     * 查询三师转签率、高危人群签约率
     *
     * @param date
     * @param area
     * @param level
     * @param index
     * @param sort
     * @param lowLevel
     * @return
     * @throws Exception
     */
    public JSONArray getLowLevelTotalSpecial(String date, String area, int level, String index, int sort, String lowLevel) throws Exception {
        JSONArray result = new JSONArray();
        List<Map<String, Object>> resultList = new ArrayList<>();
        String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
        String areaField = "";
@ -606,7 +677,7 @@ public class StatisticsAllService extends BaseService {
        String sql = " select " +
                "     ifnull(" + lowLevelField + ",'') code " +
                "     ,ifnull(" + lowLevelName + ",'') 'name' " +
                "     ,ifnull(result,'0/0') amount" +
                "     ,ifnull(result,'0') amount" +
                " from  " +
                "     wlyy_quota_result " +
                " where " +
@ -617,13 +688,41 @@ public class StatisticsAllService extends BaseService {
        resultList = jdbcTemplate.queryForList(sql, new Object[]{low_level, date, area});
        if (resultList != null && resultList.size() > 0) {
        } else {
        if (resultList == null || resultList.size() < 1) {
            resultList = getLowLevelMapKey(level, low_level, area);
        }
        return result;
        for (Map<String, Object> map : resultList) {
            if (map.get("amount").toString().equals("0")) {
                map.put("amount", 0L);
                map.put("num", 0);
                map.put("rate", 0.0000D);
            } else {
                DecimalFormat df = new DecimalFormat("0.0000");
                String[] args = map.get("amount").toString().split("/");
                map.put("amount", Long.valueOf(args[0]));
                map.put("num", Long.valueOf(args[1]));
                map.put("rate", df.format((Long.valueOf(args[0]) * 1.0000) / Long.valueOf(args[1]) * 100));
            }
        }
        Collections.sort(resultList, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                String map1value = o1.get("rate").toString();
                String map2value = o2.get("rate").toString();
                if (map1value.compareTo(map2value) > 0) {
                    return sort == 1 ? -1 : 1;
                } else if (map1value.compareTo(map2value) < 0) {
                    return sort == 1 ? 1 : -1;
                } else {
                    return 0;
                }
            }
        });
        return new JSONArray(resultList);
    }
@ -879,7 +978,9 @@ public class StatisticsAllService extends BaseService {
                towns = townDao.findByCityCode(area);
            } else if (level == 3) {
                Town town = townDao.findByCode(area);
                towns.add(town);
                if(town != null) {
                    towns.add(town);
                }
            }
            if (towns != null && towns.size() > 0) {

+ 0 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -296,7 +296,6 @@ public class WechatController extends WeixinBaseController {
            patient.setName(name);
            patient.setIdcard(idcard);
            patient.setMobile(mobile);
            patient.setPhoto("");
            //增加密码
            String salt= UUID.randomUUID().toString().replace("-","");
            patient.setSalt(salt);

+ 22 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -1589,6 +1589,28 @@ public class DoctorController extends BaseController {
        }
    }
    /**
     * 转换团队中的全科医生
     *
     * @param newDoctorCode 新的全科医生的code
     * @param oldDoctorCode 旧的全科医生的code
     * @param patients      患者code 多个逗号分隔
     * @return
     */
    @RequestMapping(value = "/updateTeamDoctors")
    @ResponseBody
    public String updateTeamDoctors(String newDoctorCode,
                                    String oldDoctorCode,
                                    String patients) {
        try {
            doctorInfoService.updateTeamDoctors(newDoctorCode, oldDoctorCode, patients);
            return write(200, "更新成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "更新失败");
        }
    }
    /**
     * 医生手机号变更
     *

+ 15 - 11
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.util.MessageType;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
@ -82,9 +83,9 @@ public class DoctorConsultController extends WeixinBaseController {
                       @RequestParam(required = false) String patient,
                       @RequestParam(required = false) String title) {
        try {
            Page<ConsultTeam> list = consultTeamService.findByDoctor(getUID(), type, id, pagesize,patient, title);
            Page<ConsultTeam> list = consultTeamService.findByDoctor(getUID(), type, id, pagesize, patient, title);
            JSONArray jsonArray = new JSONArray();
            if(list != null) {
            if (list != null) {
                for (ConsultTeam consult : list) {
                    if (consult == null) {
                        continue;
@ -111,12 +112,13 @@ public class DoctorConsultController extends WeixinBaseController {
                    json.put("doctorPhoto", doctor.getPhoto());
                    // 设置医生sex
                    json.put("doctorSex", doctor.getSex());
                    Patient p = patientService.findByCode(consult.getPatient());
                    // 设置患者头像
                    json.put("photo", consult.getPhoto());
                    json.put("photo", p.getPhoto());
                    // 设置咨询标识
                    json.put("title", consult.getSymptoms());
                    // 设置患者年龄
                    json.put("age", DateUtil.getAgeByBirthday(consult.getBirthday()));
                    json.put("age", IdCardUtil.getAgeForIdcard(p.getIdcard()));
                    // 设置评价内容
                    json.put("comment", consult.getCommentContent());
                    // 设置评价星级
@ -128,7 +130,7 @@ public class DoctorConsultController extends WeixinBaseController {
                    // 咨询状态
                    json.put("status", consult.getStatus());
                    // 设置性别
                    json.put("sex", consult.getSex());
                    json.put("sex", p.getSex());
                    // 未读消息
                    json.put("doctorRead", consult.getDoctorRead());
                    // 设置关联指导
@ -169,6 +171,8 @@ public class DoctorConsultController extends WeixinBaseController {
                    continue;
                }
                Patient p = patientService.findByCode(consult.getPatient());
                JSONObject json = new JSONObject();
                json.put("id", consult.getId());
                // 设置咨询标识
@ -176,13 +180,13 @@ public class DoctorConsultController extends WeixinBaseController {
                // 设置患者标识
                json.put("patient", consult.getPatient());
                // 设置患者头像
                json.put("photo", consult.getPhoto());
                json.put("photo", p.getPhoto());
                // 设置咨询标识
                json.put("title", consult.getSymptoms());
                // 设置患者姓名
                json.put("name", consult.getName());
                // 设置患者年龄
                json.put("age", DateUtil.getAgeByBirthday(consult.getBirthday()));
                json.put("age", IdCardUtil.getAgeForIdcard(p.getIdcard()));
                // 设置评价内容
                json.put("comment", consult.getCommentContent());
                // 设置评价星级
@ -194,7 +198,7 @@ public class DoctorConsultController extends WeixinBaseController {
                // 咨询状态
                json.put("status", consult.getStatus());
                // 设置性别
                json.put("sex", consult.getSex());
                json.put("sex", p.getSex());
                // 未读消息
                json.put("doctorRead", consult.getDoctorRead());
                // 设置关联指导
@ -494,7 +498,7 @@ public class DoctorConsultController extends WeixinBaseController {
                        json.put("replycontent", replycontent);
                        json.put("doctorName", doctor.getName());
                        json.put("remark", "医生已为您提供问诊方案");
                       // PushMsgTask.getInstance().putWxMsg(getAccessToken(), 3, p.getOpenid(), p.getName(), json);
                        // PushMsgTask.getInstance().putWxMsg(getAccessToken(), 3, p.getOpenid(), p.getName(), json);
                    }
                    if (type == 2) {
                        return write(200, "回复成功!", "data", content);
@ -638,9 +642,9 @@ public class DoctorConsultController extends WeixinBaseController {
            consultTeamService.addFamousTeamConsult(consult, getUID(), "2");
            // 推送消息给医生
            PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.D_CT_04.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.您有新的名医咨询.name(), consult.getConsult());
            if(StringUtils.isNotEmpty(images)){
            if (StringUtils.isNotEmpty(images)) {
                String[] arr = images.split(",");
                for(String img : arr) {
                for (String img : arr) {
                    PushMsgTask.getInstance().put(consult.getDoctor(), "2", MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.您有新的名医咨询.name(), img);
                }
            }

+ 36 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelController.java

@ -1,7 +1,9 @@
package com.yihu.wlyy.web.doctor.patient;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
import com.yihu.wlyy.service.app.label.SignPatientLabelService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.web.BaseController;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -9,8 +11,10 @@ import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
@ -24,6 +28,8 @@ public class SignPatientLabelController extends BaseController {
    @Autowired
    SignPatientLabelService labelService;
    @Autowired
    AdminTeamService teamService;
    /**
     * 添加标签
@ -236,4 +242,34 @@ public class SignPatientLabelController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value = "/patient_teams")
    public String getTeamsLabelsByPatient(@RequestParam String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "居民不能为空");
            }
            JSONArray teams = teamService.findPatientDoctorTeam(patient, getUID());
            if(teams != null && teams.length() > 0){
                for(int i = 0; i < teams.length(); i++){
                    JSONObject team = teams.getJSONObject(i);
                    List<SignPatientLabel> labels = labelService.getLabelsByTypeAndTeam("4", String.valueOf(team.getLong("id")));
                    if(labels != null){
                        team.put("labels",new JSONArray(labels));
                    } else {
                        team.put("labels",new JSONArray());
                    }
                }
            }
            return write(200, "查询成功", "data", teams);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
}

+ 24 - 53
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -117,7 +117,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    @ResponseBody
    public String getPatientByLable(String labelType) {
        try {
            JSONObject list = familyContractService.getPatientByLable("D20161008002", labelType);
            JSONObject list = familyContractService.getPatientByLable(getUID(), labelType);
            return write(200, "查询成功", "data", list);
        } catch (Exception e) {
            return error(-1, "查询失败");
@ -827,71 +827,42 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    /**
     * 获取没有健康管理师的患者列表
     *
     * @param doctor      医生code
     * @param page        当前页
     * @param pageSize    每页显示条数
     * @param patientName 患者名称
     * @param patientAddr 患者居住地址
     * @return
     */
    @RequestMapping(value = "/findNoHealthSignFamilyHealth")
    @ResponseBody
    public String findNoHealthSignFamilyHealth(
            String doctor,
            Integer page,
            Integer pageSize,
            @RequestParam(required = false) String patientName,
            @RequestParam(required = false) String patientAddr) {
            String labelType,
            @RequestParam(required = false) String patientName) {
        try {
            JSONObject returnJo = new JSONObject();
            JSONArray array = new JSONArray();
            Map<String, Object> returnMap = familyContractService.findNoHealthSignFamilyHealth(doctor, page, pageSize, patientName, patientAddr);
            List<Patient> list = (List<Patient>) returnMap.get("returnList");
            Integer count = (Integer) returnMap.get("count");
            if (list != null) {
                for (Patient sf : list) {
                    if (sf == null) {
                        continue;
                    }
                    JSONObject json = new JSONObject();
                    //json.put("signCode", sf.getCode());//签约code
                    json.put("code", sf.getCode());//患者code
                    json.put("name", sf.getName());//患者name
                    json.put("address", sf.getAddress());//患者地址
                    if (sf.getLabelInfos() != null && sf.getLabelInfos().size() > 0) {
                        List<String> lablesStirng = new ArrayList<>();
                        for (SignPatientLabelInfo signPatientLabelInfo : sf.getLabelInfos()) {
                            lablesStirng.add(signPatientLabelInfo.getLabelName());
                        }
                        json.put("disease", lablesStirng);//疾病
                    }
                    String idcard = sf.getIdcard();
                    if (StringUtils.isNotBlank(idcard) && (idcard.length() == 15 || idcard.length() == 18)) {
                        json.put("age", IdCardUtil.getAgeForIdcard(idcard));//患者年龄
                        String sex = IdCardUtil.getSexForIdcard(idcard);
                        if (sex.equals("1")) {
                            json.put("sex", "2");//患者性别
                        } else if (sex.equals("2")) {
                            json.put("sex", "1");//患者性别
                        } else {
                            json.put("sex", sex);//患者性别
                        }
                    } else {
                        json.put("age", "");//患者年龄
                        json.put("sex", "");//患者性别
                    }
                    array.put(json);
                }
            }
            returnJo.put("list", array);
            returnJo.put("count", count);
            return write(200, "签约数据加载成功!", "data", returnJo);
            JSONObject list = familyContractService.findNoHealthSignFamilyHealth(getUID(),labelType,patientName);
            return write(200, "签约数据加载成功!", "data", list);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 搜索患者
     * @param patientAddr
     * @param patientName
     * @return
     */
    @RequestMapping(value = "/findNoHealthSignFamilyHealthByParams")
    @ResponseBody
    public String findNoHealthSignFamilyHealthByParams(
            @RequestParam(required = false) String patientAddr,
            @RequestParam(required = false) String patientName) {
        try {
            JSONArray list = familyContractService.findNoHealthSignFamilyHealthByParams(getUID(),patientAddr,patientName);
            return write(200, "签约数据加载成功!", "data", list);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取没有健康管理师的签约数据数目
     *

+ 5 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -103,12 +103,16 @@ public class DoctorSignController extends BaseController {
            String doctor = getUID();
            Page<Object> page = infoService.findPatientByDoctorSign(doctor, id, pagesize, patientName);
            JSONArray array = new JSONArray();
            Map<Object,Object> exitMap = new HashMap<>();
            if (page != null) {
                for (Object obj : page) {
                    Object[] temp = (Object[]) obj;
                    if (temp == null) {
                        continue;
                    }
                    if(exitMap.get(temp[9])!=null){//防止患者既有三师签约也有家庭签约导致数据重复
                        continue;
                    }
                    JSONObject json = new JSONObject();
                    json.put("id", temp[1]);
@ -131,6 +135,7 @@ public class DoctorSignController extends BaseController {
                    //患者联系方式
                    json.put("mobile", temp[10]);
                    array.put(json);
                    exitMap.put(temp[9],temp);
                }
            }
            return write(200, "查询成功!", "list", array);

+ 85 - 52
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -62,11 +62,11 @@ public class StatisticsController extends BaseController {
    @RequestMapping(value = "/interval")
    @ResponseBody
    public String indexInterval(@RequestParam(required = true) String startDate,
                                @RequestParam(required = true)String endDate,
                                @RequestParam(required = true)int interval,
                                @RequestParam(required = true)String area,
                                @RequestParam(required = true)int level,
                                @RequestParam(required = true)String index) {
                                @RequestParam(required = true) String endDate,
                                @RequestParam(required = true) int interval,
                                @RequestParam(required = true) String area,
                                @RequestParam(required = true) int level,
                                @RequestParam(required = true) String index) {
        String tag = "";
        try {
            String[] indexes = index.split(",");
@ -97,11 +97,11 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/increment")
    @ResponseBody
    public String getIndexIncrement(@RequestParam(required = true)String startDate,
                                    @RequestParam(required = true)String endDate,
                                    @RequestParam(required = true)String area,
    public String getIndexIncrement(@RequestParam(required = true) String startDate,
                                    @RequestParam(required = true) String endDate,
                                    @RequestParam(required = true) String area,
                                    @RequestParam(required = true) int level,
                                    @RequestParam(required = true)String index) {
                                    @RequestParam(required = true) String index) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();
@ -128,7 +128,7 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/total")
    @ResponseBody
    public String getIndexTotal(@RequestParam(required = true)String endDate,
    public String getIndexTotal(@RequestParam(required = true) String endDate,
                                @RequestParam(required = true) String area,
                                @RequestParam(required = true) int level,
                                @RequestParam(required = true) String index) {
@ -159,13 +159,13 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/lowlevel_increment")
    @ResponseBody
    public String getIndexLowLevelIncrement(@RequestParam(required = true)String startDate,
                                            @RequestParam(required = true)String endDate,
    public String getIndexLowLevelIncrement(@RequestParam(required = true) String startDate,
                                            @RequestParam(required = true) String endDate,
                                            @RequestParam(required = true) String area,
                                            @RequestParam(required = true) int level,
                                            @RequestParam(required = true) String index,
                                            @RequestParam(required = true)int sort,
                                            @RequestParam(required = false)String lowLevel) {
                                            @RequestParam(required = true) int sort,
                                            @RequestParam(required = false) String lowLevel) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();
@ -192,12 +192,12 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/lowlevel_total")
    @ResponseBody
    public String getIndexLowLevelTotal(@RequestParam(required = true)String endDate,
                                        @RequestParam(required = true)String area,
                                        @RequestParam(required = true)int level,
                                        @RequestParam(required = true)String index,
                                        @RequestParam(required = true)int sort,
                                        @RequestParam(required = false)String lowLevel) {
    public String getIndexLowLevelTotal(@RequestParam(required = true) String endDate,
                                        @RequestParam(required = true) String area,
                                        @RequestParam(required = true) int level,
                                        @RequestParam(required = true) String index,
                                        @RequestParam(required = true) int sort,
                                        @RequestParam(required = false) String lowLevel) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();
@ -225,11 +225,11 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/leveltwo_increment")
    @ResponseBody
    public String getIndexLevelTwoIncrement(@RequestParam(required = false)String startDate,
                                            @RequestParam(required = true)String endDate,
                                            @RequestParam(required = true)String area,
                                            @RequestParam(required = true)int level,
                                            @RequestParam(required = true)String index) {
    public String getIndexLevelTwoIncrement(@RequestParam(required = false) String startDate,
                                            @RequestParam(required = true) String endDate,
                                            @RequestParam(required = true) String area,
                                            @RequestParam(required = true) int level,
                                            @RequestParam(required = true) String index) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();
@ -256,9 +256,9 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping(value = "/sign_info")
    @ResponseBody
    public String getAreaSignInfo(@RequestParam(required = true)String endDate,
                                  @RequestParam(required = true)String area,
                                  @RequestParam(required = true)int level,
    public String getAreaSignInfo(@RequestParam(required = true) String endDate,
                                  @RequestParam(required = true) String area,
                                  @RequestParam(required = true) int level,
                                  @RequestParam(required = false) String lowCode) {
        try {
            JSONObject result = new JSONObject();
@ -295,9 +295,9 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping(value = "/sixfive_statistics")
    @ResponseBody
    public String getSixFiveStatistics(@RequestParam(required = false)String startDate,
                                       @RequestParam(required = true)String endDate,
                                       @RequestParam(required = true)String area, int level) {
    public String getSixFiveStatistics(@RequestParam(required = false) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String area, int level) {
        try {
            JSONArray result = statisticsAllService.getSixFiveStatistics(endDate, area, level);
@ -321,12 +321,12 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping(value = "/interval_total")
    @ResponseBody
    public String indexIntervalTotal(@RequestParam(required = true)String startDate,
                                     @RequestParam(required = true)String endDate,
                                     @RequestParam(required = true)int interval,
                                     @RequestParam(required = true)String area,
                                     @RequestParam(required = true)int level,
                                     @RequestParam(required = true)String index,
    public String indexIntervalTotal(@RequestParam(required = true) String startDate,
                                     @RequestParam(required = true) String endDate,
                                     @RequestParam(required = true) int interval,
                                     @RequestParam(required = true) String area,
                                     @RequestParam(required = true) int level,
                                     @RequestParam(required = true) String index,
                                     @RequestParam(required = false) String lowCode) {
        try {
            String[] indexes = index.split(",");
@ -356,12 +356,12 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/lowlevel_all")
    @ResponseBody
    public String getIndexLowLevelTotalSign(@RequestParam(required = true)String date,
                                            @RequestParam(required = true)String area,
                                            @RequestParam(required = true)int level,
                                            @RequestParam(required = true)String index,
                                            @RequestParam(required = true)int sort,
                                            @RequestParam(required = false)String lowLevel,
    public String getIndexLowLevelTotalSign(@RequestParam(required = true) String date,
                                            @RequestParam(required = true) String area,
                                            @RequestParam(required = true) int level,
                                            @RequestParam(required = true) String index,
                                            @RequestParam(required = true) int sort,
                                            @RequestParam(required = false) String lowLevel,
                                            @RequestParam(required = false) String lowCode) {
        try {
            String[] indexes = index.split(",");
@ -371,7 +371,11 @@ public class StatisticsController extends BaseController {
                result.put("index_" + index, statisticsAllService.getLevelTwoLowLevelTotal(date, area, level, index, sort, lowLevel, lowCode));
            } else {
                for (String idx : indexes) {
                    result.put("index_" + idx, statisticsAllService.getLowLevelTotal(date, area, level, idx, sort, lowLevel));
                    if (idx.equals("18") || index.equals("19")) {
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotalSpecial(date, area, level, idx, sort, lowLevel));
                    } else {
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotal(date, area, level, idx, sort, lowLevel));
                    }
                }
            }
@ -382,6 +386,35 @@ public class StatisticsController extends BaseController {
        }
    }
    /**
     * 获取三师转签或高危人群
     *
     * @param endDate
     * @param area
     * @param level
     * @return
     */
    @RequestMapping(value = "/sszq_qwrq_info")
    @ResponseBody
    public String getSszqAndGwrq(@RequestParam(required = true) String endDate,
                                 @RequestParam(required = true) String area,
                                 @RequestParam(required = true) int level) {
        try {
            JSONObject result = new JSONObject();
            JSONObject sszq = statisticsAllService.getSszqAndGwrq(endDate, area, level, "18");
            JSONObject gwrq = statisticsAllService.getSszqAndGwrq(endDate, area, level, "19");
            result.put("sszq",sszq);
            result.put("gwrq",gwrq);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 二级指标到达量
     *
@ -393,10 +426,10 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping(value = "/leveltwo_all")
    @ResponseBody
    public String getIndexLevelTwoTotal(@RequestParam(required = true)String date,
                                        @RequestParam(required = true)String area,
                                        @RequestParam(required = true)int level,
                                        @RequestParam(required = true)String index) {
    public String getIndexLevelTwoTotal(@RequestParam(required = true) String date,
                                        @RequestParam(required = true) String area,
                                        @RequestParam(required = true) int level,
                                        @RequestParam(required = true) String index) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();
@ -423,10 +456,10 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/index_all")
    @ResponseBody
    public String getIndexAll(@RequestParam(required = true)String endDate,
                              @RequestParam(required = true)String area,
                              @RequestParam(required = true)int level,
                              @RequestParam(required = true)String index) {
    public String getIndexAll(@RequestParam(required = true) String endDate,
                              @RequestParam(required = true) String area,
                              @RequestParam(required = true) int level,
                              @RequestParam(required = true) String index) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();

+ 46 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

@ -9,11 +9,15 @@ import com.yihu.wlyy.service.third.guahao.GuahaoXMService;
import com.yihu.wlyy.service.third.guahao.GuahaoYihuService;
import com.yihu.wlyy.service.third.guahao.IGuahaoService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@ -24,10 +28,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * 预约挂号
@ -274,6 +275,18 @@ public class BookingController extends WeixinBaseController {
					json.put("remark", msg);
					PushMsgTask.getInstance().putWxMsg(getAccessToken(), 6, p.getOpenid(), p.getName(), json);
				}
				//发送短信小时
				// 调用总部发送信息的接口
				String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, p.getMobile()), "GBK");
				JSONObject json = toJson(result);
//				if (json == null) {
//					// 发送失败
//					throw new Exception("短信发送失败!");
//				} else if (json.getInt("result") != 0) {
//					return json.getString("description");
//				} else {
//					//发送成功,保存到数据库
//				}
				return write(200, "创建挂号单成功!");
			}
			else{
@ -285,6 +298,35 @@ public class BookingController extends WeixinBaseController {
		}
	}
	public static List<NameValuePair> buildSmsParams(String content, String mobile) {
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("SpCode", SystemConf.getInstance().getSmsCode()));
		params.add(new BasicNameValuePair("LoginName", SystemConf.getInstance().getSmsName()));
		params.add(new BasicNameValuePair("Password", SystemConf.getInstance().getSmsPassword()));
		params.add(new BasicNameValuePair("MessageContent", content));
		params.add(new BasicNameValuePair("UserNumber", mobile));
		params.add(new BasicNameValuePair("SerialNumber", String.valueOf(System.currentTimeMillis())));
		params.add(new BasicNameValuePair("ScheduleTime", ""));
		params.add(new BasicNameValuePair("f", "1"));
		return params;
	}
	public static JSONObject toJson(String result) {
		JSONObject json = new JSONObject();
		try {
			String[] temps = result.split("&");
			for (String temp : temps) {
				if (temp.split("=").length != 2) {
					continue;
				}
				String key = temp.split("=")[0];
				String value = temp.split("=")[1];
				json.put(key, value);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return json;
	}
	/**
	 * 创建挂号单
	 */