| | |
| | | package org.jeecg.modules.base.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.base.entity.Unit; |
| | | import org.jeecg.modules.base.entity.UnitCategory; |
| | |
| | | @Resource |
| | | private UnitMapper unitMapper; |
| | | |
| | | // 初始化工装类别 |
| | | // private static final String initUnitCategory = "计量单位分类"; |
| | | /** |
| | | * 查询计量单位分类树 |
| | | * @return |
| | |
| | | return treeList; |
| | | } |
| | | |
| | | @Override |
| | | public void initFristUnitCategory() { |
| | | |
| | | UnitCategory unitCategory; |
| | | List<UnitCategory> unitCategoryList = super.lambdaQuery() |
| | | .eq(UnitCategory::getName, "计量单位分类") |
| | | .eq(UnitCategory::getDelFlag, "0").list(); |
| | | if (unitCategoryList.size() == 0) { |
| | | unitCategory = new UnitCategory(); |
| | | unitCategory.setCode("0"); |
| | | // unitCategory.setId("-1"); |
| | | unitCategory.setCodeName("计量单位分类"); |
| | | unitCategory.setPid("-1"); |
| | | super.save(unitCategory); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询计量单位树 |
| | | * @return |