Parcourir la source

木易华康-同步润天SOP app发送状态

Long il y a 1 semaine
Parent
commit
96ba43b2ae

+ 69 - 19
fs-ipad-task/src/main/java/com/fs/app/task/SendMsg.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fs.app.service.IpadSendServer;
 import com.fs.common.core.redis.RedisCacheT;
+import com.fs.common.utils.CloudHostUtils;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.PubFun;
 import com.fs.company.service.ICompanyMiniappService;
@@ -279,31 +280,66 @@ public class SendMsg {
                 }
             }
             // 推送 APP
+            boolean hasAppSend = false;
+            int successCount = 0;
             if (!setting.getSetting().isEmpty()) {
-                new Thread(() -> {
-                    try {
-                        List<QwSopTempSetting.Content.Setting> settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
-                        if (!settings.isEmpty()) {
-                            asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), user.getCompanyUserId(), qwSopLogs.getFsUserId());
-                        }
+                if (!CloudHostUtils.hasCloudHostName("木易华康")) {
+                    new Thread(() -> {
+                        try {
+                            List<QwSopTempSetting.Content.Setting> settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
+                            if (!settings.isEmpty()) {
+                                asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), user.getCompanyUserId(), qwSopLogs.getFsUserId());
+                            }
 
-                        //app文本消息
-                        log.info("开始发送app文本消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
-                        settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "15".equals(e.getContentType())).collect(Collectors.toList());
+                            //app文本消息
+                            log.info("开始发送app文本消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
+                            settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "15".equals(e.getContentType())).collect(Collectors.toList());
 
-                        if (!settings.isEmpty()) {
-                            asyncSopTestService.asyncSendMsgBySopAppTxtNormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId());
+                            if (!settings.isEmpty()) {
+                                asyncSopTestService.asyncSendMsgBySopAppTxtNormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId());
+                            }
+                            //app语音消息
+                            log.info("开始发送app语音消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
+                            settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "16".equals(e.getContentType())).collect(Collectors.toList());
+                            if (!settings.isEmpty()) {
+                                asyncSopTestService.asyncSendMsgBySopAppMP3NormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId());
+                            }
+                        } catch (Exception e) {
+                            log.error("推送APP失败", e);
+                        }
+                    }).start();
+                } else {
+                    List<QwSopCourseFinishTempSetting.Setting> settings = setting.getSetting().stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
+                    if (!settings.isEmpty()) {
+                        hasAppSend = true;
+                        boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), user.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
+                        if (sendFlag) {
+                            successCount++;
                         }
-                        //app语音消息
-                        log.info("开始发送app语音消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
-                        settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "16".equals(e.getContentType())).collect(Collectors.toList());
-                        if (!settings.isEmpty()) {
-                            asyncSopTestService.asyncSendMsgBySopAppMP3NormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId());
+                    }
+
+                    //app文本消息
+                    log.info("开始发送app文本消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
+                    settings = setting.getSetting().stream().filter(e -> "15".equals(e.getContentType())).collect(Collectors.toList());
+                    if (!settings.isEmpty()) {
+                        hasAppSend = true;
+                        boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppTxtNormalIM(settings, qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
+                        if (sendFlag) {
+                            successCount++;
                         }
-                    } catch (Exception e) {
-                        log.error("推送APP失败", e);
                     }
-                }).start();
+
+                    //app语音消息
+                    log.info("开始发送app语音消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
+                    settings = setting.getSetting().stream().filter(e -> "16".equals(e.getContentType())).collect(Collectors.toList());
+                    if (!settings.isEmpty()) {
+                        hasAppSend = true;
+                        boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppMP3NormalIM(settings, qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
+                        if (sendFlag) {
+                            successCount++;
+                        }
+                    }
+                }
             }
             qwSopLogs.setSend(true);
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -326,6 +362,20 @@ public class SendMsg {
                 updateQwSop.setRealSendTime(sdf.format(new Date()));
             }
             updateQwSop.setContentJson(JSON.toJSONString(setting));
+
+            if (hasAppSend) {
+                if (successCount == 3) {
+                    updateQwSop.setAppSendRemark("APP全部发送成功");
+                    updateQwSop.setAppSendStatus(1);
+                } else if (successCount == 0) {
+                    updateQwSop.setAppSendRemark("APP全部发送失败");
+                    updateQwSop.setAppSendStatus(2);
+                } else {
+                    updateQwSop.setAppSendRemark("APP部分发送失败");
+                    updateQwSop.setAppSendStatus(2);
+                }
+            }
+
             long end2 = System.currentTimeMillis();
             int i = qwSopLogsService.updateQwSopLogsSendType(updateQwSop);
             log.info("销售:{}, 修改条数{}, 发送方消息完成:{}, 耗时: {}", user.getQwUserName(), i, qwSopLogs.getId(), end2 - start2);

+ 5 - 0
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -1630,6 +1630,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     setting.setCourseUrl(setting.getLinkImageUrl());
                     setting.setTitle(setting.getLinkDescribe()); //小节名称
 
+                    sopLogs.setAppSendStatus(0);
                     break;
                 //自定义小程序
                 case "10":
@@ -1706,6 +1707,10 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     setting.setMiniprogramPage(linkBy);
                     setting.setContentType("14");
                     break;
+                case "15": //app文本
+                case "16": //app语音
+                    sopLogs.setAppSendStatus(0);
+                    break;
                 default:
                     break;
             }

+ 34 - 0
fs-service/src/main/java/com/fs/gtPush/service/impl/uniPush2ServiceImpl.java

@@ -18,7 +18,9 @@ import com.fs.gtPush.domain.PushResult;
 import com.fs.gtPush.domain.UniPushLog;
 import com.fs.gtPush.service.UniPushLogService;
 import com.fs.gtPush.service.uniPush2Service;
+import com.fs.his.mapper.FsUserMapper;
 import com.fs.im.config.IMConfig;
+import com.fs.im.dto.OpenImResponseDTO;
 import com.fs.im.service.OpenIMService;
 import lombok.extern.slf4j.Slf4j;
 import com.fs.system.domain.SysConfig;
@@ -54,6 +56,8 @@ public class uniPush2ServiceImpl implements uniPush2Service {
 
     @Autowired
     private CompanyUserMapper companyUserMapper;
+    @Autowired
+    private FsUserMapper fsUserMapper;
 
     @Autowired
     private IMConfig imConfig;
@@ -232,6 +236,36 @@ public class uniPush2ServiceImpl implements uniPush2Service {
         }
     }
 
+    @Override
+    public OpenImResponseDTO pushSopAppLinkMsgByExternalIMV2(String cropId, String linkTitle, String linkDescribe, String linkImageUrl, String appLinkUrl, Long companyUserId, Long fsUserId) throws JsonProcessingException {
+        if (companyUserId == null || fsUserId == null || fsUserId == 0) {
+            OpenImResponseDTO errorResponse = new OpenImResponseDTO();
+            errorResponse.setErrCode(-1);
+            errorResponse.setErrMsg("参数错误:用户未绑定销售");
+            errorResponse.setErrDlt("缺少必要参数");
+            return errorResponse;
+        }
+
+        FsUser fsUser = fsUserMapper.selectFsUserByUserId(fsUserId);
+        if (fsUser == null) {
+            OpenImResponseDTO errorResponse = new OpenImResponseDTO();
+            errorResponse.setErrCode(-2);
+            errorResponse.setErrMsg("未找到对应的用户信息");
+            errorResponse.setErrDlt("用户ID: " + fsUserId);
+            return errorResponse;
+        }
+
+        if (StringUtils.isEmpty(fsUser.getHistoryApp())) {
+            OpenImResponseDTO errorResponse = new OpenImResponseDTO();
+            errorResponse.setErrCode(-3);
+            errorResponse.setErrMsg("用户未绑定APP");
+            errorResponse.setErrDlt("用户历史APP信息为空");
+            return errorResponse;
+        }
+
+        return openIMService.sendCourse(fsUserId, companyUserId, appLinkUrl, linkDescribe, linkImageUrl, cropId);
+    }
+
     /**
      * 专用于 pushIm 的参数构建方法
      */

+ 3 - 0
fs-service/src/main/java/com/fs/gtPush/service/uniPush2Service.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fs.common.core.domain.R;
 import com.fs.gtPush.domain.PushReqBean;
 import com.fs.gtPush.domain.PushResult;
+import com.fs.im.dto.OpenImResponseDTO;
 
 public interface uniPush2Service {
     PushResult pushMessage(PushReqBean push);
@@ -13,4 +14,6 @@ public interface uniPush2Service {
     PushReqBean getParam(Long userId,String purl,String title,String content,Float type,Integer desType,String imJsonString);
     void pushSopAppLinkMsgByExternalIM(String cropId,String linkTile,String linkDescribe,String linkImageUrl,String link,Long companyUserId,Long fsUserId) throws JsonProcessingException;
     void pushIm(Long userId, Long businessId, String purl, String title, String content, Float type, Integer desType,String imJsonString);
+
+    OpenImResponseDTO pushSopAppLinkMsgByExternalIMV2(String cropId, String linkTitle, String linkDescribe, String linkImageUrl, String appLinkUrl, Long companyUserId, Long fsUserId) throws JsonProcessingException;
 }

+ 143 - 0
fs-service/src/main/java/com/fs/qw/service/impl/AsyncSopTestService.java

@@ -7,13 +7,16 @@ import com.fs.common.utils.PubFun;
 import com.fs.course.domain.FsCourseSopAppLink;
 import com.fs.course.mapper.FsCourseSopAppLinkMapper;
 import com.fs.gtPush.service.uniPush2Service;
+import com.fs.his.domain.FsUser;
 import com.fs.his.mapper.FsUserMapper;
 import com.fs.im.dto.OpenImMsgDTO;
+import com.fs.im.dto.OpenImResponseDTO;
 import com.fs.im.service.OpenIMService;
 import com.fs.qw.domain.QwSopUpdateStatus;
 import com.fs.qw.domain.QwUser;
 import com.fs.qw.mapper.QwExternalContactMapper;
 import com.fs.qw.result.QwFilterSopCustomersResult;
+import com.fs.qw.vo.QwSopCourseFinishTempSetting;
 import com.fs.qw.vo.QwSopRuleTimeVO;
 import com.fs.qw.vo.QwSopTempSetting;
 import com.fs.sop.domain.QwSop;
@@ -531,6 +534,50 @@ public class AsyncSopTestService {
 
     }
 
+    public boolean asyncSendMsgBySopAppLinkNormalIM(
+            List<QwSopCourseFinishTempSetting.Setting> setting,
+            String cropId,
+            Long companyUserId,
+            Long fsUserId,
+            String logId) {
+
+        boolean success = true;
+
+        for (QwSopCourseFinishTempSetting.Setting item : setting) {
+            try {
+                item.setSendStatus(2);
+                item.setSendRemarks("APP发送失败");
+                OpenImResponseDTO resp =
+                        push2Service.pushSopAppLinkMsgByExternalIMV2(
+                                cropId,
+                                item.getLinkTitle(),
+                                item.getLinkDescribe(),
+                                item.getLinkImageUrl(),
+                                item.getAppLinkUrl(),
+                                companyUserId,
+                                fsUserId
+                        );
+                if (resp != null && resp.getErrCode() != null && resp.getErrCode() == 0) {
+                    item.setSendStatus(1);
+                    item.setSendRemarks("发送成功");
+                } else {
+                    success = false;
+                    if (resp != null) {
+                        item.setSendRemarks(resp.getErrMsg());
+                    }
+                }
+
+            } catch (Exception e) {
+                success = false;
+                item.setSendRemarks("异常:" + e.getMessage());
+                log.error("APP课程发送异常 logId={}", logId, e);
+            }
+        }
+
+        log.info("APP课程发送完成,logId={}", logId);
+        return success;
+    }
+
     /**
      * 异步录入 发送有app的客户 之 正常sop版
      */
@@ -567,6 +614,51 @@ public class AsyncSopTestService {
 
     }
 
+    public boolean  asyncSendMsgBySopAppTxtNormalIM(List<QwSopCourseFinishTempSetting.Setting> setting,Long companyUserId,Long fsUserId, String logId){
+        boolean success = true;
+        for (QwSopCourseFinishTempSetting.Setting item : setting) {
+            try {
+                item.setSendStatus(2);
+                item.setSendRemarks("APP发送失败");
+
+                FsUser fsUser = fsUserMapper.selectFsUserByUserId(fsUserId);
+
+                // ===== 用户校验 =====
+                if (fsUser == null || com.fs.common.utils.StringUtils.isEmpty(fsUser.getHistoryApp())) {
+                    item.setSendRemarks("未找到对应的用户信息");
+                    success = false;
+                    continue;
+                }
+
+                OpenImMsgDTO openImMsgDTO = new OpenImMsgDTO();
+                openImMsgDTO.setSendID("C" + companyUserId);
+                openImMsgDTO.setRecvID("U" + fsUserId);
+                openImMsgDTO.setContentType(101);
+                openImMsgDTO.setSessionType(1);
+                OpenImMsgDTO.Content imContent = new OpenImMsgDTO.Content();
+                imContent.setContent(item.getValue());
+                openImMsgDTO.setContent(imContent);
+                OpenImResponseDTO resp = openIMService.openIMSendMsg(openImMsgDTO);
+
+                if (resp != null && resp.getErrCode() != null && resp.getErrCode() == 0) {
+                    item.setSendStatus(1);
+                    item.setSendRemarks("发送成功");
+                } else {
+                    success = false;
+                    if (resp != null) {
+                        item.setSendRemarks(resp.getErrMsg());
+                    }
+                }
+            } catch (Exception e) {
+                success = false;
+                item.setSendRemarks("异常:" + e.getMessage());
+                log.error("APP文本发送异常,logId={}", logId, e);
+            }
+        }
+        log.info("APP文本发送完成,logId={}", logId);
+        return success;
+    }
+
     @Async("scheduledExecutorService")
     public void  asyncSendMsgBySopAppMP3NormalIM(List<QwSopTempSetting.Content.Setting> setting,String cropId,Long companyUserId,Long fsUserId){
 
@@ -602,4 +694,55 @@ public class AsyncSopTestService {
         });
 
     }
+
+    public boolean  asyncSendMsgBySopAppMP3NormalIM(List<QwSopCourseFinishTempSetting.Setting> setting,Long companyUserId,Long fsUserId, String logId){
+        boolean success = true;
+        for (QwSopCourseFinishTempSetting.Setting item : setting) {
+            try {
+                item.setSendStatus(2);
+                item.setSendRemarks("APP发送失败");
+
+                FsUser fsUser = fsUserMapper.selectFsUserByUserId(fsUserId);
+                // ===== 用户校验 =====
+                if (fsUser == null || com.fs.common.utils.StringUtils.isEmpty(fsUser.getHistoryApp())) {
+                    success = false;
+                    item.setSendRemarks("未找到对应的用户信息");
+                    continue;
+                }
+                boolean isText = StrUtil.isEmpty(item.getVoiceUrl());
+                log.info("执行发送app{}消息:{}", isText ? "文本" : "语音", item);
+
+                OpenImMsgDTO msg = new OpenImMsgDTO();
+                msg.setSendID("C" + companyUserId);
+                msg.setRecvID("U" + fsUserId);
+                msg.setSessionType(1);
+                msg.setContentType(isText ? 101 : 103);
+
+                OpenImMsgDTO.Content content = new OpenImMsgDTO.Content();
+                if (isText) {
+                    content.setContent(item.getValue());
+                } else {
+                    content.setSourceUrl(item.getVoiceUrl());
+                    content.setDuration(Integer.parseInt(item.getVoiceDuration()));
+                }
+                msg.setContent(content);
+
+                OpenImResponseDTO resp = openIMService.openIMSendMsg(msg);
+
+                if (resp != null && resp.getErrCode() == 0) {
+                    item.setSendStatus(1);
+                    item.setSendRemarks("发送成功");
+                } else {
+                    success = false;
+                    item.setSendRemarks(resp != null ? resp.getErrMsg() : "未知错误");
+                }
+            } catch (Exception e) {
+                success = false;
+                item.setSendRemarks("异常:" + e.getMessage());
+                log.error("APP语音/文本发送异常,logId={}", logId, e);
+            }
+        }
+        log.info("APP语音发送完成,logId={}", logId);
+        return success;
+    }
 }

+ 10 - 0
fs-service/src/main/java/com/fs/sop/domain/QwSopLogs.java

@@ -102,6 +102,16 @@ public class QwSopLogs implements Serializable {
     @TableField(exist = false)
     private Integer expiryTime;
 
+    /**
+     * app发送状态 0未发送 1成功 2失败 3不发送
+     */
+    private Integer appSendStatus;
+    
+    /**
+     * app发送备注
+     */
+    private String appSendRemark;
+
     // 构造函数
 //    public QwSopLogs() {
 //        this.id = UUID.randomUUID().toString();

+ 10 - 0
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -801,6 +801,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 break;
                             case "16":
                                 createVoiceUrl(st, companyUserId, qwSop);
+                                sopLogs.setAppSendStatus(0);
                                 break;
                             default:
                                 break;
@@ -1041,6 +1042,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 } catch (Exception e) {
                                     throw new RuntimeException(e);
                                 }
+                                sopLogs.setAppSendStatus(0);
                                 break;
                             case "16":
                                 if (qwUser.getCompanyUserId() != null) {
@@ -1053,6 +1055,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 } catch (Exception e) {
                                     throw new RuntimeException(e);
                                 }
+                                sopLogs.setAppSendStatus(0);
                                 break;
                         }
                     }
@@ -1235,6 +1238,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             st.setLinkUrl(linkByApp.getSortLink().replaceAll("^[\\s\\u2005]+", ""));
                             st.setAppLinkUrl(linkByApp.getAppMsgLink().replaceAll("^[\\s\\u2005]+", ""));
 
+                            sopLogs.setAppSendStatus(0);
                             break;
                         //自定义小程序
                         case "10":
@@ -1423,6 +1427,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             } catch (Exception e) {
                                 throw new RuntimeException(e);
                             }
+                            sopLogs.setAppSendStatus(0);
                             break;
                         case "16":
                             createVoiceUrl(st, companyUserId, qwSop);
@@ -1433,6 +1438,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             } catch (Exception e) {
                                 throw new RuntimeException(e);
                             }
+                            sopLogs.setAppSendStatus(0);
                             break;
                         default:
                             break;
@@ -1875,6 +1881,8 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             qwUser.getId(), companyUserId, companyId, item.getExternalId(), config, qwUser.getQwUserName(), contact.getFsUserId());
                     st.setLinkUrl(linkByApp.getSortLink());
                     st.setAppLinkUrl(linkByApp.getAppMsgLink());
+
+                    sopLogs.setAppSendStatus(0);
                     break;
 
                 //自定义小程序
@@ -1942,6 +1950,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     } catch (Exception e) {
                         throw new RuntimeException(e);
                     }
+                    sopLogs.setAppSendStatus(0);
                     break;
                 case "16":
                     //app语音
@@ -1954,6 +1963,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     } catch (Exception e) {
                         throw new RuntimeException(e);
                     }
+                    sopLogs.setAppSendStatus(0);
                     break;
                 case "14":
                     LuckyBag luckyBag = luckyBagMapper.selectLuckyBagById(st.getLuckyBagId());

+ 10 - 0
fs-service/src/main/java/com/fs/sop/vo/QwSopLogsListCVO.java

@@ -94,4 +94,14 @@ public class QwSopLogsListCVO {
      */
     private String remark;
     private String corpId;
+
+    /**
+     * app发送状态 0未发送 1成功 2失败 3不发送
+     */
+    private Integer appSendStatus;
+
+    /**
+     * app发送备注
+     */
+    private String appSendRemark;
 }

+ 16 - 5
fs-service/src/main/resources/mapper/sop/QwSopLogsMapper.xml

@@ -29,10 +29,12 @@
         <result property="sort"    column="sort"    />
         <result property="qwUserKey"    column="qw_user_key"    />
         <result property="userLogsId"    column="user_logs_id"    />
+        <result property="appSendStatus"    column="app_send_status"    />
+        <result property="appSendRemark"    column="app_send_remark"    />
     </resultMap>
 
     <sql id="selectQwSopLogsVo">
-        select id,sop_id,customer_id, qw_userid,corp_id,external_user_id,external_id,external_user_name, log_type, content_json, send_status,receiving_status,msg_id, send_time, real_send_time, company_id, send_type,remark,fs_user_id,take_records from qw_sop_logs
+        select id,sop_id,customer_id, qw_userid,corp_id,external_user_id,external_id,external_user_name, log_type, content_json, send_status,receiving_status,msg_id, send_time, real_send_time, company_id, send_type,remark,fs_user_id,take_records,qw_user_key,user_logs_id,app_send_status,app_send_remark from qw_sop_logs
     </sql>
 
     <select id="selectQwSopLogsListVO" parameterType="QwSopLogs" resultMap="QwSopLogsResult">
@@ -102,6 +104,8 @@
             <if test="data.sort != null">sort,</if>
             <if test="data.userLogsId != null">user_logs_id,</if>
             <if test="data.qwUserKey != null">qw_user_key,</if>
+            <if test="data.appSendStatus != null">app_send_status,</if>
+            <if test="data.appSendRemark != null">app_send_remark,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="data.qwUserid != null">#{data.qwUserid},</if>
@@ -126,6 +130,8 @@
             <if test="data.sort != null">#{data.sort},</if>
             <if test="data.userLogsId != null">#{data.userLogsId},</if>
             <if test="data.qwUserKey != null">#{data.qwUserKey},</if>
+            <if test="data.appSendStatus != null">#{data.appSendStatus},</if>
+            <if test="data.appSendRemark != null">#{data.appSendRemark},</if>
         </trim>
     </insert>
 
@@ -148,6 +154,8 @@
             <if test="data.fsUserId != null ">fs_user_id = #{data.fsUserId},</if>
             <if test="data.sort != null ">sort = #{data.sort},</if>
             <if test="data.qwUserKey != null ">qw_user_key = #{data.qwUserKey},</if>
+            <if test="data.appSendStatus != null">app_send_status = #{data.appSendStatus},</if>
+            <if test="data.appSendRemark != null and data.appSendRemark!=''">app_send_remark = #{data.appSendRemark},</if>
         </trim>
         where id = #{data.id}
     </update>
@@ -592,7 +600,7 @@
         qw_userid, external_user_id,external_id, external_user_name, log_type,
         content_json, send_status, send_time, real_send_time, send_type,
         company_id, receiving_status, msg_id, sop_id, remark,
-        corp_id, customer_id,fs_user_id,sort,qw_user_key
+        corp_id, customer_id,fs_user_id,sort,qw_user_key,app_send_status
         )
         VALUES
         <foreach collection="qwSopLogs" item="log" separator=",">
@@ -616,7 +624,8 @@
             #{log.customerId},
             #{log.fsUserId},
             #{log.sort},
-            #{log.qwUserKey}
+            #{log.qwUserKey},
+            #{log.appSendStatus}
             )
         </foreach>
     </insert>
@@ -627,7 +636,7 @@
         qw_userid, external_user_id,external_id, external_user_name, log_type,
         content_json, send_status, send_time, real_send_time, send_type,
         company_id, receiving_status, msg_id, sop_id, remark,
-        corp_id, customer_id, fs_user_id, expiration_time,sort,user_logs_id,take_records,qw_user_key
+        corp_id, customer_id, fs_user_id, expiration_time,sort,user_logs_id,take_records,qw_user_key,app_send_status,app_send_remark
         )
         VALUES
         <foreach collection="qwSopLogs" item="log" separator=",">
@@ -654,7 +663,9 @@
             #{log.sort},
             #{log.userLogsId},
             #{log.takeRecords},
-            #{log.qwUserKey}
+            #{log.qwUserKey},
+            #{log.appSendStatus},
+            #{log.appSendRemark}
             )
         </foreach>
     </insert>