Browse Source

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

yeshijie 7 years ago
parent
commit
9ebff006d0

+ 4 - 3
patient-co-customization/patient-co-modern-medicine/src/main/resources/application.yml

@ -72,9 +72,10 @@ spring:
        username: root
        password: 123456
      wlyy:
        url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
        username: root
        password: 123456
        url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
        username: ssgg
        password: ssgg
wechat:

+ 15 - 11
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -34,21 +34,25 @@ public class CustomerService{
		//查询签约信息
		SignFamily signInfo = contractService.findSignInfo(patient.getCode());
		if(signInfo!=null){
			signInfo.setStatusName("已签约");
		}
		//查询家庭成员的每个签约信息    以及签约医生
		List doctors = new ArrayList<Doctor>();
		for(Map<String, Object> familyMember:familyMembers) {
			//查找签约的医生信息
			String doctor = (String) familyMember.get("doctor");//医生code
			if(StringUtils.isNotBlank(doctor)){
				Doctor doctorInfo = hosDoctorService.getDoctorByCode(doctor);
				if(null!=doctorInfo){
					doctors.add(doctorInfo);
				}
		if(signInfo!=null){
			signInfo.setStatusName("已签约");
			//查找全科医生
			String doctorCode = signInfo.getDoctor();
			if(StringUtils.isNotBlank(doctorCode)){
				Doctor doctor = hosDoctorService.getDoctorByCode(doctorCode);
				doctors.add(doctor);
			}
			//查找健康管理师
			String doctorHealthCode = signInfo.getDoctorHealth();
			if(StringUtils.isNotBlank(doctorHealthCode)){
				Doctor doctor = hosDoctorService.getDoctorByCode(doctorHealthCode);
				doctors.add(doctor);
			}
		}
		resp.put("signInfo",signInfo);
		resp.put("doctors",doctors);

+ 34 - 32
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java

@ -575,36 +575,7 @@ public class PatientPrescriptionPayService extends BaseService {
    public Map charge(int type, String addressJson, String orgCode, String prescriptionCode, int totalAmount, String people, String accessToken, String returnUrl) throws Exception {
        Map resultMap = new HashMap();
        //获取机构映射
        HospitalMapping hos = mappingDao.findByCode(orgCode);
        if (hos == null) {
            throw new Exception("no hospital mapping!");
        }
        Hospital hospital = hospitalDao.findByCode(orgCode);
        //        患者签约信息
        String orgName = hos.getName();
        String appId = hos.getAppId();
        String appSecret = hos.getAppSecret();
        String signAddress = hospital.getAddress();
        LOGGER.info("APPID============> " + appId);
        LOGGER.info("APPSECRET============> " + appSecret);
        Patient patient = patientDao.findByCode(people);
        //微信登录患者信息
        String userName = patient.getName();
        String openid = patient.getOpenid();
        String userProvince = patient.getProvince();
        String userProvinceName = patient.getProvinceName();
        String userCity = patient.getCity();
        String userCityName = patient.getCityName();
        String userTown = patient.getTown();
        String userTownName = patient.getTownName();
        String userStreet = patient.getStreet();
        String userStreetName = patient.getStreetName();
        String userAddress = patient.getAddress();
        String userSsc = patient.getSsc();
        String userIdcard = patient.getIdcard();
        Prescription prescription = null;
        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
        Date now = new Date();
        Boolean isSuccess = true;
@ -616,6 +587,37 @@ public class PatientPrescriptionPayService extends BaseService {
        String channel = "WX_MMP";   //  医保支付渠道
        String subject = "续方订单支付";   //  订单名称
        try {
            //获取机构映射
            HospitalMapping hos = mappingDao.findByCode(orgCode);
            if (hos == null) {
                throw new Exception("no hospital mapping!");
            }
            Hospital hospital = hospitalDao.findByCode(orgCode);
            //        患者签约信息
            String orgName = hos.getName();
            String appId = hos.getAppId();
            String appSecret = hos.getAppSecret();
            String signAddress = hospital.getAddress();
            LOGGER.info("APPID============> " + appId);
            LOGGER.info("APPSECRET============> " + appSecret);
            Patient patient = patientDao.findByCode(people);
            //微信登录患者信息
            String userName = patient.getName();
            String openid = patient.getOpenid();
            String userProvince = patient.getProvince();
            String userProvinceName = patient.getProvinceName();
            String userCity = patient.getCity();
            String userCityName = patient.getCityName();
            String userTown = patient.getTown();
            String userTownName = patient.getTownName();
            String userStreet = patient.getStreet();
            String userStreetName = patient.getStreetName();
            String userAddress = patient.getAddress();
            String userSsc = patient.getSsc();
            String userIdcard = patient.getIdcard();
//       ***************************  测通流程 ***************************************
        OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
@ -626,7 +628,7 @@ public class PatientPrescriptionPayService extends BaseService {
            expressage.setCode(getCode());
        }
        expressage.setPrescriptionCode(prescriptionCode);
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
        prescription = prescriptionDao.findByCode(prescriptionCode);
        // 续方居民信息
        String paySsc = prescription.getSsc();
        String payPatientCode = prescription.getPatient();
@ -774,7 +776,7 @@ public class PatientPrescriptionPayService extends BaseService {
        prescriptionPay.setCreateTime(now);
        prescriptionPay.setCzrq(now);
        try {
//        try {
//             ***************************  测通流程 ***************************************
            LOGGER.info("================================>" + "Before get BindCard");

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java

@ -259,6 +259,10 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            throw new Exception("编码已使用!");
        } else if (status == -3) {
            throw new Exception("编码类型错误!");
        } else if (status == -4) {
            throw new Exception("未到达服务站!");
        } else if (status == -5) {
            throw new Exception("不可配送!");
        }
        return prescriptionDispensaryCode;

+ 47 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -107,6 +107,23 @@ public class PrescriptionExpressageService {
            returnStatus = -2;
            return returnStatus;
        }
//        if (prescriptionDispensaryCode.getIsUse() == 1) {
//            //判断编码是否使用过
//            PrescriptionLog prescriptionLog = new PrescriptionLog();
//            prescriptionLog.setCode(UUID.randomUUID().toString());
//            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
//            prescriptionLog.setCreateTime(new Date());
//            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
//            prescriptionLog.setFlag(1);
//            prescriptionLog.setUserCode(userCode);
//            prescriptionLog.setUserType(2);
//            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
//            prescriptionLog.setRemark("编码重复扫描");
//            prescriptionLogDao.save(prescriptionLog);
//            returnStatus = -2;
//            return returnStatus;
//        }
        switch (prescriptionDispensaryCode.getType()) {
            case 1: {
                //判断是1 居民取药码
@ -154,6 +171,20 @@ public class PrescriptionExpressageService {
        //修改处方状态为完成
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
        if(prescription.getStatus()<=65){
            PrescriptionLog prescriptionLog = new PrescriptionLog();
            prescriptionLog.setCode(UUID.randomUUID().toString());
            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
            prescriptionLog.setCreateTime(new Date());
            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
            prescriptionLog.setFlag(1);
            prescriptionLog.setUserCode(userCode);
            prescriptionLog.setUserType(2);
            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            prescriptionLog.setRemark("该状态不可取药");
            prescriptionLogDao.save(prescriptionLog);
            return -4;
        }
        Date finshTime = new Date();
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        prescription.setFinishTime(finshTime);
@ -193,8 +224,23 @@ public class PrescriptionExpressageService {
        //获取配送的医生信息
        Doctor doctor = doctorDao.findByCode(userCode);
        //修改处方状态为配送中
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
        if(prescription.getStatus()<=50){
            PrescriptionLog prescriptionLog = new PrescriptionLog();
            prescriptionLog.setCode(UUID.randomUUID().toString());
            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
            prescriptionLog.setCreateTime(new Date());
            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
            prescriptionLog.setFlag(1);
            prescriptionLog.setUserCode(userCode);
            prescriptionLog.setUserType(2);
            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            prescriptionLog.setRemark("该状态不可配送");
            prescriptionLogDao.save(prescriptionLog);
            return -5;
        }
        //修改处方状态为配送中
        Date expressageing = new Date();
        prescription.setExpressageTime(expressageing);
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());