Przeglądaj źródła

增加推荐人报表

Shanks 6 lat temu
rodzic
commit
4273a6e253

+ 22 - 0
src/main/java/com/ygj/yuemum/controller/distributionchannel/DcChannelController.java

@@ -0,0 +1,22 @@
+package com.ygj.yuemum.controller.distributionchannel;
+
+
+import com.ygj.yuemum.domain.distributionchannel.DcChannel;
+import com.ygj.yuemum.service.distributionchannel.DcChannelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+public class DcChannelController {
+
+    @Autowired
+    private DcChannelService dcChannelService;
+
+    @GetMapping("/getDcChannels")
+    public List<DcChannel> getDcChannels() {
+        return dcChannelService.getDcChannels();
+    }
+}

+ 8 - 0
src/main/java/com/ygj/yuemum/controller/distributionchannel/DcIntroduceLogController.java

@@ -3,6 +3,7 @@ package com.ygj.yuemum.controller.distributionchannel;
 
 import com.alibaba.fastjson.JSONObject;
 import com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog;
+import com.ygj.yuemum.domain.distributionchannel.DcQueryReport;
 import com.ygj.yuemum.service.distributionchannel.DcIntroduceLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -23,6 +24,13 @@ public class DcIntroduceLogController {
         return jso;
     }
 
+    @PostMapping ("/getDcReport")
+    public String getDcReport(@ModelAttribute DcQueryReport dcQueryReport) {
+        Map<String, Object> queryDcIntroduceLogs = dcIntroduceLogService.getDcReport(dcQueryReport);
+        String jso = JSONObject.toJSONString(queryDcIntroduceLogs);
+        return jso;
+    }
+
     @PostMapping ("/queryDcILbyrebate")
     public String queryDcILbyrebate(@ModelAttribute DcIntroduceLog dcIntroduceLog) {
         Map<String, Object> queryDcIntroduceLogs = dcIntroduceLogService.queryDcILbyrebate(dcIntroduceLog);

+ 12 - 0
src/main/java/com/ygj/yuemum/dao/distributionchannel/DcChannelDao.java

@@ -0,0 +1,12 @@
+package com.ygj.yuemum.dao.distributionchannel;
+
+import com.ygj.yuemum.domain.distributionchannel.DcChannel;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface DcChannelDao {
+
+    List<DcChannel> getDcChannels();
+}

+ 3 - 0
src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroduceLogDao.java

@@ -1,6 +1,7 @@
 package com.ygj.yuemum.dao.distributionchannel;
 
 import com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog;
+import com.ygj.yuemum.domain.distributionchannel.DcQueryReport;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -19,6 +20,8 @@ public interface DcIntroduceLogDao {
 
     List<DcIntroduceLog> queryDcIntroduceLogs(DcIntroduceLog dcIntroduceLog);
 
+    List<DcIntroduceLog> getDcReport(DcQueryReport dcQueryReport);
+
     List<DcIntroduceLog> queryDcILbyrebate(DcIntroduceLog dcIntroduceLog);
 
     List<DcIntroduceLog> getDcIntroduceLogs(String phone);

+ 32 - 0
src/main/java/com/ygj/yuemum/domain/distributionchannel/DcChannel.java

@@ -0,0 +1,32 @@
+package com.ygj.yuemum.domain.distributionchannel;
+
+public class DcChannel {
+
+    private Integer id;
+    private String dc_code;
+    private String dc_name;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getDc_code() {
+        return dc_code;
+    }
+
+    public void setDc_code(String dc_code) {
+        this.dc_code = dc_code;
+    }
+
+    public String getDc_name() {
+        return dc_name;
+    }
+
+    public void setDc_name(String dc_name) {
+        this.dc_name = dc_name;
+    }
+}

+ 36 - 0
src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroducer.java

@@ -4,7 +4,11 @@ public class DcIntroducer {
 
     private Integer id;
     private String wv_phone;
+    private Integer dc_channel;
     private String wv_phoneOld;
+    private String dc_channel_name;
+    private String wv_statusname;
+    private String wv_gradename;
     private Integer wv_gradeid;
     private Integer wv_status;
     private Double wv_Introduction_total;
@@ -24,6 +28,30 @@ public class DcIntroducer {
     private Integer page;
     private Integer limit;
 
+    public String getWv_statusname() {
+        return wv_statusname;
+    }
+
+    public void setWv_statusname(String wv_statusname) {
+        this.wv_statusname = wv_statusname;
+    }
+
+    public String getWv_gradename() {
+        return wv_gradename;
+    }
+
+    public void setWv_gradename(String wv_gradename) {
+        this.wv_gradename = wv_gradename;
+    }
+
+    public String getDc_channel_name() {
+        return dc_channel_name;
+    }
+
+    public void setDc_channel_name(String dc_channel_name) {
+        this.dc_channel_name = dc_channel_name;
+    }
+
     public Integer getWv_status() {
         return wv_status;
     }
@@ -32,6 +60,14 @@ public class DcIntroducer {
         this.wv_status = wv_status;
     }
 
+    public Integer getDc_channel() {
+        return dc_channel;
+    }
+
+    public void setDc_channel(Integer dc_channel) {
+        this.dc_channel = dc_channel;
+    }
+
     public String getWv_phoneOld() {
         return wv_phoneOld;
     }

+ 41 - 0
src/main/java/com/ygj/yuemum/domain/distributionchannel/DcQueryReport.java

@@ -0,0 +1,41 @@
+package com.ygj.yuemum.domain.distributionchannel;
+
+public class DcQueryReport {
+
+    private String start_date;
+    private String end_date;
+    private Integer page;
+    private Integer limit;
+
+    public String getStart_date() {
+        return start_date;
+    }
+
+    public void setStart_date(String start_date) {
+        this.start_date = start_date;
+    }
+
+    public String getEnd_date() {
+        return end_date;
+    }
+
+    public void setEnd_date(String end_date) {
+        this.end_date = end_date;
+    }
+
+    public Integer getPage() {
+        return page;
+    }
+
+    public void setPage(Integer page) {
+        this.page = page;
+    }
+
+    public Integer getLimit() {
+        return limit;
+    }
+
+    public void setLimit(Integer limit) {
+        this.limit = limit;
+    }
+}

+ 19 - 0
src/main/java/com/ygj/yuemum/service/distributionchannel/DcChannelService.java

@@ -0,0 +1,19 @@
+package com.ygj.yuemum.service.distributionchannel;
+
+import com.ygj.yuemum.dao.distributionchannel.DcChannelDao;
+import com.ygj.yuemum.domain.distributionchannel.DcChannel;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class DcChannelService {
+
+    @Autowired
+    private DcChannelDao dcChannelDao;
+
+    public List<DcChannel> getDcChannels() {
+        return dcChannelDao.getDcChannels();
+    }
+}

+ 13 - 0
src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroduceLogService.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
 import com.ygj.yuemum.dao.distributionchannel.DcIntroduceLogDao;
 import com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog;
 import com.ygj.yuemum.domain.distributionchannel.DcIntroducer;
+import com.ygj.yuemum.domain.distributionchannel.DcQueryReport;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -32,6 +33,18 @@ public class DcIntroduceLogService {
         return tableData;
     }
 
+
+    public Map<String, Object> getDcReport(DcQueryReport dcQueryReport) {
+        PageHelper.startPage(dcQueryReport.getPage(), dcQueryReport.getLimit());
+        List<DcIntroduceLog> dcIntroduceLogs = dcIntroduceLogDao.getDcReport(dcQueryReport);
+        PageInfo<DcIntroduceLog> pageInfo = new PageInfo<DcIntroduceLog>(dcIntroduceLogs);
+        long count = pageInfo.getTotal(); //获取总记录数
+        Map<String, Object> tableData = new HashMap<>();
+        tableData.put("items", dcIntroduceLogs);
+        tableData.put("total", count);
+        return tableData;
+    }
+
     public Map<String, Object> queryDcILbyrebate(DcIntroduceLog dcIntroduceLog) {
         PageHelper.startPage(dcIntroduceLog.getPage(), dcIntroduceLog.getLimit());
         List<DcIntroduceLog> dcIntroduceLogs = dcIntroduceLogDao.queryDcILbyrebate(dcIntroduceLog);

+ 4 - 4
src/main/resources/application.yml

@@ -19,9 +19,9 @@ pagehelper:
   reasonable: true
   support-methods-arguments: true
   params: count=countSql
-#logging:
-#  level:
-#     com.ygj.yuemum.dao : debug
+logging:
+  level:
+     com.ygj.yuemum.dao : debug
 #优惠券批次号信息--------------------
 #测试
 coupon:
@@ -94,7 +94,7 @@ wechat:
   OrderTemplateid : "VyMPKDDGOy85wDIJuXR7sBuiIBEg0OPaCg6C_Dt_D0g"  #公众号消息模版
   BookingTemplateid : "Wvysqh3Ec9lXpf5tytq0T2zzs662uowNLFCPiAPBFkA" #公众号消息模版
   ExtractTemplateid : "uAkxPS92FqovRSrg3n2P4xfNMwQ12iEcpRrnSp-D36Q" #公众号消息模版
-  WPOPENID : "oAjHTv9I4j1_D_BfIzBaj1bbYU9s" #公众号发送消息
+  WPOPENID : "oAjHTvxMhnBL4T59ZOG0jKwsFe4k" #公众号发送消息 园园
   #测试小程序
   #MINIAPPID : "wx1c3ef3300b74ed86"
   #MINIAPPSECRET : "ba5624bc087921d5a5832da9193e40f1"

+ 20 - 0
src/main/resources/mybatis/mapper/distributionchannel/DcChannelMapper.xml

@@ -0,0 +1,20 @@
+<?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.ygj.yuemum.dao.distributionchannel.DcChannelDao">
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.distributionchannel.DcChannel">
+        <result column="id" property="id" jdbcType="INTEGER"/>
+        <result column="dc_code" property="dc_code" jdbcType="VARCHAR"/>
+        <result column="dc_name" property="dc_name" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!--获取所有数据-->
+    <select id="getDcChannels" resultType="com.ygj.yuemum.domain.distributionchannel.DcChannel">
+        select
+        *
+        from dc_channel
+        order by id desc
+    </select>
+
+
+</mapper>

+ 23 - 0
src/main/resources/mybatis/mapper/distributionchannel/DcIntroduceLogMapper.xml

@@ -158,6 +158,29 @@
             xul_orderno
     </select>
 
+    <select id="getDcReport" resultType="com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog"
+            parameterType="com.ygj.yuemum.domain.distributionchannel.DcQueryReport">
+        SELECT DISTINCT
+            (ta.xul_phone) xul_phone,
+            ta.xul_introducer_phone,
+            ta.xul_date
+        FROM
+            dc_introduce_log ta
+        LEFT JOIN dc_introduce_log tb ON ta.xul_introducer_phone = tb.xul_introducer_phone
+        WHERE
+            ta.xul_event = '2'
+        <if test="start_date != null and start_date != ''">
+            and ta.xul_date &gt;= #{start_date,jdbcType=DATE}
+        </if>
+        <if test="end_date != null and end_date != ''">
+            and ta.xul_date &lt;= #{end_date,jdbcType=DATE}
+        </if>
+        GROUP BY
+            xul_phone
+        ORDER BY
+            count(tb.xul_introducer_phone) DESC
+    </select>
+
     <insert id="insertDcIntroduceLog" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog">
         insert into dc_introduce_log
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 17 - 1
src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerMapper.xml

@@ -5,6 +5,7 @@
     <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.distributionchannel.DcIntroducer">
         <result column="id" property="id" jdbcType="INTEGER"/>
         <result column="wv_phone" property="wv_phone" jdbcType="VARCHAR"/>
+        <result column="dc_channel" property="dc_channel" jdbcType="INTEGER"/>
         <result column="wv_gradeid" property="wv_gradeid" jdbcType="INTEGER"/>
         <result column="wv_status" property="wv_status" jdbcType="INTEGER"/>
         <result column="wv_Introduction_total" property="wv_Introduction_total" jdbcType="DECIMAL"/>
@@ -64,6 +65,7 @@
         id,
         wv_phone,
         wv_gradeid,
+        fgetdcchannel_name(dc_channel) dc_channel_name,
         wv_status,
         wv_Introduction_total,
         wv_withdraw_total,
@@ -108,8 +110,19 @@
         select
         id,
         wv_phone,
+        dc_channel,
+        fgetdcchannel_name (dc_channel) dc_channel_name,
         wv_gradeid,
+        CASE wv_gradeid
+        WHEN 1 THEN '银牌'
+        WHEN 2 THEN '金牌'
+        END as wv_gradename,
         wv_status,
+        CASE wv_status
+        WHEN 1 THEN '正常'
+        WHEN 2 THEN '失效'
+        ELSE '异常'
+        END as wv_statusname,
         wv_Introduction_total,
         wv_withdraw_total,
         wv_Introduction_count,
@@ -120,7 +133,7 @@
         wv_contract_count,
         wv_finish_count,
         wv_consultant,
-        fgetuser_name(wv_consultant) wv_consultantname,
+        fgetuser_name (wv_consultant) wv_consultantname,
         wv_account_number,
         wv_account_bank,
         wv_account_number_path
@@ -129,6 +142,9 @@
         <if test="wv_phone != null and wv_phone != ''">
             and wv_phone = #{wv_phone,jdbcType=VARCHAR}
         </if>
+        <if test="dc_channel != null and dc_channel != ''">
+            and dc_channel = #{dc_channel,jdbcType=VARCHAR}
+        </if>
         <if test="wv_gradeid != null and wv_gradeid != ''">
             and wv_gradeid = #{wv_gradeid,jdbcType=INTEGER}
         </if>