Bladeren bron

处理进度准换

ljx 4 jaren geleden
bovenliggende
commit
8729493ccb

+ 8 - 0
src/main/java/com/imed/costaccount/model/CostIncomeFile.java

@@ -66,6 +66,14 @@ public class CostIncomeFile implements Serializable {
 	 * 错误详情
 	 */
 	private String errorList;
+	/**
+	 * 年份
+	 */
+	private Integer dateYear;
+	/**
+	 * 月份
+	 */
+	private Integer dateMonth;
 	/**
 	 * 创建时间13位时间戳
 	 */

+ 12 - 0
src/main/java/com/imed/costaccount/model/vo/CostIncomeFileVO.java

@@ -33,6 +33,14 @@ public class CostIncomeFileVO {
     private Integer totalAmount;
     @ApiModelProperty(name = "userName",value = "导入人员")
     private String userName;
+    /**
+     * 年份
+     */
+    private Integer dateYear;
+    /**
+     * 月份
+     */
+    private Integer dateMonth;
     /**
      * 创建时间
      */
@@ -49,4 +57,8 @@ public class CostIncomeFileVO {
      * 是否显示错误详情按钮
      */
     private Integer errStatus=0;
+    /**
+     * 判断撤销导入是否变灰
+     */
+    private Integer rollbackImport;
 }

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

@@ -28,7 +28,7 @@ public interface CostIncomeFileService extends IService<CostIncomeFile> {
      * @param uploadFile 文件路径
      * @return
      */
-    CostIncomeFile saveCostIncomeFile(List<List<Object>> list, User user, MultipartFile file, Long hospId, List<IncomeErrorMessage> incomeErrorMessageList, String uploadFile,Integer fileType);
+    CostIncomeFile saveCostIncomeFile(List<List<Object>> list, User user, MultipartFile file, Long hospId, List<IncomeErrorMessage> incomeErrorMessageList, String uploadFile,Integer fileType,Integer year,Integer month);
 
     /**
      * 分页查询查询记录数据

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

@@ -113,7 +113,7 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
                 throw new CostException(500, "文件上传异常");
             }
             // 记录文件上传记录
-            CostIncomeFile costIncomeFile = costIncomeFileService.saveCostIncomeFile(list, user, file, hospId, incomeErrorMessageList, uploadFile, fileType);
+            CostIncomeFile costIncomeFile = costIncomeFileService.saveCostIncomeFile(list, user, file, hospId, incomeErrorMessageList, uploadFile, fileType,year,month);
             return Result.build(500, "数据未成功导入", null);
         }
         // 检验数据的合理性
@@ -129,7 +129,7 @@ public class CostCostingGroupServiceImpl extends ServiceImpl<CostCostingGroupMap
             throw new CostException(500, "文件上传异常");
         }
         // 记录文件上传记录
-        CostIncomeFile costIncomeFile = costIncomeFileService.saveCostIncomeFile(list, user, file, hospId, incomeErrorMessageList, uploadFile, fileType);
+        CostIncomeFile costIncomeFile = costIncomeFileService.saveCostIncomeFile(list, user, file, hospId, incomeErrorMessageList, uploadFile, fileType,year,month);
         Long id = costIncomeFile.getId();
         costCostingGroupArrayList.forEach(i -> {
             // 设置文件Id

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

@@ -50,7 +50,7 @@ public class CostIncomeFileServiceImpl extends ServiceImpl<CostIncomeFileMapper,
      * @return
      */
     @Override
-    public CostIncomeFile saveCostIncomeFile(List<List<Object>> list, User user, MultipartFile file, Long hospId, List<IncomeErrorMessage> incomeErrorMessageList, String uploadFile,Integer fileType) {
+    public CostIncomeFile saveCostIncomeFile(List<List<Object>> list, User user, MultipartFile file, Long hospId, List<IncomeErrorMessage> incomeErrorMessageList, String uploadFile,Integer fileType,Integer year,Integer month) {
         CostIncomeFile costIncomeFile = new CostIncomeFile();
 
         String substring = file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf("."))+System.currentTimeMillis()+".xsl";
@@ -75,6 +75,8 @@ public class CostIncomeFileServiceImpl extends ServiceImpl<CostIncomeFileMapper,
         costIncomeFile.setHospId(hospId);
         costIncomeFile.setUserName(user.getName());
         costIncomeFile.setUserId(user.getId());
+        costIncomeFile.setDateYear(year);
+        costIncomeFile.setDateMonth(month);
         costIncomeFile.setCreateTime(System.currentTimeMillis());
         this.save(costIncomeFile);
         return costIncomeFile;
@@ -103,6 +105,7 @@ public class CostIncomeFileServiceImpl extends ServiceImpl<CostIncomeFileMapper,
             }
             i.setDateTime(DateUtil.format(DateUtil.date(i.getCreateTime()),"yyyy-MM-dd"));
         });
+
         PageUtils pageUtils = new PageUtils(page);
         pageUtils.setList(costIncomeFileVOList);
         return pageUtils;

+ 4 - 4
src/main/java/com/imed/costaccount/service/impl/CostIncomeGroupServiceImpl.java

@@ -117,9 +117,9 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
             String allMoney = i.getAllMoney();
             if (StrUtil.isNotBlank(allMoney) && allMoney.contains(StrUtil.COMMA)) {
                 // 存在,在进行求和
-                long sum;
-                List<Long> list = Arrays.stream(allMoney.split(StrUtil.COMMA)).map(Long::valueOf).collect(Collectors.toList());
-                sum = list.stream().mapToLong(m -> m).sum();
+                double sum;
+                List<Double> list = Arrays.stream(allMoney.split(StrUtil.COMMA)).map(Double::valueOf).collect(Collectors.toList());
+                sum = list.stream().mapToDouble(m -> m).sum();
                 i.setAmount(BigDecimal.valueOf(sum));
             }
             //TODO 统计总金额
@@ -187,7 +187,7 @@ public class CostIncomeGroupServiceImpl extends ServiceImpl<CostIncomeGroupMappe
             throw new CostException(500, "文件上传异常");
         }
         // 记录文件上传记录
-        CostIncomeFile costIncomeFile = costIncomeFileService.saveCostIncomeFile(list, user, file, hospId, incomeErrorMessageList, uploadFile, fileType);
+        CostIncomeFile costIncomeFile = costIncomeFileService.saveCostIncomeFile(list, user, file, hospId, incomeErrorMessageList, uploadFile, fileType,year,month);
         Long id = costIncomeFile.getId();
         costIncomeGroupArrayList.forEach(i -> {
             // 设置文件Id

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

@@ -100,7 +100,7 @@ public class CostShareParamGroupServiceImpl extends ServiceImpl<CostShareParamGr
             throw new CostException(500, "文件上传异常");
         }
         // 记录文件上传记录
-        CostIncomeFile costIncomeFile = costIncomeFileService.saveCostIncomeFile(list, user, file, hospId, incomeErrorMessageList, uploadFile, fileType);
+        CostIncomeFile costIncomeFile = costIncomeFileService.saveCostIncomeFile(list, user, file, hospId, incomeErrorMessageList, uploadFile, fileType,year,month);
         Long id = costIncomeFile.getId();
         costShareParamGroupList.forEach(i -> {
             // 设置文件Id

+ 2 - 0
src/main/resources/mapper/CostIncomeFileMapper.xml

@@ -15,6 +15,8 @@
         <result property="userId" column="user_id"/>
         <result property="userName" column="user_name"/>
         <result property="errorList" column="error_list"/>
+        <result property="dateYear" column="date_year"/>
+        <result property="dateMonth" column="date_month"/>
         <result property="createTime" column="create_time"/>
         <result property="deleteTime" column="delete_time"/>
     </resultMap>