This commit is contained in:
18188916393
2022-09-26 14:58:42 +08:00
parent cceed8779f
commit bf7d53c6ea
3 changed files with 30 additions and 3 deletions

View File

@@ -54,7 +54,7 @@
struct.struct_name,
structivt.vehicle_code,
structivt.canuse_qty as ivt_qty,
structivt.pcsn,
structivt.qty_unit_id,
unit.unit_name,
'1' as is_show

View File

@@ -1,5 +1,7 @@
package org.nl.mongodb;
import cn.hutool.core.util.StrUtil;
import org.nl.exception.BadRequestException;
import org.springframework.data.domain.Page;
public class Test {
@@ -56,4 +58,29 @@ public class Test {
PageHelper pageHelper = mongoUtil.pageHelper(count, teachers);*/
}
public static void main(String[] args) {
String a = "231";
String b = "8";
String c = "23";
String d = "3242";
String e = "43243";
String aa = String.format("%0" + 4 + "d", Integer.parseInt(a) + 1);
String bb = String.format("%0" + 4 + "d", Integer.parseInt(b) + 1);
String cc = String.format("%0" + 4 + "d", Integer.parseInt(c) + 1);
String dd = String.format("%0" + 4 + "d", Integer.parseInt(d) + 1);
String ee = String.format("%0" + 4 + "d", Integer.parseInt(e) + 1);
System.out.println(aa);
System.out.println(bb);
System.out.println(cc);
System.out.println(dd);
System.out.println(ee);
}
public String autoGenericCode(String vehicle_code) {
if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("托盘号不能为空!");
}
return String.format("%0" + 4 + "d", Integer.parseInt(vehicle_code) + 1);
}
}