瀏覽代碼

07 30 8 fix add accounting parent and son accountType same

hr 4 年之前
父節點
當前提交
58b015e4a2
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/main/java/com/imed/costaccount/service/impl/AccountingServiceImpl.java

+ 3 - 0
src/main/java/com/imed/costaccount/service/impl/AccountingServiceImpl.java

@@ -104,6 +104,9 @@ public class AccountingServiceImpl extends ServiceImpl<AccountingMapper, Account
             if (Objects.isNull(byId)) {
                 throw new CostException(500, "上层级别会计科目已被移除");
             }
+            if (!byId.getAccountingType().equals(accountingSaveDTO.getAccountingType())) {
+                throw new CostException(500, "会计科目类型要与上层一致");
+            }
             String oldParentIds = byId.getAllParentIds();
             if ("0".equals(oldParentIds)) {
                 allParentIds = parentId + "";