46 lines
1.2 KiB
Java
46 lines
1.2 KiB
Java
package com.gzzn.omms.msgexchangeapi.service;
|
|||
|
|
|
||
|
|
import java.util.Date;
|
||
|
|
import java.util.Locale;
|
||
|
|
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.stereotype.Service;
|
||
|
|
|
||
|
|
import com.gzzn.omms.msgexchangeapi.dao.CmoutmsgDao;
|
||
|
|
import com.gzzn.omms.msgexchangeapi.entity.Cmoutmsg;
|
||
|
|
import com.gzzn.omms.msgexchangeapi.entity.msg.rqfd.RefdMsg;
|
||
|
|
import com.gzzn.omms.msgexchangeapi.entity.msg.rqfd.RefdMsgBody;
|
||
|
|
import com.gzzn.omms.msgexchangeapi.utils.DateTimeUtil;
|
||
|
|
|
||
|
|
@Service
|
||
|
|
public class CmoutmsgServiceImpl implements ICmoutmsgService {
|
||
|
|
@Autowired
|
||
|
|
private IExchangeService exchangeService;
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private CmoutmsgDao cmoutmsgDao;
|
||
|
|
|
||
|
|
public Boolean sendSchdGetMsg(Date date)
|
||
|
|
{
|
||
|
|
//构造消息
|
||
|
|
Cmoutmsg cmoutmsg = new Cmoutmsg();
|
||
|
|
RefdMsgBody body = new RefdMsgBody();
|
||
|
|
body.setStdb(
|
||
|
|
DateTimeUtil.gtFormatStr(
|
||
|
|
date,
|
||
|
|
"ddMMMyyHHmm",
|
||
|
|
Locale.ENGLISH)
|
||
|
|
.toUpperCase()
|
||
|
|
);
|
||
|
|
RefdMsg msg = new RefdMsg();
|
||
|
|
msg.setRefd(body);
|
||
|
|
cmoutmsg.setCminmsgsClobMsg(exchangeService.objectToXmlstr(msg));
|
||
|
|
cmoutmsg.setCminmsgsStatus("VALID");
|
||
|
|
|
||
|
|
Cmoutmsg rtCmoutmsg = cmoutmsgDao.save(cmoutmsg);
|
||
|
|
|
||
|
|
return rtCmoutmsg != null;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|