|
@@ -7,21 +7,24 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.imed.costaccount.common.util.BeanUtil;
|
|
import com.imed.costaccount.common.util.BeanUtil;
|
|
import com.imed.costaccount.common.util.DateUtils;
|
|
import com.imed.costaccount.common.util.DateUtils;
|
|
import com.imed.costaccount.common.util.PageUtils;
|
|
import com.imed.costaccount.common.util.PageUtils;
|
|
|
|
+import com.imed.costaccount.common.util.Result;
|
|
|
|
+import com.imed.costaccount.constants.NumberConstant;
|
|
import com.imed.costaccount.mapper.CostIncomeGroupMapper;
|
|
import com.imed.costaccount.mapper.CostIncomeGroupMapper;
|
|
import com.imed.costaccount.model.*;
|
|
import com.imed.costaccount.model.*;
|
|
import com.imed.costaccount.model.vo.CostIncomeGroupAllAmountVO;
|
|
import com.imed.costaccount.model.vo.CostIncomeGroupAllAmountVO;
|
|
import com.imed.costaccount.model.vo.CostIncomeGroupBeforeVO;
|
|
import com.imed.costaccount.model.vo.CostIncomeGroupBeforeVO;
|
|
import com.imed.costaccount.service.*;
|
|
import com.imed.costaccount.service.*;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-
|
|
|
|
|
|
+@Slf4j
|
|
@Service("costIncomeGroupService")
|
|
@Service("costIncomeGroupService")
|
|
public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMapper, CostIncomeGroup> implements CostIncomeGroupService {
|
|
public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMapper, CostIncomeGroup> implements CostIncomeGroupService {
|
|
|
|
|
|
@@ -54,18 +57,20 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public PageUtils queryList(Integer current, Integer pageSize, String dateTime, String responsibilityCode, String accountCode, Long hospId) {
|
|
public PageUtils queryList(Integer current, Integer pageSize, String dateTime, String responsibilityCode, String accountCode, Long hospId) {
|
|
- int year = DateUtils.getYear(dateTime);
|
|
|
|
- int month=DateUtils.getMonth(dateTime);
|
|
|
|
|
|
+ int year = 0;
|
|
|
|
+ int month=0;
|
|
|
|
+ if (StrUtil.isNotBlank(dateTime)){
|
|
|
|
+ year = DateUtils.getYear(dateTime);
|
|
|
|
+ month=DateUtils.getMonth(dateTime);
|
|
|
|
+ }
|
|
Page<CostIncomeGroup> costIncomeGroupPage = new Page<>(current, pageSize);
|
|
Page<CostIncomeGroup> costIncomeGroupPage = new Page<>(current, pageSize);
|
|
- QueryWrapper<CostIncomeGroup> wrapper = new QueryWrapper<>();
|
|
|
|
- wrapper.eq("hosp_id",hospId);
|
|
|
|
- wrapper.eq("date_year",year);
|
|
|
|
- wrapper.eq("date_month",month);
|
|
|
|
- wrapper.like(!StringUtils.isEmpty(responsibilityCode),"open_responsibility_code",responsibilityCode)
|
|
|
|
- .or()
|
|
|
|
- .like(!StringUtils.isEmpty(responsibilityCode),"start_responsibility_code",responsibilityCode);
|
|
|
|
- wrapper.eq(!StringUtils.isEmpty(accountCode),"account_code",accountCode);
|
|
|
|
- Page<CostIncomeGroup> pages = this.page(costIncomeGroupPage, wrapper);
|
|
|
|
|
|
+ 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)
|
|
|
|
+ .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<CostIncomeGroup> records = pages.getRecords();
|
|
List<CostIncomeGroupBeforeVO> costIncomeGroupBeforeVOList = BeanUtil.convertList(records, CostIncomeGroupBeforeVO.class);
|
|
List<CostIncomeGroupBeforeVO> costIncomeGroupBeforeVOList = BeanUtil.convertList(records, CostIncomeGroupBeforeVO.class);
|
|
// 查询所有的责任中心 科室 会计科目 成本项目的数据 处理名字
|
|
// 查询所有的责任中心 科室 会计科目 成本项目的数据 处理名字
|
|
@@ -88,6 +93,25 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
|
|
return pageUtils;
|
|
return pageUtils;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 批量导入收入数据
|
|
|
|
+ *
|
|
|
|
+ * @param list 输入的文件
|
|
|
|
+ * @param hospId 医院Id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Result importIncomeGroup(List<List<Object>> list, Long hospId) {
|
|
|
|
+ // 移除前几行的抬头内容
|
|
|
|
+ for (int i = list.size() - 1; i >= 0; i--) {
|
|
|
|
+ if (i == NumberConstant.ZERO || i == NumberConstant.ONE || i == NumberConstant.TWO || i == NumberConstant.THREE) {
|
|
|
|
+ list.remove(list.get(i));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ log.info("读取的数据为:{}", list);
|
|
|
|
+ return Result.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 设置相关名称
|
|
* 设置相关名称
|
|
* @param hospId
|
|
* @param hospId
|
|
@@ -114,7 +138,7 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
|
|
});
|
|
});
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
- * 收入归集数据的计算规则
|
|
|
|
|
|
+ * 收入数据导入
|
|
*/
|
|
*/
|
|
|
|
|
|
}
|
|
}
|