Parcourir la source

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu il y a 5 mois
Parent
commit
e22c8d8c74

+ 80 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/common/CallRecordOrderVo.java

@@ -0,0 +1,80 @@
+package com.gree.mall.manager.bean.common;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.plus.entity.CallRecord;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ZfireField(tbName = "a")
+public class CallRecordOrderVo   {
+
+
+    @ZfireField(hide = true)
+    @TableId(value = "id", type = IdType.ID_WORKER_STR)
+    private String id;
+
+    @ApiModelProperty(value = "工单号")
+    private String orderBaseId;
+
+    @ApiModelProperty(value = "当时的工单状态")
+    private String orderStatus;
+
+    @ApiModelProperty(value = "呼叫方式")
+    private String callType1;
+
+    @ApiModelProperty(value = "通话类型")
+    private String callType2;
+
+    @ApiModelProperty(value = "师傅手机号")
+    private String workerMobile;
+
+    @ApiModelProperty(value = "通话发起时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "摘机接通时间")
+    private Date start;
+
+    @ApiModelProperty(value = "通话结束时间")
+    private Date end;
+
+    @ApiModelProperty(value = "客户手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "师傅/信息员云呼信息")
+    private String promoter;
+
+    @ApiModelProperty(value = "回访成功/回访失败")
+    private String status;
+
+    @ApiModelProperty(value = "通话时长(秒)")
+    private Integer callTimestamp;
+
+    @ApiModelProperty(value = "振铃时长(秒)")
+    private Integer ringTimestamp;
+
+    @ApiModelProperty(value = "录音文件")
+    private String fileUrl;
+
+    @ApiModelProperty(value = "录音转文本")
+    private String contentText;
+
+    @ApiModelProperty(value = "原因描述")
+    private String remark;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+
+}

+ 3 - 0
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/CommonMapper.java

@@ -7,6 +7,7 @@ import com.gree.mall.manager.bean.activity.PromotionActivityVO;
 import com.gree.mall.manager.bean.admin.AdminCompanyPayConfigVO;
 import com.gree.mall.manager.bean.charging.ChargingStandardBean;
 import com.gree.mall.manager.bean.common.AmityUrlVO;
+import com.gree.mall.manager.bean.common.CallRecordOrderVo;
 import com.gree.mall.manager.bean.common.CallRecordVo;
 import com.gree.mall.manager.bean.contract.SettleRelaConfigVO;
 import com.gree.mall.manager.bean.engin.OrderEnginBaseVO;
@@ -704,4 +705,6 @@ public interface CommonMapper {
                              @Param("adminWebsitIds") List<String> websitIds);
 
     IPage<SettleRelaConfigVO> settleRelaConfigPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);
+
+    IPage<CallRecordOrderVo> listOrder(Page page,  @Param("ex") ZfireParamBean zfireParam);
 }

+ 31 - 1
mall-server-api/src/main/java/com/gree/mall/manager/controller/common/CallRecordController.java

@@ -4,11 +4,13 @@ import cn.hutool.core.lang.TypeReference;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.common.CallRecordOrderVo;
 import com.gree.mall.manager.bean.common.CallRecordVo;
 import com.gree.mall.manager.bean.workorder.IncreVO;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.logic.unicom.UnicomLogic;
+import com.gree.mall.manager.plus.entity.CallRecord;
 import com.gree.mall.manager.plus.entity.CallSendRecord;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
@@ -38,7 +40,7 @@ public class CallRecordController {
     ) throws RemoteServiceException {
         ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
         IPage<CallRecordVo> increVOIPage = unicomLogic.list(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
-        return ResponseHelper.success(increVOIPage, new TypeReference<IncreVO>() {});
+        return ResponseHelper.success(increVOIPage, new TypeReference<CallRecordVo>() {});
     }
 
     @PostMapping("/list/export")
@@ -74,4 +76,32 @@ public class CallRecordController {
         unicomLogic.commonlnte(phone,orderBaseId,flag);
         return ResponseHelper.success();
     }
+
+
+
+    @ZfireList
+    @PostMapping("/listOrder")
+    @ApiOperation(value = "工单通话记录列表")
+    public ResponseHelper<IPage<CallRecordOrderVo>> listOrder(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) throws RemoteServiceException {
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        IPage<CallRecordOrderVo> increVOIPage = unicomLogic.listOrder(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        return ResponseHelper.success(increVOIPage, new TypeReference<CallRecordOrderVo>() {});
+    }
+
+    @PostMapping("/list/orderExport")
+    @ApiOperation(value = "工单通话记录列表导出")
+    public void listOrderExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //1.组装查询条件
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        //2.查询要导出的内容
+        IPage<CallRecordOrderVo> increVOIPage = unicomLogic.listOrder(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        //3.导出
+        FieldUtils.exportData(increVOIPage.getRecords(), zfireParam.getExportFields(), request, response);
+    }
 }

+ 12 - 14
mall-server-api/src/main/java/com/gree/mall/manager/logic/comlist/ComListAllLogic.java

@@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.file.FileWriter;
 import cn.hutool.core.util.ZipUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.alibaba.nacos.client.config.utils.IOUtils;
 import com.alibaba.nacos.common.util.UuidUtils;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -320,23 +321,20 @@ public class ComListAllLogic {
     }
 
     public void download(String id, String downloadPwd, HttpServletRequest request, HttpServletResponse response) throws IOException {
-        AdminUserCom adminUser = commonLogic.getAdminUser();
-        //最多下载10个
-        IPage<ComList> comListIPage = commonMapper.queryComList(new Page(1, 10), adminUser.getAdminWebsitIds(), adminUser.getUserName());
-        if (CollectionUtils.isEmpty(comListIPage.getRecords())) {
-            return;
+        AdminUserCom adminUser = commonLogic.getAdminUser(request);
+        ComList comList = comListService.getById(id);
+        if (comList.getIsPwd() && !StringUtils.equals(comList.getDownloadPwd(), downloadPwd)) {
+            throw new RemoteServiceException("下载密码校验失败,请联系相关人员");
         }
-        List<String> comListIds = comListIPage.getRecords().stream().map(ComList::getId).collect(Collectors.toList());
-        if (CollectionUtils.isEmpty(comListIds))
-            return;
+        log.info("【中心文件下发下载】:{}", JSONObject.toJSONString(adminUser));
         List<ComDetail> comDetails = comDetailService.lambdaQuery()
-                .in(ComDetail::getComListId, comListIds)
-                .in(ComDetail::getWebsitId, adminUser.getAdminWebsitIds()).list();
+                .eq(ComDetail::getComListId, id)
+                .in(ComDetail::getWebsitId, adminUser.getAdminWebsitIds())
+                .list();
+
         if (CollectionUtils.isEmpty(comDetails)) {
-            return;
+            throw new RemoteServiceException("暂无您可下载的内容");
         }
-        List<String> comDetailIds = comDetails.stream().map(ComDetail::getId).collect(Collectors.toList());
-        comDetailService.lambdaUpdate().set(ComDetail::getIsDownload, true).in(ComDetail::getId, comDetailIds).update();
         this.download(comDetails, adminUser, response);
     }
 
@@ -372,7 +370,7 @@ public class ComListAllLogic {
             }
             Map<String, Object> map = new HashMap<>();
             map.put("fileUrl", comDetail.getFileUrl());
-            map.put("fileName", comDetail.getWebsitId() + "-(" + comDetail.getTitle() + ").xlsx");
+            map.put("fileName", comDetail.getFileUrl().split("/")[3]);
             files.add(map);
         }
         if (files.size() > 1) {

+ 12 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/unicom/UnicomLogic.java

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 
 import com.gree.mall.manager.bean.admin.AdminUserCom;
+import com.gree.mall.manager.bean.common.CallRecordOrderVo;
 import com.gree.mall.manager.bean.common.CallRecordVo;
 import com.gree.mall.manager.bean.workorder.IncreVO;
 import com.gree.mall.manager.commonmapper.CommonMapper;
@@ -256,4 +257,15 @@ public class UnicomLogic {
         IPage<CallRecordVo> callRecordVoIPage = commonMapper.list(page, zfireParam,websitIds);
         return callRecordVoIPage;
     }
+
+    public IPage<CallRecordOrderVo> listOrder(Page page, ZfireParamBean zfireParam) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        //1.组装查询条件
+        zfireParam = FieldUtils.supplyParam(zfireParam, CallRecordOrderVo.class);
+
+        IPage<CallRecordOrderVo> callRecordVoIPage = commonMapper.listOrder(page, zfireParam);
+        return callRecordVoIPage;
+    }
 }

+ 11 - 0
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1376,4 +1376,15 @@
         </if>
         ${ex.orderBy}
     </select>
+    <select id="listOrder" resultType="com.gree.mall.manager.bean.common.CallRecordOrderVo">
+        SELECT
+        ${ex.selected}
+        FROM
+        call_record  a
+        ${ex.query}
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
 </mapper>