wanxl пре 1 година
родитељ
комит
f2333d9673

+ 111 - 16
src/main/java/com/sqx/modules/reconciliation/service/impl/PlatformBillServiceImpl.java

@@ -106,23 +106,39 @@ public class PlatformBillServiceImpl extends ServiceImpl<PlatformBillMapper, Pla
     public ExcelData excelRiderBillList(PlatformBillDto query) {
         List<RiderBillVo> riderBillVoList=baseMapper.excelRiderBillList(query);
         ExcelData data = new ExcelData();
-        data.setName("骑手排行");
+        data.setName("骑手对账");
         List<String> titleList= Arrays.asList(
-                "排名",
-                "骑手昵称",
-                "地区 ",
-                "骑手所在站点",
-                "总收益");
+                "骑手姓名",
+                "骑手手机号",
+                "骑手站点 ",
+                "日期",
+                "期初金额(元)",
+                "收入(元)",
+                "收入笔数",
+                "提现金额",
+                "提现手续费",
+                "提现笔数",
+                "期末金额(元)",
+                "期末金额(元)",
+                "总收益(元)");
         data.setTitles(titleList);
         List<List<Object>> rows = new ArrayList<>();
         for (RiderBillVo riderBillVo:riderBillVoList ){
             List<Object> row = new ArrayList<>();
-//            row.add(riderBillVo.getRankNum());
-//            row.add(riderBillVo.getNickName());
-//            row.add(riderBillVo.getUserProvince()+tbOrder.getUserCity()+tbOrder.getUserDistrict());
-//            row.add(riderBillVo.getStationName());
-//            row.add(riderBillVo.getMoneyOrder());
-//            rows.add(row);
+            row.add(riderBillVo.getUserName());
+            row.add(riderBillVo.getPhone());
+            row.add(riderBillVo.getStationName());
+            row.add(riderBillVo.getDayId());
+            row.add(riderBillVo.getStartMoney());
+            row.add(riderBillVo.getRevenue());
+            row.add(riderBillVo.getRevenueCount());
+            row.add(riderBillVo.getRiderPayouts());
+            row.add(riderBillVo.getRiderPayoutsRates());
+            row.add(riderBillVo.getRiderPayoutsCount());
+            row.add(riderBillVo.getEndMoney());
+            row.add(riderBillVo.getSysGiftAmount());
+            row.add(riderBillVo.getTotalIncome());
+            rows.add(row);
         }
         data.setRows(rows);
         return data;
@@ -134,8 +150,46 @@ public class PlatformBillServiceImpl extends ServiceImpl<PlatformBillMapper, Pla
      */
     @Override
     public ExcelData excelShopBillList(PlatformBillDto query) {
-        List<ShopBillVo> riderBillVoList=baseMapper.excelShopBillList(query);
-        return null;
+        List<ShopBillVo> shopBillVoList=baseMapper.excelShopBillList(query);
+        ExcelData data = new ExcelData();
+        data.setName("商户对账");
+        List<String> titleList= Arrays.asList(
+                "日期 ",
+                "期初金额(元)",
+                "收入(元)",
+                "收入笔数",
+                "商家提现(元)",
+                "商家提现手续费",
+                "商家提现笔数",
+                "骑手提现",
+                "骑手提现手续费",
+                "骑手提现笔数",
+                "退款金额(元)",
+                "退款笔数",
+                "期末金额(元)",
+                "平台抽成手续费");
+        data.setTitles(titleList);
+        List<List<Object>> rows = new ArrayList<>();
+        for (ShopBillVo shopBillVo:shopBillVoList ){
+            List<Object> row = new ArrayList<>();
+            row.add(shopBillVo.getDayId());
+            row.add(shopBillVo.getStartMoney());
+            row.add(shopBillVo.getRevenue());
+            row.add(shopBillVo.getRevenueCount());
+            row.add(shopBillVo.getShopPayouts());
+            row.add(shopBillVo.getShopPayoutsRates());
+            row.add(shopBillVo.getShopPayoutsCount());
+            row.add(shopBillVo.getRiderPayouts());
+            row.add(shopBillVo.getRiderPayoutsRates());
+            row.add(shopBillVo.getRiderPayoutsCount());
+            row.add(shopBillVo.getRefundMoney());
+            row.add(shopBillVo.getRefundCount());
+            row.add(shopBillVo.getEndMoney());
+            row.add(shopBillVo.getPlatformRates());
+            rows.add(row);
+        }
+        data.setRows(rows);
+        return data;
     }
 
     /**
@@ -144,8 +198,49 @@ public class PlatformBillServiceImpl extends ServiceImpl<PlatformBillMapper, Pla
      */
     @Override
     public ExcelData excelPlatformBillList(PlatformBillDto query) {
-        List<PlatformBill> riderBillVoList=baseMapper.excelPlatformBillList(query);
-        return null;
+        List<PlatformBill> platformBills=baseMapper.excelPlatformBillList(query);
+        ExcelData data = new ExcelData();
+        data.setName("骑手排行");
+        List<String> titleList= Arrays.asList(
+                "店铺名",
+                "手机号",
+                "日期 ",
+                "期初金额(元)",
+                "收入(元)",
+                "收入笔数",
+                "平台抽成手续费",
+                "提现金额",
+                "提现手续费",
+                "提现笔数",
+                "期末金额(元)",
+                "账户余额(元)",
+                "总收益(元)",
+                "用户实际付款(元)",
+                "退款金额(元)",
+                "退款笔数");
+        data.setTitles(titleList);
+        List<List<Object>> rows = new ArrayList<>();
+        for (PlatformBill platformBill:platformBills ){
+            List<Object> row = new ArrayList<>();
+            row.add(platformBill.getShopName());
+            row.add(platformBill.getDayId());
+            row.add(platformBill.getStartMoney());
+            row.add(platformBill.getRevenue());
+            row.add(platformBill.getRevenueCount());
+            row.add(platformBill.getPlatformRates());
+            row.add(platformBill.getShopPayouts());
+            row.add(platformBill.getShopPayoutsRates());
+            row.add(platformBill.getShopPayoutsCount());
+            row.add(platformBill.getEndMoney());
+            row.add(platformBill.getEndMoney());
+            row.add(platformBill.getTotalIncome());
+            row.add(platformBill.getPayMoney());
+            row.add(platformBill.getRefundMoney());
+            row.add(platformBill.getRefundCount());
+            rows.add(row);
+        }
+        data.setRows(rows);
+        return data;
     }
 
 

+ 61 - 0
src/main/resources/mapper/reconciliation/PlatformBillMapper.xml

@@ -62,4 +62,65 @@
         </where>
         order by pb.bill_id desc
     </select>
+
+    <select id="excelRiderBillList" resultType="com.sqx.modules.reconciliation.model.RiderBillVo">
+        select pb.*,tu.user_name as userName,tu.phone ,rs.station_name as stationName
+        from platform_bill pb left join tb_user tu on pb.user_id =tu.user_id
+        left join rider_station rs on rs.id =tu.rider_station_id
+        <where>
+            pb.`type` =2
+            <if test="params.startDate != null and params.startDate != '' and params.startDate != 'null'">
+                and pb.day_id >= #{params.startDate}
+            </if>
+            <if test="params.endDate != null and params.endDate != '' and params.endDate != 'null'">
+                and pb.day_id <![CDATA[ <= ]]> #{params.endDate}
+            </if>
+            <if test="params.riderStation != null and params.riderStation != ''">
+                and rs.id = #{params.riderStation}
+            </if>
+            <if test="params.riderPhone != null and params.riderPhone != '' and params.riderPhone != 'null'">
+                and tu.phone like concat('%',#{params.riderPhone},'%')
+            </if>
+            <if test="params.riderName != null and params.riderName != '' and params.riderName != 'null'">
+                and tu.user_name like concat('%',#{params.riderName},'%')
+            </if>
+        </where>
+        order by pb.bill_id desc
+    </select>
+
+    <select id="excelShopBillList" resultType="com.sqx.modules.reconciliation.model.ShopBillVo">
+        select pb.*,gs.shop_name as shopName,gs.phone
+        from platform_bill pb left join tb_user tu on pb.user_id =tu.user_id
+        left join goods_shop gs on gs.user_id =tu.user_id
+        <where>
+            pb.`type` = 1
+            <if test="params.startDate != null and params.startDate != '' and params.startDate != 'null'">
+                and pb.day_id >= #{params.startDate}
+            </if>
+            <if test="params.endDate != null and params.endDate != '' and params.endDate != 'null'">
+                and pb.day_id <![CDATA[ <= ]]> #{params.endDate}
+            </if>
+            <if test="params.shopPhone != null and params.shopPhone != '' and params.shopPhone != 'null'">
+                and gs.phone like concat('%',#{params.shopPhone},'%')
+            </if>
+            <if test="params.shopName != null and params.shopName != '' and params.shopName != 'null'">
+                and gs.shop_name like concat('%',#{params.shopName},'%')
+            </if>
+        </where>
+        order by pb.bill_id desc
+    </select>
+    <select id="excelPlatformBillList" resultType="com.sqx.modules.reconciliation.model.PlatformBill">
+        select pb.*
+        from platform_bill pb
+        <where>
+            pb.`type` = 0
+            <if test="params.startDate != null and params.startDate != '' and params.startDate != 'null'">
+                and pb.day_id >= #{params.startDate}
+            </if>
+            <if test="params.endDate != null and params.endDate != '' and params.endDate != 'null'">
+                and pb.day_id <![CDATA[ <= ]]> #{params.endDate}
+            </if>
+        </where>
+        order by pb.bill_id desc
+    </select>
 </mapper>