|
|
@ -7,6 +7,7 @@ import com.dingtalk.api.request.OapiRobotSendRequest; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.HttpClientManager; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.ModuleConstant; |
|
|
@ -172,7 +173,7 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
|
String reason = codeAuditRecord.getReason(); |
|
|
|
log.info("开始寻找机器人发送消息"); |
|
|
|
DingResultDTO dingResultDTO = codeCustomerDao.selectCustomerNameAndVersion(customerId, clientType); |
|
|
|
this.dingDingRobot(reason,event,dingResultDTO,client); |
|
|
|
this.dingDingRobot(reason,event,dingResultDTO,client,codeAuditRecord); |
|
|
|
log.info("已找到robot,并发送消息......"); |
|
|
|
String codeCustomerId = codeCustomerDao.selectCodeCustomerId(codeAuditRecord); |
|
|
|
codeAuditResultDao.updateAuditResult(customerId, codeCustomerId, codeResult); |
|
|
@ -210,12 +211,24 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*public static void main(String[] args) { |
|
|
|
WarrantServiceImpl w = new WarrantServiceImpl(); |
|
|
|
DingResultDTO ding = new DingResultDTO(); |
|
|
|
ding.setUserVersion("1.1.1"); |
|
|
|
ding.setCustomerName("阿里巴巴"); |
|
|
|
CodeAuditRecordFormDTO dto = new CodeAuditRecordFormDTO(); |
|
|
|
String format = DateUtils.format(new Date(),ModuleConstant.DATE_FORMAT); |
|
|
|
System.out.println(format); |
|
|
|
dto.setFailTime(new Date()); |
|
|
|
w.dingDingRobot("再次失败","weapp_audit_fail",ding,"支付宝",dto); |
|
|
|
}*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 钉钉机器人报警 |
|
|
|
* @author zxc |
|
|
|
* @date 2020/8/5 4:33 下午 |
|
|
|
*/ |
|
|
|
public void dingDingRobot(String result,String event,DingResultDTO dingResultDTO,String clientType){ |
|
|
|
public void dingDingRobot(String result,String event,DingResultDTO dingResultDTO,String clientType,CodeAuditRecordFormDTO codeAuditRecord){ |
|
|
|
OapiRobotSendRequest request = new OapiRobotSendRequest(); |
|
|
|
request.setMsgtype("markdown"); |
|
|
|
OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); |
|
|
@ -227,12 +240,14 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
|
markdown.setText("代码审核结果: 审核成功\n"+ |
|
|
|
"> 客户名称:" + customerName +"\n\n"+ |
|
|
|
"> 客户端:"+clientType+"\n\n"+ |
|
|
|
"> 审核成功时间:"+DateUtils.format(codeAuditRecord.getSuccTime(),ModuleConstant.DATE_FORMAT)+"\n\n"+ |
|
|
|
"> 版本号:"+userVersion); |
|
|
|
break; |
|
|
|
case ModuleConstant.WEAPP_AUDIT_FAIL: |
|
|
|
markdown.setText("代码审核结果: 审核不通过\n"+ |
|
|
|
"> 客户名称:" + customerName +"\n\n"+ |
|
|
|
"> 客户端:"+clientType+"\n\n"+ |
|
|
|
"> 审核失败时间:"+DateUtils.format(codeAuditRecord.getFailTime(),ModuleConstant.DATE_FORMAT)+"\n\n"+ |
|
|
|
"> 版本号:"+userVersion+"\n\n"+ |
|
|
|
"> 不通过原因:"+result); |
|
|
|
break; |
|
|
@ -240,6 +255,7 @@ public class WarrantServiceImpl implements WarrantService { |
|
|
|
markdown.setText("代码审核结果: 审核延时\n"+ |
|
|
|
"> 客户名称:" + customerName +"\n\n"+ |
|
|
|
"> 客户端:"+clientType+"\n\n"+ |
|
|
|
"> 审核延时时间:"+DateUtils.format(codeAuditRecord.getDelayTime(),ModuleConstant.DATE_FORMAT)+"\n\n"+ |
|
|
|
"> 版本号:"+userVersion+"\n\n"+ |
|
|
|
"> 延时原因:"+result); |
|
|
|
break; |
|
|
|