|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.ListUtils;
|
|
|
import org.apache.ibatis.session.ExecutorType;
|
|
|
import org.apache.ibatis.session.SqlSession;
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
@@ -503,8 +504,12 @@ public class YiZhuLuRuServer {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.ERROR_MESSAGE, "请先选择患者.");
|
|
|
}
|
|
|
|
|
|
- List<BigDecimal> returnOrderList = new ArrayList<>();
|
|
|
XinZhenYiZhu patInfo = dao.queryPatientInfo(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
+ if (patInfo == null) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.ERROR_MESSAGE, "请先选择患者.");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<BigDecimal> returnOrderList = new ArrayList<>();
|
|
|
List<XinZhenYzActOrder> list = param.getList();
|
|
|
|
|
|
List<XinZhenYzActOrder> resList = new ArrayList<>();
|
|
@@ -581,7 +586,10 @@ public class YiZhuLuRuServer {
|
|
|
}
|
|
|
|
|
|
private void setTempInfo(CacheOnce<XinZhenYzActOrder> drug, XinZhenYzActOrder data, XinZhenYiZhu patInfo) {
|
|
|
- XinZhenYzActOrder feiYongXinXi = drug.get(data.getOrderCode().trim() + data.getSerial().trim() + data.getGroupNo().trim(), (temp) -> dao.drugDataOne(temp, patInfo.getZkWard()));
|
|
|
+ XinZhenYzActOrder feiYongXinXi = drug.get(
|
|
|
+ data.getOrderCode().trim() + data.getSerial().trim() + data.getGroupNo().trim(),
|
|
|
+ (temp) -> dao.drugDataOne(temp, patInfo.getZkWard())
|
|
|
+ );
|
|
|
YiZhuCheckData.calculateDrugAmount(data, feiYongXinXi);
|
|
|
}
|
|
|
|
|
@@ -1428,5 +1436,46 @@ public class YiZhuLuRuServer {
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "更新成功。");
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<JSONObject> copyTableOrder(XinZhenYiZhu param) {
|
|
|
+ if (StringUtil.isBlank(param.getInpatientNo())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.ERROR_MESSAGE, "请先选择患者.");
|
|
|
+ }
|
|
|
+
|
|
|
+ XinZhenYiZhu patInfo = dao.queryPatientInfo(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
+ if (patInfo == null) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.ERROR_MESSAGE, "请先选择患者.");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<XinZhenYzActOrder> list = param.getList();
|
|
|
+ Queue<BigDecimal> queue = new LinkedList<>();
|
|
|
+ // 保存 老 新 医嘱
|
|
|
+ Map<BigDecimal, BigDecimal> map = new HashMap<>();
|
|
|
+
|
|
|
+ for (XinZhenYzActOrder item : list) {
|
|
|
+ BigDecimal orderNo = publicServer.getActOrderNo();
|
|
|
+ queue.offer(orderNo);
|
|
|
+ map.put(item.getActOrderNo(), orderNo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ CacheOnce<XinZhenYzActOrder> drug = new CacheOnce<>();
|
|
|
+ List<BigDecimal> returnOrderList = new LinkedList<>();
|
|
|
+
|
|
|
+ String userCode = TokenUtil.getTokenUserId();
|
|
|
+
|
|
|
+ ListUtil.batchList(list, YiZhuLuRuDao.class, (mapper, item) -> {
|
|
|
+ setTempInfo(drug, item, patInfo);
|
|
|
+ item.setActOrderNo(queue.poll());
|
|
|
+ if (item.getParentNo() != null) {
|
|
|
+ item.setParentNo(map.get(item.getParentNo()));
|
|
|
+ }
|
|
|
+ returnOrderList.add(item.getActOrderNo());
|
|
|
+ mapper.insertEntryOrder(patInfo, item, userCode);
|
|
|
+ });
|
|
|
+
|
|
|
+ JSONObject js = getNewOrderData(returnOrderList);
|
|
|
+ return ResultVoUtil.success(js);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|