|
@@ -83,27 +83,35 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
|
|
|
*/
|
|
|
@Override
|
|
|
public PageUtils queryList(Integer current, Integer pageSize, String dateTime, String responsibilityCode, String accountCode, Long hospId) {
|
|
|
+ // 先检验当前年月是否存在数据
|
|
|
int year = 0;
|
|
|
int month = 0;
|
|
|
+ Date date = DateUtils.StringToDate(dateTime, DateStyleEnum.YYYY_MM);
|
|
|
if (StrUtil.isNotBlank(dateTime)) {
|
|
|
- year = DateUtils.getYear(dateTime);
|
|
|
- month = DateUtils.getMonth(dateTime);
|
|
|
+ year = DateUtil.year(date);
|
|
|
+ month = DateUtil.month(date) + 1;
|
|
|
}
|
|
|
Page<CostIncomeGroup> costIncomeGroupPage = new Page<>(current, pageSize);
|
|
|
Page<CostIncomeGroup> pages = this.page(costIncomeGroupPage, new QueryWrapper<CostIncomeGroup>().lambda()
|
|
|
.eq(Objects.nonNull(hospId), CostIncomeGroup::getHospId, hospId)
|
|
|
.eq(!NumberConstant.ZERO.equals(year), CostIncomeGroup::getDateYear, year)
|
|
|
- .eq(!NumberConstant.ONE.equals(month), CostIncomeGroup::getDateMonth, month)
|
|
|
+ .eq(!NumberConstant.ZERO.equals(month), CostIncomeGroup::getDateMonth, month)
|
|
|
.and(StrUtil.isNotBlank(responsibilityCode), i -> i.like(CostIncomeGroup::getOpenResponsibilityCode, responsibilityCode)
|
|
|
.or().like(CostIncomeGroup::getStartResponsibilityCode, responsibilityCode))
|
|
|
.like(StrUtil.isNotBlank(accountCode), CostIncomeGroup::getAccountCode, accountCode));
|
|
|
List<CostIncomeGroup> records = pages.getRecords();
|
|
|
List<CostIncomeGroupBeforeVO> costIncomeGroupBeforeVOList = BeanUtil.convertList(records, CostIncomeGroupBeforeVO.class);
|
|
|
+ if (CollectionUtils.isEmpty(costIncomeGroupBeforeVOList)){
|
|
|
+ PageUtils pageUtils = new PageUtils(pages);
|
|
|
+ pageUtils.setList(null);
|
|
|
+ pageUtils.setTotalAmount(new BigDecimal(0.0000));
|
|
|
+ return pageUtils;
|
|
|
+ }
|
|
|
// 查询所有的责任中心 科室 会计科目 成本项目的数据 处理名字
|
|
|
- // TODO 修改直接获取名字
|
|
|
- setCodeName(hospId, costIncomeGroupBeforeVOList);
|
|
|
+ setCodeName(costIncomeGroupBeforeVOList);
|
|
|
// 进行金额合并
|
|
|
- List<CostIncomeGroupAllAmountVO> costIncomeGroupAllAmountVoS = baseMapper.countMoney(costIncomeGroupBeforeVOList);
|
|
|
+ List<Long> idList = costIncomeGroupBeforeVOList.stream().map(CostIncomeGroupBeforeVO::getId).collect(Collectors.toList());
|
|
|
+ List<CostIncomeGroupAllAmountVO> costIncomeGroupAllAmountVoS = baseMapper.countMoney(idList);
|
|
|
// 对,的金额进行合并
|
|
|
AtomicReference<BigDecimal> totalAmount = new AtomicReference<>(new BigDecimal("0.0000"));
|
|
|
costIncomeGroupAllAmountVoS.forEach(i -> {
|
|
@@ -310,10 +318,11 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
|
|
|
*/
|
|
|
private void checkImportData(List<List<Object>> list, List<IncomeErrorMessage> incomeErrorMessageList, List<CostIncomeGroup> costIncomeGroupArrayList, Map<String, Department> departmentMap, Map<String, Product> productMap, Map<Long, Responsibility> responsibilityMap, Map<Long, Accounting> accountingMap, Map<Long, Long> responsibilityDepMap, Map<Long, Long> accountProMap, Long hospId, Integer year, Integer month) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
+ int row = i + 5;
|
|
|
CostIncomeGroup costIncomeGroup = new CostIncomeGroup();
|
|
|
AfterIncomegroup afterIncomegroup = new AfterIncomegroup();
|
|
|
// 用来检验数据合理性的循环
|
|
|
- IncomeErrorMessage incomeErrorMessage = new IncomeErrorMessage();
|
|
|
+
|
|
|
List<Object> data = list.get(i);
|
|
|
log.info("用户输入的数据是{}", data);
|
|
|
// 成本项目的代码和名称
|
|
@@ -324,15 +333,15 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
|
|
|
String openDepartmentCode = data.get(3).toString();
|
|
|
String startDepartmentName = data.get(4).toString();
|
|
|
String startDepartmentCode = data.get(5).toString();
|
|
|
- BigDecimal beforeMoney = BigDecimal.valueOf(Double.parseDouble(data.get(15).toString()));
|
|
|
+ BigDecimal beforeMoney = BigDecimal.valueOf(Double.parseDouble(("0".equals(data.get(15).toString()) || StrUtil.isBlank(data.get(15).toString())) ?"0.00":data.get(15).toString()));
|
|
|
boolean checkNull = StrUtil.isBlank(data.get(15).toString());
|
|
|
- boolean checkOne = NumberConstant.ZERO.equals(data.get(15).toString());
|
|
|
+ boolean checkOne = "0".equals(data.get(15).toString());
|
|
|
if (checkNull || checkOne) {
|
|
|
// 要求这一行的数据必须全部填写
|
|
|
for (int j = 0; j < NumberConstant.FIVE; j++) {
|
|
|
if (Objects.isNull(data.get(j))) {
|
|
|
+ IncomeErrorMessage incomeErrorMessage = new IncomeErrorMessage();
|
|
|
incomeErrorMessage.setTotal(i);
|
|
|
- int row = i + 1;
|
|
|
int column = j + 1;
|
|
|
incomeErrorMessage.setErrMessage("第{" + row + "}行第{" + column + "}列数据为空");
|
|
|
incomeErrorMessageList.add(incomeErrorMessage);
|
|
@@ -343,99 +352,99 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
|
|
|
Product product = productMap.get(productCode + productName);
|
|
|
Department department = departmentMap.get(openDepartmentCode + openDepartmentName);
|
|
|
Department department1 = departmentMap.get(startDepartmentCode + startDepartmentName);
|
|
|
- if (!checkNull && !checkOne) {
|
|
|
- if (StrUtil.isNotBlank(productCode) && StrUtil.isNotBlank(productName)) {
|
|
|
- if (Objects.isNull(product)) {
|
|
|
- incomeErrorMessage.setTotal(i);
|
|
|
- incomeErrorMessage.setErrMessage("代码:" + productCode + " 名称:" + productName + "成本项目不存在");
|
|
|
+ if (StrUtil.isNotBlank(productCode) && StrUtil.isNotBlank(productName)) {
|
|
|
+ if (Objects.isNull(product)) {
|
|
|
+ IncomeErrorMessage incomeErrorMessage = new IncomeErrorMessage();
|
|
|
+ incomeErrorMessage.setTotal(row);
|
|
|
+ incomeErrorMessage.setErrMessage("成本项目代码:" + productCode + " 名称:" + productName + "不存在");
|
|
|
+ incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
+ } else {
|
|
|
+ // 检验对应的会计科目是否存在
|
|
|
+ Long id = product.getId();
|
|
|
+ Long accountId = accountProMap.get(id);
|
|
|
+ if (Objects.isNull(accountingMap.get(accountId))) {
|
|
|
+ IncomeErrorMessage incomeErrorMessage = new IncomeErrorMessage();
|
|
|
+ incomeErrorMessage.setTotal(row);
|
|
|
+ incomeErrorMessage.setErrMessage("成本项目代码:" + productCode + " 名称:" + productName + "对应的会计科目不存在");
|
|
|
incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
} else {
|
|
|
- // 检验对应的会计科目是否存在
|
|
|
- Long id = product.getId();
|
|
|
- Long accountId = accountProMap.get(id);
|
|
|
- if (Objects.isNull(accountingMap.get(accountId))) {
|
|
|
- incomeErrorMessage.setTotal(i);
|
|
|
- incomeErrorMessage.setErrMessage("代码:" + productCode + " 名称:" + productName + "成本项目对应的会计科目不存在");
|
|
|
- incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
- } else {
|
|
|
- costIncomeGroup.setProductCode(productCode);
|
|
|
- costIncomeGroup.setProductName(productName);
|
|
|
- costIncomeGroup.setAccountCode(accountingMap.get(accountId).getAccountingCode());
|
|
|
- costIncomeGroup.setAccountName(accountingMap.get(accountId).getAccountingName());
|
|
|
- }
|
|
|
+ costIncomeGroup.setProductCode(productCode);
|
|
|
+ costIncomeGroup.setProductName(productName);
|
|
|
+ costIncomeGroup.setAccountCode(accountingMap.get(accountId).getAccountingCode());
|
|
|
+ costIncomeGroup.setAccountName(accountingMap.get(accountId).getAccountingName());
|
|
|
}
|
|
|
- } else {
|
|
|
- costIncomeGroup.setProductCode(null);
|
|
|
- costIncomeGroup.setProductName(null);
|
|
|
- costIncomeGroup.setAccountCode(null);
|
|
|
- costIncomeGroup.setAccountName(null);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ costIncomeGroup.setProductCode(null);
|
|
|
+ costIncomeGroup.setProductName(null);
|
|
|
+ costIncomeGroup.setAccountCode(null);
|
|
|
+ costIncomeGroup.setAccountName(null);
|
|
|
}
|
|
|
// 检验开单科室
|
|
|
- if (!checkNull && !checkOne) {
|
|
|
- if (StrUtil.isNotBlank(openDepartmentCode) && StrUtil.isNotBlank(openDepartmentName)) {
|
|
|
- // 开单科室
|
|
|
- if (Objects.isNull(department)) {
|
|
|
- incomeErrorMessage.setTotal(i);
|
|
|
- incomeErrorMessage.setErrMessage("代码:" + productCode + " 名称:" + productName + "开单科室不存在");
|
|
|
+ if (StrUtil.isNotBlank(openDepartmentCode) && StrUtil.isNotBlank(openDepartmentName)) {
|
|
|
+ // 开单科室
|
|
|
+ if (Objects.isNull(department)) {
|
|
|
+ IncomeErrorMessage incomeErrorMessage = new IncomeErrorMessage();
|
|
|
+ incomeErrorMessage.setTotal(row);
|
|
|
+ incomeErrorMessage.setErrMessage("开单科室代码:" + openDepartmentCode + " 科室名称:" + openDepartmentName + "不存在");
|
|
|
+ incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
+ } else {
|
|
|
+ Long id = department.getId();
|
|
|
+ Long responsibilityId = responsibilityDepMap.get(id);
|
|
|
+ if (Objects.isNull(responsibilityMap.get(responsibilityId))) {
|
|
|
+ IncomeErrorMessage incomeErrorMessage = new IncomeErrorMessage();
|
|
|
+ incomeErrorMessage.setTotal(row);
|
|
|
+ incomeErrorMessage.setErrMessage("开单科室代码代码:" + openDepartmentCode + " 科室名称:" + openDepartmentName + "对应的责任中心不存在");
|
|
|
incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
} else {
|
|
|
- Long id = department.getId();
|
|
|
- Long responsibilityId = responsibilityDepMap.get(id);
|
|
|
- if (Objects.isNull(responsibilityMap.get(responsibilityId))) {
|
|
|
- incomeErrorMessage.setTotal(i);
|
|
|
- incomeErrorMessage.setErrMessage("代码:" + openDepartmentCode + " 名称:" + openDepartmentName + "科室对应的责任中心不存在");
|
|
|
- incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
- } else {
|
|
|
- Responsibility responsibility = responsibilityMap.get(responsibilityId);
|
|
|
- costIncomeGroup.setOpenDepartmentCode(openDepartmentCode);
|
|
|
- costIncomeGroup.setOpenDepartmentName(openDepartmentName);
|
|
|
- costIncomeGroup.setOpenResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
- costIncomeGroup.setOpenResponsibilityName(responsibility.getResponsibilityName());
|
|
|
- afterIncomegroup.setOpenDepartmentCode(openDepartmentCode);
|
|
|
- afterIncomegroup.setOpenDepartmentName(openDepartmentName);
|
|
|
- afterIncomegroup.setOpenDepartmentStatus(responsibility.getResponsibilityType());
|
|
|
- }
|
|
|
+ Responsibility responsibility = responsibilityMap.get(responsibilityId);
|
|
|
+ costIncomeGroup.setOpenDepartmentCode(openDepartmentCode);
|
|
|
+ costIncomeGroup.setOpenDepartmentName(openDepartmentName);
|
|
|
+ costIncomeGroup.setOpenResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
+ costIncomeGroup.setOpenResponsibilityName(responsibility.getResponsibilityName());
|
|
|
+ afterIncomegroup.setOpenDepartmentCode(openDepartmentCode);
|
|
|
+ afterIncomegroup.setOpenDepartmentName(openDepartmentName);
|
|
|
+ afterIncomegroup.setOpenDepartmentStatus(responsibility.getResponsibilityType());
|
|
|
}
|
|
|
- } else {
|
|
|
- costIncomeGroup.setOpenDepartmentCode(null);
|
|
|
- costIncomeGroup.setOpenDepartmentName(null);
|
|
|
- costIncomeGroup.setOpenResponsibilityCode(null);
|
|
|
- costIncomeGroup.setOpenResponsibilityName(null);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ costIncomeGroup.setOpenDepartmentCode(null);
|
|
|
+ costIncomeGroup.setOpenDepartmentName(null);
|
|
|
+ costIncomeGroup.setOpenResponsibilityCode(null);
|
|
|
+ costIncomeGroup.setOpenResponsibilityName(null);
|
|
|
}
|
|
|
// 检验执行科室
|
|
|
- if (!checkNull && !checkOne) {
|
|
|
- if (StrUtil.isNotBlank(startDepartmentCode) && StrUtil.isNotBlank(startDepartmentName)) {
|
|
|
- //执行科室
|
|
|
- if (Objects.isNull(department1)) {
|
|
|
- incomeErrorMessage.setTotal(i);
|
|
|
- incomeErrorMessage.setErrMessage("代码:" + productCode + " 名称:" + productName + "执行科室不存在");
|
|
|
+ if (StrUtil.isNotBlank(startDepartmentCode) && StrUtil.isNotBlank(startDepartmentName)) {
|
|
|
+ //执行科室
|
|
|
+ if (Objects.isNull(department1)) {
|
|
|
+ IncomeErrorMessage incomeErrorMessage = new IncomeErrorMessage();
|
|
|
+ incomeErrorMessage.setTotal(row);
|
|
|
+ incomeErrorMessage.setErrMessage("执行科室代码:" + startDepartmentCode + " 科室名称:" + startDepartmentName + "科室不存在");
|
|
|
+ incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
+ } else {
|
|
|
+ Long id = department1.getId();
|
|
|
+ Long responsibilityId = responsibilityDepMap.get(id);
|
|
|
+ if (Objects.isNull(responsibilityMap.get(responsibilityId))) {
|
|
|
+ IncomeErrorMessage incomeErrorMessage = new IncomeErrorMessage();
|
|
|
+ incomeErrorMessage.setTotal(row);
|
|
|
+ incomeErrorMessage.setErrMessage("执行科室代码:" + openDepartmentCode + " 名称:" + openDepartmentName + "对应的责任中心不存在");
|
|
|
incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
} else {
|
|
|
- Long id = department1.getId();
|
|
|
- Long responsibilityId = responsibilityDepMap.get(id);
|
|
|
- if (Objects.isNull(responsibilityMap.get(responsibilityId))) {
|
|
|
- incomeErrorMessage.setTotal(i);
|
|
|
- incomeErrorMessage.setErrMessage("代码:" + openDepartmentCode + " 名称:" + openDepartmentName + "科室对应的责任中心不存在");
|
|
|
- incomeErrorMessageList.add(incomeErrorMessage);
|
|
|
- } else {
|
|
|
- Responsibility responsibility = responsibilityMap.get(responsibilityId);
|
|
|
- costIncomeGroup.setStartDepartmentCode(startDepartmentCode);
|
|
|
- costIncomeGroup.setStartDepartmentName(startDepartmentName);
|
|
|
- costIncomeGroup.setStartResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
- costIncomeGroup.setStartResponsibilityName(responsibility.getResponsibilityName());
|
|
|
- afterIncomegroup.setStartDepartmentCode(startDepartmentCode);
|
|
|
- afterIncomegroup.setStartDepartmentName(startDepartmentName);
|
|
|
- afterIncomegroup.setStartDepartmentStatus(responsibility.getResponsibilityType());
|
|
|
- }
|
|
|
+ Responsibility responsibility = responsibilityMap.get(responsibilityId);
|
|
|
+ costIncomeGroup.setStartDepartmentCode(startDepartmentCode);
|
|
|
+ costIncomeGroup.setStartDepartmentName(startDepartmentName);
|
|
|
+ costIncomeGroup.setStartResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
+ costIncomeGroup.setStartResponsibilityName(responsibility.getResponsibilityName());
|
|
|
+ afterIncomegroup.setStartDepartmentCode(startDepartmentCode);
|
|
|
+ afterIncomegroup.setStartDepartmentName(startDepartmentName);
|
|
|
+ afterIncomegroup.setStartDepartmentStatus(responsibility.getResponsibilityType());
|
|
|
}
|
|
|
- } else {
|
|
|
- costIncomeGroup.setStartDepartmentCode(null);
|
|
|
- costIncomeGroup.setStartDepartmentName(null);
|
|
|
- costIncomeGroup.setStartResponsibilityCode(null);
|
|
|
- costIncomeGroup.setStartResponsibilityName(null);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ costIncomeGroup.setStartDepartmentCode(null);
|
|
|
+ costIncomeGroup.setStartDepartmentName(null);
|
|
|
+ costIncomeGroup.setStartResponsibilityCode(null);
|
|
|
+ costIncomeGroup.setStartResponsibilityName(null);
|
|
|
}
|
|
|
costIncomeGroup.setDoctorNumber(Long.parseLong(data.get(6).toString())).setDoctorName(data.get(7).toString())
|
|
|
.setPatientId(Long.parseLong(data.get(8).toString())).setOutpatientId(Long.parseLong(data.get(9).toString()))
|
|
@@ -451,46 +460,55 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
|
|
|
costIncomeGroup.setDateMonth(month);
|
|
|
costIncomeGroup.setAmount(beforeMoney);
|
|
|
// 检验数据
|
|
|
- Integer openDepartmentStatus = afterIncomegroup.getOpenDepartmentStatus();
|
|
|
- Integer startDepartmentStatus = afterIncomegroup.getStartDepartmentStatus();
|
|
|
- if (Objects.nonNull(openDepartmentStatus) && Objects.nonNull(startDepartmentStatus)) {
|
|
|
- Map<String, CostIncomeGroupSet> incomeGroupSetMap = costIncomeGroupSetService.list(new QueryWrapper<CostIncomeGroupSet>().lambda().eq(CostIncomeGroupSet::getHospId, hospId)).stream().collect(Collectors.toMap(k -> k.getOpenDepartmentStatus().toString() + k.getStartDepartmentStatus().toString(), synOe -> synOe));
|
|
|
- CostIncomeGroupSet costIncomeGroupSet = incomeGroupSetMap.get(openDepartmentStatus.toString() + startDepartmentStatus.toString());
|
|
|
- if (Objects.nonNull(costIncomeGroupSet)) {
|
|
|
- Map<String, Responsibility> map = responsibilityService.list(new QueryWrapper<Responsibility>().lambda().eq(Responsibility::getHospId, hospId)).stream().collect(Collectors.toMap(Responsibility::getResponsibilityCode, synOe -> synOe));
|
|
|
- // 开单科室比例
|
|
|
- BigDecimal openDepartmentProportion = new BigDecimal(costIncomeGroupSet.getOpenDepartmentProportion().toString());
|
|
|
- // 执行科室比例
|
|
|
- BigDecimal startDepartmentProportion = new BigDecimal(costIncomeGroupSet.getStartDepartmentProportion().toString());
|
|
|
- // beforeMoney
|
|
|
- afterIncomegroup.setOpenDepartmentDecimal(beforeMoney.multiply(openDepartmentProportion).divide(new BigDecimal(100), 4, BigDecimal.ROUND_HALF_UP));
|
|
|
- afterIncomegroup.setStartDepartmentDecimal(beforeMoney.multiply(startDepartmentProportion).divide(new BigDecimal(100), 4, BigDecimal.ROUND_HALF_UP));
|
|
|
- String responsibilityCodes = costIncomeGroupSet.getResponsibilityCodes();
|
|
|
- if (NumberConstant.TWO.equals(costIncomeGroupSet.getOpenDepartmentStatus()) && NumberConstant.TWO.equals(costIncomeGroupSet.getStartDepartmentStatus()) && StrUtil.isNotBlank(responsibilityCodes)) {
|
|
|
- // /拼接的
|
|
|
- afterIncomegroup.setDirectStatus(NumberConstant.TWO);
|
|
|
- String responsibilityCode = responsibilityCodes.split(StrUtil.SLASH)[responsibilityCodes.split(StrUtil.SLASH).length - 1];
|
|
|
- Responsibility responsibility = map.get(responsibilityCode);
|
|
|
- if (Objects.nonNull(responsibility)) {
|
|
|
- afterIncomegroup.setResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
- afterIncomegroup.setResponsibilityName(responsibility.getResponsibilityName());
|
|
|
- }
|
|
|
- costIncomeGroup.setAfterIncomeGroup(JSON.toJSONString(afterIncomegroup));
|
|
|
+ getAfterData(hospId, costIncomeGroup, afterIncomegroup, beforeMoney);
|
|
|
+ costIncomeGroupArrayList.add(costIncomeGroup);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 封装需要的数据
|
|
|
+ * @param hospId
|
|
|
+ * @param costIncomeGroup
|
|
|
+ * @param afterIncomegroup
|
|
|
+ * @param beforeMoney
|
|
|
+ */
|
|
|
+ private void getAfterData(Long hospId, CostIncomeGroup costIncomeGroup, AfterIncomegroup afterIncomegroup, BigDecimal beforeMoney) {
|
|
|
+ Integer openDepartmentStatus = afterIncomegroup.getOpenDepartmentStatus();
|
|
|
+ Integer startDepartmentStatus = afterIncomegroup.getStartDepartmentStatus();
|
|
|
+ if (Objects.nonNull(openDepartmentStatus) && Objects.nonNull(startDepartmentStatus)) {
|
|
|
+ Map<String, CostIncomeGroupSet> incomeGroupSetMap = costIncomeGroupSetService.list(new QueryWrapper<CostIncomeGroupSet>().lambda().eq(CostIncomeGroupSet::getHospId, hospId)).stream().collect(Collectors.toMap(k -> k.getOpenDepartmentStatus().toString() + k.getStartDepartmentStatus().toString(), synOe -> synOe));
|
|
|
+ CostIncomeGroupSet costIncomeGroupSet = incomeGroupSetMap.get(openDepartmentStatus.toString() + startDepartmentStatus.toString());
|
|
|
+ if (Objects.nonNull(costIncomeGroupSet)) {
|
|
|
+ Map<String, Responsibility> map = responsibilityService.list(new QueryWrapper<Responsibility>().lambda().eq(Responsibility::getHospId, hospId)).stream().collect(Collectors.toMap(Responsibility::getResponsibilityCode, synOe -> synOe));
|
|
|
+ // 开单科室比例
|
|
|
+ BigDecimal openDepartmentProportion = new BigDecimal(costIncomeGroupSet.getOpenDepartmentProportion().toString());
|
|
|
+ // 执行科室比例
|
|
|
+ BigDecimal startDepartmentProportion = new BigDecimal(costIncomeGroupSet.getStartDepartmentProportion().toString());
|
|
|
+ // beforeMoney
|
|
|
+ afterIncomegroup.setOpenDepartmentDecimal(beforeMoney.multiply(openDepartmentProportion).divide(new BigDecimal(100), 4, BigDecimal.ROUND_HALF_UP));
|
|
|
+ afterIncomegroup.setStartDepartmentDecimal(beforeMoney.multiply(startDepartmentProportion).divide(new BigDecimal(100), 4, BigDecimal.ROUND_HALF_UP));
|
|
|
+ String responsibilityCodes = costIncomeGroupSet.getResponsibilityCodes();
|
|
|
+ if (NumberConstant.TWO.equals(costIncomeGroupSet.getOpenDepartmentStatus()) && NumberConstant.TWO.equals(costIncomeGroupSet.getStartDepartmentStatus()) && StrUtil.isNotBlank(responsibilityCodes)) {
|
|
|
+ // /拼接的
|
|
|
+ afterIncomegroup.setDirectStatus(NumberConstant.TWO);
|
|
|
+ String responsibilityCode = responsibilityCodes.split(StrUtil.SLASH)[responsibilityCodes.split(StrUtil.SLASH).length - 1];
|
|
|
+ Responsibility responsibility = map.get(responsibilityCode);
|
|
|
+ if (Objects.nonNull(responsibility)) {
|
|
|
+ afterIncomegroup.setResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
+ afterIncomegroup.setResponsibilityName(responsibility.getResponsibilityName());
|
|
|
}
|
|
|
+ costIncomeGroup.setAfterIncomeGroup(JSON.toJSONString(afterIncomegroup));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- costIncomeGroupArrayList.add(costIncomeGroup);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置相关名称
|
|
|
*
|
|
|
- * @param hospId
|
|
|
* @param costIncomeGroupBeforeVOList
|
|
|
*/
|
|
|
- private void setCodeName(Long hospId, List<CostIncomeGroupBeforeVO> costIncomeGroupBeforeVOList) {
|
|
|
+ private void setCodeName(List<CostIncomeGroupBeforeVO> costIncomeGroupBeforeVOList) {
|
|
|
// List<Responsibility> responsibilityList = responsibilityService.list(new QueryWrapper<Responsibility>().lambda().eq(Responsibility::getHospId, hospId));
|
|
|
// Map<String, String> responsibilityMap = responsibilityList.stream().collect(Collectors.toMap(Responsibility::getResponsibilityCode, Responsibility::getResponsibilityName));
|
|
|
// List<Department> departmentList = departmentService.list(new QueryWrapper<Department>().lambda().eq(Department::getHospId, hospId));
|