浏览代码

Merge branch 'dev' of yeshijie/patient-co-management into dev

yeshijie 7 年之前
父节点
当前提交
a22fb9b663

+ 2 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -131,9 +131,9 @@ public class PrescriptionService extends BaseService {
                    message.setRead(1);//设置未读
                    message.setOver("1");
                    message.setReceiver(expressage.getExpressageCode());
                    message.setSender("system");
                    message.setSender(prescription.getPatient());
                    message.setCode(getCode());
                    message.setSenderName("系统");
                    message.setSenderName(prescription.getPatientName());
                    message.setTitle("居民"+prescription.getPatientName()+"的续方订单待取药");
                    message.setContent("您有一条新的续方订单待取药!");
                    message.setType(7);//续方订单待取药

+ 6 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -946,6 +946,12 @@ public class ConsultTeamService extends ConsultService {
            if(signFamily==null){
                return -2;
            }
            String checkPre = prescriptionInfoService.checkPre(patient,DateUtil.getStringDateShort()+" 00:00:00");
            if("0".equals(checkPre)){//存在未结算的续方
                return -3;
            }
            Doctor doctor = doctorDao.findByCode(doctorCode);
            // 查询患者信息
            Patient p = patientDao.findByCode(patient);

+ 16 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -1138,6 +1138,22 @@ public class PrescriptionInfoService extends BaseService {
        }
    }
    /**
     * 判断丹田
     * @param patient
     * @param currentDay
     * @return
     */
    public String checkPre(String patient,String currentDay){
        StringBuffer sql = new StringBuffer("SELECT code from wlyy_prescription WHERE patient = ? and `status`> "+PrescriptionLog.PrescriptionLogStatus.revieweding.getValue()+" and create_time>? and jw_pay_status = '0'");
        List<Map<String, Object>> mp = jdbcTemplate.queryForList(sql.toString(), patient,currentDay);
        if (mp != null && mp.size() > 0) {
            return "0";
        } else {
            return "1";
        }
    }
    public String presCheckStateObj(String code) {
        StringBuffer sql = new StringBuffer(" SELECT pr.code FROM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND pr.status >= " + PrescriptionLog.PrescriptionLogStatus.revieweding.getValue() + " AND pr.status < " + PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
        List<Map<String, Object>> mp = jdbcTemplate.queryForList(sql.toString(), code);

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -999,6 +999,8 @@ public class ConsultController extends WeixinBaseController {
                return error(-1, "该处方存在未审核的续方,无法进行续方咨询!");
            } if (res == -2) {
                return error(-1, "您还未签约,不能发起续方咨询!");
            } if (res == -3) {
                return error(-1, "您当天有未完成的续方,不能发起续方咨询!");
            }
//            Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor());