瀏覽代碼

自助建档 客服平台

trick9191 7 年之前
父節點
當前提交
3706eb920b

File diff suppressed because it is too large
+ 87 - 6
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/BookingController.java


+ 2 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/PatientReservationDao.java

@ -36,4 +36,6 @@ public interface PatientReservationDao extends PagingAndSortingRepository<Patien
	//根据患者医获取近三个月的已取消的预约记录
	@Query("select a from PatientReservation a where a.patient = ?1 and a.startTime between ?2 and ?3 and a.status = 0 order by a.startTime desc")
	List<PatientReservation> findByPatientAndStartTime(String patientCode, Date startTime, Date endTime);
	List<PatientReservation> findByCallCode(String callCode);
}

+ 7 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/GuahaoXMService.java

@ -68,7 +68,7 @@ public class GuahaoXMService implements IGuahaoService {
    /**
     * 解析挂号后
     */
    private String CreateOrderAfter(String response, String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String sectionType, String startTime, String endTime, String patient, String patientName, String cardNo, String clinicCard, String patientPhone, String dname, String dcode) throws Exception {
    private String CreateOrderAfter(String response, String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String sectionType, String startTime, String endTime, String patient, String patientName, String cardNo, String clinicCard, String patientPhone, String dname, String dcode,String callCode) throws Exception {
        String code = "";
        if (response.startsWith("error") || response.startsWith("System-Error")) {
            throw new Exception(response);
@ -100,6 +100,8 @@ public class GuahaoXMService implements IGuahaoService {
        reservation.setDeptName(hosDeptName);
        reservation.setDoctorCode(doctorId);
        reservation.setDoctorName(doctorName);
        //关联通话记录
        reservation.setCallCode(callCode);
        if(doctor!=null){
            reservation.setDoctorJob(doctor.getTitle());
            reservation.setDoctorPhoto(doctor.getPhoto());
@ -593,7 +595,7 @@ public class GuahaoXMService implements IGuahaoService {
    /**
     * 创建挂号单
     */
    public String CreateOrder(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone) throws Exception {
    public String CreateOrder(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone,String callCode) throws Exception {
        String re = "";
        Patient p = patientService.findByCode(patient);
@ -654,7 +656,7 @@ public class GuahaoXMService implements IGuahaoService {
            verificationXml(response,"获取医生排班表失败!",ORDER_CREATE,content,method,msgBody,res);
            //保存http日志
            logService.saveHttpLog(true,ORDER_CREATE,content,method,null,msgBody,res,null,logService.archiveType);
            re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, null, null);
            re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, null, null,callCode);
        } else {
            throw new Exception("该排班信息错误或者不存在!");
        }
@ -1162,7 +1164,7 @@ public class GuahaoXMService implements IGuahaoService {
    /**
     * 转诊预约挂号
     */
    public String CreateOrderByDoctor(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone, String dname, String dcode) throws Exception {
    public String CreateOrderByDoctor(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone, String dname, String dcode,String callCode) throws Exception {
        String re = "";
        Patient p = patientService.findByCode(patient);
@ -1178,7 +1180,7 @@ public class GuahaoXMService implements IGuahaoService {
            String response = jwSmjkService.webRegisterByFamily(cardNo, patientName, clinicCard, sectionType, startTime, hospitalId, hosDeptId, hosDeptName, doctorId, doctorName,patientPhone);
            re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode);
            re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode,callCode);
        } else {
            throw new Exception("该排班信息错误或者不存在!");
        }

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/IGuahaoService.java

@ -36,7 +36,7 @@ public interface IGuahaoService {
	/**
	 * 创建挂号单
	 */
	public String CreateOrder(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone) throws Exception;
	public String CreateOrder(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone,String callCode) throws Exception;
	/**
	 * 获取医生信息

+ 17 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/JwSmjkService.java

@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
@ -451,4 +452,20 @@ public class JwSmjkService {
        return null;
    }
    public String doPostReturn(String url,String jsonParam){
        String response = HttpClientUtil.post(url, getJosonObjectParam(jsonParam), "UTF-8");
        return response;
    }
    public List<NameValuePair> getJosonObjectParam(String json){
        List<NameValuePair> param = new ArrayList<>();
        JSONObject jsonObject = new JSONObject(json);
        Iterator<String> it =  jsonObject.keys();
        while(it.hasNext()){
            String key = it.next();
            param.add(new BasicNameValuePair(key,(String)jsonObject.get(key)));
        }
        return param;
    }
}

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

@ -3,10 +3,7 @@ package com.yihu.wlyy.service.manager.account;
import com.yihu.wlyy.entity.*;
import com.yihu.wlyy.entity.call.CallRecord;
import com.yihu.wlyy.entity.call.CallService;
import com.yihu.wlyy.repository.DoctorDao;
import com.yihu.wlyy.repository.MessageDao;
import com.yihu.wlyy.repository.PatientDao;
import com.yihu.wlyy.repository.UserDao;
import com.yihu.wlyy.repository.*;
import com.yihu.wlyy.repository.call.CallRecordDao;
import com.yihu.wlyy.repository.call.CallServiceDao;
import com.yihu.wlyy.service.BaseService;
@ -59,6 +56,8 @@ public class CustomerService extends BaseService{
	private MessageDao messageDao;
	@Autowired
	private DoctorDao doctorDao;
	@Autowired
	private PatientReservationDao patientReservationDao;
	@Value(("${doctorAssistant.api}")+"/wlyygc/doctor/message")
	private String messageApi;
@ -390,10 +389,12 @@ public class CustomerService extends BaseService{
		CallRecord callRecord = callRecordDao.findByCode(code);
		List<CallService> consultService = callServiceDao.findByCallCodeAndType(code,0);
		List<CallService> orderService = callServiceDao.findByCallCodeAndType(code,1);
		List<PatientReservation> patientReservation = patientReservationDao.findByCallCode(code);
		Map<String,Object> rs = new HashedMap();
		rs.put("callRecord",callRecord);
		rs.put("consultService",consultService);
		rs.put("orderService",orderService);
		rs.put("patientReservation",patientReservation);
		return rs;
	}

+ 21 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/reservation/PatientReservationService.java

@ -51,6 +51,8 @@ public class PatientReservationService extends BaseService {
    private DoctorTeamMemberDao doctorTeamDoctor;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private UserDao userDao;
    public PatientReservation findByCode(String code) {
        return patientReservationDao.findByCode(code);
@ -108,6 +110,25 @@ public class PatientReservationService extends BaseService {
        }
    }
    /**
     * 客服取消预约
     */
    @Transactional
    public void userCancelOrder(Long id,String user) {
        PatientReservation obj = patientReservationDao.findOne(id);
        if (obj.getStatus()!=0) {
            obj.setStatus(0);
            User u =userDao.findByCode(user);
            obj.setCancelerName(u.getName());
            obj.setCancelerType(6);
            obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            obj.setCanceler(user);
            patientReservationDao.save(obj);
        }
    }
    /**
     * 居民取消预约
     */

+ 9 - 2
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -132,6 +132,9 @@ wechat:
   template_doctor_audit:  OFyLUeBW3r9trWw-i6pbB1sPSTD4J2recCv_mc-gKxA
   #服务结果通知
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
#测试模式是否开启,用于构造第三方接口数据 0关闭,1开启
testPattern:
  sign: 0
---
spring:
  profiles: test
@ -209,7 +212,9 @@ wechat:
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
#测试模式是否开启,用于构造第三方接口数据 0关闭,1开启
testPattern:
  sign: 1
---
spring:
  profiles: prod
@ -286,4 +291,6 @@ wechat:
   template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
   #服务结果通知
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
#测试模式是否开启,用于构造第三方接口数据 0关闭,1开启
testPattern:
  sign: 0

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/address/CountryDao.java

@ -14,4 +14,6 @@ public interface CountryDao extends PagingAndSortingRepository<Country, Long> {
    List<Country> findByStreet(String street);
    Country findByCode(String code);
    Country findByJwCode(String jwCode);
}

+ 11 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -2,10 +2,7 @@ package com.yihu.wlyy.service.app.account;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yihu.wlyy.entity.address.City;
import com.yihu.wlyy.entity.address.Province;
import com.yihu.wlyy.entity.address.Street;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.entity.address.*;
import com.yihu.wlyy.entity.demographic.DemographicInfo;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
@ -17,10 +14,7 @@ import com.yihu.wlyy.entity.patient.SocialSecurityInfo;
import com.yihu.wlyy.entity.patient.invitation.PatientInvitationLog;
import com.yihu.wlyy.entity.patient.vo.PatientArchivesDto;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.repository.address.CityDao;
import com.yihu.wlyy.repository.address.ProvinceDao;
import com.yihu.wlyy.repository.address.StreetDao;
import com.yihu.wlyy.repository.address.TownDao;
import com.yihu.wlyy.repository.address.*;
import com.yihu.wlyy.repository.demographic.TblBasicDao;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.patient.PatientDao;
@ -97,7 +91,8 @@ public class PatientInfoService extends BaseService {
    RSAUtils rsaUtils;
    @Autowired
    SocialSecurityInfoDao socialSecurityInfoDao;
    @Autowired
    CountryDao countryDao;
    /**
     * 患者更换手机号
     *
@ -379,7 +374,7 @@ public class PatientInfoService extends BaseService {
        json.put("BLOOD",blood);//血型【1.A型 2.3.O型4.AB型 5.不详】
        json.put("BLOOD_RH","1");//RH阴性【1.否 2.是 3.不详】
        json.put("MARRIAGE",marry);//婚姻状况【10.未婚 20.已婚 30.丧偶 40.离婚 90.未说明的婚姻状况】
        json.put("INSUR_CARD_NO",p.getSsc());//医保卡号
        //补充参数
        json.put("ALLERGIC_WITHOUT","1");//药物过敏史--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)",
        json.put("TRAUMA","0");// "TRAUMA":"既往史--外伤--【0 无 1 有】(同一类别,新增时,默认选无)",
@ -441,7 +436,7 @@ public class PatientInfoService extends BaseService {
        json.put("BLOOD",archive.getBlood());//血型【1.A型 2.3.O型4.AB型 5.不详】
        json.put("BLOOD_RH","1");//RH阴性【1.否 2.是 3.不详】
        json.put("MARRIAGE",archive.getMarry());//婚姻状况【10.未婚 20.已婚 30.丧偶 40.离婚 90.未说明的婚姻状况】
        json.put("INSUR_CARD_NO",p.getSsc());//医保卡号
        //补充参数
@ -513,7 +508,6 @@ public class PatientInfoService extends BaseService {
                        json.put("PAST_OTHER_CONTENT_DATE",dates[i]);//既往史--疾病--高血压日期
                    }
                }
            }
        }else{
            json.put("PAST_NONE","1");//既往史
@ -1220,6 +1214,11 @@ public class PatientInfoService extends BaseService {
    public JSONObject getPatientJWInfo(String idcard)throws Exception{
        org.json.JSONArray jsonArray = jwArchivesService.getSickArchiveRecord(idcard);
        JSONObject rs = (JSONObject) jsonArray.get(0);
        String bd =  (String)rs.get("birthday");
        rs.put("birthday",bd.substring(0,10));
        String ct = (String)rs.get("zoneCode");
        Country c = countryDao.findByJwCode(ct);
        rs.put("zoneCode",c.getName());
        String sql ="SELECT " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
                " p.photo " +

+ 13 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/pc/prescription/PrescriptionExpressagePCService.java

@ -61,7 +61,7 @@ public class PrescriptionExpressagePCService extends BaseService {
    public JSONObject getMedicine(String code,String userCode) throws Exception{
        JSONObject jsonObject = new JSONObject();
        String sql = "select a.type,a.prescription_code as prescriptionCode ,c.status,b.hospital_code as hospitalCode, b.hospital_doctor as hospitalDoctor,\n" +
        String sql = "select c.drug_delivery_flag AS drugDeliveryFlag,c.drug_delivery_operator_name AS drugDeliveryOperatorName,c.drug_delivery_time AS drugDeliveryTime,a.type,a.prescription_code as prescriptionCode ,c.status,b.hospital_code as hospitalCode, b.hospital_doctor as hospitalDoctor,\n" +
                "b.code as orderCode, b.hospital_name as hospitalName,c.dispensary_type as dispensaryType,b.fetching_medicine_time as fetchingMedicineTime ,\n" +
                "b.expressage_code as expressageCode,c.patient \n" +
                "from wlyy_prescription_dispensary_code a \n" +
@ -101,6 +101,9 @@ public class PrescriptionExpressagePCService extends BaseService {
                            String date = result.get("fetchingMedicineTime")!=null?DateUtil.dateToStr((Date)result.get("fetchingMedicineTime"),"yyyy-MM-dd HH:mm:ss"):"";
                            jsonObject.put("fetchingMedicineTime",date);
                            jsonObject.put("hospitalDoctor",result.get("hospitalDoctor"));
                            jsonObject.put("drugDeliveryFlag",result.get("drugDeliveryFlag"));
                            jsonObject.put("drugDeliveryOperatorName",result.get("drugDeliveryOperatorName"));
                            jsonObject.put("drugDeliveryTime",result.get("drugDeliveryTime"));
//                            return jsonObject;
                        }else{
                            List<PrescriptionInfo> list = prescriptionInfoDao.findByPrescriptionCode(result.get("prescriptionCode").toString());
@ -118,6 +121,9 @@ public class PrescriptionExpressagePCService extends BaseService {
                            String date = result.get("fetchingMedicineTime")!=null?DateUtil.dateToStr((Date)result.get("fetchingMedicineTime"),"yyyy-MM-dd HH:mm:ss"):"";
                            jsonObject.put("fetchingMedicineTime",date);
                            jsonObject.put("hospitalDoctor",result.get("hospitalDoctor"));
                            jsonObject.put("drugDeliveryFlag",result.get("drugDeliveryFlag"));
                            jsonObject.put("drugDeliveryOperatorName",result.get("drugDeliveryOperatorName"));
                            jsonObject.put("drugDeliveryTime",result.get("drugDeliveryTime"));
                        }
                        break;
                    }
@ -147,6 +153,9 @@ public class PrescriptionExpressagePCService extends BaseService {
                                String date = result.get("fetchingMedicineTime")!=null?DateUtil.dateToStr((Date)result.get("fetchingMedicineTime"),"yyyy-MM-dd HH:mm:ss"):"";
                                jsonObject.put("fetchingMedicineTime",date);
                                jsonObject.put("hospitalDoctor",result.get("hospitalDoctor"));
                                jsonObject.put("drugDeliveryFlag",result.get("drugDeliveryFlag"));
                                jsonObject.put("drugDeliveryOperatorName",result.get("drugDeliveryOperatorName"));
                                jsonObject.put("drugDeliveryTime",result.get("drugDeliveryTime"));
                            }else{
//                                jsonObject = new JSONObject(result);
                                jsonObject.put("flag",-6);//”订单已取药,出药人:张三,出药时间:XXXX-XX-XX,无法重新出药
@ -163,6 +172,9 @@ public class PrescriptionExpressagePCService extends BaseService {
                                String date = result.get("fetchingMedicineTime")!=null?DateUtil.dateToStr((Date)result.get("fetchingMedicineTime"),"yyyy-MM-dd HH:mm:ss"):"";
                                jsonObject.put("fetchingMedicineTime",date);
                                jsonObject.put("hospitalDoctor",result.get("hospitalDoctor"));
                                jsonObject.put("drugDeliveryFlag",result.get("drugDeliveryFlag"));
                                jsonObject.put("drugDeliveryOperatorName",result.get("drugDeliveryOperatorName"));
                                jsonObject.put("drugDeliveryTime",result.get("drugDeliveryTime"));
                            }
                        }else{
                            jsonObject.put("flag",-4);//出药机构与您所在机构不一致,无法出药,请重新确认