|
@ -379,7 +379,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
totalSubFee = totalSubFee.add(fee);
|
|
|
}
|
|
|
wlyyDoorFeeDetailService.delete(idStrSet.toArray());
|
|
|
totalFee = orderDO.getTotalFee().subtract(totalSubFee);
|
|
|
// totalFee = orderDO.getTotalFee().subtract(totalSubFee);
|
|
|
// orderDO.setTotalFee(totalFee);
|
|
|
}
|
|
|
}
|
|
@ -1020,8 +1020,8 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
orderJson.put("conclusion",conclusionJson);
|
|
|
|
|
|
//获取上门前后开方详情
|
|
|
List<WlyyDoorPrescriptionDO> doorBeforePrescriptionDOList = doorPrescriptionDao.findByOrderIdAndIsAfterDoor(id, 1);
|
|
|
List<WlyyDoorPrescriptionDO> doorAfterPrescriptionDOList = doorPrescriptionDao.findByOrderIdAndIsAfterDoor(id, 2);
|
|
|
List<WlyyPrescriptionDO> doorBeforePrescriptionDOList = prescriptionDao.findByOrderIdAndIsAfterDoor(id, 1);
|
|
|
List<WlyyPrescriptionDO> doorAfterPrescriptionDOList = prescriptionDao.findByOrderIdAndIsAfterDoor(id, 2);
|
|
|
|
|
|
orderJson.put("doorBeforePrescription",doorBeforePrescriptionDOList);
|
|
|
orderJson.put("doorAfterPrescription", doorAfterPrescriptionDOList);
|
|
@ -2517,17 +2517,29 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
doorPrescriptionDao.save(prescription);
|
|
|
}else {
|
|
|
//判断手动输入的处方号是否被关联过
|
|
|
List<WlyyDoorPrescriptionDO> doorPrescriptionDOs = new ArrayList<>();
|
|
|
String[] recipeNoString = prescriptionCode.split(",");
|
|
|
for (int i = 0; i < recipeNoString.length; i++) {
|
|
|
//判断是否被工单手工关联过
|
|
|
List<WlyyDoorServiceOrderDO> orderDOList = wlyyDoorServiceOrderDao.findByPrescriptionCode("%" + recipeNoString[i] + "%");
|
|
|
/* //判断是否被工单手工关联过
|
|
|
List<WlyyDoorServiceOrderDO> orderDOList = wlyyDoorServiceOrderDao.findByPrescriptionCode("%" + recipeNoString[i] + "%");
|
|
|
WlyyDoorPrescriptionDO prescriptionDO = doorPrescriptionDao.findByRecipeNo(recipeNoString[i]);
|
|
|
if(orderDOList.size() > 0 || prescriptionDO != null){
|
|
|
res.put("status", -1);
|
|
|
res.put("msg", "处方号:" + recipeNoString[i] + "已被关联过,请重新输入");
|
|
|
return res;
|
|
|
}*/
|
|
|
//关联处方关系
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderList(recipeNoString[i]);
|
|
|
if(prescriptionDOList.size()>0){
|
|
|
WlyyDoorPrescriptionDO prescriptionDO = new WlyyDoorPrescriptionDO();
|
|
|
prescriptionDO.setOrderId(orderId);
|
|
|
prescriptionDO.setIsAfterDoor(1);
|
|
|
prescriptionDO.setCode(prescriptionDOList.get(0).getId());
|
|
|
doorPrescriptionDOs.add(prescriptionDO);
|
|
|
}
|
|
|
}
|
|
|
doorPrescriptionDao.save(doorPrescriptionDOs);
|
|
|
|
|
|
//上门前手动开方即更新工单的处方号
|
|
|
wlyyDoorServiceOrderDao.updatePrescriptionById(orderId, prescriptionCode, new Date());
|
|
|
WlyyDoorServiceOrderDO orderDO = wlyyDoorServiceOrderDao.findOne(orderId);
|
|
@ -2550,15 +2562,15 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
*/
|
|
|
public void savePrescription(String orderId,String prescriptionCode){
|
|
|
WlyyDoorServiceOrderDO orderDO = wlyyDoorServiceOrderDao.findOne(orderId);
|
|
|
orderDO.setPrescriptionCode(prescriptionCode);
|
|
|
orderDO.setPrescriptionTime(new Date());
|
|
|
orderDO.setPrescriptionStatus(1);
|
|
|
|
|
|
WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionCode);
|
|
|
if(prescriptionDO!=null){
|
|
|
orderDO.setOutpatientId(prescriptionDO.getOutpatientId());
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionCode);
|
|
|
if(wlyyPrescriptionDO!=null){
|
|
|
WlyyDoorPrescriptionDO prescriptionDO = new WlyyDoorPrescriptionDO();
|
|
|
prescriptionDO.setOrderId(orderId);
|
|
|
prescriptionDO.setIsAfterDoor(2);
|
|
|
prescriptionDO.setCode(prescriptionCode);
|
|
|
doorPrescriptionDao.save(prescriptionDO);
|
|
|
}
|
|
|
wlyyDoorServiceOrderDao.save(orderDO);
|
|
|
//非代预约才发送im消息
|
|
|
if(orderDO.getType() != null && orderDO.getType() != 3) {
|
|
|
//发送 预约卡片信息(2101类型)
|