haungfuli 3 年之前
父节点
当前提交
283af98e34
共有 12 个文件被更改,包括 283 次插入8 次删除
  1. 5 1
      winsea-haixin-platform-backend/src/main/resources/application.yml
  2. 25 3
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/EvaluateInfoController.java
  3. 14 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FeedbackReportController.java
  4. 28 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/EvaluateInfo.java
  5. 1 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/DriverInfoMapper.java
  6. 19 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/EvaluateInfoMapper.java
  7. 14 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IEvaluateInfoService.java
  8. 7 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IFeedbackReportService.java
  9. 3 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java
  10. 60 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/EvaluateInfoServiceImpl.java
  11. 16 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FeedbackReportServiceImpl.java
  12. 91 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/EvaluateInfoMapper.xml

+ 5 - 1
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -12,7 +12,7 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
   profiles:
-    active: prod
+    active: local
   resources:
     static-locations: file:///winsea/static/
   thymeleaf:
@@ -90,6 +90,10 @@ auth:
     - /companyInfo/**/*
     - /orderInfo/*
     - /orderInfo/**/*
+    - /feedbackReport/*
+    - /feedbackReport/**/*
+    - /evaluateInfo/*
+    - /evaluateInfo/**/*
     - /agentCargoOwnerInfo/*
     - /agentCargoOwnerInfo/**/*
     - /BDAccessToken/*

+ 25 - 3
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/EvaluateInfoController.java

@@ -1,9 +1,11 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.EvaluateInfo;
+import com.yh.saas.plugin.yiliangyiyun.service.IEvaluateInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * <p>
@@ -17,5 +19,25 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/evaluateInfo")
 public class EvaluateInfoController {
 
+    @Autowired
+    private IEvaluateInfoService evaluateInfoService;
+
+    /**
+     * 添加评价
+     */
+    @PostMapping("/api/addEvaluateInfo")
+    public String addEvaluateInfo(@RequestBody EvaluateInfo evaluateInfo){
+        return evaluateInfoService.addEvaluateInfo(evaluateInfo);
+    }
+
+    /**
+     * 评价记录
+     * @param evaluateInfo
+     * @return
+     */
+    @GetMapping("/selectEvaluateInfo")
+    public Page<EvaluateInfo> selectEvaluateInfo(EvaluateInfo evaluateInfo){
+        return evaluateInfoService.selectEvaluateInfo(evaluateInfo);
+    }
 }
 

+ 14 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FeedbackReportController.java

@@ -1,6 +1,11 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
+import com.yh.saas.plugin.yiliangyiyun.entity.FeedbackReport;
+import com.yh.saas.plugin.yiliangyiyun.service.IFeedbackReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
@@ -17,5 +22,14 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/feedbackReport")
 public class FeedbackReportController {
 
+    @Autowired
+    private IFeedbackReportService feedbackReportService;
+    /**
+     * 反馈举报
+     */
+    @PostMapping("/api/addInfo")
+    public String addInfo(@RequestBody FeedbackReport feedbackReport){
+        return feedbackReportService.addInfo(feedbackReport);
+    }
 }
 

+ 28 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/EvaluateInfo.java

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.entity;
 
+import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.enums.IdType;
@@ -47,6 +48,10 @@ public class EvaluateInfo extends BaseModel<EvaluateInfo> {
      * 货主姓名
      */
     private String ownerName;
+    /**
+     * 订单id
+     */
+    private String orderId;
     /**
      * 订单编号
      */
@@ -107,6 +112,29 @@ public class EvaluateInfo extends BaseModel<EvaluateInfo> {
      * 货主匿名评价(1是)
      */
     private String ownerAnonymous;
+    /**
+     * 司机头像
+     */
+    private String driverPortrait;
+    /**
+     * 货主头像
+     */
+    private String ownerPortrait;
+    /**
+     * 标识(1评价记录2货主评价)
+     */
+    @TableField(exist = false)
+    private String flag;
+    /**
+     * 查询类型
+     */
+    @TableField(exist = false)
+    private String searchType;
+    /**
+     * 模糊查询
+     */
+    @TableField(exist = false)
+    private String searchKeyWord;
 
 
     @Override

+ 1 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/DriverInfoMapper.java

@@ -23,7 +23,7 @@ public interface DriverInfoMapper extends BaseMapper<DriverInfo> {
      *
      * @param pageView
      * @return
-     */
+             */
     Integer getCountByCondition(Map<String, Object> pageView);
 
     /**

+ 19 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/EvaluateInfoMapper.java

@@ -1,8 +1,12 @@
 package com.yh.saas.plugin.yiliangyiyun.mapper;
 
+import com.yh.saas.plugin.yiliangyiyun.entity.DriverInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.EvaluateInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 评价信息 Mapper 接口
@@ -13,4 +17,19 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  */
 public interface EvaluateInfoMapper extends BaseMapper<EvaluateInfo> {
 
+    /**
+     * 根据条件查询评价总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询评价列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<EvaluateInfo> getListByCondition(Map<String, Object> pageView);
 }

+ 14 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IEvaluateInfoService.java

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
+import com.baomidou.mybatisplus.plugins.Page;
 import com.yh.saas.plugin.yiliangyiyun.entity.EvaluateInfo;
 import com.baomidou.mybatisplus.service.IService;
 
@@ -13,4 +14,17 @@ import com.baomidou.mybatisplus.service.IService;
  */
 public interface IEvaluateInfoService extends IService<EvaluateInfo> {
 
+    /**
+     * 添加评价
+     * @param evaluateInfo
+     * @return
+     */
+    String addEvaluateInfo(EvaluateInfo evaluateInfo);
+
+    /**
+     * 评价记录
+     * @param evaluateInfo
+     * @return
+     */
+    Page<EvaluateInfo> selectEvaluateInfo(EvaluateInfo evaluateInfo);
 }

+ 7 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IFeedbackReportService.java

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
+
 import com.yh.saas.plugin.yiliangyiyun.entity.FeedbackReport;
 import com.baomidou.mybatisplus.service.IService;
 
@@ -13,4 +14,10 @@ import com.baomidou.mybatisplus.service.IService;
  */
 public interface IFeedbackReportService extends IService<FeedbackReport> {
 
+    /**
+     * 反馈举报
+     * @param feedbackReport
+     * @return
+     */
+    String addInfo(FeedbackReport feedbackReport);
 }

+ 3 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java

@@ -224,6 +224,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, DriverI
                 driverInfo1.setOperationOverdueFlag("0");
                 driverInfo1.setTrailerOperationOverdueFlag("0");
                 driverInfo1.setRejectReason(null);
+                driverInfo1.setRejectReasonDescription(null);
                 //发送消息
                 NewsInfo newsInfo = new NewsInfo();
                 newsInfo.setReCommonId(driverInfo1.getCommonId());
@@ -233,7 +234,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, DriverI
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
             }
-//            驳回
+            //驳回
             else if("2".equals(driverInfo.getFlag())){
                 driverInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
                 driverInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_FAILED.getName());
@@ -241,7 +242,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, DriverI
                 //发送消息
                 NewsInfo newsInfo = new NewsInfo();
                 newsInfo.setReCommonId(driverInfo1.getCommonId());
-                newsInfo.setNewsContent("身份认证已驳回!");
+                newsInfo.setNewsContent("身份认证已驳回!驳回原因:" + driverInfo.getRejectReason());
                 newsInfo.setBussId(driverInfo1.getId());
                 newsInfo.setNewsTypeKey("1");
                 newsInfo.setNewsType("系统消息");

+ 60 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/EvaluateInfoServiceImpl.java

@@ -1,11 +1,20 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
-import com.yh.saas.plugin.yiliangyiyun.entity.EvaluateInfo;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
+import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.mapper.EvaluateInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IEvaluateInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 评价信息 服务实现类
@@ -17,4 +26,54 @@ import org.springframework.stereotype.Service;
 @Service
 public class EvaluateInfoServiceImpl extends ServiceImpl<EvaluateInfoMapper, EvaluateInfo> implements IEvaluateInfoService {
 
+    /**
+     * 添加评价
+     * @param evaluateInfo
+     * @return
+     */
+    @Override
+    public String addEvaluateInfo(EvaluateInfo evaluateInfo){
+        //根据订单编号查询评价
+        EvaluateInfo evaluateInfo1 = this.selectOne(new EntityWrapper<EvaluateInfo>()
+            .eq("order_number",evaluateInfo.getOrderNumber()).eq("delete_flag","0"));
+        //如果为空是新增
+        if (evaluateInfo1 == null){
+            //新增主键id
+            evaluateInfo.setId(IdGenerator.generateUUID());
+            this.insert(evaluateInfo);
+        }else {
+            this.updateById(evaluateInfo);
+        }
+        return "OK";
+    }
+
+    /**
+     * 评价记录
+     *
+     * @param evaluateInfo
+     * @return
+     */
+    @Override
+    public Page<EvaluateInfo> selectEvaluateInfo(EvaluateInfo evaluateInfo) {
+        Map<String, Object> pageView = new HashMap<>(12);
+        pageView.put("startRecord", (evaluateInfo.getCurrentPage() - 1)
+                * evaluateInfo.getPageSize());
+        //用户id
+        pageView.put("driverId", evaluateInfo.getDriverId());
+        pageView.put("ownerId", evaluateInfo.getOwnerId());
+        pageView.put("flag", evaluateInfo.getFlag());
+        pageView.put("searchType", evaluateInfo.getSearchType());
+        pageView.put("searchKeyWord", evaluateInfo.getSearchKeyWord());
+        pageView.put("pageSize", evaluateInfo.getPageSize());
+        pageView.put("currentPage", evaluateInfo.getCurrentPage());
+        // 查询评价总数
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<EvaluateInfo> dataList = baseMapper.getListByCondition(pageView);
+        Page<EvaluateInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(evaluateInfo.getCurrentPage());
+        page.setSize(evaluateInfo.getPageSize());
+        return page;
+    }
 }

+ 16 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FeedbackReportServiceImpl.java

@@ -1,11 +1,14 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
+import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.entity.FeedbackReport;
 import com.yh.saas.plugin.yiliangyiyun.mapper.FeedbackReportMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IFeedbackReportService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 反馈和举报信息 服务实现类
@@ -17,4 +20,17 @@ import org.springframework.stereotype.Service;
 @Service
 public class FeedbackReportServiceImpl extends ServiceImpl<FeedbackReportMapper, FeedbackReport> implements IFeedbackReportService {
 
+    /**
+     * 反馈举报
+     * @param feedbackReport
+     * @return
+     */
+    @Override
+    public String addInfo(FeedbackReport feedbackReport){
+        //新增主键id
+        feedbackReport.setId(IdGenerator.generateUUID());
+        this.insert(feedbackReport);
+        return "OK";
+
+    }
 }

+ 91 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/EvaluateInfoMapper.xml

@@ -1,5 +1,96 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.EvaluateInfoMapper">
+    <!-- 获得评价总数 -->
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        select
+        count(id)
+        FROM evaluate_info
+        WHERE
+        delete_flag = '0'
+        <if test="flag == 1">
+            <if test="driverId != null and driverId != ''">
+                AND driver_id = #{driverId}
+            </if>
+            <if test="ownerId != null and ownerId != ''">
+                AND owner_id = #{ownerId}
+            </if>
+        </if>
+        <if test="flag == 2">
+            <if test="driverId != null and driverId != ''">
+                AND driver_id = #{driverId}
+                AND owner_id != null
+            </if>
+            <if test="ownerId != null and ownerId != ''">
+                AND owner_id = #{ownerId}
+                AND driver_id != null
+            </if>
+        </if>
+        <if test="searchType != null and searchType != ''">
 
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(order_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+    </select>
+
+    <!-- 评价列表查询 -->
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.EvaluateInfo">
+        SELECT
+        id,
+        driver_id as driverId,
+        owner_id as ownerId,
+        driver_name as driverName,
+        owner_name as ownerName,
+        order_id as orderId,
+        order_number as orderNumber,
+        owner_credit as ownerCredit,
+        freight_payment as freightPayment,
+        comprehensive_satisfaction as comprehensiveSatisfaction,
+        driver_content as driverContent,
+        driver_url as driverUrl,
+        driver_anonymous as driverAnonymous,
+        driver_portrait as driverPortrait,
+        driver_credit as driverCredit,
+        tran_efficiency as tranEfficiency,
+        tran_safety as tranSafety,
+        service_quality as serviceQuality,
+        satisfaction,
+        owner_content as ownerContent,
+        owner_url as ownerUrl,
+        owner_anonymous as ownerAnonymous,
+        owner_portrait as ownerPortrait
+        FROM evaluate_info
+        WHERE
+        delete_flag = '0'
+        <if test="flag == 1">
+            <if test="driverId != null and driverId != ''">
+                AND driver_id = #{driverId}
+            </if>
+            <if test="ownerId != null and ownerId != ''">
+                AND owner_id = #{ownerId}
+            </if>
+        </if>
+        <if test="flag == 2">
+            <if test="driverId != null and driverId != ''">
+                AND driver_id = #{driverId}
+                AND owner_id != null
+            </if>
+            <if test="ownerId != null and ownerId != ''">
+                AND owner_id = #{ownerId}
+                AND driver_id != null
+            </if>
+        </if>
+        <if test="searchType != null and searchType != ''">
+
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(order_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+        ORDER BY create_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
 </mapper>