|
@@ -13,6 +13,7 @@ import thyyxxk.webserver.entity.medicaltechnology.MedicinePage;
|
|
|
import thyyxxk.webserver.entity.medicaltechnology.PoisonousAnesthetics;
|
|
|
import thyyxxk.webserver.service.PublicServer;
|
|
|
import thyyxxk.webserver.service.redislike.RedisLikeService;
|
|
|
+import thyyxxk.webserver.utils.ListUtil;
|
|
|
import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
import thyyxxk.webserver.utils.StringUtil;
|
|
|
import thyyxxk.webserver.utils.TokenUtil;
|
|
@@ -54,16 +55,30 @@ public class MedicineManagementService {
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<MedicinePage>> submitMedicinePages(FetchMedicines params) {
|
|
|
- if (StringUtil.isBlank(params.getChargeCodes())) {
|
|
|
+ if (ListUtil.isBlank(params.getChargeList())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "请勾选需要提交的药品。");
|
|
|
}
|
|
|
- int pageNo = publicService.getTheDrugListNo();
|
|
|
- dao.deleteExistTargetPageNo(pageNo);
|
|
|
transformDateToDatetime(params);
|
|
|
- params.setPageNo(pageNo);
|
|
|
- dao.insertNewPageNo(params);
|
|
|
- dao.submitMedicinePages(params);
|
|
|
- log.info("【操作员:{}】提交药品单:{}", TokenUtil.getTokenUserId(), params);
|
|
|
+ Map<String, String> deptChargeCodes = new HashMap<>();
|
|
|
+ for (MedicinePage page : params.getChargeList()) {
|
|
|
+ String execUnit = page.getExecUnit();
|
|
|
+ if (deptChargeCodes.containsKey(execUnit)) {
|
|
|
+ String tempVal = deptChargeCodes.get(page.getExecUnit()) + ",'" + page.getChargeCode() + "'";
|
|
|
+ deptChargeCodes.replace(execUnit, tempVal);
|
|
|
+ } else {
|
|
|
+ deptChargeCodes.put(execUnit, "'" + page.getChargeCode() + "'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (Map.Entry<String, String> entry : deptChargeCodes.entrySet()) {
|
|
|
+ params.setDept(entry.getKey());
|
|
|
+ params.setChargeCodes(entry.getValue());
|
|
|
+ int pageNo = publicService.getTheDrugListNo();
|
|
|
+ dao.deleteExistTargetPageNo(pageNo);
|
|
|
+ params.setPageNo(pageNo);
|
|
|
+ dao.insertNewPageNo(params);
|
|
|
+ dao.submitMedicinePages(params);
|
|
|
+ log.info("【操作员:{}】提交药品单:{}", TokenUtil.getTokenUserId(), params);
|
|
|
+ }
|
|
|
return ResultVoUtil.success(dao.selectMedicinePages(buildFetchPageNoQw(params)));
|
|
|
}
|
|
|
|