Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

humingfen 4 years ago
parent
commit
ab65c76f42

+ 23 - 15
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -70,10 +70,28 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        try{
        BasePatientMemberDictDO basePatientMemberDictDO = basePatientMemberDictDao.findOne(dictId);
        BasePatientDO basePatientDO = basePatientDao.findByIdcard(idCard);
        Map<String,Object> resultMap = new HashMap<>();
        if(null==basePatientDO){
           basePatientDO = new BasePatientDO();
        List<BasePatientDO> list = basePatientDao.findByMobile(phoneNum);
        if (!"xm_zsyy_wx".equalsIgnoreCase(wxId)){
            if (list!=null&&list.size()>0&&basePatientDO!=null){
                if (basePatientDO.getMobile().equalsIgnoreCase(phoneNum)){
                }else{
                    mixEnvelop.setStatus(408);
                    mixEnvelop.setMessage("您所添加的家属手机号已被他人占用");
                    return  mixEnvelop;
                }
            }else if (list!=null&&list.size()>0&&basePatientDO==null){
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属手机号已被他人占用");
                return  mixEnvelop;
            } else {
                if(basePatientDO==null){
                    basePatientDO = new BasePatientDO();
                }
                basePatientDO.setMobile(phoneNum);
            }
        }
        Map<String,Object> resultMap = new HashMap<>();
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcard(idCard);
        if(null==patientMappingDO){
            patientMappingDO = new PatientMappingDO();
@ -91,18 +109,6 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        String birth = "";
        String yktFamilyId = "";
        int sex=3;
        List<BasePatientDO> list = basePatientDao.findByMobile(phoneNum);
        if (list!=null&&list.size()>0){
            if (basePatientDO.getMobile().equalsIgnoreCase(phoneNum)){
            }else {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属手机号已被他人占用");
                return  mixEnvelop;
            }
        }else {
            basePatientDO.setMobile(phoneNum);
        }
        //获取his家属数据
        JSONArray jsonArray = new JSONArray();
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
@ -208,6 +214,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                            mixEnvelop.setMessage("您所添加的家属的电话有误,无法添加");
                            return mixEnvelop;
                        }
                        basePatientDO.setMobile(phoneNum);
                        basePatientDO.setPhone(phoneNum);
                    }
                    if (!Pat_name.equalsIgnoreCase(familyName)) {
                        mixEnvelop.setStatus(408);

+ 277 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -1,7 +1,6 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONPObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.DictDeptDescDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
@ -81,6 +80,7 @@ import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.utils.CheckSumBuilder;
import com.yihu.jw.utils.GenerateUserSig;
import com.yihu.jw.utils.PinYinUtils;
import com.yihu.jw.utils.Pkis.PKIService_PortType;
import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
import com.yihu.jw.utils.WebserviceUtil;
@ -93,6 +93,7 @@ import com.yihu.jw.wechat.service.BaseSensitiveFilterWordsService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.jw.yx.dao.YxTokenMappingDao;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.pinyin.PinyinUtil;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
@ -10760,6 +10761,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            sql+="select  t.street_name as \"streetName\" from base_address_mapping t  where t.town_name ='"+parentName+"' and street_name <> '' and street_name is not null";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        list.stream().forEach(one->{
            String firstSpell = null;
            if ("1".equalsIgnoreCase(addressFlag)){
                firstSpell = PinYinUtils.getFirstSpell(one.get("provinceName").toString());
            }else if("2".equalsIgnoreCase(addressFlag)){
                firstSpell = PinYinUtils.getFirstSpell(one.get("cityName").toString());
            }else if("3".equalsIgnoreCase(addressFlag)){
                firstSpell = PinYinUtils.getFirstSpell(one.get("townName").toString());
            }else if("4".equalsIgnoreCase(addressFlag)){
                firstSpell = PinYinUtils.getFirstSpell(one.get("streetName").toString());
            }
            one.put("firstSpell",firstSpell);
        });
        return list;
    }
@ -10827,5 +10841,267 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return res;
    }
    //先调预约核酸检测的接口
    public Map natAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
                                  String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName) throws Exception {
        BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
        baseNatAppointmentDO.setMedicare(mediaCard);
        baseNatAppointmentDO.setName(name);
        baseNatAppointmentDO.setCardNo(cardNo);
        baseNatAppointmentDO.setCardType(cardType);
        baseNatAppointmentDO.setAddress(address);
        baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDate(natTime,"yyyy-MM-dd hh:mm:ss"));
        baseNatAppointmentDO.setCityName(cityName);
        baseNatAppointmentDO.setFirstJobCode(firstJobCode);
        baseNatAppointmentDO.setFirstJobName(firstJobName);
        baseNatAppointmentDO.setSecondJobCode(secondJobCode);
        baseNatAppointmentDO.setSecondJobName(secondJobName);
        baseNatAppointmentDO.setProvinceName(provinceName);
        baseNatAppointmentDO.setTownName(townName);
        baseNatAppointmentDO.setStreetName(streetName);
        baseNatAppointmentDO.setPatientId(patientId);
        baseNatAppointmentDO.setIsSuccess("0");
        baseNatAppointmentDO.setPayStatus("0");
        baseNatAppointmentDO.setCreateTime(new Date());
        baseNatAppointmentDO.setMobile(mobile);
        baseNatAppointmentDO.setInspectionCode("鼻/咽拭子");
        baseNatAppointmentDO.setInspectionName("鼻/咽拭子");
        baseNatAppointmentDO.setIcdCode("Z00.000");
        baseNatAppointmentDO.setChargeCode("361322");
        baseNatAppointmentDO.setWinNo("6");
        baseNatAppointmentDO.setDept("3150000");
        baseNatAppointmentDO.setDeptName("感染疾病科");
        baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
        Map<String,Object> returnMap = new HashMap();
        //先进行核算检测预约
        String result = entranceService.BS10144("3150000","0001",natTime,mediaCard,name,cardNo,mobile,demoFlag);
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
        logger.info("核酸检测预约结束"+result);
        if (object!=null){
            com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("MsgInfo");
            String Msg = jsonObject.getString("Msg");
            if (Msg.contains("Error")){
                throw new Exception(Msg);
            }else {
                baseNatAppointmentDO.setIsSuccess("1");
                baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
                returnMap.put("id",baseNatAppointmentDO.getId());
                returnMap.put("msg","预约成功");
            }
        }else {
            returnMap.put("id",baseNatAppointmentDO.getId());
            returnMap.put("msg","预约失败");
        }
        return  returnMap;
    }
    //预约核酸成功后通过订单id去挂号生成订单
    public Map<String,Object> registerAndNatPre(Integer id) throws Exception{
        BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
        Map<String,Object> map = findRandomDoctor();
        Map<String,Object> returnMap = new HashMap<>();
        if (baseNatAppointmentDO!=null){
            net.sf.json.JSONObject jsondate = new JSONObject();
            jsondate.put("checkPart","鼻/咽拭子");
            jsondate.put("cardNo",baseNatAppointmentDO.getMedicare());
            jsondate.put("chargeFlag","2");
            jsondate.put("chargeCode","361322");
            jsondate.put("icdCode","Z00.000");
            jsondate.put("socialNo",baseNatAppointmentDO.getCardNo());
            jsondate.put("tellPhone",baseNatAppointmentDO.getMobile());
            jsondate.put("address1",baseNatAppointmentDO.getProvinceName());
            jsondate.put("address2",baseNatAppointmentDO.getCityName());
            jsondate.put("address3",baseNatAppointmentDO.getTownName());
            jsondate.put("address4",baseNatAppointmentDO.getStreetName());
            jsondate.put("address5","");
            jsondate.put("area",baseNatAppointmentDO.getAddress());
            jsondate.put("winNo","6");
            jsondate.put("target","1");
            jsondate.put("quantity","1");
            if("1".equalsIgnoreCase(baseNatAppointmentDO.getIsSuccess())){
                logger.info("挂号开始");
                String date = DateUtil.dateToStr(new Date(), "yyyy-MM-dd");
                if (map!=null){
                    List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctorAndDel(baseNatAppointmentDO.getPatientId(), date,map.get("doctorCode").toString() ,1);
                    net.sf.json.JSONObject rs = new JSONObject();
                    if (patientRegisterDOs != null && patientRegisterDOs.size() > 0) {
                        WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
                        //判断是否已经挂号,如果已经挂号
                        if (StringUtils.isNotBlank(registerDO.getConNo()) && StringUtils.isNotBlank(registerDO.getRegisterNo())) {
                            net.sf.json.JSONObject res = new JSONObject();
                            res.put("@RESULT", "0");
                            logger.info("已经挂号 res: " + res.toString());
                            jsondate.put("serialNo",registerDO.getRegisterNo());
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                        }else {
                            returnMap.put("msg","已经挂号的数据有误");
                            returnMap.put("status","-1");
                            returnMap.put("id",baseNatAppointmentDO.getId());
                            return returnMap;
                        }
                    }else {
                        rs = entranceService.BS10111(baseNatAppointmentDO.getMedicare(), map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
                        net.sf.json.JSONObject res = rs.getJSONObject("resquest");
                        logger.info("挂号结果 res: " + res.toString());
                        String rsCode = res.getString("@RESULT");
                        if ("0".equals(rsCode)) {
                            //存储挂号号
                            // {"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47770476","@times":"28"}}
                            String serialNo = (String) res.get("@serial_no");
                            String conNo = (String) res.get("@times");
                            String xtgzh = (String) res.get("@xtgzh");
                            String realOrder = (String) res.get("@real_order");
                            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
                            jsondate.put("serialNo",serialNo);
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            //存储就诊记录
                            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
                            // 存储挂号医生与挂号科室
                            registerDO.setDoctor(map.get("doctorCode").toString());
                            registerDO.setDoctorName(map.get("doctorName").toString());
                            registerDO.setDept(map.get("deptCode").toString());
                            registerDO.setDeptName(map.get("deptName").toString());
                            registerDO.setRealOrder(realOrder);
                            registerDO.setXtgzh(xtgzh);
                            registerDO.setPatient(baseNatAppointmentDO.getPatientId());
                            registerDO.setPatientName(baseNatAppointmentDO.getName());
                            //挂号流水号与挂号次数
                            registerDO.setRegisterNo(serialNo);
                            registerDO.setConNo(conNo);
                            registerDO.setCreateTime(new Date());
                            registerDO.setDel(1);
                            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
                            patientRegisterDao.save(registerDO);
                            //保存日志
                            WlyyHttpLogDO log = new WlyyHttpLogDO();
                            log.setCode("registerNat");
                            log.setName("挂号");
                            log.setPatient(baseNatAppointmentDO.getPatientId());
                            log.setDoctor(map.get("doctorCode").toString());
                            log.setResponse(rs.toString());
                            log.setStatus(rsCode);
                            log.setCreateTime(new Date());
                            wlyyHttpLogDao.save(log);
                        } else if ("-2".equals(rsCode)) {
                            String serialNo = (String) res.get("@serial_no");
                            String xtgzh = (String) res.get("@xtgzh");
                            String realOrder = (String) res.get("@real_order");
                            String conNo = (String) res.get("@times");
                            jsondate.put("serialNo",serialNo);
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
                            //存储就诊记录
                            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
                            registerDO.setDoctor(map.get("doctorCode").toString());
                            registerDO.setDoctorName(map.get("doctorName").toString());
                            registerDO.setDept(map.get("deptCode").toString());
                            registerDO.setDeptName(map.get("deptName").toString());
                            registerDO.setRealOrder(realOrder);
                            registerDO.setXtgzh(xtgzh);
                            registerDO.setPatient(baseNatAppointmentDO.getPatientId());
                            registerDO.setPatientName(baseNatAppointmentDO.getName());
                            registerDO.setRegisterNo(serialNo);
                            registerDO.setConNo(conNo);
                            registerDO.setCreateTime(new Date());
                            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
                            patientRegisterDao.save(registerDO);
                            //保存日志
                            WlyyHttpLogDO log = new WlyyHttpLogDO();
                            log.setCode("registerOutPatient");
                            log.setName("挂号");
                            log.setPatient(baseNatAppointmentDO.getPatientId());
                            log.setDoctor(map.get("doctorCode").toString());
                            log.setResponse(rs.toString());
                            log.setStatus(rsCode);
                            log.setCreateTime(new Date());
                            wlyyHttpLogDao.save(log);
                        }else {
                            returnMap.put("msg","请求挂号失败");
                            returnMap.put("status","-1");
                            returnMap.put("id",baseNatAppointmentDO.getId());
                            return returnMap;
                        }
                        baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                    }
                    logger.info("开单开始");
                    logger.info("NatPre params:"+jsondate.toString());
                    com.alibaba.fastjson.JSONArray array = new com.alibaba.fastjson.JSONArray();
                    array.add(jsondate);
                    try {
                        JSONObject jsonObject  = entranceService.BS10112(array.toString(),demoFlag);
                        //判断返回结果
                        String prers = jsonObject.getString("@RESULT");
                        //保存日志
                        WlyyHttpLogDO log = new WlyyHttpLogDO();
                        log.setCode("NatAppointment");
                        log.setName("核酸检测开方");
                        log.setPatient(baseNatAppointmentDO.getPatientId());
                        log.setDoctor(map.get("doctorCode").toString());
                        log.setResponse(jsonObject.toString());
                        log.setRequest(jsondate.toString());
                        log.setCreateTime(new Date());
                        wlyyHttpLogDao.save(log);
                        if ("0".equals(prers)) {
                            String realOrder = jsonObject.getString("@real_order");
                            baseNatAppointmentDO.setRealOrder(realOrder);
                            baseNatAppointmentDao.save(baseNatAppointmentDO);
                            String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
                            String applyDepaName = map.get("deptName").toString();
                            String voucherNo = jsonObject.getString("@xtgzh0");
                            String applyDoctorName = map.get("doctorName").toString();
                            BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId());
                            String userName = null;
                            String idcard = null;
                            if (patientDO != null) {
                                userName = patientDO.getName();
                                idcard = patientDO.getIdcard();
                            }
                            PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(baseNatAppointmentDO.getPatientId());
                            String userNo = null;
                            if (patientMappingDO != null) {
                                userNo = patientMappingDO.getMappingCode();
                            }
                        /*JSONObject jsonObject1 =entranceService.BS15054(patientMappingDO.getMappingCode(),realOrder,demoFlag);
                        net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
                        logger.info("获取待结算数据 res: " + res.toString());
                        String rsCode = res.getString("@RESULT");*/
                            String free= 80+"";
                        /*if ("0".equals(rsCode)) {
                            free = res.getString("@total_charge");
                        }*/
                            ylzPayService.msgPush("01", baseNatAppointmentDO.getMedicare(), "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1");
                        /*//成功后发送模板消息
                        sendNatWxTemplat(name,cardNo,mobile,natTime,realOrder,"natAppointmentRemind");*/
                        }else{
                            returnMap.put("msg","核酸检测开方失败");
                            returnMap.put("status","-1");
                            returnMap.put("id",baseNatAppointmentDO.getId());
                            return returnMap;
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    returnMap.put("msg","预约成功");
                    returnMap.put("status","200");
                    returnMap.put("id",baseNatAppointmentDO.getId());
                }else {
                    returnMap.put("msg","医生映射表找不到对应信息");
                    returnMap.put("status","-1");
                    returnMap.put("id",baseNatAppointmentDO.getId());
                }
            }else{
                returnMap.put("msg","该单状态出错:"+baseNatAppointmentDO.getIsSuccess());
                returnMap.put("status","-1");
                returnMap.put("id",baseNatAppointmentDO.getId());
            }
        }
        return returnMap;
    }
}

+ 80 - 2
business/base-service/src/main/java/com/yihu/jw/utils/PinYinUtils.java

@ -5,12 +5,27 @@ import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
import org.apache.commons.lang3.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
 * @author huangwenjie
 * @date 2020/3/13 09:32
 */
public class PinYinUtils {
	public static final Map<String, String> multiToneMap = new HashMap<>();
	static {
		multiToneMap.put("重庆", "C");
		multiToneMap.put("广东", "G");
		multiToneMap.put("广西", "G");
		multiToneMap.put("厦门", "X");
	}
	 //将中文转换为英文
	public static String getEname(String name) throws  Exception
    {
@ -55,8 +70,71 @@ public class PinYinUtils {
		
		return newstr.toString();
	}
	/**
	 * 获取汉字串拼音首字母,英文字符不变
	 *
	 * @param chinese 汉字串
	 * @return 汉语拼音首字母
	 */
	public static String getFirstSpell(String chinese) {
		StringBuffer pybf = new StringBuffer();
		char[] arr = chinese.toCharArray();
		HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
		defaultFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE);
		defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
		//只取第一个汉字的拼音
		if (arr[0] > 128) {
			try {
				String[] temp = PinyinHelper.toHanyuPinyinStringArray(arr[0], defaultFormat);
				// 长度大于1,表明是多音字,往后多取一个字或两个字,取词组,取匹配多音字属性文件确定最终读音
				if (temp != null && temp.length > 1 && !temp[0].equalsIgnoreCase(temp[1])) {
					String finalLetter = getOrgNameMultiTone(chinese);
					if(StringUtils.isEmpty(finalLetter)){
						System.out.print(arr[0]);
						System.out.print(arr[1]+":[");
						for(int i=0; i< temp.length-1; i++)
							System.out.print(temp[i]+", ");
						System.out.println(temp[temp.length-1]+"]");
						pybf.append(temp[0].charAt(0));
					}else{
						pybf.append(finalLetter.charAt(0));
					}
				} else {
					pybf.append(temp[0].charAt(0));
				}
			} catch (BadHanyuPinyinOutputFormatCombination e) {
				e.printStackTrace();
			}
		} else {
			pybf.append(arr[0]);
		}
		return pybf.toString().replaceAll("\\W", "").trim();
	}
	/**
	 * 获取医院多音字的读音,取词组,最多取三个
	 *
	 * @param chinesePhrase 中文词组
	 * @return
	 */
	public static String getOrgNameMultiTone(String chinesePhrase) {
		try{
			if (multiToneMap.containsKey(chinesePhrase.substring(0, 1))) {
				return multiToneMap.get(chinesePhrase.substring(0, 1));
			} else if (multiToneMap.containsKey(chinesePhrase.substring(0, 2))) {
				return multiToneMap.get(chinesePhrase.substring(0, 2));
			} else if (multiToneMap.containsKey(chinesePhrase.substring(0, 3))) {
				return multiToneMap.get(chinesePhrase.substring(0, 3));
			}
		}catch (Exception e){
		}
		return null;
	}
	public static void main(String[] args)  throws  Exception{
		System.out.println(getUpEname("李宇春"));
		
		System.out.println(getFirstSpell("广西"));
	}
}

+ 119 - 6
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -57,11 +57,13 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    private static final String DEFAULT_PATIENT_INSERT_STATEMENT =
            "INSERT into base_patient (id,photo,idcard,password,salt,name,birthday,sex,mobile," +
                    "province_code,province_name,city_code,city_name,town_code,town_name,street_code,street_name,address," +
                    "del,locked,enabled,login_failure_count,login_date,card_type) " +
                    " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
                    "del,locked,enabled,login_failure_count,login_date,card_type,alipay_id) " +
                    " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
    private static final String PATIENT_INSERT_WEHCAT = "insert into base_patient_wechat (id,wechat_id,patient_id,openid,create_time) values(?,?,?,?,?)";
    private static final String UPDATE_PATIENT_CARD_TYPE = "update base_patient set card_type = ?,alipay_id = ? where id = ?";
    private static final String BespeakRegist = "bespeakRegist:";
@ -144,7 +146,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
     * 用户登录判读接口
     * 判断loginType查找用户信息
     * 用户类型 1或默认为user,2:医生登录,3:患者登录,4:i健康系统-患者登录(i健康患者可以不注册直接登录互联网系统,首次使用,根据i健康居民code去i健康查询居民信息,然后保存到base.base_patient)
     *
     * 用户类型 5 中山医院支付宝-患者登录(可以不注册直接登录)
     * @param username
     * @return
     */
@ -229,7 +231,9 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                                        0,
                                        1,
                                        0,
                                        new Date()
                                        new Date(),
                                        null,
                                        null
                                }
                        );
                    }catch (Exception e){
@ -331,7 +335,8 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                                            1,
                                            0,
                                            new Date(),
                                            idtype
                                            idtype,
                                            null
                                    }
                            );
                        }catch (Exception e){
@ -379,6 +384,110 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                    familyMemberDao.save(basePatientFamilyMemberDO);
                }
            }
        }else if("5".equals(loginType)){
            //中山医院支付宝-患者登录(可以不注册直接登录)
            // 姓名,电话,证件类型,证件号和⽀付宝open_id以冒号组合,如:
            //张三:13012341234:01:350000200112231234:123456
            String data[] = username.split(":");
            String name = data[0];
            username = data[1];
            String idcard = data[3];
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserDetails.class),username,idcard);
            if (null == users || users.size() == 0) {
                String patientId = UUID.randomUUID().toString();
                String salt = randomString(5);
                String pw = idcard.substring(idcard.length()-6);
                String password = MD5.md5Hex(pw + "{" + salt + "}");
                int sex = 0;
                try {
                    sex = Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard));
                    this.getJdbcTemplate().update(DEFAULT_PATIENT_INSERT_STATEMENT,
                            new Object[]{patientId,
                                    null,
                                    idcard,
                                    password,
                                    salt,
                                    name,
                                    IdCardUtil.getBirthdayForIdcard(idcard),
                                    sex,
                                    username,
                                    null,
                                    null,
                                    null,
                                    null,
                                    null,
                                    null,
                                    null,
                                    null,
                                    null,
                                    1,
                                    0,
                                    1,
                                    0,
                                    new Date(),
                                    data[2],
                                    data[4]
                            }
                    );
                }catch (Exception e){
                    logger.error("将中山医院支付宝登录数据同步到互联网医院居民表失败:" + e.getMessage());
                    return users;
                }
                try {
                    this.getJdbcTemplate().update(PATIENT_INSERT_WEHCAT,
                            new Object[]{
                                    UUID.randomUUID().toString(),
                                    getWechatId(),
                                    patientId,
                                    getOpenid(),
                                    new Date()
                            }
                    );
                }catch (Exception e){
                    logger.error("将中山医院支付宝登录数据同步到互联网医院居民微信关联表失败:" + e.getMessage());
                    return users;
                }
                WlyyUserDetails user = new WlyyUserDetails();
                user.setName(name);
                user.setPassword(password);
                if(sex == 1){
                    user.setGender(WlyyUserDetails.Gender.male);
                }else if(sex == 2){
                    user.setGender(WlyyUserDetails.Gender.female);
                }
                user.setId(username);
                user.setIdcard(idcard);
                user.setMobile(username);
                user.setEnabled(true);
                user.setLocked(false);
                user.setLockedDate(null);
                users.add(user);
                BasePatientDO patientDO = patientDao.findByIdcardAndDel(idcard,"1");
                WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patientDO.getId(),"7");
                if (basePatientFamilyMemberDO==null){
                    basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
                    basePatientFamilyMemberDO.setPatient(patientDO.getId());
                    basePatientFamilyMemberDO.setFamilyRelation("7");
                    basePatientFamilyMemberDO.setFamilyRelationName("自己");
                    basePatientFamilyMemberDO.setCardType("身份证");
                    basePatientFamilyMemberDO.setCardNo(patientDO.getIdcard());
                    basePatientFamilyMemberDO.setCreateTime(new Date());
                    basePatientFamilyMemberDO.setUpdateTime(new Date());
                    basePatientFamilyMemberDO.setIsAuthorize(1);
                    basePatientFamilyMemberDO.setIsDel(1);
                    basePatientFamilyMemberDO.setFamilyMember(patientDO.getId());
                    familyMemberDao.save(basePatientFamilyMemberDO);
                }
            }else{
                this.getJdbcTemplate().update(UPDATE_PATIENT_CARD_TYPE,
                        new Object[]{
                                data[2],
                                data[4],
                                users.get(0).getId()
                        }
                );
            }
        }
        return users;
    }
@ -533,6 +642,10 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
            //更新登录时间
            this.getJdbcTemplate().update("update base_patient p set p.login_failure_count = 0, p.login_date = ? where p.mobile = ? or p.idcard = ?", new Date(), username, getIdcard());
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_IDCARD_STATEMENT, new BeanPropertyRowMapper(WlyyUserSimple.class), getIdcard());
        }else if("5".equals(loginType)){
            //更新登录时间
            this.getJdbcTemplate().update("update base_patient p set p.login_failure_count = 0, p.login_date = ? where p.mobile = ? or p.idcard = ?", new Date(), username, username);
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserSimple.class), username,username);
        }
        logger.info("login:登录进入6");
@ -612,7 +725,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    public boolean setRolePhth(String loginType, OAuth2AccessToken token, String id, StringRedisTemplate redisTemplate) {
        if (org.apache.commons.lang.StringUtils.isBlank(loginType) || "1".equals(loginType) || "2".equals(loginType) || "3".equals(loginType) || "4".equals(loginType)) { //1或默认查找user表,为平台管理员账号
        if (org.apache.commons.lang.StringUtils.isBlank(loginType) || "1".equals(loginType) || "2".equals(loginType) || "3".equals(loginType) || "4".equals(loginType)|| "5".equals(loginType)) { //1或默认查找user表,为平台管理员账号
            String key = "wlyy2:auth:token:" + token.getValue();
            redisTemplate.opsForValue().set(key, "/**");
            redisTemplate.expire(key, token.getExpiresIn(), TimeUnit.SECONDS);

+ 68 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/WlyyTokenGranter.java

@ -2,6 +2,7 @@ package com.yihu.jw.security.oauth2.provider;
import com.yihu.jw.security.core.userdetails.SaltUser;
import com.yihu.jw.security.oauth2.core.redis.WlyyRedisVerifyCodeService;
import com.yihu.jw.security.utils.AES;
import org.springframework.security.authentication.*;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper;
@ -22,7 +23,9 @@ import org.springframework.security.oauth2.provider.token.AbstractTokenGranter;
import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices;
import org.springframework.util.Assert;
import java.util.*;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
 * Token授权器。
@ -96,6 +99,14 @@ public class WlyyTokenGranter implements TokenGranter {
                        requestFactory,
                        userDetailsService
                ));
        tokenGranters.put(AlipayTokenGranter.GRANT_TYPE,
                new AlipayTokenGranter(
                        authenticationManager,
                        tokenServices,
                        clientDetailsService,
                        requestFactory,
                        userDetailsService
                ));
    }
    public OAuth2AccessToken grant(String grantType, TokenRequest tokenRequest) {
@ -444,6 +455,62 @@ public class WlyyTokenGranter implements TokenGranter {
                throw new InvalidGrantException("User account is locked");
            }
//            parameters.put("password",userDetails.getPassword());
            Authentication userAuth = new UsernamePasswordAuthenticationToken(username,userDetails.getPassword(),  this.authoritiesMapper.mapAuthorities(userDetails.getAuthorities()));
            ((AbstractAuthenticationToken) userAuth).setDetails(parameters);
            OAuth2Request storedOAuth2Request = getRequestFactory().createOAuth2Request(client, tokenRequest);
            return new OAuth2Authentication(storedOAuth2Request, userAuth);
        }
    }
    /**
     * 支付宝登录
     */
    public static class AlipayTokenGranter extends AbstractTokenGranter {
        private static final String GRANT_TYPE = "alipay";
        private final AuthenticationManager authenticationManager;
        private final UserDetailsService userDetailsService;
        private GrantedAuthoritiesMapper authoritiesMapper = new NullAuthoritiesMapper();
        public AlipayTokenGranter(AuthenticationManager authenticationManager,
                                                  AuthorizationServerTokenServices tokenServices,
                                                  ClientDetailsService clientDetailsService,
                                                  OAuth2RequestFactory requestFactory,
                                                  UserDetailsService userDetailsService) {
            this(authenticationManager, tokenServices, clientDetailsService, requestFactory, userDetailsService, GRANT_TYPE);
        }
        protected AlipayTokenGranter(AuthenticationManager authenticationManager,
                                                     AuthorizationServerTokenServices tokenServices,
                                                     ClientDetailsService clientDetailsService,
                                                     OAuth2RequestFactory requestFactory,
                                                     UserDetailsService userDetailsService,
                                                     String grantType) {
            super(tokenServices, clientDetailsService, requestFactory, grantType);
            this.authenticationManager = authenticationManager;
            this.userDetailsService = userDetailsService;
        }
        @Override
        protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) {
            Map<String, String> parameters = new LinkedHashMap<String, String>(tokenRequest.getRequestParameters());
            String encdata = parameters.get("encdata");
            encdata = AES.decrypt(encdata);
            //姓名,电话,证件类型,证件号和⽀付宝open_id以冒号组合,如:
            //张三:13012341234:01:350000200112231234:123456
            String data[] = encdata.split(":");
            String username = data[1];
            SaltUser userDetails = (SaltUser)userDetailsService.loadUserByUsername(encdata);
            if (!userDetails.isEnabled()) {
                throw new InvalidGrantException("User is disabled");
            }
            if (!userDetails.isAccountNonLocked()) {
                throw new InvalidGrantException("User account is locked");
            }
//            parameters.put("password",userDetails.getPassword());
            Authentication userAuth = new UsernamePasswordAuthenticationToken(username,userDetails.getPassword(),  this.authoritiesMapper.mapAuthorities(userDetails.getAuthorities()));
            ((AbstractAuthenticationToken) userAuth).setDetails(parameters);

+ 20 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -192,15 +192,25 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        }
        logger.info("login:登录进入2");
        String flag = parameters.get("flag");
        String username = parameters.get("username");
        if (StringUtils.isEmpty(username)) {
        if (StringUtils.isEmpty(username)&&StringUtils.isEmpty(flag)) {
            throw new InvalidRequestException("username");
        }
        String client_id = parameters.get("client_id");
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id");
        }
        if (StringUtils.isEmpty(parameters.get("captcha"))) {
        if("alipay".equals(flag)){
            //支付宝登录
            parameters.put("grant_type", flag);
            String encdata = parameters.get("encdata");
            encdata = AES.decrypt(encdata);
            String data[] = encdata.split(":");
            username = data[1];
            parameters.put("username", username);
        }else if (StringUtils.isEmpty(parameters.get("captcha"))) {
            parameters.put("grant_type", "password");
            //解密密码
            if (parameters.get("password") != null) {
@ -278,6 +288,14 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        return getResponse(wlyyUserSimple);
    }
    public static void main(String[] args) throws Exception{
        String encodedText = "OiF6sj1G11jLgHrvgPVUilE9IGeqgNZs2EFh%2FiCyFd9uhZqC5vl%2BwyrVXVM9jAEgRvxbi3jYK%2BmFvmRa5s1EQg%3D%3D";
        encodedText = URLDecoder.decode(encodedText,"utf-8");
        String str =  AES.decrypt("3bdc154ed1e44a9c9f44451a16d8e0aa",encodedText);
        System.out.println(str);
    }
    /**
     * 单点登陆第二步 - token验证
     *

+ 17 - 4
server/svr-authentication/src/main/java/com/yihu/jw/security/utils/AES.java

@ -1,18 +1,31 @@
package com.yihu.jw.security.utils;
import org.apache.commons.lang3.StringUtils;
import sun.misc.BASE64Decoder;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.lang3.StringUtils;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
/**
 * Created by Trick on 2020/2/24.
 */
public class AES {
    /**
     * 中山支付宝加密密钥
     */
    private static final String key = "3bdc154ed1e44a9c9f44451a16d8e0aa";
    public static String decrypt(String strIn){
        try {
            return decrypt(key,strIn);
        }catch (Exception e){
            e.printStackTrace();
        }
        return strIn;
    }
    //AES解密方法
    public static String decrypt(String strKey, String strIn) throws Exception {
        if(StringUtils.isEmpty(strKey)|| StringUtils.isEmpty(strIn)){

+ 104 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java

@ -2,6 +2,7 @@ package com.yihu.jw.door.controller.doctor;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
import com.yihu.jw.door.controller.BaseController;
import com.yihu.jw.door.dao.WlyyDoorDoctorDao;
import com.yihu.jw.door.dao.WlyyDoorServiceOrderDao;
@ -12,6 +13,7 @@ import com.yihu.jw.door.service.common.HospitalService;
import com.yihu.jw.door.service.common.ServerPackageService;
import com.yihu.jw.door.service.prescription.JwDoorPrescriptionService;
import com.yihu.jw.door.util.StreamUtil;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.door.WlyyDoorConclusionDO;
import com.yihu.jw.entity.door.WlyyDoorServiceOrderDO;
import com.yihu.jw.restmodel.ResponseContant;
@ -62,6 +64,9 @@ public class DoorOrderController extends BaseController {
    @Autowired
    private JwDoorPrescriptionService jwDoorPrescriptionService;
    @Autowired
    private BaseDoctorRoleDao baseDoctorRoleDao;
    @PostMapping("/initDoorStatus")
    @ApiOperation(value = "获取医生分派订单开关状态")
@ -634,7 +639,106 @@ public class DoorOrderController extends BaseController {
                    if (doctor == null) {
                        continue;
                    }
                    String status = wlyyDoorServiceOrderService.findDispatchStatusByDoctor(doctor.get("id").toString());
                    JSONObject json = new JSONObject();
                    json.put("status", status);
                    json.put("id", doctor.get("id"));
                    // 医生标识
                    json.put("code", doctor.get("id"));
                    // 医生姓名
                    json.put("name", doctor.get("name"));
                    // 所在医院名称
                    json.put("hospital", doctor.get("hospital"));
                    // 所在医院名称
                    json.put("hospital_name", doctor.get("hospital_name"));
                    // 科室名称
                    json.put("dept_name", (doctor.get("dept_name") == null ||
                            org.apache.commons.lang3.StringUtils.isEmpty(doctor.get("dept_name").toString())) ? " " : doctor.get("dept_name"));
//                    json.put("level", doctor.get("level") );
                    json.put("job", doctor.get("job") );
                    // 职称名称
                    json.put("job_name", (doctor.get("job_name") == null ||
                            org.apache.commons.lang3.StringUtils.isEmpty(doctor.get("job_name").toString())) ? " " : doctor.get("job_name"));
                    // 头像
                    json.put("photo", doctor.get("photo"));
                    // 简介
                    json.put("introduce", doctor.get("introduce"));
                    // 专长
                    json.put("expertise", doctor.get("expertise"));
                    json.put("flag", doctors.contains(String.valueOf(doctor.get("code"))) ? true : false);
                    json.put("fixed", one != null && String.valueOf(doctor.get("code")).equals(one.getDoctor()) ? true : false);
                    //出诊费用
                    json.put("fee", 0);
                    array.add(json);
                }
            }
            // 排序
            Collections.sort(array, new Comparator<JSONObject>() {
                @Override
                public int compare(JSONObject o1, JSONObject o2) {
                    Integer flag1 = (Boolean)o1.get("flag") ? 2 : 1;
                    Integer flag2 = (Boolean)o2.get("flag") ? 2 : 1;
                    if (flag1 - flag2 > 0) {
                        return -1;
                    } else if (flag1 - flag2 < 0) {
                        return 1;
                    } else {return 0;}
                }
            });
            Collections.sort(array, new Comparator<JSONObject>() {
                @Override
                public int compare(JSONObject o1, JSONObject o2) {
                    Integer fixed = (Boolean)o1.get("fixed") ? 2 : 1;
                    Integer fixed2 = (Boolean)o2.get("fixed") ? 2 : 1;
                    int sort = fixed - fixed2;
                    if (sort > 0) {
                        return -1;
                    } else if (sort < 0) {
                        return 1;
                    } else {
                        return 0;
                    }
                }
            });
            return write(200, "获取医院医生列表成功!", "list", array);
        } catch (Exception e) {
            error(e);
            return error(-1, "获取医院医生列表失败!");
        }
    }
    @ApiOperation("社区医院下护士列表查询接口 没分页")
    @RequestMapping(value = "getNurseListByHospitalNoPage",method =RequestMethod.POST)
    @ResponseBody
    public String getNurseListByHospitalNoPage(
            @RequestParam(required = true) String orderId,
            @RequestParam(required = false) String hospital,
            @RequestParam(required = false) String name,
            @RequestParam(required = false) Integer type) {
        try {
            List<JSONObject> array = new ArrayList<>();
            WlyyDoorServiceOrderDO one = doorServiceOrderDao.findOne(orderId);
            // 被服务的居民的次数(非代理居民)
//            Integer times = wlyyDoorServiceOrderService.countPatientDoorTimes(one.getPatient());
            List<String> doctors = doorDoctorDao.findDoctors(orderId);
            List<Map<String, Object>> list = hospitalService.getDoctorsByhospitalNoPage(hospital, name, type, 0);
            if (list != null) {
                for (Map<String, Object> doctor : list) {
                    if (doctor == null) {
                        continue;
                    }
                    List<BaseDoctorRoleDO> baseDoctorRoleDOS = baseDoctorRoleDao.findByDoctorCode(doctor.get("id").toString());
                    if (baseDoctorRoleDOS.size()<1){
                        continue;
                    }
                    if (!baseDoctorRoleDOS.get(0).getRoleCode().equals("nurse")){
                        continue;
                    }
                    String status = wlyyDoorServiceOrderService.findDispatchStatusByDoctor(doctor.get("id").toString());
                    JSONObject json = new JSONObject();
                    json.put("status", status);
                    json.put("id", doctor.get("id"));
                    // 医生标识
                    json.put("code", doctor.get("id"));

+ 22 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -25,6 +25,7 @@ import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.jw.util.date.DateUtil;
@ -2949,6 +2950,27 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        return result;
    }
    /**
     * 查看指定医生是否开启分派订单功能
     * @param doctor
     * @return
     */
    public String findDispatchStatusByDoctor(String doctor) {
        WlyyDoorDoctorStatusDO doctorSwitch = wlyyDoorDoctorStatusDao.findByDoctor(doctor);
        BaseDoctorDO doctorVO = doctorDao.findById(doctor);
        if (null == doctorSwitch) {
            WlyyDoorDoctorStatusDO wlyyDoorDoctorStatusDO =new WlyyDoorDoctorStatusDO();
            wlyyDoorDoctorStatusDO.setDoctor(doctor);
            wlyyDoorDoctorStatusDO.setStatus(5);
            wlyyDoorDoctorStatusDO.setCreateTime(new Date());
            wlyyDoorDoctorStatusDO.setCreateUser(doctor);
            wlyyDoorDoctorStatusDO.setCreateUserName(null != doctorVO ? doctorVO.getName() : null);
            wlyyDoorDoctorStatusDao.save(wlyyDoorDoctorStatusDO);
            return "0";
        }
        return doctorSwitch.getStatus() == 5 ? "0" : "1";
    }
    /**
     * 获取未付款的服务项
     * @param orderId

+ 57 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -2539,8 +2539,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                               @RequestParam(value = "id",required = false)Integer id,
                           @ApiParam(name = "patientId", value = "patientId")
                               @RequestParam(value = "patientId",required = false)String patientId) throws Exception {
        return success(prescriptionService.cancelNatAppointment(id,patientId));
        try {
            return success(prescriptionService.cancelNatAppointment(id,patientId));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/saveNatAppointment")
    @ApiOperation(value = "核酸检测预约接口")
@ -2584,5 +2587,57 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping("/natAppointment")
    @ApiOperation(value = "核酸检测预约接口New")
    public Envelop natAppointment(@ApiParam(name = "mediaCard", value = "mediaCard")
                                      @RequestParam(value = "mediaCard",required = false)String mediaCard,
                                      @ApiParam(name = "patientId", value = "patientId")
                                      @RequestParam(value = "patientId",required = false)String patientId,
                                      @ApiParam(name = "name", value = "name")
                                      @RequestParam(value = "name",required = false)String name,
                                      @ApiParam(name = "cardNo", value = "cardNo")
                                      @RequestParam(value = "cardNo",required = false)String cardNo,
                                      @ApiParam(name = "cardType", value = "cardType")
                                      @RequestParam(value = "cardType",required = false)String cardType,
                                      @ApiParam(name = "mobile", value = "mobile")
                                      @RequestParam(value = "mobile",required = false)String mobile,
                                      @ApiParam(name = "firstJobCode", value = "firstJobCode")
                                      @RequestParam(value = "firstJobCode",required = false)String firstJobCode,
                                      @ApiParam(name = "firstJobName", value = "firstJobName")
                                      @RequestParam(value = "firstJobName",required = false)String firstJobName,
                                      @ApiParam(name = "secondJobCode", value = "secondJobCode")
                                      @RequestParam(value = "secondJobCode",required = false)String secondJobCode,
                                      @ApiParam(name = "secondJobName", value = "secondJobName")
                                      @RequestParam(value = "secondJobName",required = false)String secondJobName,
                                      @ApiParam(name = "natTime", value = "natTime")
                                      @RequestParam(value = "natTime",required = false)String natTime,
                                      @ApiParam(name = "address", value = "address")
                                      @RequestParam(value = "address",required = false)String address,
                                      @ApiParam(name = "provinceName", value = "provinceName")
                                      @RequestParam(value = "provinceName",required = false)String provinceName,
                                      @ApiParam(name = "cityName", value = "cityName")
                                      @RequestParam(value = "cityName",required = false)String cityName,
                                      @ApiParam(name = "townName", value = "townName")
                                      @RequestParam(value = "townName",required = false)String townName,
                                      @ApiParam(name = "streetName", value = "streetName")
                                      @RequestParam(value = "streetName",required = false)String streetName){
        try {
            return success(prescriptionService.natAppointment(mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/registerAndNatPre")
    @ApiOperation(value = "核酸检测挂号接口New")
    public Envelop registerAndNatPre(@ApiParam(name = "id", value = "id")
                           @RequestParam(value = "id",required = false)Integer id) throws Exception {
        try {
            return success(prescriptionService.registerAndNatPre(id));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
}