完善SEQN 生成算法

This commit is contained in:
zhouxiunai
2019-01-08 11:02:18 +08:00
parent cf31345289
commit 6b4fb1ac60
2 changed files with 18 additions and 2 deletions
@@ -30,6 +30,16 @@ public class CmoutmsgServiceImpl implements ICmoutmsgService {
public Boolean sendSchdGetMsg(Date startDate,Date endDate)
{
String nowtime = DateTimeUtil.gtFormatStr(new Date(), "yyMMddhhmmss", Locale.ENGLISH);
String seqn = "1";
//
Integer maxId = cmoutmsgDao.findMaxId();
if(maxId != null)
{
seqn = String.valueOf(maxId + 1);
}
//构造消息
MSG rqfdMsg = new MSGBuilder().
setMETA(
@@ -38,7 +48,7 @@ public class CmoutmsgServiceImpl implements ICmoutmsgService {
.setTYPE(MESSAGETYPES.RQFD)
.setSTYP(MESSAGESUBTYPES.NONE)
.setDTTM(new BigInteger(nowtime))
.setSEQN(new BigInteger(nowtime))
.setSEQN(new BigInteger(seqn))
.build()
)
.build();