|
@ -3,11 +3,9 @@ package com.epmet.service.impl; |
|
|
import com.alibaba.nacos.client.config.utils.IOUtils; |
|
|
import com.alibaba.nacos.client.config.utils.IOUtils; |
|
|
import com.epmet.constant.ModuleConstant; |
|
|
import com.epmet.constant.ModuleConstant; |
|
|
import com.epmet.constant.ThirdRunTimeInfoConstant; |
|
|
import com.epmet.constant.ThirdRunTimeInfoConstant; |
|
|
import com.epmet.dao.CodeAuditRecordDao; |
|
|
import com.epmet.dao.*; |
|
|
import com.epmet.dao.CodeAuditResultDao; |
|
|
|
|
|
import com.epmet.dao.CodeCustomerDao; |
|
|
|
|
|
import com.epmet.dao.MiniInfoDao; |
|
|
|
|
|
import com.epmet.dto.form.CodeAuditRecordFormDTO; |
|
|
import com.epmet.dto.form.CodeAuditRecordFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.MessagePushTextFormDTO; |
|
|
import com.epmet.dto.result.CustomerIdAndClientResultDTO; |
|
|
import com.epmet.dto.result.CustomerIdAndClientResultDTO; |
|
|
import com.epmet.dto.result.TemplateAndAppIdResultDTO; |
|
|
import com.epmet.dto.result.TemplateAndAppIdResultDTO; |
|
|
import com.epmet.mpaes.AesException; |
|
|
import com.epmet.mpaes.AesException; |
|
@ -55,6 +53,10 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
private CodeCustomerDao codeCustomerDao; |
|
|
private CodeCustomerDao codeCustomerDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private CodeAuditResultDao codeAuditResultDao; |
|
|
private CodeAuditResultDao codeAuditResultDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ComponentVerifyTicketServiceImpl componentVerifyTicketServiceImpl; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private MessagePushTextDao messagePushTextDao; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 1.保存代码审核结果 2.更新代码上传结果 |
|
|
* @Description 1.保存代码审核结果 2.更新代码上传结果 |
|
@ -91,9 +93,10 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
Map<String, Object> result = WXXmlToMapUtil.multilayerXmlToMap(msg); |
|
|
Map<String, Object> result = WXXmlToMapUtil.multilayerXmlToMap(msg); |
|
|
Map<String,Object> xml = (Map<String, Object>) result.get(ModuleConstant.XML); |
|
|
Map<String,Object> xml = (Map<String, Object>) result.get(ModuleConstant.XML); |
|
|
if (xml.get(ModuleConstant.MSG_TYPE).equals(ModuleConstant.EVENT_LOW)) { |
|
|
if (xml.get(ModuleConstant.MSG_TYPE).equals(ModuleConstant.EVENT_LOW)) { |
|
|
|
|
|
// TODO 目前来看,msgType = ‘event’ 的是代码审核结果
|
|
|
Long createTime = Long.valueOf(xml.get(ModuleConstant.CREATE_TIME).toString()); |
|
|
Long createTime = Long.valueOf(xml.get(ModuleConstant.CREATE_TIME).toString()); |
|
|
CodeAuditRecordFormDTO codeAuditRecord = componentVerifyTicketService.mapToEntity(xml, CodeAuditRecordFormDTO.class); |
|
|
CodeAuditRecordFormDTO codeAuditRecord = componentVerifyTicketService.mapToEntity(xml, CodeAuditRecordFormDTO.class); |
|
|
codeAuditRecord.setWechatCreateTime(new Date(createTime)); |
|
|
codeAuditRecord.setWechatCreateTime(componentVerifyTicketServiceImpl.sToDate(createTime.toString())); |
|
|
String toUserName = codeAuditRecord.getToUserName();//小程序原始ID
|
|
|
String toUserName = codeAuditRecord.getToUserName();//小程序原始ID
|
|
|
CustomerIdAndClientResultDTO customerIdAndClientResultDTO = miniInfoDao.selectCustomerIdAndClientByToUserName(toUserName); |
|
|
CustomerIdAndClientResultDTO customerIdAndClientResultDTO = miniInfoDao.selectCustomerIdAndClientByToUserName(toUserName); |
|
|
String clientType = customerIdAndClientResultDTO.getClientType(); |
|
|
String clientType = customerIdAndClientResultDTO.getClientType(); |
|
@ -113,15 +116,23 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
switch (event) { |
|
|
switch (event) { |
|
|
case ModuleConstant.WEAPP_AUDIT_SUCCESS: |
|
|
case ModuleConstant.WEAPP_AUDIT_SUCCESS: |
|
|
codeResult = ModuleConstant.AUDIT_SUCCESS; |
|
|
codeResult = ModuleConstant.AUDIT_SUCCESS; |
|
|
|
|
|
break; |
|
|
case ModuleConstant.WEAPP_AUDIT_FAIL: |
|
|
case ModuleConstant.WEAPP_AUDIT_FAIL: |
|
|
codeResult = ModuleConstant.AUDIT_FAILED; |
|
|
codeResult = ModuleConstant.AUDIT_FAILED; |
|
|
|
|
|
break; |
|
|
case ModuleConstant.WEAPP_AUDIT_DELAY: |
|
|
case ModuleConstant.WEAPP_AUDIT_DELAY: |
|
|
codeResult = ModuleConstant.DELAY; |
|
|
codeResult = ModuleConstant.DELAY; |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
String codeCustomerId = codeCustomerDao.selectCodeCustomerId(codeAuditRecord); |
|
|
String codeCustomerId = codeCustomerDao.selectCodeCustomerId(codeAuditRecord); |
|
|
codeAuditResultDao.updateAuditResult(customerId, codeCustomerId, codeResult); |
|
|
codeAuditResultDao.updateAuditResult(customerId, codeCustomerId, codeResult); |
|
|
}else if (xml.get(ModuleConstant.MSG_TYPE).equals(ModuleConstant.TEXT)){ |
|
|
}else if (xml.get(ModuleConstant.MSG_TYPE).equals(ModuleConstant.TEXT)){ |
|
|
|
|
|
// TODO 公众号回复消息
|
|
|
|
|
|
MessagePushTextFormDTO messagePushTextFormDTO = componentVerifyTicketService.mapToEntity(xml, MessagePushTextFormDTO.class); |
|
|
|
|
|
Object createTime = xml.get(ModuleConstant.CREATE_TIME); |
|
|
|
|
|
Date date = componentVerifyTicketServiceImpl.sToDate(createTime.toString()); |
|
|
|
|
|
messagePushTextFormDTO.setWeChatCreateTime(date); |
|
|
|
|
|
messagePushTextDao.insertMessageText(messagePushTextFormDTO); |
|
|
} |
|
|
} |
|
|
return ModuleConstant.SUCCESS; |
|
|
return ModuleConstant.SUCCESS; |
|
|
} |
|
|
} |
|
|