Browse Source

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

liubing 4 năm trước cách đây
mục cha
commit
e60b08ecd4

+ 79 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerDoctorService.java

@ -29,6 +29,8 @@ import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import javax.imageio.ImageIO;
import javax.transaction.Transactional;
import javax.transaction.Transactional;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.core.ValueOperations;
@ -64,10 +66,12 @@ public class BaseBannerDoctorService
        ObjEnvelop objEnvelop = new ObjEnvelop();
        ObjEnvelop objEnvelop = new ObjEnvelop();
        BasePatientDO basePatientDO = this.patientDao.findById(patientId);
        BasePatientDO basePatientDO = this.patientDao.findById(patientId);
        boolean checkTimeOut = checkGiveTimeOut(patientId, doctor);
        boolean checkTimeOut = checkGiveTimeOut(patientId, doctor);
        boolean checkMessageTimeout = checkMessageTimeOut(patientId,doctor);
        if ((org.apache.commons.lang.StringUtils.isNotBlank(key)) && (org.apache.commons.lang.StringUtils.isNotBlank(value))) {
        if ((org.apache.commons.lang.StringUtils.isNotBlank(key)) && (org.apache.commons.lang.StringUtils.isNotBlank(value))) {
            if (verifyCaptcha(key, value))
            if (verifyCaptcha(key, value))
            {
            {
                checkTimeOut = true;
                checkTimeOut = true;
                checkMessageTimeout = true;
            }
            }
            else
            else
            {
            {
@ -118,6 +122,33 @@ public class BaseBannerDoctorService
                    baseUserMessageDO.setType(type);
                    baseUserMessageDO.setType(type);
                    baseUserMessageDO.setIsRead(Integer.valueOf(0));
                    baseUserMessageDO.setIsRead(Integer.valueOf(0));
                    this.baseUserMessageDao.save(baseUserMessageDO);
                    this.baseUserMessageDao.save(baseUserMessageDO);
                }else {
                    if(checkMessageTimes(patientId,doctor)){
                        if (checkMessageTimeout){
                            BaseUserMessageDO baseUserMessageDO = new BaseUserMessageDO();
                            baseUserMessageDO.setReceiver(doctor);
                            baseUserMessageDO.setContent(content);
                            baseUserMessageDO.setReceiverName(doctorName);
                            baseUserMessageDO.setRelationCode(relationCode);
                            baseUserMessageDO.setSender(patientId);
                            baseUserMessageDO.setSenderName(patientName);
                            baseUserMessageDO.setRelationName("赠送锦旗");
                            baseUserMessageDO.setRelationType(Integer.valueOf(2));
                            baseUserMessageDO.setStatus(Integer.valueOf(1));
                            baseUserMessageDO.setDel(Integer.valueOf(1));
                            baseUserMessageDO.setType(type);
                            baseUserMessageDO.setIsRead(Integer.valueOf(0));
                            objEnvelop.setMessage("success");
                        }else {
                            objEnvelop.setMessage("生成验证码");
                            objEnvelop.setObj(generateCaptcha());
                            return objEnvelop;
                        }
                    }else {
                        objEnvelop.setMessage("当天总送锦旗留言次数已达上限");
                        objEnvelop.setStatus(Integer.valueOf(77));
                        return objEnvelop;
                    }
                }
                }
            }
            }
            else
            else
@ -319,4 +350,52 @@ public class BaseBannerDoctorService
        }
        }
        return pass;
        return pass;
    }
    }
    public boolean checkMessageTimeOut(String sender, String reciver)
    {
        List<BaseUserMessageDO> baseBannerDoctorDOS = this.baseUserMessageDao.getMessageByPatientAndDoctor(reciver, sender);
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("leave_message_timeout");
        if (null != baseBannerDoctorDOS)
        {
            BaseUserMessageDO lastOne = (BaseUserMessageDO)baseBannerDoctorDOS.get(0);
            Date lastDate = lastOne.getCreateTime();
            long timeOut = wlyyHospitalSysDictDO.getDictValue() != null ? Long.valueOf(wlyyHospitalSysDictDO.getDictValue()).longValue() : 5L;
            Date current = new Date();
            if (current.getTime() - lastDate.getTime() > timeOut * 1000L * 60L) {
                return true;
            }
            return false;
        }
        return true;
    }
    public boolean checkMessageTimes(String patientId, String doctorId)
    {
        StringBuffer sql = new StringBuffer();
        sql.append("select t.sender as \"sender\",t.receiver as \"receiver\" from base_user_message t");
        sql.append(" where 1=1 ");
        if (StringUtils.isNotBlank(patientId)) {
            sql.append(" and t.sender = '" + patientId + "'");
        }
        if (StringUtils.isNotBlank(doctorId)) {
            sql.append(" and t.receiver = '" + doctorId + "'");
        }
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String strDate = format.format(date);
        sql.append(" and t.create_time > '" + strDate + " 00:00:00' and t.create_time<'" + strDate + " 23:59:59'");
        List<Map<String, Object>> list = this.hibenateUtils.createSQLQuery(sql.toString());
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("leave_message_times");
        long countTimes = 5L;
        if (wlyyHospitalSysDictDO != null) {
            countTimes = wlyyHospitalSysDictDO.getDictValue() == null ? countTimes : Long.valueOf(wlyyHospitalSysDictDO.getDictValue()).longValue();
        }
        if (list.size() > countTimes) {
            return false;
        }
        return true;
    }
}
}

+ 13 - 13
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java

@ -473,22 +473,22 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
        return sql.toString();
        return sql.toString();
    }
    }
    public boolean checkGiveTimeOut(String sender, String reciver)
    public boolean checkGiveTimeOut(String sender, String reciver)
{
    List<BaseUserMessageDO> baseBannerDoctorDOS = this.baseUserMessageDao.getMessageByPatientAndDoctor(reciver, sender);
    WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("leave_message_timeout");
    if (null != baseBannerDoctorDOS)
    {
    {
        List<BaseUserMessageDO> baseBannerDoctorDOS = this.baseUserMessageDao.getMessageByPatientAndDoctor(reciver, sender);
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("leave_message_timeout");
        if (null != baseBannerDoctorDOS)
        {
            BaseUserMessageDO lastOne = (BaseUserMessageDO)baseBannerDoctorDOS.get(0);
            Date lastDate = lastOne.getCreateTime();
            long timeOut = wlyyHospitalSysDictDO.getDictValue() != null ? Long.valueOf(wlyyHospitalSysDictDO.getDictValue()).longValue() : 5L;
            Date current = new Date();
            if (current.getTime() - lastDate.getTime() > timeOut * 1000L * 60L) {
                return true;
            }
            return false;
        BaseUserMessageDO lastOne = (BaseUserMessageDO)baseBannerDoctorDOS.get(0);
        Date lastDate = lastOne.getCreateTime();
        long timeOut = wlyyHospitalSysDictDO.getDictValue() != null ? Long.valueOf(wlyyHospitalSysDictDO.getDictValue()).longValue() : 5L;
        Date current = new Date();
        if (current.getTime() - lastDate.getTime() > timeOut * 1000L * 60L) {
            return true;
        }
        }
        return true;
        return false;
    }
    }
    return true;
}
    public boolean checkGiveTimes(String patientId, String doctorId)
    public boolean checkGiveTimes(String patientId, String doctorId)
    {
    {

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java

@ -34,6 +34,8 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    List<WlyyPrescriptionDO> findById(String id);
    List<WlyyPrescriptionDO> findById(String id);
    WlyyPrescriptionDO findByRealOrder(String realOrder);
    WlyyPrescriptionDO findByRealOrder(String realOrder);
    List<WlyyPrescriptionDO> findByRealOrderList(String realOrder);
    
    
    WlyyPrescriptionDO findByAdmNoAndRealOrder(String admno,String realOrder);
    WlyyPrescriptionDO findByAdmNoAndRealOrder(String admno,String realOrder);

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

@ -5667,13 +5667,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //根据门诊唯一号取就诊记录
        //根据门诊唯一号取就诊记录
//        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
//        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
        WlyyPrescriptionDO wlyyPrescriptionDOS = prescriptionDao.findByAdmNoAndRealOrder(admNo, realOrder);
        List<WlyyPrescriptionDO> wlyyPrescriptionDOList = prescriptionDao.findByRealOrderList(realOrder);
        Object result = "";
        Object result = "";
        System.out.println("获取顺丰物流面单信息:wlyyPrescriptionDOS != null=" + wlyyPrescriptionDOS != null);
        if (wlyyPrescriptionDOS != null) {
        System.out.println("获取顺丰物流面单信息:wlyyPrescriptionDOS != null=" + wlyyPrescriptionDOList != null);
        if (wlyyPrescriptionDOList != null&&wlyyPrescriptionDOList.size()!=0) {
            WlyyPrescriptionDO wlyyPrescriptionDOS = wlyyPrescriptionDOList.get(0);
            List<WlyyPrescriptionExpressageDO> expressageDOList = sfexpressService.findByField("outpatientId", wlyyPrescriptionDOS.getOutpatientId());
            List<WlyyPrescriptionExpressageDO> expressageDOList = sfexpressService.findByField("outpatientId", wlyyPrescriptionDOS.getOutpatientId());
            WlyyPrescriptionExpressageDO sfexpress_obj = null;
            WlyyPrescriptionExpressageDO sfexpress_obj = null;
            System.out.println("获取顺丰物流面单信息:CollectionUtils.isEmpty(expressageDOList)=" + CollectionUtils.isEmpty(expressageDOList));
            System.out.println("获取顺丰物流面单信息:CollectionUtils.isEmpty(expressageDOList)=" + CollectionUtils.isEmpty(expressageDOList));
@ -5683,7 +5682,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                System.out.println("获取顺丰物流面单信息:1");
                System.out.println("获取顺丰物流面单信息:1");
                sfexpress_obj = expressageDOList.get(0);
                sfexpress_obj = expressageDOList.get(0);
                System.out.println("获取顺丰物流面单信息:2");
                System.out.println("获取顺丰物流面单信息:2");
                BasePatientDO basePatientDO = basePatientDao.findById(wlyyPrescriptionDOS.getPatientCode());
                //如果该处方的快递单号已生成,则说明已经下单成功,不需要重复下单,直接返回面单信息
                //如果该处方的快递单号已生成,则说明已经下单成功,不需要重复下单,直接返回面单信息
                System.out.println("获取顺丰物流面单信息:3");
                System.out.println("获取顺丰物流面单信息:3");
                if (org.apache.commons.lang.StringUtils.isNotBlank(sfexpress_obj.getMailno())) {
                if (org.apache.commons.lang.StringUtils.isNotBlank(sfexpress_obj.getMailno())) {
@ -5712,9 +5710,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    System.out.println("获取顺丰物流面单信息:6");
                    System.out.println("获取顺丰物流面单信息:6");
                }
                }
                wlyyPrescriptionDOS.setStatus(32);
                prescriptionDao.save(wlyyPrescriptionDOS);
                for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOList){
                    prescriptionDO.setStatus(32);
                    prescriptionDao.save(prescriptionDO);
                }
                if (sfexpress_obj != null && StringUtils.isNoneBlank(sfexpress_obj.getMailno())) {
                if (sfexpress_obj != null && StringUtils.isNoneBlank(sfexpress_obj.getMailno())) {
                    com.alibaba.fastjson.JSONObject object = sfexpressService.postSFOrderQueryService(sfexpress_obj);
                    com.alibaba.fastjson.JSONObject object = sfexpressService.postSFOrderQueryService(sfexpress_obj);
                    System.out.println("获取顺丰物流面单信息7-1"+object.toJSONString());
                    System.out.println("获取顺丰物流面单信息7-1"+object.toJSONString());

+ 55 - 48
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1034,31 +1034,35 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
           WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
           WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
           wlyyOutpatientDO.setPayStatus(1);
           wlyyOutpatientDO.setPayStatus(1);
           WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
           WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
            //发送企业模板消息给医生
            BasePatientDO patientDO = new BasePatientDO();
            String msg = "";
            String name=outpatientDO.getPatientName();
            String sex = "";
            String age="";
            String date = "";
            String title = "";
            String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
            if (patientDO!=null){
                sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard());
                age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
            }
            if (outpatientDO!=null){
                if (outpatientDO.getType().equalsIgnoreCase("1")){
                    title = "图文复诊";
                    msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                    title = "视频复诊";
                    date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                    msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                }
            }
            enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
            System.out.println("发送企业模板消息成功");
           if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()!=1){
               //发送企业模板消息给医生
               BasePatientDO patientDO = new BasePatientDO();
               patientDO = patientDao.findById(outpatientDO.getPatient());
               String msg = "";
               String name=outpatientDO.getPatientName();
               String sex = "";
               String age="";
               String date = "";
               String title = "";
               String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
               if (patientDO!=null){
                   sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard());
                   age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
               }
               if (outpatientDO!=null){
                   if (outpatientDO.getType().equalsIgnoreCase("1")){
                       title = "图文复诊";
                       msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                   }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                       title = "视频复诊";
                       date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                       msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                   }
               }
               enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
               System.out.println("发送企业模板消息成功");
           }
        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) {
        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) {
           List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
           List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
           if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
           if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
@ -1094,31 +1098,34 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
            wlyyOutpatientDO.setPayStatus(1);
            wlyyOutpatientDO.setPayStatus(1);
            WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
            WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
            //发送企业模板消息给医生
            BasePatientDO patientDO = new BasePatientDO();
            String msg = "";
            String name=outpatientDO.getPatientName();
            String sex = "";
            String age="";
            String date = "";
            String title = "";
            String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
            if (patientDO!=null){
                sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard());
                age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
            }
            if (outpatientDO!=null){
                if (outpatientDO.getType().equalsIgnoreCase("1")){
                    title = "图文复诊";
                    msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                    title = "视频复诊";
                    date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                    msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
            if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()!=1){
                //发送企业模板消息给医生
                BasePatientDO patientDO = new BasePatientDO();
                patientDO = patientDao.findById(outpatientDO.getPatient());
                String msg = "";
                String name=outpatientDO.getPatientName();
                String sex = "";
                String age="";
                String date = "";
                String title = "";
                String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                if (patientDO!=null){
                    sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard());
                    age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
                }
                if (outpatientDO!=null){
                    if (outpatientDO.getType().equalsIgnoreCase("1")){
                        title = "图文复诊";
                        msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                    }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                        title = "视频复诊";
                        date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                        msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                    }
                }
                }
                enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
                System.out.println("发送企业模板消息成功");
            }
            }
            enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
            System.out.println("发送企业模板消息成功");
        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) {
        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) {
            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
            if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
            if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){

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

@ -3069,6 +3069,7 @@ public class ImService {
		}
		}
		if("9".equals(type) || "16".equals(type)|| "12".equals(type)){
		if("9".equals(type) || "16".equals(type)|| "12".equals(type)){
			sql = "SELECT " +
			sql = "SELECT " +
					" DISTINCT op.id AS \"outpatientId\"," +
					"op.description AS \"title\"," +
					"op.description AS \"title\"," +
					"op.description AS \"symptoms\",";
					"op.description AS \"symptoms\",";
			if("xm_ykyy_wx".equals(wxId)){
			if("xm_ykyy_wx".equals(wxId)){
@ -3088,8 +3089,7 @@ public class ImService {
					"patient.id AS \"patientId\"," +
					"patient.id AS \"patientId\"," +
					"patient.idcard AS \"patientIdcard\"," +
					"patient.idcard AS \"patientIdcard\"," +
					"patient.sex AS \"patientsex\"," +
					"patient.sex AS \"patientsex\"," +
					"patient.photo AS \"patientphoto\"," +
					"op.id AS \"outpatientId\"," ;
					"patient.photo AS \"patientphoto\",";
			if("xm_ykyy_wx".equals(wxId)){
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
				if (flag){
					sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";
					sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -19,13 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
    @Id
//==========mysql 环境 id策略======================================================
//==========mysql 环境 id策略======================================================
    /*@GeneratedValue(generator = "generator")
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)*/
    @Column(name = "id", unique = true, nullable = false)
//==========mysql 环境 id策略 end======================================================
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
//==========Oracle 环境id策略 =========================================================
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
   /*@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
    public Integer getId() {
        return id;
        return id;

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

@ -3,12 +3,14 @@ package com.yihu.jw.service.channel;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.job.QuartzJobLog;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.repository.job.QuartzJobLogDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
@ -61,6 +63,8 @@ public class PrescriptionStatusUpdateService {
    private BusinessOrderService businessOrderService;
    private BusinessOrderService businessOrderService;
    @Autowired
    @Autowired
    private PrescriptionLogService prescriptionLogService;
    private PrescriptionLogService prescriptionLogService;
    @Autowired
    private QuartzJobLogDao quartzJobLogDao;
    public void autoPush() throws Exception {
    public void autoPush() throws Exception {
@ -143,11 +147,11 @@ public class PrescriptionStatusUpdateService {
                if (!preExistFlag) {
                if (!preExistFlag) {
                    updatePrescriptionInfo(preId,wlyyPrescriptionVO,wlyyOutpatientDO);
                    updatePrescriptionInfo(preId,wlyyPrescriptionVO,wlyyOutpatientDO);
                }
                }
                //更改门诊状态为已经检查
                /*//更改门诊状态为已经检查
                if (100 == wlyyPrescriptionVO.getStatus()) {
                if (100 == wlyyPrescriptionVO.getStatus()) {
                    wlyyOutpatientDO.setStatus("2");
                    wlyyOutpatientDO.setStatus("3");
                }
                }
                outpatientDao.save(wlyyOutpatientDO);
                outpatientDao.save(wlyyOutpatientDO);*/
                //更新处方状态记录
                //更新处方状态记录
                wlyyPrescriptionDO.setStatus(wlyyPrescriptionVO.getStatus());
                wlyyPrescriptionDO.setStatus(wlyyPrescriptionVO.getStatus());
@ -279,6 +283,7 @@ public class PrescriptionStatusUpdateService {
        Calendar calendar = Calendar.getInstance();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.setTime(new Date());
        int i = calendar.get(Calendar.HOUR_OF_DAY);
        int i = calendar.get(Calendar.HOUR_OF_DAY);
        QuartzJobLog quartzJobLog = new QuartzJobLog();
        //复诊记录状态状态安全锁,每天0~2点才允许触发,避免误调用
        //复诊记录状态状态安全锁,每天0~2点才允许触发,避免误调用
        //将所有的已接诊的处方记录
        //将所有的已接诊的处方记录
        if(i==0||i==1){
        if(i==0||i==1){
@ -288,7 +293,7 @@ public class PrescriptionStatusUpdateService {
                for(WlyyOutpatientDO outpatientDO:outpatientDOs){
                for(WlyyOutpatientDO outpatientDO:outpatientDOs){
                    //结束门诊
                    //结束门诊
                    outpatientDO.setStatus("3");
                    outpatientDO.setStatus("3");
    
                    logger.info(outpatientDO.getId()+"的处方记录设置为结束");
                    String consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
                    String consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
                    if(StringUtils.isNoneBlank(consultCode)){
                    if(StringUtils.isNoneBlank(consultCode)){
                        try {
                        try {
@ -299,27 +304,32 @@ public class PrescriptionStatusUpdateService {
                        }
                        }
                       
                       
                    }
                    }
                    //保存操作日志
                    quartzJobLog.setId(UUID.randomUUID().toString());
                    quartzJobLog.setJobName("setOutPatientOver");
                    quartzJobLog.setJobId("setOutPatientOver");
                    quartzJobLog.setJobContent(outpatientDO.getId()+"问诊执行自动结束"+outpatientDO.getStatus());
                    quartzJobLog.setJobStartTime(new Date());
                    quartzJobLogDao.save(quartzJobLog);
                }
                }
                outpatientDao.save(outpatientDOs);
                outpatientDao.save(outpatientDOs);
                //退费
                //退费
                for (WlyyOutpatientDO outpatientDO:outpatientDOs){
                for (WlyyOutpatientDO outpatientDO:outpatientDOs){
                    try {
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
                    if (businessOrderDO!=null){
                    if (businessOrderDO!=null){
                        try {
                            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();
                        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());
                logger.info("setOutPatientOver count :"+outpatientDOs.size());
            }else {
            }else {
                logger.info("setOutPatientOver count :"+0);
                logger.info("setOutPatientOver count :"+0);

+ 4 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BannerDoctorController.java

@ -45,13 +45,13 @@ public class BannerDoctorController extends EnvelopRestEndpoint {
                                  @RequestParam(value = "key", required = false)String key,
                                  @RequestParam(value = "key", required = false)String key,
                                 @ApiParam(name = "value", value = "value", required = false)
                                 @ApiParam(name = "value", value = "value", required = false)
                                  @RequestParam(value = "value", required = false)String value) throws Exception{
                                  @RequestParam(value = "value", required = false)String value) throws Exception{
        List<BaseBannerDoctorDO> resultList = new ArrayList<>();
        ObjEnvelop objEnvelop = new ObjEnvelop();
        ObjEnvelop objEnvelop = new ObjEnvelop();
        List<String> list = new ArrayList<>();
        if(StringUtils.isNotEmpty(bannerIds)){
        if(StringUtils.isNotEmpty(bannerIds)){
            List<String> list =  Arrays.asList(bannerIds.split(","));
            String patientId= getUID();
            objEnvelop = baseBannerDoctorService.bannerGive(patientId,list,content,doctor,doctorName,type,key,value);
            list =  Arrays.asList(bannerIds.split(","));
        }
        }
        String patientId= getUID();
        objEnvelop = baseBannerDoctorService.bannerGive(patientId,list,content,doctor,doctorName,type,key,value);
    return objEnvelop;
    return objEnvelop;
    }
    }
    @ApiOperation("查询赠送锦旗")
    @ApiOperation("查询赠送锦旗")