Parcourir la source

自定义报表添加小数位与千分号处理

wangyongsheng il y a 6 mois
Parent
commit
accfa93483

+ 0 - 5
src/main/java/com/kcim/dao/repository/OrderCostDetailRepository.java

@@ -1,15 +1,11 @@
 package com.kcim.dao.repository;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.kcim.common.util.UserContext;
 import com.kcim.dao.mapper.OrderCostDetailMapper;
-import com.kcim.dao.model.ComputeClinicalPathwayCostDetail;
-import com.kcim.dao.model.ComputeGroupCostDetail;
 import com.kcim.dao.model.OrderCostDetail;
 import org.springframework.stereotype.Repository;
-import org.springframework.util.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -53,7 +49,6 @@ public class OrderCostDetailRepository extends ServiceImpl<OrderCostDetailMapper
             this.update(updateWrapper);
         }
 
-
     }
 
     static  Integer MAX_NUMBER = 500;

+ 27 - 17
src/main/java/com/kcim/service/impl/ReportServiceImpl.java

@@ -191,19 +191,20 @@ public class ReportServiceImpl implements ReportService {
                         }else {
                             handleSql = MatchParameter(sql, keyParameter,new HashMap<>());
                         }
-                        Integer dataType = col.getDataType();
                         Object o = sqlRunner(handleSql);
-                        if(dataType != null&&dataType.equals(NumberConstant.THREE)){
-                            Integer decimalPlace = col.getDecimalPlace();
-                            if(o.equals("")){
-                                vo.setValue(BigDecimal.ZERO.setScale(decimalPlace,RoundingMode.HALF_UP));
-                            }else {
-                                BigDecimal value = new BigDecimal(o.toString());
-                                vo.setValue(value.setScale(decimalPlace,RoundingMode.HALF_UP));
-                            }
-                        }else {
+//                        Integer dataType = col.getDataType();
+//
+//                        if(dataType != null&&dataType.equals(NumberConstant.THREE)){
+//                            Integer decimalPlace = col.getDecimalPlace();
+//                            if(o.equals("")){
+//                                vo.setValue(BigDecimal.ZERO.setScale(decimalPlace,RoundingMode.HALF_UP));
+//                            }else {
+//                                BigDecimal value = new BigDecimal(o.toString());
+//                                vo.setValue(value.setScale(decimalPlace,RoundingMode.HALF_UP));
+//                            }
+//                        }else {
                             vo.setValue(o);
-                        }
+//                        }
                         dataVo.add(vo);
                     }
                 }
@@ -238,13 +239,13 @@ public class ReportServiceImpl implements ReportService {
                         CostColumn col = costColumnMap.get(column.getColumnCode());
                         String formula = col.getFormula();
                         BigDecimal formulaData = getFormulaData(formula, dataVo,column);
-                        Integer dataType = col.getDataType();
-                        if(dataType != null&&dataType.equals(NumberConstant.THREE)){
-                            Integer decimalPlace = col.getDecimalPlace();
-                            vo.setValue(formulaData.setScale(decimalPlace, RoundingMode.HALF_UP));
-                        }else {
+//                        Integer dataType = col.getDataType();
+//                        if(dataType != null&&dataType.equals(NumberConstant.THREE)){
+//                            Integer decimalPlace = col.getDecimalPlace();
+//                            vo.setValue(formulaData.setScale(decimalPlace, RoundingMode.HALF_UP));
+//                        }else {
                             vo.setValue(formulaData);
-                        }
+//                        }
                         dataVo.add(vo);
                     }
                 }
@@ -455,6 +456,15 @@ public class ReportServiceImpl implements ReportService {
         CostColumn computeColumn = map.get(Long.valueOf(column));
         if(Objects.nonNull(computeColumn)){
             vo.setDataType(computeColumn.getDataType());
+            vo.setDecimalPlace(computeColumn.getDecimalPlace());
+            String permil = computeColumn.getPermil();
+            if(StringUtils.isEmpty(permil)){
+                vo.setPermil(false);
+            }else {
+                vo.setPermil(permil.equals(NumberConstant.ONE_S));
+            }
+
+
         }
         List<String> primary = new ArrayList<>();
         if(reportCodeModifyVo.getReportCode() != null){

+ 4 - 0
src/main/java/com/kcim/vo/ReportTitleVo.java

@@ -36,6 +36,10 @@ public class ReportTitleVo {
 
     private Integer freeze;
 
+    private Integer decimalPlace;
+
+    private boolean permil = false;
+
     private List<RedirectData> redirectData;
 
     private List<CommonTitleVo> childTitle;

+ 4 - 0
src/main/java/com/kcim/vo/SessionUserVO.java

@@ -39,4 +39,8 @@ public class SessionUserVO {
     private Long currentLoginHospId;
 
     // TODO: 2022/1/4 按业务需求新增
+
+    private Long orgnId;
+
+    private String orgnName;
 }