Jelajahi Sumber

Merge branch 'master' of huangrui/CostAccount into role_test

lijiaxi 4 tahun lalu
induk
melakukan
b3010f6fb9

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

@@ -137,7 +137,8 @@ public class ReportFormServiceImpl extends ServiceImpl<ReportFormMapper, ReportF
      * @param reportForm 需要构建的实体
      * @param parentId 父级id
      */
-    private void setDataByParentId(Long hospId, ReportForm reportForm, Long parentId) {
+    @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
+    public void setDataByParentId(Long hospId, ReportForm reportForm, Long parentId) {
         if (parentId == 0L) {
             reportForm.setCalcType(0);
             reportForm.setCalcFormula("");
@@ -157,7 +158,9 @@ public class ReportFormServiceImpl extends ServiceImpl<ReportFormMapper, ReportF
             checkExist(byId,"选择的父报表层级不正确");
             reportForm.setReportType(byId.getReportType());
             // 如果子节点 小计只能存在一个
-            this.isSubtotal(parentId, hospId);
+            if (reportForm.getCalcType() == 3) {
+                this.isSubtotal(parentId, hospId);
+            }
         }
     }
 

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

@@ -11,8 +11,6 @@ import com.imed.costaccount.model.ReportForm;
 import com.imed.costaccount.model.ReportRelation;
 import com.imed.costaccount.model.dto.ReportRelationDTO;
 import com.imed.costaccount.model.vo.RelationVO;
-import com.imed.costaccount.service.AccountingService;
-import com.imed.costaccount.service.CostShareParamService;
 import com.imed.costaccount.service.ReportRelationService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;