Browse Source

1.生成托盘码逻辑修改

training
zhenghaoyu 1 year ago
parent
commit
dbc22cb591
  1. 16
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java

16
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java

@ -107,20 +107,20 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
return null; return null;
} }
// String abbreviation = entity.getAbbreviation();//简称 // String abbreviation = entity.getAbbreviation();//简称
String code = entity.getCode(); String code = entity.getWarehouseCode();
//获得年月日短字符串 //获得年月日短字符串
String dateShort = CommonUtil.dateToStringShortYM(new Date()); // String dateShort = CommonUtil.dateToStringShortYM(new Date());
String key = "HT"+":"+code+":"+dateShort; String key = "HT"+":"+code;
//获得序号 //获得序号
Long incr = bladeRedis.incr(key); Long incr = bladeRedis.incr(key);
if(1 == incr){ // if(1 == incr){
//如果为1就是刚刚才建立,给他一个过期时间 // //如果为1就是刚刚才建立,给他一个过期时间
bladeRedis.expireAt(key,CommonUtil.getMonthDayEnd()); // bladeRedis.expireAt(key,CommonUtil.getMonthDayEnd());
} // }
return "HT"+code+dateShort+CommonUtil.geFourNumber(incr,5); return "HT"+code+CommonUtil.geFourNumber(incr,6);
} }

Loading…
Cancel
Save