|
|
@@ -48,7 +48,7 @@ public class AdminVarietiesServiceImpl extends BaseMybatisDao<BusinessVarietiesM
|
|
|
}
|
|
|
buv.setCid(s);
|
|
|
}
|
|
|
- System.out.println("========================cid:"+buv.getCid());
|
|
|
+
|
|
|
//判断是否数据库这个ID已经存在
|
|
|
String n=businessVarietiesMapper.ThanCid(buv.getCid());
|
|
|
while(StringUtils.isNotBlank(n)) {
|
|
|
@@ -129,23 +129,21 @@ public class AdminVarietiesServiceImpl extends BaseMybatisDao<BusinessVarietiesM
|
|
|
BusinessVarieties bs=new BusinessVarieties();
|
|
|
bs=businessVarietiesMapper.selectByPrimaryKey(id);
|
|
|
bs.setCname(cname);
|
|
|
- String str=businessVarietiesMapper.getCid(superId);
|
|
|
- int i=Integer.valueOf(businessVarietiesMapper.getCount(superId));
|
|
|
- if (3>str.length()) {
|
|
|
- if(Integer.valueOf(i)<=9){
|
|
|
-
|
|
|
- bs.setCid("BZ0"+i);
|
|
|
- }else {
|
|
|
- bs.setCid("BZ"+i);
|
|
|
- }
|
|
|
- }else {
|
|
|
- int w=i+1;
|
|
|
- if(Integer.valueOf(i)<9){
|
|
|
- bs.setCid(str+"0"+w);
|
|
|
+ String str=businessVarietiesMapper.getCidMax(superId);
|
|
|
+ String scid=businessVarietiesMapper.getCid(superId);
|
|
|
+ if (null==str) {
|
|
|
+ bs.setCid(scid+"01");
|
|
|
+ }else {
|
|
|
+ int i=Integer.valueOf(str.substring(str.length()-2, str.length()));
|
|
|
+ i=(i%99)+1;
|
|
|
+ String s;
|
|
|
+ if (i<10) {
|
|
|
+ s=str.substring(0,str.length()-2)+"0"+i;
|
|
|
}else {
|
|
|
- bs.setCid(str+w);
|
|
|
+ s=str.substring(0,str.length()-2)+i;
|
|
|
}
|
|
|
- }
|
|
|
+ bs.setCid(s);
|
|
|
+ }
|
|
|
//判断是否数据库这个ID已经存在
|
|
|
checkCid(bs);
|
|
|
//将子品类名称编号做修改
|
|
|
@@ -157,6 +155,7 @@ public class AdminVarietiesServiceImpl extends BaseMybatisDao<BusinessVarietiesM
|
|
|
BusinessVarieties bvs=businessVarietiesMapper.selectByPrimaryKey(n);
|
|
|
String s2=bvs.getCid().substring(w.length()-2, w.length());
|
|
|
bvs.setCid(c1+s2);
|
|
|
+ bvs.setLayer(bvs.getCid().length()/2-1);
|
|
|
checkCid(bvs);
|
|
|
businessVarietiesMapper.updateByPrimaryKey(bvs);
|
|
|
}
|