|
|
@ -5,9 +5,12 @@ import com.zcloud.dto.TenCorpDto;
|
|
|
|
import com.zcloud.entity.PageData;
|
|
|
|
import com.zcloud.entity.PageData;
|
|
|
|
import com.zcloud.mapper.datasource.mq.MqErrorMessageLogMapper;
|
|
|
|
import com.zcloud.mapper.datasource.mq.MqErrorMessageLogMapper;
|
|
|
|
import com.zcloud.mapper.datasource.mq.MqMessageLogMapper;
|
|
|
|
import com.zcloud.mapper.datasource.mq.MqMessageLogMapper;
|
|
|
|
|
|
|
|
import com.zcloud.mapper.datasource.mq.MqProductionErrorLogMapper;
|
|
|
|
|
|
|
|
import com.zcloud.mapper.datasource.mq.MqProductionLogMapper;
|
|
|
|
import com.zcloud.service.mq.DockSendMessageService;
|
|
|
|
import com.zcloud.service.mq.DockSendMessageService;
|
|
|
|
import com.zcloud.service.mq.LogService;
|
|
|
|
import com.zcloud.service.mq.LogService;
|
|
|
|
import com.zcloud.util.DateUtil;
|
|
|
|
import com.zcloud.util.DateUtil;
|
|
|
|
|
|
|
|
import com.zcloud.util.StackTraceUtils;
|
|
|
|
import com.zcloud.util.Warden;
|
|
|
|
import com.zcloud.util.Warden;
|
|
|
|
import com.zcloud.util.mq.MqUtil;
|
|
|
|
import com.zcloud.util.mq.MqUtil;
|
|
|
|
import org.apache.rocketmq.client.producer.SendResult;
|
|
|
|
import org.apache.rocketmq.client.producer.SendResult;
|
|
|
@ -18,7 +21,6 @@ import org.springframework.messaging.support.GenericMessage;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
@ -39,8 +41,22 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private MqMessageLogMapper mqMessageLogMapper;
|
|
|
|
private MqMessageLogMapper mqMessageLogMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
MqProductionErrorLogMapper mqProductionErrorLogMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
MqProductionLogMapper mqProductionLogMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void sendMessage(TenCorpDto tenCorpDto) throws Exception {
|
|
|
|
public void sendMessage(TenCorpDto tenCorpDto) {
|
|
|
|
|
|
|
|
PageData productionPD = tenCorpDto.getPd();
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_ID", Warden.get32UUID());
|
|
|
|
|
|
|
|
productionPD.put("MESSAGE_LOG_ID", tenCorpDto.getMessageLogId());
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TYPE", "DockSendMessageServiceImpl.sendMessage(TenCorpDto tenCorpDto)");
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TIME", DateUtil.getTime());
|
|
|
|
|
|
|
|
productionPD.put("CREATE_TIME", tenCorpDto.getCREATE_TIME());
|
|
|
|
|
|
|
|
productionPD.put("MARK", tenCorpDto.getMark());
|
|
|
|
|
|
|
|
productionPD.putAll(tenCorpDto.getPd());
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
mqMessageLogMapper.save(log);
|
|
|
|
mqMessageLogMapper.save(log);
|
|
|
@ -48,6 +64,9 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'1');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE","SUCCESS");
|
|
|
|
|
|
|
|
mqProductionLogMapper.save(productionPD);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
@ -57,11 +76,23 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
log.put("TYPE", "0");
|
|
|
|
log.put("TYPE", "0");
|
|
|
|
log.put("TIME", tenCorpDto.getCREATE_TIME());
|
|
|
|
log.put("TIME", tenCorpDto.getCREATE_TIME());
|
|
|
|
mqErrorMessageLogMapper.save(log);
|
|
|
|
mqErrorMessageLogMapper.save(log);
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'0');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE", StackTraceUtils.printStackTraceToString(e));
|
|
|
|
|
|
|
|
mqProductionErrorLogMapper.save(productionPD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void sendMessagePicture(TenCorpDto tenCorpDto) throws Exception {
|
|
|
|
public void sendMessagePicture(TenCorpDto tenCorpDto) {
|
|
|
|
|
|
|
|
PageData productionPD = tenCorpDto.getPd();
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_ID", Warden.get32UUID());
|
|
|
|
|
|
|
|
productionPD.put("MESSAGE_LOG_ID", tenCorpDto.getMessageLogId());
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TYPE", "DockSendMessageServiceImpl.sendMessagePicture(TenCorpDto tenCorpDto)");
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TIME", DateUtil.getTime());
|
|
|
|
|
|
|
|
productionPD.put("CREATE_TIME", tenCorpDto.getCREATE_TIME());
|
|
|
|
|
|
|
|
productionPD.put("MARK", tenCorpDto.getMark());
|
|
|
|
|
|
|
|
productionPD.putAll(tenCorpDto.getPd());
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
|
|
|
|
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
|
|
|
@ -72,6 +103,9 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'1');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE","SUCCESS");
|
|
|
|
|
|
|
|
mqProductionLogMapper.save(productionPD);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
@ -80,11 +114,24 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
log.put("TYPE", "0");
|
|
|
|
log.put("TYPE", "0");
|
|
|
|
log.put("TIME", DateUtil.getTime());
|
|
|
|
log.put("TIME", DateUtil.getTime());
|
|
|
|
mqErrorMessageLogMapper.save(log);
|
|
|
|
mqErrorMessageLogMapper.save(log);
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'0');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE", StackTraceUtils.printStackTraceToString(e));
|
|
|
|
|
|
|
|
mqProductionErrorLogMapper.save(productionPD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void sendMessagePictureDelete(TenCorpDto tenCorpDto) throws Exception {
|
|
|
|
public void sendMessagePictureDelete(TenCorpDto tenCorpDto) {
|
|
|
|
|
|
|
|
PageData productionPD = tenCorpDto.getPd();
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_ID", Warden.get32UUID());
|
|
|
|
|
|
|
|
productionPD.put("MESSAGE_LOG_ID", tenCorpDto.getMessageLogId());
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TYPE", "DockSendMessageServiceImpl.sendMessagePictureDelete(TenCorpDto tenCorpDto)");
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TIME", DateUtil.getTime());
|
|
|
|
|
|
|
|
productionPD.put("CREATE_TIME", tenCorpDto.getCREATE_TIME());
|
|
|
|
|
|
|
|
productionPD.put("MARK", tenCorpDto.getMark());
|
|
|
|
|
|
|
|
productionPD.put("DATA", tenCorpDto.getData());
|
|
|
|
|
|
|
|
productionPD.putAll(tenCorpDto.getPd());
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
|
|
|
|
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
|
|
|
@ -95,6 +142,9 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'1');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE","SUCCESS");
|
|
|
|
|
|
|
|
mqProductionLogMapper.save(productionPD);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
@ -103,11 +153,23 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
log.put("TYPE", "0");
|
|
|
|
log.put("TYPE", "0");
|
|
|
|
log.put("TIME", DateUtil.getTime());
|
|
|
|
log.put("TIME", DateUtil.getTime());
|
|
|
|
mqErrorMessageLogMapper.save(log);
|
|
|
|
mqErrorMessageLogMapper.save(log);
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'0');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE", StackTraceUtils.printStackTraceToString(e));
|
|
|
|
|
|
|
|
mqProductionErrorLogMapper.save(productionPD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void SendDelayQueue(TenCorpDto tenCorpDto) {
|
|
|
|
public void SendDelayQueue(TenCorpDto tenCorpDto) {
|
|
|
|
|
|
|
|
PageData productionPD = tenCorpDto.getPd();
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_ID", Warden.get32UUID());
|
|
|
|
|
|
|
|
productionPD.put("MESSAGE_LOG_ID", tenCorpDto.getMessageLogId());
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TYPE", "DockSendMessageServiceImpl.SendDelayQueue(TenCorpDto tenCorpDto)");
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TIME", DateUtil.getTime());
|
|
|
|
|
|
|
|
productionPD.put("CREATE_TIME", tenCorpDto.getCREATE_TIME());
|
|
|
|
|
|
|
|
productionPD.put("MARK", tenCorpDto.getMark());
|
|
|
|
|
|
|
|
productionPD.put("DATA", tenCorpDto.getData());
|
|
|
|
|
|
|
|
productionPD.putAll(tenCorpDto.getPd());
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
|
|
|
|
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -127,6 +189,9 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'1');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE","SUCCESS");
|
|
|
|
|
|
|
|
mqProductionLogMapper.save(productionPD);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
log.put("ERROR_MESSAGE", e.getMessage());
|
|
|
|
log.put("ERROR_MESSAGE", e.getMessage());
|
|
|
@ -134,12 +199,26 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
log.put("TYPE", "0");
|
|
|
|
log.put("TYPE", "0");
|
|
|
|
log.put("TIME", DateUtil.getTime());
|
|
|
|
log.put("TIME", DateUtil.getTime());
|
|
|
|
mqErrorMessageLogMapper.save(log);
|
|
|
|
mqErrorMessageLogMapper.save(log);
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'0');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE", StackTraceUtils.printStackTraceToString(e));
|
|
|
|
|
|
|
|
mqProductionErrorLogMapper.save(productionPD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void SendDelayQueue(String message) {
|
|
|
|
public void SendDelayQueue(String message) {
|
|
|
|
TenCorpDto tenCorpDto = JSONObject.parseObject(message,TenCorpDto.class);
|
|
|
|
TenCorpDto tenCorpDto = JSONObject.parseObject(message,TenCorpDto.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageData productionPD = tenCorpDto.getPd();
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_ID", Warden.get32UUID());
|
|
|
|
|
|
|
|
productionPD.put("MESSAGE_LOG_ID", tenCorpDto.getMessageLogId());
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TYPE", "DockSendMessageServiceImpl.SendDelayQueue(TenCorpDto tenCorpDto)");
|
|
|
|
|
|
|
|
productionPD.put("PRODUCTION_TIME", DateUtil.getTime());
|
|
|
|
|
|
|
|
productionPD.put("CREATE_TIME", tenCorpDto.getCREATE_TIME());
|
|
|
|
|
|
|
|
productionPD.put("MARK", tenCorpDto.getMark());
|
|
|
|
|
|
|
|
productionPD.put("DATA", tenCorpDto.getData());
|
|
|
|
|
|
|
|
productionPD.putAll(tenCorpDto.getPd());
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
log.put("CREATE_TIME", DateUtil.getTime());
|
|
|
|
log.put("CREATE_TIME", DateUtil.getTime());
|
|
|
@ -157,20 +236,17 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
throw new RuntimeException("产品入栈失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'1');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE","SUCCESS");
|
|
|
|
|
|
|
|
mqProductionLogMapper.save(productionPD);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
PageData log = tenCorpDto.getPd();
|
|
|
|
logService.saveErrorMessage(log,e.getMessage());
|
|
|
|
logService.saveErrorMessage(log,e.getMessage());
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
productionPD.put("SUCCESS",'0');
|
|
|
|
|
|
|
|
productionPD.put("ERROR_MESSAGE", StackTraceUtils.printStackTraceToString(e));
|
|
|
|
|
|
|
|
mqProductionErrorLogMapper.save(productionPD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
System.out.println(MqUtil.analysisTime("2023-06-30 14:30:00:000"));
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|