Gitea 2 years ago
parent 10282bbdbf
commit 5561512756
  1. 8
      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<ZyGoods, IZyGoodsService>
ZyStyleModel zyStyleModel = zyStyleModelService.getById(xhid);
String xhbm =zyStyleModel.getModelNumber();
//顺序号
String sxh = "";
String format = "";
ZyGoods zyGoods = new ZyGoods();
/* //随机6位随机码
QueryWrapper<ZyGoods> qw =new QueryWrapper();
@ -409,10 +409,12 @@ public class ZyGoodsController extends JeecgController<ZyGoods, IZyGoodsService>
queryWrapper.eq("cloths_type_id",lxid);
queryWrapper.eq("model_id",xhid);
List<ZyGoods> list = zyGoodsService.list(queryWrapper);
sxh = list.size()+1+"";
//随机数=服装类型编号+随机6位+型号编码+该类型商品长度
//spbh = lxbh+rcode+ xhbm + sxh;
spbh = lxbh+ xhbm + sxh;
List<String> 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);
}

Loading…
Cancel
Save