mirror of
https://gitee.com/sdyunze/iotlink.git
synced 2026-09-01 15:33:12 +08:00
修复定时任务激活时间消费者监听队列
This commit is contained in:
+17
-9
@@ -57,8 +57,9 @@ public class ActivateDate {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RabbitHandler
|
||||
@RabbitListener(queues = "polling_dlxcardActivateDate_exchange",containerFactory = "customContainerFactory")
|
||||
@RabbitListener(queues = "polling_dlxcardActivateDate_queue",containerFactory = "customContainerFactory")
|
||||
public void dlxcardActivateDate_queue(String msg, Channel channel_1) throws IOException {
|
||||
if(msg!=null && msg.length()>0){
|
||||
synActivateDate(msg,channel_1);
|
||||
@@ -67,6 +68,8 @@ public class ActivateDate {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void synActivateDate(String msg, Channel channel) throws IOException {
|
||||
try {
|
||||
if (StringUtils.isEmpty(msg)) {
|
||||
@@ -82,8 +85,7 @@ public class ActivateDate {
|
||||
//if(isExecute==null){
|
||||
//System.out.println("SUCCESS");
|
||||
// redisCache.setCacheObject(prefix+":"+ iccid, msg, 3, TimeUnit.MINUTES);//3 分钟缓存 避免 重复消费
|
||||
redisCache.setCacheObject(polling_id+":"+ iccid, msg, 1, TimeUnit.HOURS);//1 小时缓存 用来统计轮询进度
|
||||
|
||||
// redisCache.setCacheObject(polling_id+":"+ iccid, msg, 3, TimeUnit.MINUTES);//3 分钟缓存 用来统计轮询进度
|
||||
|
||||
Map<String,Object> Parammap=new HashMap<>();
|
||||
Parammap.put("iccid",iccid);
|
||||
@@ -91,12 +93,18 @@ public class ActivateDate {
|
||||
String code = Rmap.get("code")!=null?Rmap.get("code").toString():"500";
|
||||
if(code.equals("200")){
|
||||
//获取 激活日期 开卡日期 更新 card info
|
||||
if(Rmap.get("activateDate")!=null && Rmap.get("activateDate")!="" && Rmap.get("activateDate").toString().trim().length()>0){
|
||||
String activateDate = Rmap.get("activateDate").toString().trim();
|
||||
if(Rmap.get("activateDate")!=null && Rmap.get("activateDate")!="" && Rmap.get("activateDate").toString().trim().length()>0 ||
|
||||
Rmap.get("openDate")!=null && Rmap.get("openDate")!="" && Rmap.get("openDate").toString().trim().length()>0){
|
||||
Object activateDate_obj = Rmap.get("activateDate")!=null && Rmap.get("activateDate")!="" && Rmap.get("activateDate").toString().trim().length()>0?
|
||||
Rmap.get("activateDate").toString().trim():"";
|
||||
String activateDate = activateDate_obj.toString().trim();
|
||||
activateDate = activateDate.length()>10?activateDate.substring(0,10):activateDate;
|
||||
Object openDate = Rmap.get("openDate")!=null && Rmap.get("openDate")!="" && Rmap.get("openDate").toString().trim().length()>0?
|
||||
Rmap.get("openDate").toString().trim():null;
|
||||
Map<String,Object> Upd_Map = new HashMap<>();
|
||||
Upd_Map.put("activate_date",activateDate);
|
||||
if(activateDate!=null && activateDate.length()>0 ){
|
||||
Upd_Map.put("activate_date",activateDate);
|
||||
}
|
||||
if(openDate!=null){
|
||||
Upd_Map.put("open_date",openDate);
|
||||
}
|
||||
@@ -113,13 +121,13 @@ public class ActivateDate {
|
||||
return message;
|
||||
});*/
|
||||
int upd = yzCardMapper.updActivate(Upd_Map);
|
||||
log.info("发送 变更激活时间 指令成功 !{} ",upd);
|
||||
//log.info("发送 变更激活时间 指令成功 !{} ",upd);
|
||||
} catch (Exception e) {
|
||||
System.out.println("变更激活时间 队列 创建 失败 " + e.getMessage().toString());
|
||||
System.out.println("变更激活时间 队列 创建 失败 " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.info(">>API - 激活时间轮询消费者 未获取到激活日期:{} | {} | Parammap {} | map {}<<",iccid,Rmap,Parammap,map);
|
||||
log.info(">>API - 未获取到:{} | {} | Parammap {} | map {}<<",iccid,Rmap,Parammap,map);
|
||||
// System.out.println(map.get("iccid")+" 未获取到激活日期 !");
|
||||
}
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user