瀏覽代碼

增加推荐人报表

Shanks 6 年之前
父節點
當前提交
46d0d3d620

+ 5 - 5
pom.xml

@@ -55,11 +55,11 @@
 			<version>2.8.2</version>
 		</dependency>
 		<!--启动-->
-		<!--<dependency>-->
-			<!--<groupId>org.springframework.boot</groupId>-->
-			<!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
-			<!--<scope>provided</scope>-->
-		<!--</dependency>-->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-tomcat</artifactId>
+			<scope>provided</scope>
+		</dependency>
 
 
 		<dependency>

+ 30 - 27
src/main/java/com/ygj/yuemum/YueMumApplication.java

@@ -4,44 +4,23 @@ import com.github.pagehelper.PageHelper;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.support.SpringBootServletInitializer;
 import org.springframework.context.annotation.Bean;
 import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.web.WebApplicationInitializer;
 
 import java.util.Properties;
 
 @SpringBootApplication
 @MapperScan("com.ygj.yuemum.dao")
 @EnableScheduling
-public class YueMumApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(YueMumApplication.class, args);
-    }
-
-    @Bean
-    public PageHelper pageHelper() {
-        PageHelper pageHelper = new PageHelper();
-        Properties properties = new Properties();
-        properties.setProperty("offsetAsPageNum", "true");
-        properties.setProperty("rowBoundsWithCount", "true");
-        properties.setProperty("reasonable", "true");
-        properties.setProperty("dialect", "mysql");    //配置mysql数据库的方言
-        pageHelper.setProperties(properties);
-        return pageHelper;
-    }
-
-}
-//public class YueMumApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
-//
-//    @Override
-//    protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
-//
-//        return application.sources(YueMumApplication.class);
-//    }
+//public class YueMumApplication {
 //
 //    public static void main(String[] args) {
 //        SpringApplication.run(YueMumApplication.class, args);
 //    }
+//
 //    @Bean
 //    public PageHelper pageHelper() {
 //        PageHelper pageHelper = new PageHelper();
@@ -53,4 +32,28 @@ public class YueMumApplication {
 //        pageHelper.setProperties(properties);
 //        return pageHelper;
 //    }
-//}
+//
+//}
+public class YueMumApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
+
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
+
+        return application.sources(YueMumApplication.class);
+    }
+
+    public static void main(String[] args) {
+        SpringApplication.run(YueMumApplication.class, args);
+    }
+    @Bean
+    public PageHelper pageHelper() {
+        PageHelper pageHelper = new PageHelper();
+        Properties properties = new Properties();
+        properties.setProperty("offsetAsPageNum", "true");
+        properties.setProperty("rowBoundsWithCount", "true");
+        properties.setProperty("reasonable", "true");
+        properties.setProperty("dialect", "mysql");    //配置mysql数据库的方言
+        pageHelper.setProperties(properties);
+        return pageHelper;
+    }
+}

+ 3 - 3
src/main/java/com/ygj/yuemum/component/ScheduledService.java

@@ -14,16 +14,16 @@ public class ScheduledService {
     private BaiDuInfoServices baiDuInfoServices;
     @Scheduled(fixedRate = 5400000)
     public void timerCron() {
-//        weChatInfoService.SaveWeChatInfo();
+        weChatInfoService.SaveWeChatInfo();
     }
     @Scheduled(cron="0 */4 * * * ?")
     public void getMiniAppAccess_token() {
-//        weChatInfoService.SaveMiniAppInfo();
+        weChatInfoService.SaveMiniAppInfo();
     }
 
     @Scheduled(initialDelay = 1000, fixedDelay = 70000*1000)
     public void getAuth() {
-//        baiDuInfoServices.getAuth();
+        baiDuInfoServices.getAuth();
     }
 
 }

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

@@ -4,9 +4,18 @@ public class DcQueryReport {
 
     private String start_date;
     private String end_date;
+    private Integer xul_event;
     private Integer page;
     private Integer limit;
 
+    public Integer getXul_event() {
+        return xul_event;
+    }
+
+    public void setXul_event(Integer xul_event) {
+        this.xul_event = xul_event;
+    }
+
     public String getStart_date() {
         return start_date;
     }

+ 33 - 25
src/main/java/com/ygj/yuemum/service/order/YSOrderService.java

@@ -307,32 +307,40 @@ public class YSOrderService {
                     HttpEntity he = resp.getEntity();
                     respContent = EntityUtils.toString(he,"UTF-8");
                     org.json.JSONObject jsonObject = new org.json.JSONObject(respContent);
-                    int introducerGradeId = jsonObject.getJSONObject("data").getInt("introducerGradeId");
-                    String pm_type = "";
-                    if (!jsonObject.getJSONObject("data").isNull("introducerActivityType")) {
-                        pm_type = jsonObject.getJSONObject("data").getString("introducerActivityType");
-                    }
-                    float xul_rebateamount = jsonObject.getJSONObject("data").getInt("rebateAmount");
-                    //介绍人日志
-                    DcIntroduceLog dcIntroduceLog = new DcIntroduceLog();
-                    if (pm_type.equals("mdj")) {
-                        dcIntroduceLog.setXul_pm_type(1);
-                    }
-                    dcIntroduceLog.setXul_rebateamount(xul_rebateamount);
-                    dcIntroduceLog.setXul_phone(ysOrder.getOd_phone());
-                    dcIntroduceLog.setXul_event(6);
-                    dcIntroduceLog.setXul_date(sdf.format(new Date()));
-                    dcIntroduceLog.setXul_introducer_phone(ysOrder.getOd_introducer_phone());
-                    dcIntroduceLog.setXul_orderno(ysOrder.getOd_no());
-                    dcIntroduceLogService.insertDcIntroduceLog(dcIntroduceLog);
-                    // 支付尾款 + 推荐金额增加
                     DcIntroducer dcIntroducer = dcIntroducerService.checkDcIntroducers(ysOrder.getOd_introducer_phone());
-                    if (dcIntroducer != null) {
-                        //增加金额
-                        dcIntroducer.setWv_Introduction_total(dcIntroducer.getWv_Introduction_total() + Double.valueOf(ysOrder.getOd_rebate_amount()));
-                        dcIntroducer.setWv_gradeid(introducerGradeId);
-                        //升降级
-                        dcIntroducerService.updateDcIntroducer(dcIntroducer);
+                    if (dcIntroducer != null ) {
+                        String pm_type = "";
+                        int introducerGradeId = dcIntroducer.getWv_gradeid();
+                        float xul_rebateamount = 0;
+                        if (!jsonObject.getJSONObject("data").isNull("introducerGradeId")) {
+                            introducerGradeId = jsonObject.getJSONObject("data").getInt("introducerGradeId");
+                        }
+                        if (!jsonObject.getJSONObject("data").isNull("introducerActivityType")) {
+                            pm_type = jsonObject.getJSONObject("data").getString("introducerActivityType");
+                        }
+                        if (!jsonObject.getJSONObject("data").isNull("rebateAmount")) {
+                            xul_rebateamount = jsonObject.getJSONObject("data").getInt("rebateAmount");
+                        }
+                        //介绍人日志
+                        DcIntroduceLog dcIntroduceLog = new DcIntroduceLog();
+                        if (pm_type.equals("mdj")) {
+                            dcIntroduceLog.setXul_pm_type(1);
+                        }
+                        dcIntroduceLog.setXul_rebateamount(xul_rebateamount);
+                        dcIntroduceLog.setXul_phone(ysOrder.getOd_phone());
+                        dcIntroduceLog.setXul_event(6);
+                        dcIntroduceLog.setXul_date(sdf.format(new Date()));
+                        dcIntroduceLog.setXul_introducer_phone(ysOrder.getOd_introducer_phone());
+                        dcIntroduceLog.setXul_orderno(ysOrder.getOd_no());
+                        dcIntroduceLogService.insertDcIntroduceLog(dcIntroduceLog);
+                        // 支付尾款 + 推荐金额增加
+                        if (dcIntroducer != null) {
+                            //增加金额
+                            dcIntroducer.setWv_Introduction_total(dcIntroducer.getWv_Introduction_total() + Double.valueOf(ysOrder.getOd_rebate_amount()));
+                            dcIntroducer.setWv_gradeid(introducerGradeId);
+                            //升降级
+                            dcIntroducerService.updateDcIntroducer(dcIntroducer);
+                        }
                     }
                 }
             }

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

@@ -8,9 +8,9 @@ mybatis:
 spring:
   datasource:
     driverClassName: com.mysql.jdbc.Driver
-    url: jdbc:mysql://121.43.235.99:3306/yuemum?useUnicode=true&characterEncoding=utf-8&noDatetimeStringSync=true
-    username: jielin
-    password: jielin123
+    url: jdbc:mysql://47.97.74.34:3306/yuemum?useUnicode=true&characterEncoding=utf-8&noDatetimeStringSync=true
+    username: root
+    password: Yuemum10000W!
   thymeleaf:
     mode: LEGACYHTML5
     prefix: classpath:/templates
@@ -19,38 +19,38 @@ 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:
-  NewUserCoupon : "PVP2018051297451"
-  ConsultTaskCoupon : "PVP2018051273883"
-  DetectionTaskCoupon : "PVP2018051211608"
-  RechargeTaskCoupon : "PVP2018051263016"
-#生产
 #coupon:
-#  NewUserCoupon : "PVP2018051717019"
-#  ConsultTaskCoupon : "PVP2018051739929"
-#  DetectionTaskCoupon : "PVP2018051713733"
-#  RechargeTaskCoupon : "PVP2018051714111"
+#  NewUserCoupon : "PVP2018051297451"
+#  ConsultTaskCoupon : "PVP2018051273883"
+#  DetectionTaskCoupon : "PVP2018051211608"
+#  RechargeTaskCoupon : "PVP2018051263016"
+#生产
+coupon:
+  NewUserCoupon : "PVP2018051717019"
+  ConsultTaskCoupon : "PVP2018051739929"
+  DetectionTaskCoupon : "PVP2018051713733"
+  RechargeTaskCoupon : "PVP2018051714111"
 #图片上传路径--------------------------
 #本地
-file:
-  ROOT : "D:/apache-tomcat-9.0.6/webapps/resume/img/"
-  ResumeFile : "D:/apache-tomcat-9.0.6/webapps/resume/"
-  httpRoot : "http://localhost:8080/resume/img/"
-  httphtmlRoot : "http://localhost:8080/resume/"
-  modulePath : "D:/apache-tomcat-9.0.6/webapps/resume/resume.html"
-  payvoucher : "D:/apache-tomcat-9.0.6/webapps/payvoucher"
-  httppayvoucher : "http://localhost:8080/payvoucher"
-  promotionvoucher : "D:/apache-tomcat-9.0.6/webapps/MiniProgram/promotion/offline"
-  httppromotionvoucher : "http://localhost:8080/MiniProgram/promotion/offline"
-  qrcode: "D:/apache-tomcat-9.0.6/webapps/MiniProgram/mgm"
-  httpqrcode: "http://localhost:8080/MiniProgram/mgm"
-  IMGBANKCARD: "D:/apache-tomcat-9.0.6/webapps/MiniProgram/mgm/bankCard/"
-  HTTPIMGBANKCARD: "http://192.168.8.13:8080/MiniProgram/mgm/bankCard/"
+#file:
+#  ROOT : "D:/apache-tomcat-9.0.6/webapps/resume/img/"
+#  ResumeFile : "D:/apache-tomcat-9.0.6/webapps/resume/"
+#  httpRoot : "http://localhost:8080/resume/img/"
+#  httphtmlRoot : "http://localhost:8080/resume/"
+#  modulePath : "D:/apache-tomcat-9.0.6/webapps/resume/resume.html"
+#  payvoucher : "D:/apache-tomcat-9.0.6/webapps/payvoucher"
+#  httppayvoucher : "http://localhost:8080/payvoucher"
+#  promotionvoucher : "D:/apache-tomcat-9.0.6/webapps/MiniProgram/promotion/offline"
+#  httppromotionvoucher : "http://localhost:8080/MiniProgram/promotion/offline"
+#  qrcode: "D:/apache-tomcat-9.0.6/webapps/MiniProgram/mgm"
+#  httpqrcode: "http://localhost:8080/MiniProgram/mgm"
+#  IMGBANKCARD: "D:/apache-tomcat-9.0.6/webapps/MiniProgram/mgm/bankCard/"
+#  HTTPIMGBANKCARD: "http://192.168.8.13:8080/MiniProgram/mgm/bankCard/"
 #测试
 #file:
 #  ROOT : "/usr/local/apache-tomcat-8.5.30/webapps/resume/img/"
@@ -67,20 +67,20 @@ file:
 #  IMGBANKCARD: "/usr/local/apache-tomcat-8.5.30/webapps/MiniProgram/mgm/bankCard/"
 #  HTTPIMGBANKCARD: "http://192.168.1.24/MiniProgram/mgm/bankCard/"
 #生产
-#file:
-#  ROOT : "/usr/local/tomcat/tomcat7/webapps/resume/img/"
-#  ResumeFile : "/usr/local/tomcat/tomcat7/webapps/resume/"
-#  httpRoot : "http://yuesuo.yueguanjia.com/resume/img/"
-#  httphtmlRoot : "http://yuesuo.yueguanjia.com/resume/"
-#  modulePath : "/usr/local/tomcat/tomcat7/webapps/resume/resume.html"
-#  payvoucher : "/usr/local/tomcat/tomcat7/webapps/payvoucher"
-#  httppayvoucher : "http://yuesuo.yueguanjia.com/payvoucher"
-#  promotionvoucher : "/usr/local/tomcat/tomcat7/webapps/MiniProgram/promotion/offline"
-#  httppromotionvoucher : "http://yuesuo.yueguanjia.com/MiniProgram/promotion/offline"
-#  qrcode: "/usr/local/tomcat/tomcat7/webapps/MiniProgram/mgm"
-#  httpqrcode: "http://yuesuo.yueguanjia.com/MiniProgram/mgm"
-#  IMGBANKCARD: "/usr/local/tomcat/tomcat7/webapps/MiniProgram/mgm/bankCard/"
-#  HTTPIMGBANKCARD: "http://yuesuo.yueguanjia.com/MiniProgram/mgm/bankCard/"
+file:
+  ROOT : "/usr/local/tomcat/tomcat7/webapps/resume/img/"
+  ResumeFile : "/usr/local/tomcat/tomcat7/webapps/resume/"
+  httpRoot : "http://yuesuo.yueguanjia.com/resume/img/"
+  httphtmlRoot : "http://yuesuo.yueguanjia.com/resume/"
+  modulePath : "/usr/local/tomcat/tomcat7/webapps/resume/resume.html"
+  payvoucher : "/usr/local/tomcat/tomcat7/webapps/payvoucher"
+  httppayvoucher : "http://yuesuo.yueguanjia.com/payvoucher"
+  promotionvoucher : "/usr/local/tomcat/tomcat7/webapps/MiniProgram/promotion/offline"
+  httppromotionvoucher : "http://yuesuo.yueguanjia.com/MiniProgram/promotion/offline"
+  qrcode: "/usr/local/tomcat/tomcat7/webapps/MiniProgram/mgm"
+  httpqrcode: "http://yuesuo.yueguanjia.com/MiniProgram/mgm"
+  IMGBANKCARD: "/usr/local/tomcat/tomcat7/webapps/MiniProgram/mgm/bankCard/"
+  HTTPIMGBANKCARD: "http://yuesuo.yueguanjia.com/MiniProgram/mgm/bankCard/"
 #微信公众号---------------------------------------------------
 wechat:
   APPID : "wx52852a3c47540fad"

+ 9 - 4
src/main/resources/mybatis/mapper/distributionchannel/DcIntroduceLogMapper.xml

@@ -163,12 +163,17 @@
         SELECT DISTINCT
             (ta.xul_phone) xul_phone,
             ta.xul_introducer_phone,
-            ta.xul_date
+            ta.xul_date,
+            ta.xul_orderno,
+            ifnull(fgetorder_amount(ta.xul_orderno),0) od_order_amount,
+            ifnull(ta.xul_rebateamount,0) od_rebate_amount,
+            count(tb.xul_introducer_phone)
         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'
+           ta.xul_introducer_phone != ''
+           and ta.xul_event = #{xul_event,jdbcType=INTEGER}
         <if test="start_date != null and start_date != ''">
             and ta.xul_date &gt;= #{start_date,jdbcType=DATE}
         </if>
@@ -176,9 +181,9 @@
             and ta.xul_date &lt;= #{end_date,jdbcType=DATE}
         </if>
         GROUP BY
-            xul_phone
+          ta.xul_phone,ta.xul_introducer_phone,ta.xul_date,ta.xul_orderno,ta.xul_rebateamount
         ORDER BY
-            count(tb.xul_introducer_phone) DESC
+        count(tb.xul_introducer_phone) DESC, ta.xul_introducer_phone asc
     </select>
 
     <insert id="insertDcIntroduceLog" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog">