Browse Source

复诊列表时间格式错误

huangwenjie 5 years ago
parent
commit
22491997a1

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

@ -5,8 +5,6 @@ import com.yihu.jw.doctor.service.excel.DoctorWorkTimeMainExcelDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionCheckDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.InspectionService;
@ -51,25 +49,25 @@ import java.util.Map;
@RequestMapping(value = BaseHospitalRequestMapping.Prescription.PREFIX)
@Api(value = "在线复诊", description = "在线复诊接口", tags = {"在线复诊接口"})
public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    
    @Autowired
    private PrescriptionService prescriptionService;
    
    @Autowired
    private WlyyBusinessService wlyyBusinessService;
    
    @Autowired
    private PrescriptionLogService prescriptionLogService;
    
    @Autowired
    private InspectionService inspectionService;
    
    @Autowired
    private DoctorPreSignService doctorPreSignService;
    
    @Autowired
    private HospitalSystemMessageService hospitalSystemMessageService;
    
    @Autowired
    private WorkTimeService workTimeService;
    
@ -78,31 +76,31 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    
    @Autowired
    private OutpatientDao outpatientDao;
    
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    
    @Autowired
    private BusinessOrderService businessOrderService;
    
    @Value("${demo.flag}")
    private boolean demoFlag;
    
    @Value("${wechat.id}")
    private String wxId;
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOutpatientList)
    @ApiOperation(value = " 查询某个时间段的患者门诊就诊记录")
    public ListEnvelop findOutpatientList(@ApiParam(name = "patient", value = "居民id")
                               @RequestParam(value = "patient",required = false) String patient,
                               @ApiParam(name = "startTime", value = "开始时间")
                               @RequestParam(value = "startTime",required = false) String startTime,
                               @ApiParam(name = "endTime", value = "结束时间")
                               @RequestParam(value = "endTime",required = false) String endTime) throws Exception {
                                          @RequestParam(value = "patient",required = false) String patient,
                                          @ApiParam(name = "startTime", value = "开始时间")
                                          @RequestParam(value = "startTime",required = false) String startTime,
                                          @ApiParam(name = "endTime", value = "结束时间")
                                          @RequestParam(value = "endTime",required = false) String endTime) throws Exception {
        List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag);
        return success(vos);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOutpatientInfo)
    @ApiOperation(value = " 查询单条门诊就诊记录")
    public ObjEnvelop findOutpatientInfo(@ApiParam(name = "patient", value = "居民id")
@ -112,7 +110,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        WlyyOutpatientVO obj = prescriptionService.findOutpatientInfo(patient,conNo);
        return success(obj);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOriginPrescriptionList)
    @ApiOperation(value = "门诊下所有处方信息")
    public ListEnvelop findOriginPrescriptionList(
@ -127,7 +125,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        List<WlyyPrescriptionVO> obj = prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
        return success(obj);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOriginPrescription)
    @ApiOperation(value = "历史处方信息(单条)")
    public ObjEnvelop findOriginPrescription(
@ -142,7 +140,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        WlyyPrescriptionVO obj = prescriptionService.findOriginPrescription(registerSn, patNo, admNo,realOrder, demoFlag);
        return success(obj);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPrescriptionList)
    @ApiOperation(value = "获取续方记录列表", notes = "获取续方记录列表")
    public MixEnvelop<WlyyPrescriptionVO,WlyyPrescriptionVO> findPrescriptionList(@ApiParam(name = "patient", value = "居民code")
@ -159,7 +157,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                                                  @RequestParam(value = "size", required = true) Integer size) {
        return prescriptionService.findPrescriptionList(patient,status,startTime,endTime,page,size);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findReOutpatientList)
    @ApiOperation(value = "查询复诊记录列表", notes = "查询复诊记录列表")
    public MixEnvelop<WlyyOutpatientVO,WlyyOutpatientVO> findReOutpatientList(@ApiParam(name = "patient", value = "居民code")
@ -176,7 +174,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                                              @RequestParam(value = "size", required = true) Integer size) {
        return prescriptionService.findReOutpatientList(patient,status,startTime,endTime,page,size);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findReOutpatientInfo)
    @ApiOperation(value = "查询复诊记录,处方,居民信息,物流(单条)", notes = "查询复诊记录,处方,居民信息,物流(单条)")
    public ObjEnvelop findReOutpatientInfo(@ApiParam(name = "outpatientId", value = "复诊ID")
@ -186,45 +184,45 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        com.alibaba.fastjson.JSONObject obj =  prescriptionService.findReOutpatientInfo(outpatientId,prescriptionId);
        return success(obj);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPrescriptionInfo)
    @ApiOperation(value = "获取所有居民相关信息,续方信息,物流信息,药品信息(单条)", notes = "获取所有居民相关信息,续方信息,物流信息,药品信息(单条)")
    public ObjEnvelop<Map<String,Object>> findPrescriptionInfo(@ApiParam(name = "prescriptionId", value = "续方明细")
                                                               @RequestParam(value = "prescriptionId", required = false) String prescriptionId) {
        
        return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.findPrescriptionInfo(prescriptionId));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.checkPrescription)
    @ApiOperation(value = "判断是否可续方,true 可以,false不可以", notes = "判断是否可续方,true 可以,false不可以")
    public ObjEnvelop<Boolean> checkPrescription(@ApiParam(name = "patient", value = "续方明细")
                                                               @RequestParam(value = "patient", required = false) String patient) {
                                                 @RequestParam(value = "patient", required = false) String patient) {
        
        return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.checkPrescription(patient));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.cancelPrescription)
    @ApiOperation(value = "居民取消续方", notes = "居民取消续方")
    public ObjEnvelop<Boolean> cancelPrescription(@ApiParam(name = "prescriptionId", value = "续方ID")
                                                      @RequestParam(value = "prescriptionId", required = false) String prescriptionId) {
                                                  @RequestParam(value = "prescriptionId", required = false) String prescriptionId) {
        
        return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.cancelPrescription(prescriptionId));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientCard)
    @ApiOperation(value = "查询患者就诊卡", notes = "查询患者就诊卡")
    public ListEnvelop findPatientCard(@ApiParam(name = "patient", value = "居民Code")
                                       @RequestParam(value = "patient", required = true)String patient)throws Exception {
        return success(prescriptionService.findPatientCard(patient));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.checkOutpatient)
    @ApiOperation(value = "判断是否可用发起门诊", notes = "判断是否可用发起门诊")
    public ObjEnvelop checkOutpatient(@ApiParam(name = "patient", value = "续方明细")
                                      @RequestParam(value = "patient", required = true)String patient)throws Exception{
        return success(prescriptionService.checkOutpatient(patient));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findAllHospital)
    @ApiOperation(value = "查询所有机构", notes = "查询所有机构")
    public ListEnvelop findAllHospital(@ApiParam(name = "level", value = "医院等级")
@ -233,7 +231,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "keyWord", required = false)String keyWord) {
        return success(prescriptionService.findAllHospital(level,keyWord));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByHospital)
    @ApiOperation(value = "查询机构底下部门", notes = "查询机构底下部门")
    public ListEnvelop findDeptByHospital(@ApiParam(name = "orgCode", value = "机构code")
@ -248,14 +246,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByKeyWord)
    @ApiOperation(value = "查询有所有已开放的科室", notes = "查询有所有已开放的科室")
    public ListEnvelop findDeptByKeyWord(@ApiParam(name = "keyWord", value = "关键字")
                                          @RequestParam(value = "keyWord", required = false)String keyWord,
                                         @RequestParam(value = "keyWord", required = false)String keyWord,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page",required = true) Integer page,
                                         @ApiParam(name = "pagesize", value = "分页大小")
                                             @RequestParam(value = "pagesize",required = true) Integer pagesize) {
                                         @RequestParam(value = "pagesize",required = true) Integer pagesize) {
        return success(prescriptionService.findDeptByKeyWord(keyWord,page,pagesize));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByHospitalAndDept)
    @ApiOperation(value = "查询部门下医生", notes = "查询部门下医生")
    public ListEnvelop findDoctorByHospitalAndDept(@ApiParam(name = "orgCode", value = "机构code")
@ -278,7 +276,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                   @RequestParam(value = "consultStatus", required = false)String consultStatus) {
        return success(prescriptionService.findDoctorByHospitalAndDept(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,consultStatus));
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.appointmentRevisit)
    @ApiOperation(value = "居民发起复诊", notes = "居民发起复诊")
    public ObjEnvelop appointmentRevisit(@ApiParam(name = "outpatientJson", value = "居民门诊json")
@ -289,9 +287,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "registerJson", required = false)String registerJson,
                                         @ApiParam(name = "chargeType", value = "预约实体json")
                                         @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
    
        
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson,expressageJson,registerJson,chargeType);
    
        
        //发送系统消息
        SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO);
        //发送IM消息
@ -301,18 +299,18 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        if(StringUtils.isBlank(wlyyOutpatientDO.getDoctor())){
            hospitalSystemMessageService.sendImPichCheckMessage(wlyyOutpatientDO);
        }
    
        
        return success(BaseHospitalRequestMapping.Prescription.api_success,wlyyOutpatientDO);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getICD10)
    @ApiOperation(value = "获取ICD10诊断编码", notes = "获取ICD10诊断编码")
    public ListEnvelop getICD10(@ApiParam(name = "pyKey", value = "拼音关键字")
                                @RequestParam(value = "pyKey", required = false)String pyKey)throws Exception {
        return success(prescriptionService.getICD10(pyKey));
        
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDrugDictionary)
    @ApiOperation(value = "获取药品字典", notes = "获取药品字典")
    public ListEnvelop getDrugDictionary(@ApiParam(name = "drugNo", value = "药品编码")
@ -325,7 +323,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "groupNo", required = false)String groupNo)throws Exception {
        return success(prescriptionService.getDrugDictionary(drugNo,pyKey,winNo,groupNo));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDrugUse)
    @ApiOperation(value = "获取用法", notes = "获取用法")
    public ListEnvelop getDrugUse(@ApiParam(name = "pyKey", value = "拼音关键字")
@ -333,34 +331,34 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                  @ApiParam(name = "drugNo", value = "药品编码")
                                  @RequestParam(value = "drugNo", required = false)String drugNo)throws Exception {
        return success(prescriptionService.getDrugUse(drugNo,pyKey));
        
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDrugFrequency)
    @ApiOperation(value = "获取用药频次", notes = "获取用药频次")
    public ListEnvelop getDrugFrequency()throws Exception {
        return success(prescriptionService.getDrugFrequency());
    }
    
    
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.makeDiagnosis)
    @ApiOperation(value = "下诊断", notes = "下诊断接口")
    public ObjEnvelop makeDiagnosis(@ApiParam(name = "outPatientId", value = "门诊编号")
                                            @RequestParam(value = "outPatientId", required = true)String outPatientId,
                                            @ApiParam(name = "advice", value = "医嘱")
                                            @RequestParam(value = "advice", required = false)String advice,
                                            @ApiParam(name = "type", value = "1需要提交his,2不提交只下诊断")
                                            @RequestParam(value = "type", required = true)String type,
                                            @ApiParam(name = "infoJsons", value = "药品json")
                                            @RequestParam(value = "infoJsons", required = false)String infoJsons,
                                            @ApiParam(name = "diagnosisJson", value = "诊断json")
                                            @RequestParam(value = "diagnosisJson", required = true)String diagnosisJson,
                                            @ApiParam(name = "inspectionJson", value = "检查检验")
                                            @RequestParam(value = "inspectionJson", required = false)String inspectionJson)throws Exception {
                                    @RequestParam(value = "outPatientId", required = true)String outPatientId,
                                    @ApiParam(name = "advice", value = "医嘱")
                                    @RequestParam(value = "advice", required = false)String advice,
                                    @ApiParam(name = "type", value = "1需要提交his,2不提交只下诊断")
                                    @RequestParam(value = "type", required = true)String type,
                                    @ApiParam(name = "infoJsons", value = "药品json")
                                    @RequestParam(value = "infoJsons", required = false)String infoJsons,
                                    @ApiParam(name = "diagnosisJson", value = "诊断json")
                                    @RequestParam(value = "diagnosisJson", required = true)String diagnosisJson,
                                    @ApiParam(name = "inspectionJson", value = "检查检验")
                                    @RequestParam(value = "inspectionJson", required = false)String inspectionJson)throws Exception {
        Map<String,Object> result = prescriptionService.makeDiagnosis(outPatientId,advice,type,infoJsons,diagnosisJson,inspectionJson);
        try {
    
            
            com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
            
            List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = (List<WlyyPrescriptionDiagnosisDO>) com.alibaba.fastjson.JSONArray.parseArray(diagnosisJson, WlyyPrescriptionDiagnosisDO.class);
@ -386,8 +384,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
        return success(result);
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findExpressageList)
    @ApiOperation(value = "获取订单列表", notes = "获取订单列表")
    public MixEnvelop findExpressageList(@ApiParam(name = "status", value = "流程状态,多状态用‘,’分割")
@ -406,7 +404,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "size", required = false)Integer size) {
        return prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,page,size,wxId);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.setMailno)
    @ApiOperation(value = "设置订单编号", notes = "设置订单编号")
    public ObjEnvelop setMailno(@ApiParam(name = "mailno", value = "订单号")
@ -415,20 +413,20 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                @RequestParam(value = "expressageId", required = false)String expressageId) {
        return success(prescriptionService.setMailno(mailno,expressageId));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.pushListWrite)
    @ApiOperation(value = "订单导出", notes = "订单导出")
    public void pushListWrite(@ApiParam(name = "status", value = "流程状态,多状态用‘,’分割")
                                    @RequestParam(value = "status", required = false)String status,
                                    @ApiParam(name = "oneselfPickupFlg", value = "是否自取 1是 0否")
                                    @RequestParam(value = "oneselfPickupFlg", required = false)String oneselfPickupFlg,
                                    @ApiParam(name = "nameKey", value = "配送员名称")
                                    @RequestParam(value = "nameKey", required = false)String nameKey,
                                    @ApiParam(name = "startTime", value = "开始时间,yyyy-MM-dd")
                                    @RequestParam(value = "startTime", required = false)String startTime,
                                    @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd")
                                    @RequestParam(value = "endTime", required = false)String endTime,
                                    HttpServletResponse response) throws Exception{
                              @RequestParam(value = "status", required = false)String status,
                              @ApiParam(name = "oneselfPickupFlg", value = "是否自取 1是 0否")
                              @RequestParam(value = "oneselfPickupFlg", required = false)String oneselfPickupFlg,
                              @ApiParam(name = "nameKey", value = "配送员名称")
                              @RequestParam(value = "nameKey", required = false)String nameKey,
                              @ApiParam(name = "startTime", value = "开始时间,yyyy-MM-dd")
                              @RequestParam(value = "startTime", required = false)String startTime,
                              @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd")
                              @RequestParam(value = "endTime", required = false)String endTime,
                              HttpServletResponse response) throws Exception{
        MixEnvelop expressages = prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,1,10000,wxId);
        List<Map<String,Object>> list = expressages.getDetailModelList();
        response.setContentType("octets/stream");
@ -436,21 +434,21 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        OutputStream os = response.getOutputStream();
        prescriptionService.pushListWrite(os,list);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByDeptTypeCode)
    @ApiOperation(value = "就诊费用查询", notes = "就诊费用查询")
    public ListEnvelop findByDeptTypeCode(@ApiParam(name = "deptTypeCode", value = "6总部7金榜8夏禾")
                                @RequestParam(value = "deptTypeCode", required = false)String deptTypeCode) throws Exception{
                                          @RequestParam(value = "deptTypeCode", required = false)String deptTypeCode) throws Exception{
        return success(prescriptionService.findByDeptTypeCode(deptTypeCode));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getCardInfo)
    @ApiOperation(value = "获取卡信息", notes = "获取卡信息")
    public ObjEnvelop getCardInfo(@ApiParam(name = "cardNo", value = "卡号")
                                  @RequestParam(value = "cardNo", required = false)String cardNo) throws Exception {
        return success(prescriptionService.getCardInfo(cardNo,demoFlag));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorWithWork)
    @ApiOperation(value = "查询医生带排班", notes = "查询医生带排班")
    public ObjEnvelop findDoctorWithWork(@ApiParam(name = "orgCode", value = "机构code")
@ -475,33 +473,33 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        
        return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,consultStatus,page,size));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorWithMouthWork)
    @ApiOperation(value = "查询医生列表带月份排班状态", notes = "查询医生列表带月份排班状态")
    public ObjEnvelop findDoctorWithMouthWork(@ApiParam(name = "orgCode", value = "机构code")
                                         @RequestParam(value = "orgCode", required = true)String orgCode,
                                         @ApiParam(name = "dept", value = "部门code")
                                         @RequestParam(value = "dept", required = false)String dept,
                                         @ApiParam(name = "date", value = "yyyy-MM")
                                         @RequestParam(value = "date", required = true)String date,
                                         @ApiParam(name = "chargeType", value = "号别")
                                         @RequestParam(value = "chargeType", required = false)String chargeType,
                                         @ApiParam(name = "nameKey", value = "名字关键字")
                                         @RequestParam(value = "nameKey", required = false)String nameKey,
                                         @ApiParam(name = "iswork", value = "不传全部,1.当月已经排班,2.当月未排班")
                                         @RequestParam(value = "iswork", required = false)String iswork,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
                                              @RequestParam(value = "orgCode", required = true)String orgCode,
                                              @ApiParam(name = "dept", value = "部门code")
                                              @RequestParam(value = "dept", required = false)String dept,
                                              @ApiParam(name = "date", value = "yyyy-MM")
                                              @RequestParam(value = "date", required = true)String date,
                                              @ApiParam(name = "chargeType", value = "号别")
                                              @RequestParam(value = "chargeType", required = false)String chargeType,
                                              @ApiParam(name = "nameKey", value = "名字关键字")
                                              @RequestParam(value = "nameKey", required = false)String nameKey,
                                              @ApiParam(name = "iswork", value = "不传全部,1.当月已经排班,2.当月未排班")
                                              @RequestParam(value = "iswork", required = false)String iswork,
                                              @ApiParam(name = "page", value = "第几页")
                                              @RequestParam(value = "page", required = true)Integer page,
                                              @ApiParam(name = "size", value = "每页大小")
                                              @RequestParam(value = "size", required = true)Integer size) {
        
        return success(prescriptionService.findDoctorWithMouthWork(orgCode,dept,chargeType,date,nameKey,iswork,page,size));
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findWorkTimeInfo)
    @ApiOperation(value = "获取具体号源", notes = "获取具体号源")
    public ListEnvelop findWorkTimeInfo(@ApiParam(name = "id", value = "排班id")
@ -516,14 +514,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "withWork", required = false)String withWork){
        return success(prescriptionService.findDoctorInfo(doctor,withWork));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorBaseInfo)
    @ApiOperation(value = "获取医生基本信息信息", notes = "获取医生基本信息信息")
    public ObjEnvelop findDoctorBaseInfo(@ApiParam(name = "doctor", value = "医生code")
                                     @RequestParam(value = "doctor", required = true)String doctor){
                                         @RequestParam(value = "doctor", required = true)String doctor){
        return success(prescriptionService.findDoctorBaseInfo(doctor));
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.cancelOutPatient)
    @ApiOperation(value = "取消复诊", notes = "取消复诊")
    public ObjEnvelop cancelOutPatient(@ApiParam(name = "outPatientId", value = "门诊记录")
@ -534,22 +532,22 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "cancelValue", required = false)String cancelValue,
                                       @ApiParam(name = "cancelRemark", value = "取消原因详细说明")
                                       @RequestParam(value = "cancelRemark", required = false)String cancelRemark) {
        
        return success(prescriptionService.cancelOutPatient(outPatientId,cancelType,cancelValue,cancelRemark,1));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findCancelReasonList)
    @ApiOperation(value = "获取居民取消原因字典", notes = "获取居民取消原因字典")
    public ListEnvelop findCancelReasonList(){
        return success(prescriptionService.findCancelReasonList());
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findFastRegisterDate)
    @ApiOperation(value = "獲取快速咨詢時間", notes = "獲取快速咨詢時間")
    public ListEnvelop findFastRegisterDate(){
        return success(prescriptionService.findFastRegisterDate());
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByTimeSlot)
    @ApiOperation(value = "获取快速咨询时间分段", notes = "获取快速咨询时间分段")
    public ListEnvelop findByTimeSlot(@ApiParam(name = "startTime", value = "开始时间")
@ -558,8 +556,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "endTime", required = false)String endTime) {
        return success(prescriptionService.findByTimeSlot(startTime,endTime));
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorWorkTimeByMonth)
    @ApiOperation(value = "查询某个医生某个月份排班记录", notes = "查询某个医生某个月份排班记录")
    public ListEnvelop findDoctorWorkTimeByMonth(@ApiParam(name = "doctor", value = "医生code")
@ -572,21 +570,21 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                 @RequestParam(value = "endDate", required = false)String endDate) {
        return success(prescriptionService.findDoctorWorkTimeByMonth(doctor,date,startDate,endDate));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findWorkRule)
    @ApiOperation(value = "查询排班规则", notes = "查询排班规则")
    public ListEnvelop findWorkRule(@ApiParam(name = "hospital", value = "医生code")
                                    @RequestParam(value = "hospital", required = true)String hospital) {
        return success(prescriptionService.findWorkRule("Scheduling",hospital));
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.updateWorkRule)
    @ApiOperation(value = "保存排班规则", notes = "保存排班规则")
    public ObjEnvelop updateWorkRule(@ApiParam(name = "workRoleJsons", value = "排班规则json")
                                     @RequestParam(value = "workRoleJsons", required = true)String workRoleJsons) {
        return success(prescriptionService.updateWorkRule(workRoleJsons));
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.saveDoctorWorkTimeJson)
    @ApiOperation(value = "排班批量保存接口", notes = "排班批量保存接口")
    public ObjEnvelop saveDoctorWorkTimeJson(@ApiParam(name = "type", value = "1.全医院,2.科室,3.医生")
@ -599,19 +597,19 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                             @RequestParam(value = "date", required = false)String date)throws Exception {
        return success(prescriptionService.saveDoctorWorkTimeJson(type,codes,workTimeJson,date));
    }
    
    @PostMapping(value = "test")
    @ApiOperation(value = "test", notes = "test")
    public Envelop test()throws Exception {
        return success(prescriptionService.test());
    }
    
    @PostMapping(value = "test2")
    @ApiOperation(value = "test2", notes = "test2")
    public Envelop test(String no)throws Exception {
        return success(prescriptionService.test2(no));
    }
    
    @PostMapping(value = "/sendMes")
    @ApiOperation(value = "心脏模板消息推送", notes = "心脏模板消息推送")
    public Envelop sendMes(@ApiParam(name = "wxId", value = "wxId")
@ -633,24 +631,24 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = "/sendXCXMes")
    @ApiOperation(value = "心脏模板消息推送小程序跳转", notes = "心脏模板消息推送小程序跳转")
    public Envelop sendXCXMes(@ApiParam(name = "wxId", value = "wxId")
                           @RequestParam(value = "wxId", required = true)String wxId,
                           @ApiParam(name = "patient", value = "居民ID")
                           @RequestParam(value = "patient", required = false)String patient,
                           @ApiParam(name = "cardNo", value = "卡号")
                           @RequestParam(value = "cardNo", required = false)String cardNo,
                           @ApiParam(name = "first", value = "头部")
                           @RequestParam(value = "first", required = true)String first,
                           @ApiParam(name = "noticeContent", value = "内容")
                           @RequestParam(value = "noticeContent", required = true)String noticeContent,
                           @ApiParam(name = "remark", value = "备注")
                           @RequestParam(value = "remark", required = true)String remark,
                           @ApiParam(name = "redirectUrl", value = "跳转链接")
                           @RequestParam(value = "redirectUrl", required = true)String miniProgramPagepath,
                           @ApiParam(name = "miniProgramAppId", value = "APPID")
                           @RequestParam(value = "miniProgramAppId", required = true)String miniProgramAppId  ) {
                              @RequestParam(value = "wxId", required = true)String wxId,
                              @ApiParam(name = "patient", value = "居民ID")
                              @RequestParam(value = "patient", required = false)String patient,
                              @ApiParam(name = "cardNo", value = "卡号")
                              @RequestParam(value = "cardNo", required = false)String cardNo,
                              @ApiParam(name = "first", value = "头部")
                              @RequestParam(value = "first", required = true)String first,
                              @ApiParam(name = "noticeContent", value = "内容")
                              @RequestParam(value = "noticeContent", required = true)String noticeContent,
                              @ApiParam(name = "remark", value = "备注")
                              @RequestParam(value = "remark", required = true)String remark,
                              @ApiParam(name = "redirectUrl", value = "跳转链接")
                              @RequestParam(value = "redirectUrl", required = true)String miniProgramPagepath,
                              @ApiParam(name = "miniProgramAppId", value = "APPID")
                              @RequestParam(value = "miniProgramAppId", required = true)String miniProgramAppId  ) {
        return success(xzzxEntranceService.sendXCXMes( wxId, patient, cardNo, first, noticeContent, remark, miniProgramPagepath, miniProgramAppId));
    }
    
    @PostMapping(value = "/sendXZMes")
    @ApiOperation(value = "心脏模板消息推送小程序跳转", notes = "心脏模板消息推送小程序跳转")
    public Envelop ehospitalNotice(
@ -674,30 +672,30 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
        return failed("推送失败");
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientInfo)
    @ApiOperation(value = "获取居民信息接口", notes = "获取居民信息接口")
    public ObjEnvelop findPatientInfo(@ApiParam(name = "patient", value = "居民ID")
                                      @RequestParam(value = "patient", required = true)String patient){
        return success(prescriptionService.findPatientInfo(patient));
        
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.saveDoctorOnlineWork)
    @ApiOperation(value = "保存在线排班", notes = "保存在线排班")
    public Envelop saveDoctorOnlineWork(@ApiParam(name = "onlineWorkJson", value = "保存在线排班json")
                                        @RequestParam(value = "onlineWorkJson", required = true)String onlineWorkJson)throws Exception {
        return prescriptionService.saveDoctorOnlineWork(onlineWorkJson);
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.delDoctorOnlineWork)
    @ApiOperation(value = "删除在线排班", notes = "删除在线排班")
    public Envelop delDoctorOnlineWork(@ApiParam(name = "id", value = "保存在线排班ID")
                                       @RequestParam(value = "id", required = true)String id)throws Exception {
        return prescriptionService.delDoctorOnlineWork(id);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorOnlineWorkList)
    @ApiOperation(value = "查询医生在线排班", notes = "查询医生在线排班")
    public ListEnvelop findDoctorOnlineWorkList(@ApiParam(name = "doctor", value = "医生code")
@ -708,7 +706,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                @RequestParam(value = "endDate", required = true)String endDate)throws Exception {
        return success(prescriptionService.findDoctorOnlineWorkList(doctor,startDate,endDate));
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.cooperativeOutpatient)
    @ApiOperation(value = "发起协同门诊", notes = "发起协同门诊")
    public ObjEnvelop cooperativeOutpatient(@ApiParam(name = "outpatientJson", value = "复诊实体json")
@ -718,65 +716,65 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                            @ApiParam(name = "chargeType", value = "号别")
                                            @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.cooperativeOutpatient(outpatientJson,registerJson,chargeType);
    
        
        //构建系统消息
        SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO);
        //发送系统消息
        hospitalSystemMessageService.sendImMessage(systemMessageDO);
    
        
        //发送医生抢单消息
        if(StringUtils.isBlank(wlyyOutpatientDO.getDoctor())){
            hospitalSystemMessageService.sendImPichCheckMessage(wlyyOutpatientDO);
        }
    
        
        return success(wlyyOutpatientDO);
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.saveOutpatientDoctor)
    @ApiOperation(value = "设置门诊医生", notes = "设置门诊医生")
    public ObjEnvelop saveOutpatientDoctor(@ApiParam(name = "outpatientJson", value = "复诊实体json")
                                             @RequestParam(value = "outpatientJson", required = true)String outpatientJson,
                                             @ApiParam(name = "registerJson", value = "预约实体json")
                                             @RequestParam(value = "registerJson", required = false)String registerJson,
                                             @ApiParam(name = "chargeType", value = "号别")
                                             @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
                                           @RequestParam(value = "outpatientJson", required = true)String outpatientJson,
                                           @ApiParam(name = "registerJson", value = "预约实体json")
                                           @RequestParam(value = "registerJson", required = false)String registerJson,
                                           @ApiParam(name = "chargeType", value = "号别")
                                           @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        return success(prescriptionService.saveOutpatientDoctor(outpatientJson,registerJson,chargeType));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.checkOauthQRCode)
    @ApiOperation(value = "验证授权", notes = "验证授权")
    public ObjEnvelop checkOauthQRCode(@ApiParam(name = "authorizeNo", value = "流水编号")
                                       @RequestParam(value = "authorizeNo", required = true)String authorizeNo)throws Exception {
        return success(prescriptionService.checkOauthQRCode(authorizeNo));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByGeneralDoctor)
    @ApiOperation(value = "全科医生协同门诊列表", notes = "全科医生协同门诊列表")
    public Envelop findByGeneralDoctor(@ApiParam(name = "generalDoctor", value = "全科医生")
                                           @RequestParam(value = "generalDoctor", required = true)String generalDoctor,
                                           @ApiParam(name = "startDate", value = "开始时间")
                                           @RequestParam(value = "startDate", required = false)String startDate,
                                           @ApiParam(name = "endDate", value = "结束时间")
                                           @RequestParam(value = "endDate", required = false)String endDate,
                                           @ApiParam(name = "status", value = "状态")
                                           @RequestParam(value = "status", required = false)String status,
                                           @ApiParam(name = "sort", value = "排序")
                                           @RequestParam(value = "sort", required = false)String sort,
                                           @ApiParam(name = "page", value = "第几页")
                                           @RequestParam(value = "page", required = true)Integer page,
                                           @ApiParam(name = "size", value = "每页大小")
                                           @RequestParam(value = "size", required = true)Integer size) {
                                       @RequestParam(value = "generalDoctor", required = true)String generalDoctor,
                                       @ApiParam(name = "startDate", value = "开始时间")
                                       @RequestParam(value = "startDate", required = false)String startDate,
                                       @ApiParam(name = "endDate", value = "结束时间")
                                       @RequestParam(value = "endDate", required = false)String endDate,
                                       @ApiParam(name = "status", value = "状态")
                                       @RequestParam(value = "status", required = false)String status,
                                       @ApiParam(name = "sort", value = "排序")
                                       @RequestParam(value = "sort", required = false)String sort,
                                       @ApiParam(name = "page", value = "第几页")
                                       @RequestParam(value = "page", required = true)Integer page,
                                       @ApiParam(name = "size", value = "每页大小")
                                       @RequestParam(value = "size", required = true)Integer size) {
        return prescriptionService.findByGeneralDoctor(generalDoctor,startDate,endDate,status,sort,page,size);
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findGeneralDoctorInfo)
    @ApiOperation(value = "全科医生首页统计信息", notes = "全科医生首页统计信息")
    public ObjEnvelop findGeneralDoctorInfo(@ApiParam(name = "generalDoctor", value = "全科医生")
                                            @RequestParam(value = "generalDoctor", required = true)String generalDoctor) {
        return success(prescriptionService.findGeneralDoctorInfo(generalDoctor));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.sendWlyyOutpatientMes)
    @ApiOperation(value = "发送i健康系统消息", notes = "发送i健康系统消息")
    public ObjEnvelop sendWlyyOutpatientMes(@ApiParam(name = "doctor", value = "全科医生Id")
@ -785,7 +783,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                            @RequestParam(value = "outPatientId", required = true)String outPatientId) {
        return success(wlyyBusinessService.sendWlyyOutpatientMes(doctor,outPatientId));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.readWlyyOutpatientMes)
    @ApiOperation(value = "设置I健康消息已读", notes = "设置I健康消息已读")
    public ObjEnvelop readWlyyOutpatientMes(@ApiParam(name = "outPatientId", value = "门诊id")
@ -797,10 +795,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getTodayOutpatinetList)
    @ApiOperation(value = "居民获取当日就诊列表", notes = "居民获取当日就诊列表")
    public ListEnvelop getTodayOutpatinetList(@ApiParam(name = "patient", value = "居民ID")
                                                  @RequestParam(value = "patient", required = true) String patient){
                                              @RequestParam(value = "patient", required = true) String patient){
        return success(prescriptionService.getTodayOutpatinetList(patient,wxId));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDoctorMapping)
    @ApiOperation(value = "获取医生mappingcode", notes = "获取医生mappingcode")
    public ObjEnvelop getDoctorMapping(@ApiParam(name = "doctor", value = "医生code")
@ -808,34 +806,41 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @ApiParam(name = "orgCode", value = "机构code")
                                       @RequestParam(value = "orgCode", required = true)String orgCode){
        return success(prescriptionService.getDoctorMapping(doctor,orgCode));
        
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getInspectionDictionary)
    @ApiOperation(value = "获取检查检验", notes = "获取检查检验")
    public ListEnvelop getInspectionDictionary(@ApiParam(name = "pyKey", value = "拼音码")
                                              @RequestParam(value = "pyKey", required = false)String pyKey,
                                              @ApiParam(name = "winNo", value = "6总部7金榜8夏禾")
                                              @RequestParam(value = "winNo", required = true)String winNo,
                                              @ApiParam(name = "codes", value = "检查检验收费码codes,用逗号分割")
                                              @RequestParam(value = "codes", required = false)String codes)throws Exception{
                                               @RequestParam(value = "pyKey", required = false)String pyKey,
                                               @ApiParam(name = "winNo", value = "6总部7金榜8夏禾")
                                               @RequestParam(value = "winNo", required = true)String winNo,
                                               @ApiParam(name = "codes", value = "检查检验收费码codes,用逗号分割")
                                               @RequestParam(value = "codes", required = false)String codes)throws Exception{
        return success(prescriptionService.getInspectionDictionary(pyKey,codes,winNo));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPrescriptionLogByPreId)
    @ApiOperation(value = "查询处方日志", notes = "查询处方日志")
    public ListEnvelop findPrescriptionLogByPreId(@ApiParam(name = "prescriptionCode", value = "处方code")
                                               @RequestParam(value = "prescriptionCode", required = true)String prescriptionCode)throws Exception{
                                                  @RequestParam(value = "prescriptionCode", required = true)String prescriptionCode)throws Exception{
        return success(prescriptionLogService.findPrescriptionLogByPreId(prescriptionCode));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByPrescriptionCodeByStatus)
    @ApiOperation(value = "查询处方流程", notes = "查询处方流程")
    public ListEnvelop findByPrescriptionCodeByStatus(@ApiParam(name = "prescriptionCode", value = "处方code")
                                                      @RequestParam(value = "prescriptionCode", required = true)String prescriptionCode)throws Exception{
        return success(prescriptionLogService.findByPrescriptionCodeByStatus(prescriptionCode));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByPartsCode)
    @ApiOperation(value = "查询部位字典", notes = "查询部位字典")
    public ListEnvelop findByPartsCode(@ApiParam(name = "parentCode", value = "父节点ID,第一层为0")
                                                  @RequestParam(value = "parentCode", required = true)String parentCode)throws Exception{
                                       @RequestParam(value = "parentCode", required = true)String parentCode)throws Exception{
        return success(inspectionService.findByPartsCode(parentCode));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDictByName)
    @ApiOperation(value = "查询检查检验字典", notes = "查询检查检验字典")
    public ListEnvelop findDictByName(@ApiParam(name = "hospital", value = "医院")
@ -844,7 +849,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "name", required = true)String name)throws Exception{
        return success(inspectionService.findDictByName(hospital,name));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getJymb)
    @ApiOperation(value = "检验模板接口")
    public ListEnvelop getJymb(@ApiParam(name = "bz_code", value = "入参条件为第一节点代码")
@ -855,7 +860,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                               @RequestParam(value = "flag",defaultValue = "1") String flag) throws Exception {
        return success(prescriptionService.getJymb(bz_code,tc_no,flag));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getJcmb)
    @ApiOperation(value = "检查模板接口")
    public ListEnvelop getJcmb(
@ -867,7 +872,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "flag",defaultValue = "1") String flag) throws Exception {
        return success(prescriptionService.getJcmb(bz_code,tc_no,flag));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getTcChild)
    @ApiOperation(value = "套餐子项目字典接口")
    public ListEnvelop getTcChild(
@ -875,7 +880,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "parent_code",defaultValue = "") String parent_code) throws Exception {
        return success(prescriptionService.getTcChild(parent_code));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getInsChild)
    @ApiOperation(value = "主项目绑定子项目字典接口")
    public ListEnvelop getInsChild(
@ -883,7 +888,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "zd_charge_code",defaultValue = "") String zd_charge_code) throws Exception {
        return success(prescriptionService.getInsChild(zd_charge_code));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getTcxz)
    @ApiOperation(value = "套餐选择接口")
    public ListEnvelop getTcxz(
@ -895,21 +900,21 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "flag",defaultValue = "1") String flag) throws Exception {
        return success(prescriptionService.getTcxz(charge_code,tc_no,flag));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDoctorPreSign)
    @ApiOperation(value = "获取医生签名")
    public ObjEnvelop getDoctorPreSign(@ApiParam(name = "doctor", value = "医生编码")
                                         @RequestParam(value = "doctor",required = false) String doctor)throws Exception{
                                       @RequestParam(value = "doctor",required = false) String doctor)throws Exception{
        return success(doctorPreSignService.getDoctorSign(doctor));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDoctorIntroduction)
    @ApiOperation(value = "获取医生简介")
    public ObjEnvelop getDoctorIntroduction(@ApiParam(name = "doctor", value = "医生编码")
                                            @RequestParam(value = "doctor",required = false) String doctor)throws Exception{
        return success(prescriptionService.getDoctorIntroduction(doctor));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByDict)
    @ApiOperation(value = "查询医院字典", notes = "查询医院字典")
    public ListEnvelop findByDict(@ApiParam(name = "name", value = "字典名称")
@ -922,17 +927,17 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getPatientAccetokenByIdcard)
    @ApiOperation(value = "根据居民CODE换取居民请求秘钥")
    public Envelop getPatientAccetokenByIdcard(@ApiParam(name = "patientCode", value = "居民CODE")
                                       @RequestParam(value = "patientCode",required = true) String patientCode)throws Exception{
                                               @RequestParam(value = "patientCode",required = true) String patientCode)throws Exception{
        return success(wlyyBusinessService.wlyyGetPatientAccetokenByIdcard(patientCode));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findWlyyPatient)
    @ApiOperation(value = "获取居民信息")
    public Envelop findWlyyPatient(@ApiParam(name = "idcard", value = "idcard")
                                               @RequestParam(value = "idcard",required = true) String idcard)throws Exception{
                                   @RequestParam(value = "idcard",required = true) String idcard)throws Exception{
        return success(wlyyBusinessService.findWlyyPatient(idcard));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientListBySscOrIdCard)
    @ApiOperation(value = "获取居民身份证信息")
    public Envelop findPatientListBySscOrIdCard(@ApiParam(name = "idcard", value = "idcard")
@ -947,11 +952,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
        return failed("身份证或医保卡格式有误");
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.makeBase64Qrcode)
    @ApiOperation(value = "获取医生二维码")
    public ObjEnvelop makeBase64Qrcode(@ApiParam(name = "doctor", value = "医生ID")
                                    @RequestParam(value = "doctor",required = true) String doctor)throws Exception{
                                       @RequestParam(value = "doctor",required = true) String doctor)throws Exception{
        return success("获取医生二维码成功",wlyyBusinessService.makeBase64Qrcode(doctor));
    }
    
@ -982,13 +987,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientid")!=null?consult.get("outpatientid").toString():null+"_12");
                    consult.put("type",type);
                }else{}
            
                
                array.add(consult);
            }
        }
        return success(array);
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.setRecord)
    @ApiOperation(value = "his建立档案与互联网医院账户同步")
    public Envelop setRecord(@ApiParam(name = "json", value = "档案实体json")
@ -997,7 +1002,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                             @RequestParam(value = "type",required = true)String type)throws Exception{
        return success(prescriptionService.setRecord(json,type));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientRecord)
    @ApiOperation(value = "获取HIIS居民档案信息")
    public Envelop findPatientRecord(@ApiParam(name = "idcard", value = "居民身份证")
@ -1010,7 +1015,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "ybcard",required = false)String ybcard)throws Exception{
        return success(prescriptionService.findPatientRecord(idcard,patient,admitNum,ybcard));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByName)
    @ApiOperation(value = "获取医生信息")
    public ListEnvelop findDoctorByName(@ApiParam(name = "hospital", value = "医院code")
@ -1021,7 +1026,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                        @RequestParam(value = "chargeType",required = false)String chargeType) {
        return success(prescriptionService.findDoctorByName(hospital,name,chargeType));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptWithDoctorWorkTime)
    @ApiOperation(value = "获取带排班部门")
    public ListEnvelop findDeptWithDoctorWorkTime(@ApiParam(name = "hospital", value = "医院code")
@ -1034,29 +1039,29 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                  @RequestParam(value = "pagesize",required = false)Integer pagesize) {
        return success(prescriptionService.findDeptWithDoctorWorkTime(hospital,keyWord,page,pagesize));
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.findWorkTimeRule)
    @ApiOperation(value = "查询排班规则")
    public ObjEnvelop findWorkTimeRule(@ApiParam(name = "hospital", value = "医院code")
                                       @RequestParam(value = "hospital",required = true)String hospital) {
        return success(workTimeService.findWorkTimeRule(hospital));
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.saveWorkTimeRule)
    @ApiOperation(value = "保存排班规则")
    public ObjEnvelop saveWorkTimeRule(@ApiParam(name = "workTimeRuleJson", value = "保存排班规则")
                                           @RequestParam(value = "workTimeRuleJson",required = true)String workTimeRuleJson) throws Exception{
                                       @RequestParam(value = "workTimeRuleJson",required = true)String workTimeRuleJson) throws Exception{
        return success(workTimeService.saveWorkTimeRule(workTimeRuleJson));
    }
    
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.checkDoctorWork)
    @ApiOperation(value = "判断医生是否在班")
    public ObjEnvelop checkDoctorWork(@ApiParam(name = "doctor", value = "判断医生是否在班")
                                      @RequestParam(value = "doctor",required = true)String doctor) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor));
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.importDoctorWork)
    @ApiOperation(value = "导入排班信息")
    public ListEnvelop importDoctorWork(@ApiParam(name = "file", value = "文件", required = true)
@ -1069,14 +1074,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        request.setCharacterEncoding("UTF-8");
        DoctorWorkTimeExcelReader reader = new DoctorWorkTimeExcelReader();
        reader.read(file);
        
        if("-1".equals(reader.getCode())) {
            ListEnvelop envelop = new ListEnvelop();
            envelop.setStatus(-1);
            envelop.setMessage("目前仅支持200位医生同时导入!");
            return envelop;
        }
        
        List<DoctorWorkTimeMainExcelDO> errorLs = reader.getErrorLs();
        List<DoctorWorkTimeMainExcelDO> correctLs = reader.getCorrectLs();
        if(errorLs!=null&&errorLs.size()>0){
@ -1086,12 +1091,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            envelop.setDetailModelList(errorLs);
            return envelop;
        }
        
        Map<String,Object> rs = workTimeService.getExcelWorkInfo(correctLs,dateMoth,hospital);
        List<DoctorWorkTimeMainExcelDO> error = (List<DoctorWorkTimeMainExcelDO>)rs.get("error");
        Integer errorTotal = (Integer) rs.get("errorTotal");
        Integer succTotal = (Integer) rs.get("succTotal");
        
        if(error!=null&&error.size()>0){
            ListEnvelop envelop = new ListEnvelop();
            envelop.setStatus(-1);
@ -1099,15 +1104,15 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            envelop.setDetailModelList(error);
            return envelop;
        }
        
        ListEnvelop envelop = new ListEnvelop();
        envelop.setStatus(200);
        envelop.setMessage("导入成功!"+succTotal+"位医生排班数据!");
        envelop.setDetailModelList(error);
        return envelop;
    }
    
    
    /**
     * 易联众统一支付
     * @param relationCode
@ -1127,8 +1132,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    /**
     * 查询支付状态
     * @param relationCode
@ -1146,8 +1151,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    /**
     * 易联众统一退款
     *
@ -1171,8 +1176,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    /**
     * 易联众统一订单查询
     *
@ -1194,29 +1199,29 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.selectPrescriptionList)
    @ApiOperation(value = "查询处方列表")
    public ListEnvelop findPrescriptionList(@ApiParam(name = "hospital", value = "医院code")
                                                  @RequestParam(value = "hospital",required = false)String hospital,
                                                  @ApiParam(name = "dept", value = "科室code")
                                                  @RequestParam(value = "dept",required = false)String dept,
                                                  @ApiParam(name = "status", value = "状态")
                                                  @RequestParam(value = "status",required = false)String status,
                                                  @ApiParam(name = "startTime", value = "开始时间")
                                                  @RequestParam(value = "startTime",required = false)String startTime,
                                                  @ApiParam(name = "endTime", value = "结束时间")
                                                  @RequestParam(value = "endTime",required = false)String endTime,
                                                  @ApiParam(name = "nameinfo", value = "医生名字/患者名字")
                                                  @RequestParam(value = "nameinfo",required = false)String nameinfo,
                                                  @ApiParam(name = "page", value = "第几页")
                                                  @RequestParam(value = "page",required = false)Integer page,
                                                  @ApiParam(name = "pagesize", value = "每页大小")
                                                  @RequestParam(value = "pagesize",required = false)Integer pagesize) {
                                            @RequestParam(value = "hospital",required = false)String hospital,
                                            @ApiParam(name = "dept", value = "科室code")
                                            @RequestParam(value = "dept",required = false)String dept,
                                            @ApiParam(name = "status", value = "状态")
                                            @RequestParam(value = "status",required = false)String status,
                                            @ApiParam(name = "startTime", value = "开始时间")
                                            @RequestParam(value = "startTime",required = false)String startTime,
                                            @ApiParam(name = "endTime", value = "结束时间")
                                            @RequestParam(value = "endTime",required = false)String endTime,
                                            @ApiParam(name = "nameinfo", value = "医生名字/患者名字")
                                            @RequestParam(value = "nameinfo",required = false)String nameinfo,
                                            @ApiParam(name = "page", value = "第几页")
                                            @RequestParam(value = "page",required = false)Integer page,
                                            @ApiParam(name = "pagesize", value = "每页大小")
                                            @RequestParam(value = "pagesize",required = false)Integer pagesize) {
        return success(prescriptionService.selectByCondition(hospital,dept,status,startTime,endTime,nameinfo,page,pagesize,wxId));
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.updateStatus)
    @ApiOperation("完成自取")
    public ObjEnvelop updateStatus(
@ -1231,7 +1236,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    /**
     * 更改单号
     * @param id
@ -1253,7 +1258,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    /**
     * 处方-- 审方
     *
@ -1268,51 +1273,109 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.prescriptionCheck)
    @ApiOperation("处方-审方")
    public ObjEnvelop prescriptionCheck(
            @ApiParam(name = "operate", value = "operate", required = true)
            @ApiParam(name = "operate", value = "审核人", required = true)
            @RequestParam(required = true)String operate,
            @ApiParam(name = "operateName", value = "operateName", required = true)
            @ApiParam(name = "operateName", value = "审核人名字", required = true)
            @RequestParam(required = true)String operateName,
            @ApiParam(name = "reason", value = "reason", required = true)
            @ApiParam(name = "reason", value = "审核原因", required = true)
            @RequestParam(required = true)String reason,
            @ApiParam(name = "status", value = "status", required = true)
            @ApiParam(name = "status", value = "0未审核1审核退回2审核通过", required = true)
            @RequestParam(required = true)Integer status,
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            //String operate,String operateName,String reason,Integer status,String prescriptionId
            WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO = prescriptionService.saveCheck(operate,operateName,reason,status,prescriptionId);
            try {
//                WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionService.
//                com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
//                msgObj.put("reason",zd_str);
//                msgObj.put("outpatientid",jl_str);
//                msgObj.put("prescriptionId",prescriptionId);
//                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outPatientId);
//                String immsg = imService.pushHuiZhenMsg(msgObj,wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getDoctorName(),outPatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
//                System.out.println("发送诊断消息成功:"+immsg);
            }catch (Exception e){
                System.out.println("发送诊断消息失败:"+e.getMessage());
//            e.printStackTrace();
            }
            return ObjEnvelop.getSuccess("ok",wlyyPrescriptionCheckDO);
            return ObjEnvelop.getSuccess("ok",prescriptionService.saveCheck(operate,operateName,reason,status,prescriptionId,wxId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    /**
     * 医生端-处方处理
     *
     * @param operate
     * @param reason
     * @param status
     * @param prescriptionId
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.savePrescriptionCheck)
    @ApiOperation("医生端-处方处理")
    public ObjEnvelop savePrescriptionCheck(
            @ApiParam(name = "operate", value = "操作人code", required = true)
            @RequestParam(required = true)String operate,
            @ApiParam(name = "reason", value = "处理原因", required = true)
            @RequestParam(required = true)String reason,
            @ApiParam(name = "status", value = "3处方修改4执行处方", required = true)
            @RequestParam(required = true)Integer status,
            @ApiParam(name = "prescriptionId", value = "处方id", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            //String operate,String operateName,String reason,Integer status,String prescriptionId
            return ObjEnvelop.getSuccess("ok",prescriptionService.savePrescriptionCheck(operate,reason,status,prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    /**
     * 查询审核历史记录
     *
     * @param prescriptionId
     * @return
     * @throws Exception
     */
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.prescriptionCheckList)
    @ApiOperation("查询审核历史记录")
    public ObjEnvelop prescriptionCheckList(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            
            return ObjEnvelop.getSuccess("ok",prescriptionService.findPrescriptionCheck(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    /**
     * 查询单条处方记录
     * @param prescriptionId
     * @return
     * @throws Exception
     */
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.selectByPrescriptionId)
    @ApiOperation("查询单条处方记录")
    public ObjEnvelop selectByPrescriptionId(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            
            return ObjEnvelop.getSuccess("ok",prescriptionService.selectByPrescriptionId(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.deleteById)
    @ApiOperation("医生端-逻辑删除业务数据")
    public ObjEnvelop deleteById(
            @ApiParam(name = "flag", value = "1药品2诊断3检查", required = true)
            @RequestParam(required = true)Integer flag,
            @ApiParam(name = "id", value = "业务id", required = true)
            @RequestParam(required = true)String id) throws Exception {
        try {
            prescriptionService.deleteById(flag,id);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
}