Forráskód Böngészése

修改语音通知bug

suntianwu 3 éve
szülő
commit
ac2384770a

+ 2 - 2
src/main/java/com/care/bms/controller/VoiceCallbackController.java

@@ -54,7 +54,7 @@ public class VoiceCallbackController {
                     status = ContactorStatusEnum.WEI_JIE_TONG.getValue();
                 }
 
-                bmsEventOrderService.updateOrderContactStatus4Callback(Long.parseLong(orderId), mobile, status,"无");
+                bmsEventOrderService.updateOrderContactStatus4Callback(callId,Long.parseLong(orderId), mobile, status,"无");
 
                 Map<String, Object> rtn = new HashMap<>();
                 rtn.put("result", 0);
@@ -74,7 +74,7 @@ public class VoiceCallbackController {
 
                     Integer status =  ContactorStatusEnum.WEI_JIE_TONG.getValue();
 
-                    bmsEventOrderService.updateOrderContactStatus4Callback(Long.parseLong(orderId), mobile, status,failureReason);
+                    bmsEventOrderService.updateOrderContactStatus4Callback(callId,Long.parseLong(orderId), mobile, status,failureReason);
 
                     Map<String, Object> rtn = new HashMap<>();
                     rtn.put("result", 0);

+ 11 - 16
src/main/java/com/care/bms/service/BmsEventOrderService.java

@@ -726,27 +726,22 @@ public class BmsEventOrderService {
      * @param status
      * @return
      */
-    public boolean updateOrderContactStatus4Callback(Long orderId,String contactPhone, Integer status,String failureReason) {
+    public boolean updateOrderContactStatus4Callback(String callId, Long orderId,String phone, Integer status,String failureReason) {
 
         UpdateWrapper<CareEventOrderContactStatus> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.lambda().eq(CareEventOrderContactStatus::getOrderId, orderId).eq(CareEventOrderContactStatus::getContactPhone,contactPhone)
+        updateWrapper.lambda().eq(CareEventOrderContactStatus::getOrderId, orderId).eq(CareEventOrderContactStatus::getContactPhone,phone)
                 .set(CareEventOrderContactStatus::getStatus, status);
 
-        QueryWrapper<CareEventOrderContactStatus> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(CareEventOrderContactStatus::getOrderId,orderId).eq(CareEventOrderContactStatus::getContactPhone,contactPhone);
-        CareEventOrderContactStatus contact = this.careEventOrderContactStatusService.getOne(queryWrapper);
-
-        if(contact != null) {
-            UpdateWrapper<CareEventOrderHandleHis> updateWrapper2 = new UpdateWrapper<>();
-            updateWrapper2.lambda().eq(CareEventOrderHandleHis::getOrderId, orderId)
-                    .eq(CareEventOrderHandleHis::getLogType,LogTypeEnum.VOTICE.getValue())
-                    .eq(CareEventOrderHandleHis::getLogObjectId,contact.getContactId())
-                    .eq(CareEventOrderHandleHis::getLogResult,"语音通知")
-                    .set(CareEventOrderHandleHis::getVoiceCallStatus, status)
-                    .set(CareEventOrderHandleHis::getVoiceFailureReason, failureReason);
-            this.careEventOrderHandleHisService.update(updateWrapper2);
-        }
+        UpdateWrapper<CareEventOrderHandleHis> updateWrapper2 = new UpdateWrapper<>();
+        updateWrapper2.lambda().eq(CareEventOrderHandleHis::getVoiceCallId,callId)
+                .set(CareEventOrderHandleHis::getVoiceCallStatus, status)
+                .set(CareEventOrderHandleHis::getVoiceFailureReason, failureReason);
+        this.careEventOrderHandleHisService.update(updateWrapper2);
 
+        UpdateWrapper<CareEventOrderChamb> updateWrapper3 = new UpdateWrapper<>();
+        updateWrapper3.lambda().eq(CareEventOrderChamb::getOrderId,orderId).eq(CareEventOrderChamb::getPhone,phone)
+                .set(CareEventOrderChamb::getVoiceCallStatus, status);
+        this.careEventOrderChambService.update(updateWrapper3);
 
         return this.careEventOrderContactStatusService.update(updateWrapper);
     }

+ 3 - 0
src/main/java/com/care/common/entity/CareEventOrderChamb.java

@@ -71,6 +71,9 @@ public class CareEventOrderChamb implements Serializable {
     @TableField("STATUS")
     private String status;
 
+    @ApiModelProperty("语音通知状态:1未联系,2未接通,3已联系")
+    @TableField("VOICE_CALL_STATUS")
+    private String voiceCallStatus;
 
     @ApiModelProperty("到达时间")
     @TableField("DAODA_TIME")

+ 4 - 0
src/main/java/com/care/common/entity/CareEventOrderHandleHis.java

@@ -74,6 +74,10 @@ public class CareEventOrderHandleHis implements Serializable {
     @TableField("LOG_RESULT")
     private String logResult;
 
+    @ApiModelProperty("语音通知 callid")
+    @TableField("VOICE_CALL_ID")
+    private String voiceCallId;
+
     @ApiModelProperty("语音通知状态:1未联系,2未接通,3已联系")
     @TableField("VOICE_CALL_STATUS")
     private String voiceCallStatus;

+ 2 - 0
src/main/java/com/care/common/service/impl/CareEventOrderServiceImpl.java

@@ -316,6 +316,7 @@ public class CareEventOrderServiceImpl extends ServiceImpl<CareEventOrderMapper,
                             his2.setLogType(LogTypeEnum.VOTICE.getValue());
                             his2.setLogObjectId(item.getContactId());
                             his2.setLogObjectName(item.getContactName());
+                            his2.setVoiceCallId(sendStatus.getCallId());
                             his2.setLogResult("语音通知");
                             his2.setOpUserRole(UserRoleEnum.SEAT.getValue());
                             his2.setCreateTime(DateUtil.date());
@@ -349,6 +350,7 @@ public class CareEventOrderServiceImpl extends ServiceImpl<CareEventOrderMapper,
                             his2.setLogObjectId(item.getChambId());
                             his2.setLogObjectName(item.getChambName());
                             his2.setLogResult("语音通知");
+                            his2.setVoiceCallId(sendStatus.getCallId());
                             his2.setOpUserRole(UserRoleEnum.SEAT.getValue());
                             his2.setCreateTime(DateUtil.date());
                             his2.setRelationTypeDesc("管家");