wmUtil获取订单号

master
e 2019-10-01 22:05:36 +08:00
parent 445a0e81c9
commit a5f258050b
1 changed files with 23 additions and 8 deletions

View File

@ -57,6 +57,14 @@ public class wmUtil {
Map<String, Object> countMap = systemService Map<String, Object> countMap = systemService
.findOneForJdbc("SELECT cast(right(ifnull((notice_id),0),4)+1 as SIGNED) as count FROM wm_im_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW()) order by create_date desc limit 1"); .findOneForJdbc("SELECT cast(right(ifnull((notice_id),0),4)+1 as SIGNED) as count FROM wm_im_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW()) order by create_date desc limit 1");
int newcount = 0;
try{
newcount= ((Long) countMap.get("count")).intValue();
}catch (Exception e){
newcount = 1;
}
if (StringUtil.isEmpty(orderType)){ if (StringUtil.isEmpty(orderType)){
orderType = "01"; orderType = "01";
} }
@ -66,35 +74,35 @@ public class wmUtil {
+ DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd)
+ "-" + "-"
+ StringUtil.leftPad( + StringUtil.leftPad(
((Long) countMap.get("count")).intValue(), 4, newcount, 4,
'0'); '0');
}else if(orderType.equals("01")){ }else if(orderType.equals("01")){
noticeid = "RK" noticeid = "RK"
+ DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd)
+ "-" + "-"
+ StringUtil.leftPad( + StringUtil.leftPad(
((Long) countMap.get("count")).intValue(), 4, newcount, 4,
'0'); '0');
}else if(orderType.equals("04")){ }else if(orderType.equals("04")){
noticeid = "YK" noticeid = "YK"
+ DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd)
+ "-" + "-"
+ StringUtil.leftPad( + StringUtil.leftPad(
((Long) countMap.get("count")).intValue(), 4, newcount, 4,
'0'); '0');
}else if(orderType.equals("09")){ }else if(orderType.equals("09")){
noticeid = "QTRK" noticeid = "QTRK"
+ DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd)
+ "-" + "-"
+ StringUtil.leftPad( + StringUtil.leftPad(
((Long) countMap.get("count")).intValue(), 4, newcount, 4,
'0'); '0');
}else { }else {
noticeid = "QT" noticeid = "QT"
+ DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd)
+ "-" + "-"
+ StringUtil.leftPad( + StringUtil.leftPad(
((Long) countMap.get("count")).intValue(), 4, newcount, 4,
'0'); '0');
} }
@ -109,6 +117,13 @@ public class wmUtil {
Map<String, Object> countMap = systemService Map<String, Object> countMap = systemService
.findOneForJdbc("SELECT cast(right(ifnull((om_notice_id),0),4)+1 as SIGNED) as count FROM wm_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW()) order by create_date desc limit 1"); .findOneForJdbc("SELECT cast(right(ifnull((om_notice_id),0),4)+1 as SIGNED) as count FROM wm_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW()) order by create_date desc limit 1");
String noticeid = null; String noticeid = null;
int newcount = 0;
try{
newcount= ((Long) countMap.get("count")).intValue();
}catch (Exception e){
newcount = 1;
}
if (StringUtil.isEmpty(orderType)){ if (StringUtil.isEmpty(orderType)){
orderType = "11"; orderType = "11";
} }
@ -117,21 +132,21 @@ public class wmUtil {
+ DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd)
+ "-" + "-"
+ StringUtil.leftPad( + StringUtil.leftPad(
((Long) countMap.get("count")).intValue(), 4, newcount, 4,
'0'); '0');
}else if (orderType.equals("11")){ }else if (orderType.equals("11")){
noticeid = "CK" noticeid = "CK"
+ DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd)
+ "-" + "-"
+ StringUtil.leftPad( + StringUtil.leftPad(
((Long) countMap.get("count")).intValue(), 4, newcount, 4,
'0'); '0');
}else { }else {
noticeid = "QT" noticeid = "QT"
+ DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd)
+ "-" + "-"
+ StringUtil.leftPad( + StringUtil.leftPad(
((Long) countMap.get("count")).intValue(), 4, newcount, 4,
'0'); '0');
} }
return noticeid; return noticeid;