|
@ -702,4 +702,91 @@ public class PrescriptionStatusUpdateService {
|
|
}
|
|
}
|
|
return msgReturn;
|
|
return msgReturn;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void cancelRecieve(){
|
|
|
|
//将所有的已接诊的处方记录
|
|
|
|
List<WlyyOutpatientDO> outpatientDOs = outpatientDao.findByStatus();
|
|
|
|
if(outpatientDOs!=null&&outpatientDOs.size()>0){
|
|
|
|
System.out.println(outpatientDOs.get(0).getId()+"id______-");
|
|
|
|
for(WlyyOutpatientDO outpatientDO:outpatientDOs){
|
|
|
|
//结束门诊
|
|
|
|
outpatientDO.setStatus("3");
|
|
|
|
outpatientDO.setEndTime(new Date());
|
|
|
|
String consultCode ="";
|
|
|
|
try {
|
|
|
|
consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
|
|
|
|
logger.info("consultCode"+consultCode);
|
|
|
|
if(StringUtils.isNoneBlank(consultCode)){
|
|
|
|
imService.finish(consultCode,"admin",2);
|
|
|
|
}
|
|
|
|
}catch(Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
logger.info("自动结束咨询报错 consultCode: "+consultCode);
|
|
|
|
}
|
|
|
|
logger.info(outpatientDO.getId()+"的处方记录设置为结束");
|
|
|
|
}
|
|
|
|
outpatientDao.save(outpatientDOs);
|
|
|
|
//退费
|
|
|
|
for (WlyyOutpatientDO outpatientDO:outpatientDOs){
|
|
|
|
try {
|
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
|
|
|
|
if (businessOrderDO!=null){
|
|
|
|
if (businessOrderDO.getPayType()==1){
|
|
|
|
businessOrderService.orderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
|
|
|
|
}else if (businessOrderDO.getPayType()==3){
|
|
|
|
/*
|
|
|
|
businessOrderService.ylzOrderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
} } catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.info("setOutPatientOver count :"+outpatientDOs.size());
|
|
|
|
}else {
|
|
|
|
logger.info("setOutPatientOver count :"+0);
|
|
|
|
}
|
|
|
|
logger.info("setOutPatientOver end ");
|
|
|
|
}
|
|
|
|
public void cancelRecieveSingle(String outpatientId){
|
|
|
|
//将所有的已接诊的处方记录
|
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
|
|
|
|
if(outpatientDO!=null){
|
|
|
|
System.out.println(outpatientDO.getId()+"id______-");
|
|
|
|
//结束门诊
|
|
|
|
outpatientDO.setStatus("3");
|
|
|
|
outpatientDO.setEndTime(new Date());
|
|
|
|
String consultCode ="";
|
|
|
|
try {
|
|
|
|
consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
|
|
|
|
logger.info("consultCode"+consultCode);
|
|
|
|
if(StringUtils.isNoneBlank(consultCode)){
|
|
|
|
imService.finish(consultCode,"admin",2);
|
|
|
|
}
|
|
|
|
}catch(Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
logger.info("自动结束咨询报错 consultCode: "+consultCode);
|
|
|
|
}
|
|
|
|
logger.info(outpatientDO.getId()+"的处方记录设置为结束");
|
|
|
|
outpatientDao.save(outpatientDO);
|
|
|
|
//退费
|
|
|
|
try {
|
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
|
|
|
|
if (businessOrderDO!=null){
|
|
|
|
if (businessOrderDO.getPayType()==1){
|
|
|
|
businessOrderService.orderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
|
|
|
|
}else if (businessOrderDO.getPayType()==3){
|
|
|
|
/*
|
|
|
|
businessOrderService.ylzOrderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
} } catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
logger.info("setOutPatientOver count :"+0);
|
|
|
|
}
|
|
|
|
logger.info("setOutPatientOver end ");
|
|
|
|
}
|
|
}
|
|
}
|