给商品导入增加通过名称生成助记码的功能

This commit is contained in:
jishenghua
2024-10-14 00:44:39 +08:00
parent 34f65fcbf3
commit 6d20b6393f
3 changed files with 57 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ import com.jsh.erp.service.unit.UnitService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ExcelUtils;
import com.jsh.erp.utils.PinYinUtil;
import com.jsh.erp.utils.StringUtil;
import jxl.Sheet;
import jxl.Workbook;
@@ -626,6 +627,8 @@ public class MaterialService {
m.setModel(model);
m.setColor(color);
m.setBrand(brand);
//通过名称生成助记码
m.setMnemonic(PinYinUtil.getFirstLettersLo(name));
Long categoryId = materialCategoryService.getCategoryIdByName(categoryName);
if(null!=categoryId){
m.setCategoryId(categoryId);