feat: 新增初始化材料数据脚本
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package mjkf.xinke.main.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import mjkf.xinke.main.model.db.Material;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -7,6 +8,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MaterialService extends ServiceImpl<BaseMapper<Material>, Material> {
|
||||
@Deprecated
|
||||
public String createNewMaterialId(String parentId, String maxBrotherId) {
|
||||
String prefix;
|
||||
String suffix;
|
||||
@@ -41,5 +43,11 @@ public class MaterialService extends ServiceImpl<BaseMapper<Material>, Material>
|
||||
|
||||
return prefix + String.format("%02d", current) + suffix;
|
||||
}
|
||||
|
||||
public Material getBykey(String code) {
|
||||
var query = new LambdaQueryWrapper<Material>();
|
||||
query.eq(Material::getCode, code);
|
||||
return this.getOne(query, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user