|
@@ -3,6 +3,7 @@ package thyyxxk.webserver.service.zhuyuanyisheng;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -449,18 +450,16 @@ public class YiZhuLuRuServer {
|
|
|
qw.eq("a.admiss_times", param.getAdmissTimes());
|
|
|
qw.eq("a.status_flag", "1");
|
|
|
|
|
|
- if (data.getParentNo() != null) {
|
|
|
- qw.and(
|
|
|
- wrapper -> wrapper.eq("a.act_order_no", data.getParentNo())
|
|
|
- .or()
|
|
|
- .eq("a.parent_no", data.getParentNo())
|
|
|
- );
|
|
|
- } else {
|
|
|
+ // 不是子节点,就需要查询是否存在子节点
|
|
|
+ if (data.getParentNo() == null) {
|
|
|
qw.and(wrapper -> wrapper.eq("a.act_order_no", param.getActOrderNo())
|
|
|
.or()
|
|
|
.eq("a.parent_no", param.getActOrderNo())
|
|
|
);
|
|
|
+ } else {
|
|
|
+ qw.eq("a.act_order_no", data.getParentNo());
|
|
|
}
|
|
|
+
|
|
|
qw.orderByAsc("a.act_order_no");
|
|
|
|
|
|
Map<String, Object> successMap = new HashMap<>();
|
|
@@ -1254,16 +1253,24 @@ public class YiZhuLuRuServer {
|
|
|
* @param param 主医嘱 和 多个子医嘱
|
|
|
* @return 返回数据
|
|
|
*/
|
|
|
- public ResultVo<String> associateOrders(XinZhenYiZhu param) {
|
|
|
+ public ResultVo<List<XinZhenYzActOrder>> associateOrders(XinZhenYiZhu param) {
|
|
|
log.info("数据:{}", JSON.toJSONString(param));
|
|
|
XinZhenYzActOrder order = dao.getActOrderNoOne(param.getActOrderNo());
|
|
|
if (order.getParentNo() != null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "操作失败,父医嘱不能为子医嘱。");
|
|
|
}
|
|
|
+ Set<BigDecimal> orderList = new HashSet<>();
|
|
|
+ orderList.add(order.getActOrderNo());
|
|
|
+
|
|
|
param.getAssociatedGroup().forEach(item -> {
|
|
|
dao.associateOrders(item, order);
|
|
|
+ orderList.add(item);
|
|
|
});
|
|
|
- return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "关联成功。");
|
|
|
+
|
|
|
+ QueryWrapper<?> qw = new QueryWrapper<>();
|
|
|
+ qw.in("a.act_order_no", orderList);
|
|
|
+
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "关联成功。", dao.selectOrderNo(qw));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1405,13 +1412,10 @@ public class YiZhuLuRuServer {
|
|
|
|
|
|
public ResultVo<List<ZyDetailCharge>> queryFeeByOrderNo(BigDecimal actOrderNo) {
|
|
|
XinZhenYzActOrder yz = dao.getActOrderNoOne(actOrderNo.stripTrailingZeros().toPlainString());
|
|
|
-
|
|
|
if (yz == null) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,"该医嘱未产生费用。");
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该医嘱未产生费用。");
|
|
|
}
|
|
|
-
|
|
|
List<ZyDetailCharge> feeList = dao.selectOrderFee(yz);
|
|
|
-
|
|
|
return ResultVoUtil.success(feeList);
|
|
|
}
|
|
|
|