Просмотр исходного кода

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

liubing 4 лет назад
Родитель
Сommit
2a4adbefaf

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/PatientMappingService.java

@ -82,6 +82,9 @@ public class PatientMappingService {
    public String findYkyyPatNoByPatient(String patient,boolean demoFlag)throws Exception{
        logger.info("findYkyyPatNoByPatient:"+patient);
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if(patientDO == null){
            return patient;
        }
        logger.info("patientDO:"+patientDO.toString());
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");

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

@ -6606,7 +6606,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            String str[] = realOrder.split(";");
            Object result = "";
            for (int i=0;i<str.length;i++){
                WlyyPrescriptionDO wlyyPrescriptionDOS = prescriptionDao.findByAdmNoAndRealOrder(admNo,str[i]);
                WlyyPrescriptionDO wlyyPrescriptionDOS = new WlyyPrescriptionDO();
                if(StringUtils.isNoneBlank(admNo)){
                    wlyyPrescriptionDOS = prescriptionDao.findByAdmNoAndRealOrder(admNo,str[i]);
                }else {
                    List<WlyyPrescriptionDO> wlyyPrescriptionDOList = prescriptionDao.findByRealOrderList(str[i]);
                    if (wlyyPrescriptionDOList!=null&&wlyyPrescriptionDOList.size()!=0){
                        wlyyPrescriptionDOS =wlyyPrescriptionDOList.get(0);
                    }
                }
                System.out.println("获取顺丰物流面单信息:wlyyPrescriptionDOS != null=" + wlyyPrescriptionDOS != null);
                if (wlyyPrescriptionDOS != null) {
                    List<WlyyPrescriptionExpressageDO> expressageDOList = sfexpressService.findByField("outpatientId", wlyyPrescriptionDOS.getOutpatientId());
@ -9678,11 +9686,62 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    yxTokenMappingDao.save(yxTokenMappingDO1);
                }
                return jsonObject1.getString("token");
            }else if (jsonObject.getString("code").equalsIgnoreCase("414")&&jsonObject.getString("desc").contains("already")){
                return  refreshToken(userId);
            }
        }
        return null;
    }
    /**
     * 重置云信token
     * @param userId
     * @return
     */
    public String refreshToken(String userId){
        YxTokenMappingDO yxTokenMappingDO = yxTokenMappingDao.findMappingByAccid(userId);
        if (yxTokenMappingDO!=null){
            return yxTokenMappingDO.getToken();
        }
        WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("YXAPPKEY");
        WlyyHospitalSysDictDO hospitalSysDictDO =  hospitalSysDictDao.findById("YXAPPSECRET");
        if (sysDictDO==null){
            return  "找不到对应的key";
        }
        String appKey = sysDictDO.getDictValue();
        String appSecret = hospitalSysDictDO.getDictValue();
        String nonce =  randomInt(10);
        String curTime = String.valueOf((new Date()).getTime() / 1000L);
        String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce ,curTime);//参考 计算CheckSum的java代码
        String url = "https://api.netease.im/nimserver/user/refreshToken.action";
        Map<String,Object> httpPost = new HashedMap();
        // 设置请求的header
        httpPost.put("AppKey", appKey);
        httpPost.put("Nonce", nonce);
        httpPost.put("CurTime", curTime);
        httpPost.put("CheckSum", checkSum);
        httpPost.put("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
        List<NameValuePair> nvps = new ArrayList<NameValuePair>();
        nvps.add(new BasicNameValuePair("accid", userId));
        YxTokenMappingDO yxTokenMappingDO1 = new YxTokenMappingDO();
        String response = httpClientUtil.headerPost(url,nvps,"UTF-8",httpPost);
        logger.info("返回日志"+response);
        if(StringUtils.isNoneBlank(response)){
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response);
            if (jsonObject.getString("code").equalsIgnoreCase("200")){
                com.alibaba.fastjson.JSONObject jsonObject1 = com.alibaba.fastjson.JSONObject.parseObject(jsonObject.getString("info"));
                if (StringUtils.isNoneBlank(jsonObject1.getString("token"))){
                    yxTokenMappingDO1.setAccid(userId);
                    yxTokenMappingDO1.setToken(jsonObject1.getString("token"));
                    yxTokenMappingDao.save(yxTokenMappingDO1);
                }
                return jsonObject1.getString("token");
            }
        }
        return null;
    }
    public static void main(String[] args) {
        String ss = DateUtil.getStringDateShort();
        System.out.println(ss);

+ 29 - 7
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TnPrescriptionService.java

@ -34,6 +34,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.mysql.query.BaseJpaService;
@ -186,12 +187,31 @@ public class TnPrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pr
     *
     */
    public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn, String patient, String realOrder, String admNo, boolean demoFlag)throws Exception{
        String patNo =patientMappingService.findHisPatNoByPatient(patient,null);
        if(StringUtils.isBlank(patNo)){
            return null;
        String patNo = "";
        if (!StringUtil.isEmpty(patient)){
            PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
            if (patientMappingDO!=null){
                patNo = patientMappingDO.getMappingCode();
            }else {
                BasePatientDO basePatientDO = basePatientDao.findById(patient);
                if (basePatientDO!=null){
                    JSONArray res = tnyyEntranceService.selectPatientMappingCode(basePatientDO.getIdcard());
                    if (res!=null&&res.size()!=0){
                        JSONObject object = res.getJSONObject(0);
                        patNo = object.getString("BRID");
                        patientMappingDO= new PatientMappingDO();
                        patientMappingDO.setPatientName(basePatientDO.getName());
                        patientMappingDO.setPatient(patient);
                        patientMappingDO.setMappingCode(patNo);
                        patientMappingDO.setSource("1");
                        patientMappingDO.setIdcard(basePatientDO.getIdcard());
                        patientMappingDao.save(patientMappingDO);
                    }
                }
            }
        }
        //BS16017(String REGISTER_SN,String realOrder,String PAT_NO,String ADM_NO,boolean demoFlag) throws Exception {
        logger.info("findOriginPrescriptionList: registerSn:"+registerSn+" patient"+patient+" patNo:"+patNo+" realOrder:"+realOrder+" admNo:"+admNo);
        logger.info("findOriginPrescriptionList: registerSn:"+registerSn+" patient"+patient+" realOrder:"+realOrder+" admNo:"+admNo);
        return tnyyEntranceService.findMS_CF01And02(admNo,demoFlag);
    }
@ -212,9 +232,11 @@ public class TnPrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pr
        if (wlyyOutpatientVOS!=null&&wlyyOutpatientVOS.size()!=0){
            WlyyOutpatientVO outpatientVO = wlyyOutpatientVOS.get(0);
            BasePatientDO patientDO = basePatientDao.findById(patient);
            outpatientVO.setSex(patientDO.getSex()+"");
            outpatientVO.setBirthday(patientDO.getBirthday());
            outpatientVO.setIdcard(patientDO.getIdcard());
            if (patientDO!=null){
                outpatientVO.setSex(patientDO.getSex()+"");
                outpatientVO.setBirthday(patientDO.getBirthday());
                outpatientVO.setIdcard(patientDO.getIdcard());
            }
            return outpatientVO;
        }
       return null;

+ 10 - 9
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/TnyyEntranceService.java

@ -408,7 +408,8 @@ public class TnyyEntranceService {
     * @throws Exception
     */
    public JSONArray findV_ZKSG_HZCX_HIS(String brid,String conNo,String startTime,String endTime,String ksdm) throws Exception{
        String sql = "SELECT h.JZXH,h.GHXH,h.BRBH,h.KSDM,h.YSDM,h.ZYZD,h.KSSJ,h.JSSJ,h.JZZT,h.FZRQ,h.GHFZ,ks.KSMC,yg.YGXM  from YS_MZ_JZLS h,GY_KSDM ks,GY_YGDM yg WHERE yg.YGDM=h.YSDM and ks.KSDM=h.KSDM and  h.BRBH = "+brid+" ";
        String sql = "SELECT h.JZXH,h.GHXH,h.BRBH,h.KSDM,h.YSDM,zd.JBMC as ZYZD,h.KSSJ,h.JSSJ,h.JZZT,h.FZRQ,h.GHFZ,ks.KSMC,yg.YGXM  from YS_MZ_JZLS h,GY_KSDM ks,GY_YGDM yg " +
                " ,GY_JBBM zd  WHERE yg.YGDM=h.YSDM and ks.KSDM=h.KSDM and h.ZYZD = zd.JBXH and  h.BRBH = "+brid+" ";
        if(!StringUtil.isBlank(conNo)){
            sql += " and h.JZXH = " + conNo;
        }
@ -455,19 +456,17 @@ public class TnyyEntranceService {
        logger.info("EntranceService " + fid + " PAT_NO :" + PAT_NO + " conNo:" + conNo + " startTime:" + startTime + " endTime:" + endTime);
        String resp = "";
        String orgCode = "350211A5004";
        String orgName = "厦门大学附属厦门眼科中心";
        String orgCode = "350211A1002";
        String orgName = "泰安市中医医院";
        //居民id转化
        PatientMappingDO patientMappingDO = patientMappingDao.findByMappingCodeAndSource(PAT_NO,"1");
        if(patientMappingDO == null){
            return null;
        }
//KSSJ,h.BRID,h.BRXM,h.SJHM,h.JZKH,h.SFZH,h.BRXZ,h.YSDM,h.KDYS" +
//                ",h.KSDM,h.KSMC,h.ZDMC,h.JZXH
        JSONArray jsonArray = new JSONArray();
        jsonArray = findV_ZKSG_HZCX_HIS(patientMappingDO.getMappingCode(),conNo,startTime,endTime,ksdm);
        jsonArray = findV_ZKSG_HZCX_HIS(PAT_NO,conNo,startTime,endTime,ksdm);
        //查找眼科数据
        if (jsonArray.size() == 0) {
            return null;
@ -485,8 +484,10 @@ public class TnyyEntranceService {
                //wlyyOutpatientVO.setRegisterNo(null == jsonObjectMgsInfo.get("REGISTER_SN") ? "" : jsonObjectMgsInfo.get("REGISTER_SN") + "");
                wlyyOutpatientVO.setDept(null == jsonObjectMgsInfo.get("KSDM") ? "" : jsonObjectMgsInfo.get("KSDM") + "");
                wlyyOutpatientVO.setDeptName(null == jsonObjectMgsInfo.get("KSMC") ? "" : jsonObjectMgsInfo.get("KSMC") + "");
                wlyyOutpatientVO.setPatient(patientMappingDO.getPatient());
                wlyyOutpatientVO.setPatientName(patientMappingDO.getPatientName());
                if (patientMappingDO!=null){
                    wlyyOutpatientVO.setPatient(patientMappingDO.getPatient());
                    wlyyOutpatientVO.setPatientName(patientMappingDO.getPatientName());
                }
                wlyyOutpatientVO.setConNo(null == jsonObjectMgsInfo.get("JZXH") ? "" : jsonObjectMgsInfo.get("JZXH") + "");
                String doctor = null == jsonObjectMgsInfo.get("YSDM") ? "" : jsonObjectMgsInfo.get("YSDM") + "";

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java


+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/utils/hibernate/HibenateUtils.java

@ -47,7 +47,7 @@ public class HibenateUtils {
        SQLQuery query = session.createSQLQuery(sql);
        query.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
        if(page!=null&&size!=null){
            query.setFirstResult(page * size);
            query.setFirstResult((page - 1) * size);
            query.setMaxResults(size);
        }
        List<Map<String, Object>> list = query.list();
@ -89,7 +89,7 @@ public class HibenateUtils {
        setSqlQueryByMap(query, params);
        if(page!=null&&size!=null){
            query.setFirstResult(page * size);
            query.setFirstResult((page-1) * size);
            query.setMaxResults(size);
        }
        List<Map<String, Object>> list = query.list();

+ 10 - 6
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -2273,9 +2273,9 @@ public class ImService {
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId());
			if (wlyyOutpatientDO.getOutpatientType()!=null){
				if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")&&wlyyOutpatientDO.getType().equalsIgnoreCase("1")){
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1",null);
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1",null);
				}else if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")&&wlyyOutpatientDO.getType().equalsIgnoreCase("2")){
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_16", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1",null);
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_16", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1",null);
				}
			}
		}
@ -2291,9 +2291,9 @@ public class ImService {
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId());
			if (wlyyOutpatientDO.getOutpatientType()!=null){
				if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")&&wlyyOutpatientDO.getType().equalsIgnoreCase("1")){
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "27", JSON.toJSONString(object),"1",null);
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "27", JSON.toJSONString(object),"1",null);
				}else if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")&&wlyyOutpatientDO.getType().equalsIgnoreCase("2")){
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_16", "27", JSON.toJSONString(object),"1",null);
					String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_16", "27", JSON.toJSONString(object),"1",null);
				}
			}
		}
@ -2347,9 +2347,13 @@ public class ImService {
	 * @return
	 * @throws Exception
	 */
	public String pushPrescriptionBackMsg(com.alibaba.fastjson.JSONObject jsonObject,String doctor,String doctorName,String outpatientId,String patient,String outpatientType) throws Exception {
	public String pushPrescriptionBackMsg(com.alibaba.fastjson.JSONObject jsonObject,String doctor,String doctorName,String outpatientId,String patient,String outpatientType,String type) throws Exception {
		if("1".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "33",jsonObject.toString(),"1",null);
			if ("1".equalsIgnoreCase(type)){
				return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "33",jsonObject.toString(),"1",null);
			}else {
				return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_16", "33",jsonObject.toString(),"1",null);
			}
		}else if("2".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "33",jsonObject.toString(),"1",null);
		}else{

+ 5 - 0
common/common-entity-es/pom.xml

@ -38,5 +38,10 @@
            <artifactId>jest-common</artifactId>
            <version>2.4.0</version>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>4.1.0</version>
        </dependency>
    </dependencies>
</project>

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

@ -9,7 +9,6 @@ import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.restmodel.ResultStatus;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -19,7 +18,6 @@ import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.WechatDao;
import com.yihu.jw.security.dao.patient.WlyyHospitalSysDictDao;
import com.yihu.jw.security.dao.patient.WlyyPatientFamilyMemberDao;
import com.yihu.jw.security.exception.ImgCaptchaException;
import com.yihu.jw.security.login.service.BaseLoginLogService;
import com.yihu.jw.security.model.*;
@ -1746,6 +1744,48 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                return ObjEnvelop.getSuccess("修改成功!");
            }
            return ObjEnvelop.getError("手机号未注册!");
        }else if ("sd_tnzyy_wx".equalsIgnoreCase(wechatId)){
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedSMS");
            if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
                if (captcha.equalsIgnoreCase(wlyyHospitalSysDictDO.getDictValue())){
                }else {
                    return ObjEnvelop.getError("验证码错误!");
                }
            }else {
                if (wlyyRedisVerifyCodeService.verification(client_id, mobile, captcha)) {
                    //验证码正确
                } else {
                    return ObjEnvelop.getError("验证码错误!");
                }
            }
            String rs = registerService.updateDoctorPw(mobile,pw,wechatId);
            if("ok".equals(rs)){
                return ObjEnvelop.getSuccess("修改成功!");
            }
            return ObjEnvelop.getError("手机号未注册!");
        }else if ("xm_xzzx_wx".equalsIgnoreCase(wechatId)){
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedSMS");
            if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
                if (captcha.equalsIgnoreCase(wlyyHospitalSysDictDO.getDictValue())){
                }else {
                    return ObjEnvelop.getError("验证码错误!");
                }
            }else {
                if (wlyyRedisVerifyCodeService.verification(client_id, mobile, captcha)) {
                    //验证码正确
                } else {
                    return ObjEnvelop.getError("验证码错误!");
                }
            }
            String rs = registerService.updateDoctorPw(mobile,pw,wechatId);
            if("ok".equals(rs)){
                return ObjEnvelop.getSuccess("修改成功!");
            }
            return ObjEnvelop.getError("手机号未注册!");
        }else {
            return ObjEnvelop.getError("暂未开放");

+ 45 - 24
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -306,12 +306,22 @@ public class PrescriptionStatusUpdateService {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        int i = calendar.get(Calendar.HOUR_OF_DAY);
        if(i==0){
            //将所有的已接诊的处方记录
            List<WlyyOutpatientDO> outpatientDOs = outpatientDao.findByStatus();
            if(outpatientDOs!=null&&outpatientDOs.size()>0){
                System.out.println(outpatientDOs.get(0).getId()+"id______-");
                for(WlyyOutpatientDO outpatientDO:outpatientDOs){
        //将所有的已接诊的处方记录
        List<WlyyOutpatientDO> outpatientDOs = outpatientDao.findByStatus();
        if(outpatientDOs!=null&&outpatientDOs.size()>0){
            System.out.println(outpatientDOs.get(0).getId()+"id______-");
            for(WlyyOutpatientDO outpatientDO:outpatientDOs){
                long currentTime = new Date().getTime();
                Date temp = new Date();
                if (outpatientDO.getConDate()==null){
                    temp = outpatientDO.getCreateTime();
                }else {
                    temp = outpatientDO.getConDate();
                }
                long outpatientTime = outpatientDO.getAdmDate()==null?temp.getTime():outpatientDO.getAdmDate().getTime();
                if(currentTime-outpatientTime>24*60*60*1000){
                    logger.info("结束接诊时间满足条件");
                    //结束门诊
                    outpatientDO.setStatus("3");
                    outpatientDO.setEndTime(new Date());
@ -328,30 +338,41 @@ public class PrescriptionStatusUpdateService {
                    }
                    logger.info(outpatientDO.getId()+"的处方记录设置为结束");
                }
                outpatientDao.save(outpatientDOs);
                //退费
                for (WlyyOutpatientDO outpatientDO:outpatientDOs){
            }
            outpatientDao.save(outpatientDOs);
            //退费
            for (WlyyOutpatientDO outpatientDO:outpatientDOs){
                long currentTime = new Date().getTime();
                Date temp = new Date();
                if (outpatientDO.getConDate()==null){
                    temp = outpatientDO.getCreateTime();
                }else {
                    temp = outpatientDO.getConDate();
                }
                long outpatientTime = outpatientDO.getAdmDate()==null?temp.getTime():outpatientDO.getAdmDate().getTime();
                if(currentTime-outpatientTime>24*60*60*1000) {
                    logger.info("退费时间满足条件");
                    try {
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
                    if (businessOrderDO!=null){
                        if (businessOrderDO.getPayType()==1){
                            businessOrderService.orderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
                        }else if (businessOrderDO.getPayType()==3){
        /*
                            businessOrderService.ylzOrderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
        */
                        }
                    } } catch (Exception e) {
                        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
                        if (businessOrderDO!=null){
                            if (businessOrderDO.getPayType()==1){
                                businessOrderService.orderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
                            }else if (businessOrderDO.getPayType()==3){
    /*
                        businessOrderService.ylzOrderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
    */
                            }
                        } } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                logger.info("setOutPatientOver count :"+outpatientDOs.size());
            }else {
                logger.info("setOutPatientOver count :"+0);
            }
            logger.info("setOutPatientOver end ");
            logger.info("setOutPatientOver count :"+outpatientDOs.size());
        }else {
            logger.info("setOutPatientOver count :"+0);
        }
        logger.info("setOutPatientOver end ");
    }

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -198,7 +198,7 @@ public class UnSettledHISPrescriptionService {
                        msgObj.put("reason","处方驳回");
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                        System.out.println("发送诊断消息开始+"+wlyyOutpatientDO.getId());
                        String immsg = imService.pushPrescriptionBackMsg(msgObj,doctor,doctorName,outpatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
                        String immsg = imService.pushPrescriptionBackMsg(msgObj,doctor,doctorName,outpatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType(),wlyyOutpatientDO.getType());
                        System.out.println("发送诊断消息成功:"+immsg);
                    }
                }

+ 2 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java

@ -27,9 +27,9 @@ import java.util.List;
@EnableScheduling
public class OverdueJob implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(OverdueJob.class);
    private static String cron = "0 0 0 * * ?";
    private static String cron = "0 */5 * * * ?";//"0 0 0 * * ?";
    public OverdueJob(){
        cron="0 0 0 * * ?";
        cron="0 */5 * * * ?";
        System.out.println("初始化时的corn"+cron);
    }
    @Autowired

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

@ -143,8 +143,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                              @RequestParam(value = "cardNo",required = false)String cardNo,
                                          @ApiParam(name = "flag", value = "标识", required = false)
                                              @RequestParam(value = "flag",required = false)String flag) throws Exception {
        startTime = startTime+" 00:00:00";
        endTime =endTime+" 23:59:59";
        if(StringUtils.isNoneBlank(startTime)){
            startTime = startTime+" 00:00:00";
        }
        if(StringUtils.isNoneBlank(endTime)){
            endTime =endTime+" 23:59:59";
        }
        List<WlyyOutpatientVO> vos = new ArrayList<>();
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm,cardNo);
@ -1711,7 +1715,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                msgObj.put("outpatientid",wlyyPrescriptionDO.getOutpatientId());
                msgObj.put("prescriptionId",prescriptionId);
                msgObj.put("reason",reason);
                String immsg = imService.pushPrescriptionBackMsg(msgObj,operate,operateName,wlyyPrescriptionDO.getOutpatientId(),wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
                String immsg = imService.pushPrescriptionBackMsg(msgObj,operate,operateName,wlyyPrescriptionDO.getOutpatientId(),wlyyOutpatientDO.getConsumer(),wlyyOutpatientDO.getOutpatientType(),wlyyOutpatientDO.getType());
                System.out.println("发送诊断消息成功:"+immsg);
            }else if (status==2){
                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);