From 6afe66f741d4294c5ecb02eba557e09817cb28d3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 5 Aug 2020 15:34:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA=F0=9F=A4=96?= =?UTF-8?q?=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/PaCustomerDao.java | 7 +++++ .../service/impl/WarrantServiceImpl.java | 29 ++++++++++++++----- .../main/resources/mapper/PaCustomerDao.xml | 11 +++++++ 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerDao.java index c977d5d7f4..7f59170729 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerDao.java @@ -77,4 +77,11 @@ public interface PaCustomerDao extends BaseDao { * @Description 修改pa_customer表主键值 **/ int updateIdById(ModifyCustomerFormDTO formDTO); + + /** + * @Description 查询客户名称 + * @author zxc + * @date 2020/8/5 3:23 下午 + */ + String selectCustomerName(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java index 7177625410..39dddfe6dc 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java @@ -75,6 +75,8 @@ public class WarrantServiceImpl implements WarrantService { private MessagePushTextDao messagePushTextDao; @Autowired private RedisThird redisThird; + @Autowired + private PaCustomerDao paCustomerDao; /** * @Description 1.保存代码审核结果 2.更新代码上传结果 @@ -139,6 +141,8 @@ public class WarrantServiceImpl implements WarrantService { codeAuditRecord.setCustomerId(customerId); codeAuditRecord.setAuthAppId(authAppId); codeAuditRecord.setTemplateId(templateId); + String customerName = paCustomerDao.selectCustomerName(customerId); + String client = this.getClient(clientType); //插入 代码审核 记录 log.info(String.format(ThirdRunTimeInfoConstant.CODE_AUDIT_RESULT, xml)); codeAuditRecordDao.insertCodeAuditRecord(codeAuditRecord); @@ -149,15 +153,15 @@ public class WarrantServiceImpl implements WarrantService { switch (event) { case ModuleConstant.WEAPP_AUDIT_SUCCESS: codeResult = ModuleConstant.AUDIT_SUCCESS; - this.dingDingRobot(reason,null); + this.dingDingRobot(reason,null,customerName,client); break; case ModuleConstant.WEAPP_AUDIT_FAIL: codeResult = ModuleConstant.AUDIT_FAILED; - this.dingDingRobot(reason,codeResult); + this.dingDingRobot(reason,codeResult,customerName,client); break; case ModuleConstant.WEAPP_AUDIT_DELAY: codeResult = ModuleConstant.DELAY; - this.dingDingRobot(reason,codeResult); + this.dingDingRobot(reason,codeResult,customerName,client); break; } String codeCustomerId = codeCustomerDao.selectCodeCustomerId(codeAuditRecord); @@ -199,21 +203,27 @@ public class WarrantServiceImpl implements WarrantService { return ModuleConstant.SUCCESS; } - public void dingDingRobot(String result,String event){ + public void dingDingRobot(String result,String event,String customerName,String clientType){ DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/robot/send?access_token=5b48fcbc3fde24b8ba4696aa062b7f8146479a9d3467dbb1f9cf132ec36b955a"); OapiRobotSendRequest request = new OapiRobotSendRequest(); request.setMsgtype("text"); OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); switch (event){ case ModuleConstant.WEAPP_AUDIT_SUCCESS: - text.setContent("代码审核结果: 审核成功"); + text.setContent("代码审核结果: 审核成功\n"+ + "客户名称:" + customerName +"\n"+ + "客户端:"+clientType+"\n"); break; case ModuleConstant.WEAPP_AUDIT_FAIL: - text.setContent("代码审核结果: 审核不通过,"+ + text.setContent("代码审核结果: 审核不通过\n"+ + "客户名称:" + customerName +"\n"+ + "客户端:"+clientType+"\n"+ "不通过原因:"+result); break; case ModuleConstant.WEAPP_AUDIT_DELAY: - text.setContent("代码审核结果: 审核延时,"+ + text.setContent("代码审核结果: 审核延时\n"+ + "客户名称:" + customerName +"\n"+ + "客户端:"+clientType+"\n"+ "延时原因:"+result); break; } @@ -226,6 +236,11 @@ public class WarrantServiceImpl implements WarrantService { } } + public String getClient(String clientType){ + String result = clientType == "resi" ? "居民端" : "工作端"; + return result; + } + /** * 方法描述: 类型为enevt的时候,拼接 * @param request diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml index 7d4c8e69ef..2d09708ba1 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml @@ -71,6 +71,17 @@ + + + UPDATE pa_customer SET is_initialize = #{isInitialize}