diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java index 2f52b662..36f8c228 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zygoods/controller/ZyGoodsController.java @@ -398,7 +398,7 @@ public class ZyGoodsController extends JeecgController ZyStyleModel zyStyleModel = zyStyleModelService.getById(xhid); String xhbm =zyStyleModel.getModelNumber(); //顺序号 - String sxh = ""; + String format = ""; ZyGoods zyGoods = new ZyGoods(); /* //随机6位随机码 QueryWrapper qw =new QueryWrapper(); @@ -409,10 +409,12 @@ public class ZyGoodsController extends JeecgController queryWrapper.eq("cloths_type_id",lxid); queryWrapper.eq("model_id",xhid); List list = zyGoodsService.list(queryWrapper); - sxh = list.size()+1+""; //随机数=服装类型编号+随机6位+型号编码+该类型商品长度 //spbh = lxbh+rcode+ xhbm + sxh; - spbh = lxbh+ xhbm + sxh; + + List collect = list.stream().map(ZyGoods::getGoodsCode).collect(Collectors.toList()); + format = String.format("%08d", zyClothsTypeService.getListMax(collect, 8)); + spbh = lxbh+ xhbm + format; return Result.OK(spbh); }