|  | @ -22,7 +22,7 @@ public class PrescriptionLogService extends BaseService {
 | 
	
		
			
				|  |  |      * 根据处方code 和 types查询处方的流程日志 时间倒叙
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param prescriptionCode 处方code
 | 
	
		
			
				|  |  |      * @param status            需要查询的status
 | 
	
		
			
				|  |  |      * @param status           需要查询的status
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public List<PrescriptionLog> findPrescriptionLogsByPrescriptionCode(String prescriptionCode, Integer[] status) {
 | 
	
	
		
			
				|  | @ -31,18 +31,20 @@ public class PrescriptionLogService extends BaseService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 添加日志
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param prescription
 | 
	
		
			
				|  |  |      * @param type 类型: 1智业对接 2易联众对接  3创建处方 4 审核  5付款 6 配送 7完成
 | 
	
		
			
				|  |  |      * @param flag 1成功 0失败
 | 
	
		
			
				|  |  |      * @param userType 1 患者 2医生
 | 
	
		
			
				|  |  |      * @param type         类型: 1智业对接 2易联众对接  3创建处方 4 审核  5付款 6 配送 7完成
 | 
	
		
			
				|  |  |      * @param flag         1成功 0失败
 | 
	
		
			
				|  |  |      * @param userType     1 患者 2医生
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void addLog(Prescription prescription,Integer type,Integer flag,Integer userType){
 | 
	
		
			
				|  |  |     public void addLog(Prescription prescription, Integer type, Integer flag, Integer userType) {
 | 
	
		
			
				|  |  |         PrescriptionLog log = null;
 | 
	
		
			
				|  |  |         List<PrescriptionLog> prescriptionLogs = prescriptionLogDao.findByPrescriptionCodeAndStutas(prescription.getCode(),prescription.getStatus());
 | 
	
		
			
				|  |  |         if (prescriptionLogs == null || prescriptionLogs.size() ==0){
 | 
	
		
			
				|  |  |         List<PrescriptionLog> prescriptionLogs = prescriptionLogDao.findByPrescriptionCodeAndStutas(prescription.getCode(), prescription.getStatus());
 | 
	
		
			
				|  |  |         if (prescriptionLogs == null || prescriptionLogs.size() == 0) {
 | 
	
		
			
				|  |  |             log = new PrescriptionLog();
 | 
	
		
			
				|  |  |         } else {
 | 
	
		
			
				|  |  |             log = prescriptionLogDao.findOne(prescriptionLogs.get(0).getId());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         log = prescriptionLogDao.findOne(prescriptionLogs.get(0).getId());
 | 
	
		
			
				|  |  |         log.setStatus(prescription.getStatus());
 | 
	
		
			
				|  |  |         log.setType(type);
 | 
	
		
			
				|  |  |         log.setCode(getCode());
 | 
	
	
		
			
				|  | @ -51,10 +53,10 @@ public class PrescriptionLogService extends BaseService {
 | 
	
		
			
				|  |  |         log.setHospital(prescription.getHospital());
 | 
	
		
			
				|  |  |         log.setHospitalName(prescription.getHospitalName());
 | 
	
		
			
				|  |  |         log.setPrescriptionCode(prescription.getCode());
 | 
	
		
			
				|  |  |         if(userType==1){
 | 
	
		
			
				|  |  |         if (userType == 1) {
 | 
	
		
			
				|  |  |             log.setUserCode(prescription.getParentCode());
 | 
	
		
			
				|  |  |             log.setUserName(prescription.getPatientName());
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |         } else {
 | 
	
		
			
				|  |  |             log.setUserCode(prescription.getDoctor());
 | 
	
		
			
				|  |  |             log.setUserName(prescription.getDoctorName());
 | 
	
		
			
				|  |  |         }
 |