|
@ -9,10 +9,7 @@ import com.yihu.wlyy.service.common.util.CommonUtil;
|
|
|
import com.yihu.wlyy.service.common.util.DateUtil;
|
|
|
import com.yihu.wlyy.service.dao.*;
|
|
|
import com.yihu.wlyy.service.dao.prescription.*;
|
|
|
import com.yihu.wlyy.service.entity.Doctor;
|
|
|
import com.yihu.wlyy.service.entity.Hospital;
|
|
|
import com.yihu.wlyy.service.entity.Patient;
|
|
|
import com.yihu.wlyy.service.entity.SignFamily;
|
|
|
import com.yihu.wlyy.service.entity.*;
|
|
|
import com.yihu.wlyy.service.entity.prescription.*;
|
|
|
import com.yihu.wlyy.service.entity.prescription.VO.PrescriptionExpressageVO;
|
|
|
import com.yihu.wlyy.service.service.ZysoftBaseService;
|
|
@ -65,6 +62,8 @@ public class PrescriptionService extends ZysoftBaseService{
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private PrescriptionReviewedDao prescriptionReviewedDao;
|
|
|
@Autowired
|
|
|
private MessageDao messageDao;
|
|
|
|
|
|
@Value("${redisChannel.prescription}")
|
|
|
private String channelTopic;
|
|
@ -175,13 +174,30 @@ public class PrescriptionService extends ZysoftBaseService{
|
|
|
//保存新的药品
|
|
|
prescriptionInfoDao.save(infoList);
|
|
|
|
|
|
//发送系统消息
|
|
|
Message message = new Message();
|
|
|
message.setCzrq(new Date());
|
|
|
message.setCreateTime(new Date());
|
|
|
message.setContent("您有1个续方申请已在线下调整完成,请点击进行CA认证。");
|
|
|
message.setRead(1);//设置未读
|
|
|
message.setReceiver(prescription.getDoctor());//设置接受医生的code
|
|
|
message.setSender("系统");//设置发送的用户
|
|
|
message.setSenderName("system");
|
|
|
message.setCode(getCode());
|
|
|
message.setTitle("新增系统消息");
|
|
|
message.setType(9);
|
|
|
message.setReadonly(1);//是否只读消息
|
|
|
message.setOver("1");//未处理
|
|
|
message.setRelationCode(prescription.getCode());
|
|
|
messageDao.save(message);
|
|
|
|
|
|
// redis 的发布 {tilte:redisAddPrescription state: 1 ,//1:成功,2.失败 mes:'开方成功' prescription : "0001" //续方CODE }
|
|
|
JSONObject message = new JSONObject();
|
|
|
message.put("title","adjustPrescription");
|
|
|
message.put("state",1);
|
|
|
message.put("prescription",prescription.getCode());
|
|
|
message.put("mes","调整处方完成");
|
|
|
redisTemplate.convertAndSend(channelTopic,message.toString());
|
|
|
JSONObject redisMessage = new JSONObject();
|
|
|
redisMessage.put("title","adjustPrescription");
|
|
|
redisMessage.put("state",1);
|
|
|
redisMessage.put("prescription",prescription.getCode());
|
|
|
redisMessage.put("mes","调整处方完成");
|
|
|
redisTemplate.convertAndSend(channelTopic,redisMessage.toString());
|
|
|
}else {
|
|
|
//调整失败
|
|
|
prescription.setStatus(4);
|