Przeglądaj źródła

设置是否是父节点的判断

ljx 4 lat temu
rodzic
commit
3a8d4336ab

+ 1 - 0
src/main/java/com/imed/costaccount/model/vo/AccountProductVO.java

@@ -23,6 +23,7 @@ public class AccountProductVO {
     @JsonInclude(JsonInclude.Include.NON_NULL)
     private List<ProductVO> productVOs;
 
+    private Boolean isParent=false;
     @JsonInclude(JsonInclude.Include.NON_NULL)
     private List<AccountProductVO> child;
 }

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

@@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.imed.costaccount.mapper.AccountingMapper;
 import com.imed.costaccount.mapper.AccountingProductMapper;
 import com.imed.costaccount.mapper.ProductMapper;
-import com.imed.costaccount.model.*;
+import com.imed.costaccount.model.Accounting;
+import com.imed.costaccount.model.AccountingProduct;
+import com.imed.costaccount.model.Product;
+import com.imed.costaccount.model.User;
 import com.imed.costaccount.model.dto.AccountProductSaveDTO;
-import com.imed.costaccount.model.dto.ProductAccountDTO;
 import com.imed.costaccount.model.vo.AccountProductVO;
 import com.imed.costaccount.model.vo.ProductVO;
 import com.imed.costaccount.service.AccountingProductService;
@@ -101,6 +103,7 @@ public class AccountingProductServiceImpl extends ServiceImpl<AccountingProductM
                 accountVO.setChild(child);
                 // 处理子节点
                 this.getAccountTree(account, list);
+                accountVO.setIsParent(true);
             }
         }
         return accountVOS;