wangzhinan 1 рік тому
батько
коміт
0bdf41b9fe

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

@ -149,6 +149,8 @@ import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -16497,4 +16499,45 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 根据后台配置,发起后多少个小时内可以取消或者转医生
     * @param outpatientId
     * @return
     */
    public boolean selectByDate(String outpatientId){
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("cancelTime");
        boolean flag= true;
        if(outpatientDO!=null){
            if (hospitalSysDictDO!=null){
                String time = hospitalSysDictDO.getDictValue();
                int days; //天数
                int hours; //时
                int minutes;
                Date firstDate = outpatientDO.getCreateTime();
                Date secondDate = new Date();
                long firstDateMilliSeconds = firstDate.getTime();
                long secondDateMilliSeconds = secondDate.getTime();
                //得到两者之差
                long firstMinusSecond = secondDateMilliSeconds - firstDateMilliSeconds;
                logger.info(""+firstMinusSecond);
                //毫秒转为秒
                long milliSeconds = firstMinusSecond;
                int totalSeconds = (int)(milliSeconds / 1000);
                //得到总天数
                days = totalSeconds / (3600*24);
                int days_remains = totalSeconds % (3600*24);
                //得到总小时数
                hours = days_remains / 3600;
                int remains_hours = days_remains % 3600;
                //得到分种数
                minutes = remains_hours / 60;
                if (hours<Integer.parseInt(time)){
                    flag= false;
                }
            }
        }
        return flag;
    }
}

+ 13 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -1226,6 +1226,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                "  patient_phone as \"patientPhone\",\n" +
                "  app_source as \"appSource\",\n" +
                "  appoint_way as \"appointWay\",\n" +
                "  consumer_doctor as \"consumerDoctor\",\n" +
                "  consumer_doctor_name as \"consumerDoctorName\",\n" +
                "  status as \"status\"\n" +
                "FROM\n" +
                "\tbase_appointment_log where 1=1  ";
@ -1750,18 +1752,22 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     * @param type 登录类型 1-手机号 2-证件号 3 二维码"
     * @return
     */
    public JSONObject getStudentInfo(String condition, String type){
        JSONObject loginObj =  otherLogin(condition,type);
    public JSONObject getStudentInfo(String condition, String type,String name){
        JSONObject loginObj =  otherLogin(condition,type,name);
        JSONObject jsonObject = new JSONObject();
        if (loginObj.getJSONObject("body")!=null){
            JSONObject body = loginObj.getJSONObject("body");
            if (body.getString("code").equalsIgnoreCase("200")){
                JSONObject header = loginObj.getJSONObject("header");
                JSONObject studentInfo = body.getJSONObject("result");
                if (header.getJSONArray("Authorization")!=null){
                    JSONArray authorizationAry = header.getJSONArray("Authorization");
                    String authorization = authorizationAry.getString(0);
                    JSONObject archives = otherVisionHealthArchives(authorization);
                    if (archives!=null){
                        return archives.getJSONObject("body");
                        jsonObject.put("studentInfo",studentInfo);
                        jsonObject.put("data",archives.getJSONObject("body"));
                        return jsonObject;
                    }
                }
            }
@ -1776,7 +1782,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     * @param type
     * @return
     */
    public JSONObject otherLogin(String condition, String type){
    public JSONObject otherLogin(String condition, String type,String userName){
        String url = slUrl+"/applet/otherLogin";
        long time = new Date().getTime();
        String sign = MD5.md5Hex(appid+secret_key+time);
@ -1786,6 +1792,9 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        params.put("sign",sign);
        params.put("password",condition);
        params.put("type",type);
        if (type.equalsIgnoreCase("2")){
            params.put("username",userName);
        }
        System.out.println("params"+params);
        Map<String, Object> headMap = new HashMap<>();
        headMap.put("platform","X-APP");

+ 36 - 16
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseAppointmentLogDO.java

@ -19,22 +19,26 @@ import java.util.Date;
@Table(name = "base_appointment_log")
public class BaseAppointmentLogDO extends UuidIdentityEntityWithOperator {
   private String orderCode;
   private String corpNo;
   private String departmentCode;
   private String departmentName;
   private String doctorCode;//院区id
   private String doctorName;
   private String scheduleCode;
   private String scheduleItemCode;
   private Date serviceStartDate;
   private Date serviceEndDate;
   private String patientName;
   private String patientCard;
   private String patientPhone;
   private String appSource;
   private String appointWay;
   private Integer status;//0预约失败1预约成功2取消预约
    private String orderCode;
    private String corpNo;
    private String departmentCode;
    private String departmentName;
    private String doctorCode;//院区id
    private String doctorName;
    private String scheduleCode;
    private String scheduleItemCode;
    private Date serviceStartDate;
    private Date serviceEndDate;
    private String patientName;
    private String patientCard;
    private String patientPhone;
    private String appSource;
    private String appointWay;
    private Integer status;//0预约失败1预约成功2取消预约
    private String consumerDoctor;//代预约人code
    private String consumerDoctorName;//代预约姓名
    public String getOrderCode() {
        return orderCode;
@ -166,4 +170,20 @@ public class BaseAppointmentLogDO extends UuidIdentityEntityWithOperator {
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getConsumerDoctor() {
        return consumerDoctor;
    }
    public void setConsumerDoctor(String consumerDoctor) {
        this.consumerDoctor = consumerDoctor;
    }
    public String getConsumerDoctorName() {
        return consumerDoctorName;
    }
    public void setConsumerDoctorName(String consumerDoctorName) {
        this.consumerDoctorName = consumerDoctorName;
    }
}

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

@ -2,7 +2,9 @@ package com.yihu.jw.service.channel;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
@ -46,6 +48,8 @@ public class RemindDoctorService {
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    public void sendSystemMessage() {
        try {
            List<WlyyOutpatientDO> list = outpatientDao.findDoctorRemindMessage();
@ -70,6 +74,7 @@ public class RemindDoctorService {
                    sex= IdCardUtil.getSexForIdcard(wlyyOutpatientDO.getIdcard());
                    age = IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard())+"";
                    Long createTime = wlyyOutpatientDO.getCreateTime().getTime();
                    BaseDoctorDO doctorDO = baseDoctorDao.findById(wlyyOutpatientDO.getDoctor());
                    Long minusts = TimeUnit.MILLISECONDS.toMinutes(nowTime - createTime);
                    SystemMessageDO systemMessageDO = new SystemMessageDO();
                    if ("2".equals(wlyyOutpatientDO.getOutpatientType())) {
@ -129,6 +134,16 @@ public class RemindDoctorService {
                    if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                        String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+wlyyOutpatientDO.getDescription()+"&type=3&id="+wlyyOutpatientDO.getId();
                        enterpriseService.sendTWMesByDoctor("zsyy",wlyyOutpatientDO.getDoctor(),title,msg,url);
                        /*int i= zhongShanSMSService.ZhongShangSendSMS(doctorDO.getMobile(),msg);
                        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
                        wlyyHttpLogDO.setDoctor(outpatient.getDoctor());
                        wlyyHttpLogDO.setRequest("");
                        wlyyHttpLogDO.setName(content);
                        wlyyHttpLogDO.setCode(outpatient.getId());
                        wlyyHttpLogDO.setCreateTime(new Date());
                        wlyyHttpLogDO.setResponse(i+"");
                        wlyyHttpLogDao.save(wlyyHttpLogDO);*/
                    }else if(wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                        String url=baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+wlyyOutpatientDO.getDescription()+"&type=3&id="+wlyyOutpatientDO.getId();
                        enterpriseService.sendTWMesByDoctor("xm_ykyy_wx",wlyyOutpatientDO.getDoctor(),title,msg,url);

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

@ -3819,5 +3819,19 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping("/selectByDate")
    @ApiOperation(value = "根据后台配置,发起后多少个小时内可以取消或者转医生", notes = "根据后台配置,发起后多少个小时内可以取消或者转医生")
    public Envelop selectByDate(
            @ApiParam(name = "outpatientId", value = "门诊id")
            @RequestParam(value = "outpatientId", required = false) String outpatientId) {
        try {
            return success("操作成功", prescriptionService.selectByDate(outpatientId));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
}

+ 6 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -604,10 +604,12 @@ public class YkyyController extends EnvelopRestEndpoint {
    @ApiOperation("获取筛查学生视力档案" )
    public ObjEnvelop getStudentInfo(@ApiParam(name = "condition", value = "手机号/证件号/二维码", required = true)
                                 @RequestParam(required = true)String condition,
                                     @ApiParam(name = "username", value = "用户名字", required = true)
                                     @RequestParam(required = false)String username,
                                 @ApiParam(name = "type", value = "登录类型 1-手机号 2-证件号 3 二维码", required = true)
                                 @RequestParam(required = true)String type) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.getStudentInfo(condition,type));
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.getStudentInfo(condition,type,username));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
@ -618,10 +620,12 @@ public class YkyyController extends EnvelopRestEndpoint {
    @ApiOperation("视力学生认证信息" )
    public ObjEnvelop otherLogin(@ApiParam(name = "condition", value = "手机号/证件号/二维码", required = true)
                                         @RequestParam(required = true)String condition,
                                 @ApiParam(name = "username", value = "用户名字", required = true)
                                 @RequestParam(required = false)String username,
                                 @ApiParam(name = "type", value = "登录类型 1-手机号 2-证件号 3 二维码", required = true)
                                 @RequestParam(required = true)String type) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.otherLogin(condition,type));
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.otherLogin(condition,type,username));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }