فهرست منبع

项目导入百分号

qianxb 1 سال پیش
والد
کامیت
8d12893d3f
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      src/main/java/org/springblade/modules/project/service/impl/ProjectInfoServiceImpl.java

+ 3 - 2
src/main/java/org/springblade/modules/project/service/impl/ProjectInfoServiceImpl.java

@@ -1218,7 +1218,7 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                 BeanUtils.copyProperties(project,infoDTO);
                 List<ProjectInvestPlan> plans = new ArrayList<>();
                 //创建年数组
-                for (int i = project.getStartYear(); i < project.getEndYear(); i++) {
+                for (int i = project.getStartYear(); i <= project.getEndYear(); i++) {
                     ProjectInvestPlan plan = new ProjectInvestPlan();
                     if (i == project.getPlanYear()) {
                         plan.setPlanYear(project.getPlanYear());
@@ -1413,7 +1413,8 @@ public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, P
                         BigDecimal investMoney = StringChangeBigdecimal(dataFormatter.formatCellValue(row.getCell(18,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)));
                         String workProgress = dataFormatter.formatCellValue(row.getCell(19, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
                         String workProgressAll = dataFormatter.formatCellValue(row.getCell(20, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
-                        BigDecimal planRatio = StringChangeBigdecimal(dataFormatter.formatCellValue(row.getCell(21,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)));
+                        String planRatioString = dataFormatter.formatCellValue(row.getCell(21, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK));
+                        BigDecimal planRatio = StringChangeBigdecimal(planRatioString.contains("%")?planRatioString.substring(0,planRatioString.length()-1):planRatioString);
                         if (planRatio != null && (planRatio.compareTo(BigDecimal.ZERO) == -1 || planRatio.compareTo(new BigDecimal(100)) == 1)){
                             throw new ServiceException("工程整体形象进度要在0-100之间");
                         }