|
@@ -179,7 +179,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
.setResponsibilityName(responsibility.getResponsibilityName()).setAccountShareId(accountShareId).setAmount(targetAmount)
|
|
.setResponsibilityName(responsibility.getResponsibilityName()).setAccountShareId(accountShareId).setAmount(targetAmount)
|
|
.setCreateTime(timeMillis).setTargetResponsibilityCode(valueResponsibilityCode).setTargetResponsibilityName(targetRespName)
|
|
.setCreateTime(timeMillis).setTargetResponsibilityCode(valueResponsibilityCode).setTargetResponsibilityName(targetRespName)
|
|
.setShareParamCode(paramValue.getShareParamCode()).setShareParamName(shareParamName).setTotalAmount(totalAmount).setShareParamValueNum(paramValue.getValueNum())
|
|
.setShareParamCode(paramValue.getShareParamCode()).setShareParamName(shareParamName).setTotalAmount(totalAmount).setShareParamValueNum(paramValue.getValueNum())
|
|
- .setShareParamRate(numerator.divide(reduce, 4))
|
|
|
|
|
|
+ .setShareParamRate(numerator.divide(reduce, 4)).setShareLevelId(levelId)
|
|
;
|
|
;
|
|
|
|
|
|
// todo 目标分摊层级责任中心 就是当前列个表中的责任中心
|
|
// todo 目标分摊层级责任中心 就是当前列个表中的责任中心
|
|
@@ -401,12 +401,13 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
* @param sheet 报表
|
|
* @param sheet 报表
|
|
* @param year 年
|
|
* @param year 年
|
|
* @param month 月
|
|
* @param month 月
|
|
|
|
+ * @param shareLevelId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public ExcelWriter getShareReportTemplate(ExcelWriter writer, Integer levelSort, Sheet sheet, Integer year, Integer month) {
|
|
|
|
|
|
+ public ExcelWriter getShareReportTemplate(ExcelWriter writer, Integer levelSort, Sheet sheet, Integer year, Integer month, Long shareLevelId) {
|
|
// 获取数据
|
|
// 获取数据
|
|
- List<AllocationReportVO> allocationReportVOList = getAllocationReportVOS(levelSort, year, month);
|
|
|
|
|
|
+ List<AllocationReportVO> allocationReportVOList = getAllocationReportVOS(levelSort, year, month,shareLevelId);
|
|
// 设置导出
|
|
// 设置导出
|
|
Map<String, List<AllocationReportVO>> responsibilityMap = allocationReportVOList.stream().collect(Collectors.groupingBy(AllocationReportVO::getResponsibilityCode));
|
|
Map<String, List<AllocationReportVO>> responsibilityMap = allocationReportVOList.stream().collect(Collectors.groupingBy(AllocationReportVO::getResponsibilityCode));
|
|
Map<String, List<AllocationReportVO>> targetResponsibilityMap = allocationReportVOList.stream().collect(Collectors.groupingBy(AllocationReportVO::getTargetResponsibilityCode));
|
|
Map<String, List<AllocationReportVO>> targetResponsibilityMap = allocationReportVOList.stream().collect(Collectors.groupingBy(AllocationReportVO::getTargetResponsibilityCode));
|
|
@@ -552,10 +553,10 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Map<String, Integer> rowMap = new HashMap<>();
|
|
Map<String, Integer> rowMap = new HashMap<>();
|
|
- int cc=levelSort+3;
|
|
|
|
|
|
+ int cc = levelSort + 3;
|
|
// 合并行
|
|
// 合并行
|
|
- boolean otherData=false;
|
|
|
|
- for (int m = levelSort + 3; m < column-1; m++) {
|
|
|
|
|
|
+ boolean otherData = false;
|
|
|
|
+ for (int m = levelSort + 3; m < column - 1; m++) {
|
|
// String cellValue = sheet.getRow(0).getCell(m).getStringCellValue();
|
|
// String cellValue = sheet.getRow(0).getCell(m).getStringCellValue();
|
|
// if (!rowMap.containsKey(cellValue)){
|
|
// if (!rowMap.containsKey(cellValue)){
|
|
// rowMap.put(cellValue,m);
|
|
// rowMap.put(cellValue,m);
|
|
@@ -563,28 +564,29 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
// String value = sheet.getRow(0).getCell(m ).getStringCellValue();
|
|
// String value = sheet.getRow(0).getCell(m ).getStringCellValue();
|
|
// writer.merge(0, 0, rowMap.get(sheet.getRow(0).getCell(m-1).getStringCellValue()), m-1, sheet.getRow(0).getCell(m-1).getStringCellValue(), false);
|
|
// writer.merge(0, 0, rowMap.get(sheet.getRow(0).getCell(m-1).getStringCellValue()), m-1, sheet.getRow(0).getCell(m-1).getStringCellValue(), false);
|
|
// }
|
|
// }
|
|
- String cellValue1=sheet.getRow(0).getCell(m).getStringCellValue();
|
|
|
|
- String cellValue2=sheet.getRow(0).getCell(m+1).getStringCellValue();
|
|
|
|
- if(!cellValue1.equals(cellValue2)){
|
|
|
|
- otherData=true;
|
|
|
|
- writer.merge(0, 0, cc,m,cellValue1,false);
|
|
|
|
- cc=m+1;
|
|
|
|
- }if (m==column-2){
|
|
|
|
- writer.merge(0, 0, cc,m+1,sheet.getRow(0).getCell(m+1).getStringCellValue(),false);
|
|
|
|
|
|
+ String cellValue1 = sheet.getRow(0).getCell(m).getStringCellValue();
|
|
|
|
+ String cellValue2 = sheet.getRow(0).getCell(m + 1).getStringCellValue();
|
|
|
|
+ if (!cellValue1.equals(cellValue2)) {
|
|
|
|
+ otherData = true;
|
|
|
|
+ writer.merge(0, 0, cc, m, cellValue1, false);
|
|
|
|
+ cc = m + 1;
|
|
|
|
+ }
|
|
|
|
+ if (m == column - 2) {
|
|
|
|
+ writer.merge(0, 0, cc, m + 1, sheet.getRow(0).getCell(m + 1).getStringCellValue(), false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 合并列
|
|
// 合并列
|
|
- int jj=3;
|
|
|
|
-
|
|
|
|
- for (int i=3;i<num-1;i++){
|
|
|
|
- String cellValue1=sheet.getRow(i).getCell(0).getStringCellValue();
|
|
|
|
- String cellValue2=sheet.getRow(i+1).getCell(0).getStringCellValue();
|
|
|
|
- if(!cellValue1.equals(cellValue2)){
|
|
|
|
- otherData=true;
|
|
|
|
- writer.merge(jj, i, 0,0,cellValue1,false);
|
|
|
|
- jj=i+1;
|
|
|
|
- }else if (i==num-2){
|
|
|
|
- writer.merge(jj, i+1, 0,0,cellValue1,false);
|
|
|
|
|
|
+ int jj = 3;
|
|
|
|
+
|
|
|
|
+ for (int i = 3; i < num - 1; i++) {
|
|
|
|
+ String cellValue1 = sheet.getRow(i).getCell(0).getStringCellValue();
|
|
|
|
+ String cellValue2 = sheet.getRow(i + 1).getCell(0).getStringCellValue();
|
|
|
|
+ if (!cellValue1.equals(cellValue2)) {
|
|
|
|
+ otherData = true;
|
|
|
|
+ writer.merge(jj, i, 0, 0, cellValue1, false);
|
|
|
|
+ jj = i + 1;
|
|
|
|
+ } else if (i == num - 2) {
|
|
|
|
+ writer.merge(jj, i + 1, 0, 0, cellValue1, false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (int i = 0; i < 30; i++) {
|
|
for (int i = 0; i < 30; i++) {
|
|
@@ -604,16 +606,16 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
* @param month
|
|
* @param month
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private List<AllocationReportVO> getAllocationReportVOS(Integer levelSort, Integer year, Integer month) {
|
|
|
|
|
|
+ private List<AllocationReportVO> getAllocationReportVOS(Integer levelSort, Integer year, Integer month,Long shareLevelId) {
|
|
Long hospId = UserContext.getHospId();
|
|
Long hospId = UserContext.getHospId();
|
|
if (Objects.isNull(levelSort) || Objects.isNull(year) || Objects.isNull(month)) {
|
|
if (Objects.isNull(levelSort) || Objects.isNull(year) || Objects.isNull(month)) {
|
|
throw new CostException(500, "参数异常");
|
|
throw new CostException(500, "参数异常");
|
|
}
|
|
}
|
|
// 处理第几次分摊计算值
|
|
// 处理第几次分摊计算值
|
|
List<Allocation> allocationList = baseMapper.selectList(new QueryWrapper<Allocation>().lambda()
|
|
List<Allocation> allocationList = baseMapper.selectList(new QueryWrapper<Allocation>().lambda()
|
|
- .eq(Allocation::getHospId, hospId).eq(Allocation::getLevelSort, levelSort).eq(Allocation::getDateYear, year)
|
|
|
|
|
|
+ .eq(Allocation::getHospId, hospId).eq(Allocation::getLevelSort, levelSort).eq(Allocation::getShareLevelId,shareLevelId).eq(Allocation::getDateYear, year)
|
|
.eq(Allocation::getDateMonth, month));
|
|
.eq(Allocation::getDateMonth, month));
|
|
-
|
|
|
|
|
|
+ // 找会计科室的时候使用的
|
|
List<Allocation> allocations = baseMapper.selectList(new QueryWrapper<Allocation>().lambda()
|
|
List<Allocation> allocations = baseMapper.selectList(new QueryWrapper<Allocation>().lambda()
|
|
.eq(Allocation::getHospId, hospId).eq(Allocation::getDateYear, year)
|
|
.eq(Allocation::getHospId, hospId).eq(Allocation::getDateYear, year)
|
|
.eq(Allocation::getDateMonth, month));
|
|
.eq(Allocation::getDateMonth, month));
|
|
@@ -751,6 +753,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
vo.setShareLevel(i.getLevelSort());
|
|
vo.setShareLevel(i.getLevelSort());
|
|
vo.setShareReportName(i.getShareParamName() + "分摊");
|
|
vo.setShareReportName(i.getShareParamName() + "分摊");
|
|
vo.setShareTime(DateUtil.date(i.getCreateTime()));
|
|
vo.setShareTime(DateUtil.date(i.getCreateTime()));
|
|
|
|
+ vo.setShareLevelId(i.getShareLevelId());
|
|
return vo;
|
|
return vo;
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
return vos;
|
|
return vos;
|