|
@@ -20,6 +20,7 @@ import thyyxxk.webserver.utils.StringUtil;
|
|
|
import thyyxxk.webserver.utils.TokenUtil;
|
|
|
import thyyxxk.webserver.websocket.WebSocketServer;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -79,14 +80,18 @@ public class YzActOrderModifyService {
|
|
|
if (param.getList().size() > 100) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "一次性申请超过100条");
|
|
|
}
|
|
|
- for (TYzActOrderModify pojo : param.getList()) {
|
|
|
- //判断 这条医嘱是否已经存在了 如果有就执行 更新的操作 ,没有就插入
|
|
|
- if (dao.chaKansfCunZai(pojo.getActOrderNo()) == 0) {
|
|
|
- insertList.add(pojo);
|
|
|
+ List<BigDecimal> actOrderNoList = new ArrayList<>();
|
|
|
+ param.getList().forEach(item -> {
|
|
|
+ actOrderNoList.add(item.getActOrderNo());
|
|
|
+ });
|
|
|
+ List<BigDecimal> yiJingCunZai = dao.chaKansfCunZai(actOrderNoList);
|
|
|
+ param.getList().forEach(item -> {
|
|
|
+ if (yiJingCunZai.contains(item.getActOrderNo())) {
|
|
|
+ updateList.add(item);
|
|
|
} else {
|
|
|
- updateList.add(pojo);
|
|
|
+ insertList.add(item);
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
//执行批量插入
|
|
|
if (!insertList.isEmpty()) {
|
|
|
dao.yzActOrderModifyInsert(param, insertList);
|
|
@@ -128,7 +133,7 @@ public class YzActOrderModifyService {
|
|
|
public ResultVo<String> danGeShenQing(TYzActOrderModify param) {
|
|
|
param.setProposer(TokenUtil.getTokenUserId());
|
|
|
log.info("申请医嘱修改 --> 申请人:{},数据:{}", param.getProposer(), JSON.toJSONStringWithDateFormat(param, GetDateFormat.DATE_TIME));
|
|
|
- if (dao.chaKansfCunZai(param.getActOrderNo()) == 0) {
|
|
|
+ if (dao.chaKanDanGeShenQing(param.getActOrderNo()) == 0) {
|
|
|
dao.danGeShenQingInsert(param);
|
|
|
} else {
|
|
|
dao.danGeShenQingUpdate(param);
|