|
@ -341,7 +341,13 @@ public class PrescriptionService extends ZysoftBaseService{
|
|
|
|
|
|
Prescription prescription = prescriptionDao.findByVisitNoAndRecipeNo(orderNo,recipeNo);
|
|
|
if(prescription.getStatus().equals(PrescriptionLog.PrescriptionLogStatus.pay_success.getValue())){
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
|
|
|
|
|
|
if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
|
|
|
} else{
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
|
|
|
}
|
|
|
|
|
|
prescription.setDrugDeliveryTime(new Date());
|
|
|
prescriptionDao.save(prescription);
|
|
|
|
|
@ -356,44 +362,51 @@ public class PrescriptionService extends ZysoftBaseService{
|
|
|
log.setHospitalName(prescription.getHospitalName());
|
|
|
log.setUserName(prescription.getDoctorName());
|
|
|
log.setFlag(1);
|
|
|
log.setRemark("配药成功");
|
|
|
log.setUserCode(prescription.getDoctor());
|
|
|
log.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
|
|
|
prescriptionLogDao.save(log);
|
|
|
|
|
|
//健管师配送
|
|
|
PrescriptionExpressage expressage = prescriptionExpressageDao.findByPrescriptionCode(prescription.getCode());
|
|
|
if(StringUtils.isNotBlank(expressage.getExpressageCode())){
|
|
|
Message message = new Message();
|
|
|
message.setCzrq(new Date());
|
|
|
message.setCreateTime(new Date());
|
|
|
message.setRead(1);//设置未读
|
|
|
message.setOver("1");
|
|
|
message.setReceiver(expressage.getExpressageCode());
|
|
|
message.setSender("system");
|
|
|
message.setCode(getCode());
|
|
|
message.setSenderName("系统");
|
|
|
message.setTitle("居民"+prescription.getPatientName()+"的续方订单待取药");
|
|
|
message.setContent("您有一条新的续方订单待取药!");
|
|
|
message.setType(7);//续方订单待取药
|
|
|
message.setReadonly(1);//是否只读消息
|
|
|
message.setDel("1");
|
|
|
message.setRelationCode(prescription.getCode());
|
|
|
message.setPrescriptionStatus("0");//待取药
|
|
|
message.setData(prescription.getAdminTeamId()+"");
|
|
|
messageDao.save(message);
|
|
|
}
|
|
|
|
|
|
//判断提示健管师有续方代配送,居民待取药
|
|
|
JSONObject message = new JSONObject();
|
|
|
message.put("title","dispensingComplete");
|
|
|
message.put("state",1);
|
|
|
message.put("prescription",prescription.getCode());
|
|
|
message.put("mes","success");
|
|
|
if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
|
|
|
log.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
|
|
|
log.setRemark("快递配送:配药成功,配送中");
|
|
|
prescriptionLogDao.save(log);
|
|
|
} else{
|
|
|
log.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
|
|
|
log.setRemark("配药成功");
|
|
|
prescriptionLogDao.save(log);
|
|
|
|
|
|
//健管师配送
|
|
|
PrescriptionExpressage expressage = prescriptionExpressageDao.findByPrescriptionCode(prescription.getCode());
|
|
|
if(StringUtils.isNotBlank(expressage.getExpressageCode())){
|
|
|
Message message = new Message();
|
|
|
message.setCzrq(new Date());
|
|
|
message.setCreateTime(new Date());
|
|
|
message.setRead(1);//设置未读
|
|
|
message.setOver("1");
|
|
|
message.setReceiver(expressage.getExpressageCode());
|
|
|
message.setSender("system");
|
|
|
message.setCode(getCode());
|
|
|
message.setSenderName("系统");
|
|
|
message.setTitle("居民"+prescription.getPatientName()+"的续方订单待取药");
|
|
|
message.setContent("您有一条新的续方订单待取药!");
|
|
|
message.setType(7);//续方订单待取药
|
|
|
message.setReadonly(1);//是否只读消息
|
|
|
message.setDel("1");
|
|
|
message.setRelationCode(prescription.getCode());
|
|
|
message.setPrescriptionStatus("0");//待取药
|
|
|
message.setData(prescription.getAdminTeamId()+"");
|
|
|
messageDao.save(message);
|
|
|
}
|
|
|
|
|
|
//判断提示健管师有续方代配送,居民待取药
|
|
|
JSONObject message = new JSONObject();
|
|
|
message.put("title","dispensingComplete");
|
|
|
message.put("state",1);
|
|
|
message.put("prescription",prescription.getCode());
|
|
|
message.put("mes","success");
|
|
|
// redisTemplate.convertAndSend(channelTopic,message.toString());
|
|
|
// redisTemplate.watch(channelTopic);
|
|
|
redisTemplate.opsForList().leftPush(channelTopic,message.toString());
|
|
|
redisTemplate.opsForList().leftPush(channelTopic,message.toString());
|
|
|
// redisTemplate.unwatch();
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
error = "code:"+prescription.getCode()+",status:"+prescription.getStatus();
|
|
|
}
|