Prechádzať zdrojové kódy

Merge branch 'dev-1.3.9' of wujunjie/patient-co-management into dev

trick9191 7 rokov pred
rodič
commit
04d54aa51f

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionLogDao.java

@ -14,4 +14,7 @@ public interface PrescriptionLogDao extends PagingAndSortingRepository<Prescript
    @Query(" from PrescriptionLog l where l.prescriptionCode=?1 and l.status in ?2 order by createTime desc")
    List<PrescriptionLog> findPrescriptionLogsByPrescriptionCode(String prescriptionCode, Integer[] types);
    @Query(" from PrescriptionLog l where l.prescriptionCode=?1 and l.status = ?2 ")
    List<PrescriptionLog> findByPrescriptionCodeAndStutas(String prescriptionCode, int status);
}

+ 6 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionLogService.java

@ -37,7 +37,12 @@ public class PrescriptionLogService extends BaseService {
     * @param userType 1 患者 2医生
     */
    public void addLog(Prescription prescription,Integer type,Integer flag,Integer userType){
        PrescriptionLog log = new PrescriptionLog();
        PrescriptionLog log = null;
        List<PrescriptionLog> prescriptionLogs = prescriptionLogDao.findByPrescriptionCodeAndStutas(prescription.getCode(),prescription.getStatus());
        if (prescriptionLogs == null || prescriptionLogs.size() ==0){
            log = new PrescriptionLog();
        }
        log = prescriptionLogDao.findOne(prescriptionLogs.get(0).getId());
        log.setStatus(prescription.getStatus());
        log.setType(type);
        log.setCode(getCode());