Explorar o código

文件类型筛选

ljx %!s(int64=4) %!d(string=hai) anos
pai
achega
8dd81afa01

+ 3 - 2
src/main/java/com/imed/costaccount/service/CostIncomeFileService.java

@@ -34,11 +34,12 @@ public interface CostIncomeFileService extends IService<CostIncomeFile> {
      * 分页查询查询记录数据
      * @param current
      * @param pageSize
-     * @param name
+     * @param fileName
+     * @param dateTime
      * @param hospId
      * @return
      */
-    PageUtils queryList(Integer current, Integer pageSize, String name, Long hospId);
+    PageUtils queryList(Integer current, Integer pageSize, String fileName, String dateTime, Long hospId);
 
     /**
      * 撤销导入

+ 1 - 1
src/main/java/com/imed/costaccount/service/impl/CostCostingGroupServiceImpl.java

@@ -156,8 +156,8 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
         // 先检验当前年月是否存在数据
         int year = 0;
         int month = 0;
-        Date date = DateUtils.StringToDate(dateTime, DateStyleEnum.YYYY_MM);
         if (StrUtil.isNotBlank(dateTime)) {
+            Date date = DateUtils.StringToDate(dateTime, DateStyleEnum.YYYY_MM);
             year = DateUtil.year(date);
             month = DateUtil.month(date) + 1;
         }

+ 16 - 3
src/main/java/com/imed/costaccount/service/impl/CostIncomeFileServiceImpl.java

@@ -1,5 +1,6 @@
 package com.imed.costaccount.service.impl;
 
+import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -96,15 +97,27 @@ public class CostIncomeFileServiceImpl extends ServiceImpl<CostIncomeFileMapper,
      *
      * @param current
      * @param pageSize
-     * @param name
+     * @param fileName
+     * @param dateTime
      * @param hospId
      * @return
      */
     @Override
-    public PageUtils queryList(Integer current, Integer pageSize, String name, Long hospId) {
+    public PageUtils queryList(Integer current, Integer pageSize, String fileName, String dateTime, Long hospId) {
+        Integer year = null;
+        Integer month = null;
+        if (StrUtil.isNotBlank(dateTime)) {
+            DateTime date = DateUtil.parseDate(dateTime);
+            year = DateUtil.year(date);
+            month = DateUtil.month(date) + 1;
+        }
         Page<CostIncomeFile> costIncomeFilePage = new Page<>(current, pageSize);
         Page<CostIncomeFile> page = this.page(costIncomeFilePage, new QueryWrapper<CostIncomeFile>().lambda()
-                .eq(CostIncomeFile::getHospId, hospId).like(StrUtil.isNotBlank(name), CostIncomeFile::getFileName, name).orderByDesc(CostIncomeFile::getCreateTime));
+                .eq(CostIncomeFile::getHospId, hospId)
+                .like(StrUtil.isNotBlank(fileName), CostIncomeFile::getFileName, fileName)
+                .eq(StrUtil.isNotBlank(dateTime),CostIncomeFile::getDateYear,year)
+                .eq(StrUtil.isNotBlank(dateTime),CostIncomeFile::getDateMonth,month)
+                .orderByDesc(CostIncomeFile::getCreateTime));
         List<CostIncomeFile> records = page.getRecords();
         List<CostIncomeFileVO> costIncomeFileVOList = BeanUtil.convertList(records, CostIncomeFileVO.class);
         costIncomeFileVOList.forEach(i -> {

+ 2 - 2
src/main/java/com/imed/costaccount/service/impl/CostShareParamServiceImpl.java

@@ -178,8 +178,8 @@ public class CostShareParamServiceImpl extends ServiceImpl<CostShareParamMapper,
         String accountingId = byId.getAccountingId();
         if (!StringUtils.isEmpty(accountingId)){
             String[] split = accountingId.split(StrUtil.COMMA);
-            List<Long> collect = Arrays.stream(split).map(Long::valueOf).collect(Collectors.toList());
-            return collect;
+            List<Long> accountingIdList = Arrays.stream(split).map(Long::valueOf).collect(Collectors.toList());
+            return accountingIdList;
         }else {
             return Collections.emptyList();
         }

+ 3 - 2
src/main/java/com/imed/costaccount/web/CostIncomeFileController.java

@@ -36,9 +36,10 @@ public class CostIncomeFileController {
     @ApiOperation("分页查询记录数据")
     public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
                        @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
-                       @RequestParam(value = "fileName",required = false) String fileName){
+                       @RequestParam(value = "fileName",required = false) String fileName,
+                       @RequestParam(value = "dateTime",required = false) String dateTime){
         Long hospId = UserContext.getHospId();
-        PageUtils pageUtils = costIncomeFileService.queryList(current,pageSize,fileName,hospId);
+        PageUtils pageUtils = costIncomeFileService.queryList(current,pageSize,fileName,dateTime,hospId);
         return Result.ok(pageUtils);
     }