|
|
@ -17,6 +17,7 @@ import com.epmet.dto.form.CodeAuditRecordFormDTO; |
|
|
|
import com.epmet.dto.form.MessagePushTextFormDTO; |
|
|
|
import com.epmet.dto.result.AuthorizationInfoResultDTO; |
|
|
|
import com.epmet.dto.result.CustomerIdAndClientResultDTO; |
|
|
|
import com.epmet.dto.result.DingResultDTO; |
|
|
|
import com.epmet.dto.result.TemplateAndAppIdResultDTO; |
|
|
|
import com.epmet.mpaes.AesException; |
|
|
|
import com.epmet.mpaes.WXBizMsgCrypt; |
|
|
@ -143,27 +144,35 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
|
codeAuditRecord.setCustomerId(customerId); |
|
|
|
codeAuditRecord.setAuthAppId(authAppId); |
|
|
|
codeAuditRecord.setTemplateId(templateId); |
|
|
|
String customerName = paCustomerDao.selectCustomerName(customerId); |
|
|
|
String client = clientType.equals(ModuleConstant.RESI) ? "居民端" : "工作端"; |
|
|
|
//插入 代码审核 记录
|
|
|
|
log.info(String.format(ThirdRunTimeInfoConstant.CODE_AUDIT_RESULT, xml)); |
|
|
|
codeAuditRecordDao.insertCodeAuditRecord(codeAuditRecord); |
|
|
|
// 修改 code_audit_result 中的代码审核结果
|
|
|
|
String reason = codeAuditRecord.getReason(); |
|
|
|
String codeResult = null; |
|
|
|
switch (event) { |
|
|
|
case ModuleConstant.WEAPP_AUDIT_SUCCESS: |
|
|
|
codeResult = ModuleConstant.AUDIT_SUCCESS; |
|
|
|
Long successTime = Long.valueOf(xml.get(ModuleConstant.SUCC_TIME).toString()); |
|
|
|
codeAuditRecord.setSuccTime(componentVerifyTicketServiceImpl.sToDate(successTime.toString())); |
|
|
|
break; |
|
|
|
case ModuleConstant.WEAPP_AUDIT_FAIL: |
|
|
|
codeResult = ModuleConstant.AUDIT_FAILED; |
|
|
|
Long failTime = Long.valueOf(xml.get(ModuleConstant.FAIL_TIME).toString()); |
|
|
|
codeAuditRecord.setFailTime(componentVerifyTicketServiceImpl.sToDate(failTime.toString())); |
|
|
|
break; |
|
|
|
case ModuleConstant.WEAPP_AUDIT_DELAY: |
|
|
|
codeResult = ModuleConstant.DELAY; |
|
|
|
Long delayTime = Long.valueOf(xml.get(ModuleConstant.DELAY_TIME).toString()); |
|
|
|
codeAuditRecord.setDelayTime(componentVerifyTicketServiceImpl.sToDate(delayTime.toString())); |
|
|
|
break; |
|
|
|
default: |
|
|
|
codeResult = ModuleConstant.AUDIT_FAILED; |
|
|
|
} |
|
|
|
//插入 代码审核 记录
|
|
|
|
log.info(String.format(ThirdRunTimeInfoConstant.CODE_AUDIT_RESULT, xml)); |
|
|
|
codeAuditRecordDao.insertCodeAuditRecord(codeAuditRecord); |
|
|
|
// 修改 code_audit_result 中的代码审核结果
|
|
|
|
String reason = codeAuditRecord.getReason(); |
|
|
|
log.info("开始寻找机器人发送消息"); |
|
|
|
this.dingDingRobot(reason,event,customerName,client); |
|
|
|
DingResultDTO dingResultDTO = codeCustomerDao.selectCustomerNameAndVersion(customerId, clientType); |
|
|
|
this.dingDingRobot(reason,event,dingResultDTO,client); |
|
|
|
log.info("已找到robot,并发送消息......"); |
|
|
|
String codeCustomerId = codeCustomerDao.selectCodeCustomerId(codeAuditRecord); |
|
|
|
codeAuditResultDao.updateAuditResult(customerId, codeCustomerId, codeResult); |
|
|
@ -206,33 +215,37 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
|
* @author zxc |
|
|
|
* @date 2020/8/5 4:33 下午 |
|
|
|
*/ |
|
|
|
public void dingDingRobot(String result,String event,String customerName,String clientType){ |
|
|
|
public void dingDingRobot(String result,String event,DingResultDTO dingResultDTO,String clientType){ |
|
|
|
OapiRobotSendRequest request = new OapiRobotSendRequest(); |
|
|
|
request.setMsgtype("markdown"); |
|
|
|
OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); |
|
|
|
markdown.setTitle("代码审核结果"); |
|
|
|
String customerName = dingResultDTO.getCustomerName(); |
|
|
|
String userVersion = dingResultDTO.getUserVersion(); |
|
|
|
switch (event){ |
|
|
|
case ModuleConstant.WEAPP_AUDIT_SUCCESS: |
|
|
|
markdown.setText("代码审核结果: 审核成功\n"+ |
|
|
|
"> 客户名称:" + customerName +"\n\n"+ |
|
|
|
"> 客户端:"+clientType+"\n"); |
|
|
|
"> 客户端:"+clientType+"\n\n"+ |
|
|
|
"> 版本号:"+userVersion); |
|
|
|
break; |
|
|
|
case ModuleConstant.WEAPP_AUDIT_FAIL: |
|
|
|
markdown.setText("代码审核结果: 审核不通过\n"+ |
|
|
|
"> 客户名称:" + customerName +"\n\n"+ |
|
|
|
"> 客户端:"+clientType+"\n\n"+ |
|
|
|
"> 版本号:"+userVersion+"\n\n"+ |
|
|
|
"> 不通过原因:"+result); |
|
|
|
break; |
|
|
|
case ModuleConstant.WEAPP_AUDIT_DELAY: |
|
|
|
markdown.setText("代码审核结果: 审核延时\n"+ |
|
|
|
"> 客户名称:" + customerName +"\n\n"+ |
|
|
|
"> 客户端:"+clientType+"\n\n"+ |
|
|
|
"> 版本号:"+userVersion+"\n\n"+ |
|
|
|
"> 延时原因:"+result); |
|
|
|
break; |
|
|
|
default: |
|
|
|
markdown.setText("机器人生病了......"); |
|
|
|
log.info("event为:"+event); |
|
|
|
break; |
|
|
|
} |
|
|
|
request.setMarkdown(markdown); |
|
|
|
log.info("robot需要发送的内容为:"+markdown.getText()); |
|
|
|