Bläddra i källkod

Merge remote-tracking branch 'origin/master'

zhaoxian 11 månader sedan
förälder
incheckning
01955a509a

+ 20 - 13
ruixuan-live/src/main/java/com/ruixuan/isc/controller/SupplyChainController.java

@@ -2708,33 +2708,38 @@ public class SupplyChainController extends BaseController {
     public void exportShopList(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject requestJson) throws IOException {
     public void exportShopList(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject requestJson) throws IOException {
 
 
         try {
         try {
+
+
             if (Check.isNull(requestJson.getString("orderStartDate")) || Check.isNull(requestJson.getString("orderEndDate"))) {
             if (Check.isNull(requestJson.getString("orderStartDate")) || Check.isNull(requestJson.getString("orderEndDate"))) {
                 throw new Exception("请输入开始时间和结束时间");
                 throw new Exception("请输入开始时间和结束时间");
             }
             }
 
 
-            Long userId = requestJson.getLong("userId");
-            if (Check.isNull(userId)) {
-                throw new Exception("请输入用户ID");
+            if (Check.isNull(requestJson.getLong("userId"))) {
+                throw new Exception("请输入用户id");
             }
             }
-
-
             Map<String, Object> requestMap = new HashMap<>();
             Map<String, Object> requestMap = new HashMap<>();
-            requestMap.put("start", requestJson.getString("orderStartDate"));
-            requestMap.put("end", requestJson.getString("orderEndDate"));
-            requestMap.put("fieId", "orderNum");
-            requestMap.put("sort", "desc");
 
 
-            String roleKey = sysUserService.getRoleKeyByUserId(userId);
+            String roleKey = sysUserService.getRoleKeyByUserId(requestJson.getLong("userId"));
             if (roleKey.equals("courtship")) {
             if (roleKey.equals("courtship")) {
-                List<Long> itemIds = supplyChainService.getItemIdsByUserId(userId);
+                List<Long> itemIds = supplyChainService.getItemIdsByUserId(requestJson.getLong("userId"));
                 requestMap.put("itemIds", itemIds);
                 requestMap.put("itemIds", itemIds);
             }
             }
 
 
             if (roleKey.equals("courtshipManager")) {
             if (roleKey.equals("courtshipManager")) {
-                Long deptId = deptService.getDeptIdByUserId(userId);
+                Long deptId = deptService.getDeptIdByUserId(requestJson.getLong("userId"));
                 List<Long> itemIds = supplyChainService.getItemIdsByDeptId(deptId);
                 List<Long> itemIds = supplyChainService.getItemIdsByDeptId(deptId);
                 requestMap.put("itemIds", itemIds);
                 requestMap.put("itemIds", itemIds);
             }
             }
+
+
+            requestMap.put("start", DateUtils.strDateToInt(requestJson.getString("orderStartDate")));
+            requestMap.put("end", DateUtils.strDateToInt(requestJson.getString("orderEndDate")));
+            if (!Check.isNull(requestJson.getLong("sellerId"))) {
+                requestMap.put("sellerId", requestJson.getLong("sellerId"));
+
+            }
+            requestMap.put("fieId", "orderNum");
+            requestMap.put("sort", "desc");
             List<JSONObject> list = supplyChainService.shopList(requestMap);
             List<JSONObject> list = supplyChainService.shopList(requestMap);
             List<List<Object>> exportList = new ArrayList<>();
             List<List<Object>> exportList = new ArrayList<>();
             if (!Check.isNull(list)) {
             if (!Check.isNull(list)) {
@@ -2746,6 +2751,8 @@ public class SupplyChainController extends BaseController {
                     export.add(date.getString("orderNum"));
                     export.add(date.getString("orderNum"));
                     export.add(date.getString("validOrderNUm"));
                     export.add(date.getString("validOrderNUm"));
                     export.add(date.getString("validRadio"));
                     export.add(date.getString("validRadio"));
+                    export.add(date.getString("settledOrderNUm"));
+                    export.add(date.getString("settledOrderRate"));
                     export.add(date.getString("payAmount"));
                     export.add(date.getString("payAmount"));
                     export.add(date.getString("deliveryNum"));
                     export.add(date.getString("deliveryNum"));
                     export.add(date.getString("shippingGreen"));
                     export.add(date.getString("shippingGreen"));
@@ -2755,7 +2762,7 @@ public class SupplyChainController extends BaseController {
                     exportList.add(export);
                     exportList.add(export);
                 }
                 }
             }
             }
-            String[] headers = {"店铺ID", "店铺名称", "单量", "有效单量", "有效率", "付款金额", "发货数", "发货率", "有效发货数", "未发货数", "有效发货率"};
+            String[] headers = {"店铺ID", "店铺名称", "单量", "有效单量", "有效率", "已结单量", "结算率", "付款金额", "发货数", "发货率", "有效发货数", "未发货数", "有效发货率"};
             OutputStream os = response.getOutputStream();
             OutputStream os = response.getOutputStream();
             ExportExcelUtils eeu = new ExportExcelUtils();
             ExportExcelUtils eeu = new ExportExcelUtils();
             XSSFWorkbook workbook = new XSSFWorkbook();
             XSSFWorkbook workbook = new XSSFWorkbook();

+ 4 - 4
ruixuan-live/src/main/resources/mapper/isc/KwaixiaodianOrderCursorListMapper.xml

@@ -440,14 +440,14 @@
         end
         end
         ) as price,
         ) as price,
         round(sum(t1.total_fee) / 100, 2) as 'totalFee',
         round(sum(t1.total_fee) / 100, 2) as 'totalFee',
-        IFNULL(round(SUM(CASE WHEN t1.status != 80 THEN t1.total_fee ELSE 0 END) / 100, 2), 0) as 'validTotalFee',
+        IFNULL(round(SUM(CASE WHEN t1.status != 80 and t1.status != 10 THEN t1.total_fee ELSE 0 END) / 100, 2), 0) as 'validTotalFee',
         count(t1.oid) as 'orderNum',
         count(t1.oid) as 'orderNum',
-        IFNULL(SUM(CASE WHEN t1.status != 80 THEN 1 ELSE 0 END), 0) AS 'validOrderNum',
-        round(sum(case when t1.status != 80 then 1 else 0 end) / count(t1.oid) * 100,
+        IFNULL(SUM(CASE WHEN t1.status != 80 and t1.status != 10 THEN 1 ELSE 0 END), 0) AS 'validOrderNum',
+        round(sum(case when t1.status != 80  and t1.status != 10 then 1 else 0 end) / count(t1.oid) * 100,
         2) as 'validRadio',
         2) as 'validRadio',
         sum(case when t1.status >= 40 and t1.status &lt; 80 then 1 else 0 end) as 'deliveryNum',
         sum(case when t1.status >= 40 and t1.status &lt; 80 then 1 else 0 end) as 'deliveryNum',
         round(sum(case when t1.status >= 40 and t1.status &lt; 80 then 1 else 0 end) /
         round(sum(case when t1.status >= 40 and t1.status &lt; 80 then 1 else 0 end) /
-        sum(case when t1.status != 80 then 1 else 0 end) * 100, 2) as 'deliveryRate',
+        sum(case when t1.status != 80 and t1.status != 10 then 1 else 0 end) * 100, 2) as 'deliveryRate',
         sum(case when t1.status = 30 then 1 else 0 end) as 'notDeliveryNum',
         sum(case when t1.status = 30 then 1 else 0 end) as 'notDeliveryNum',
         round(sum(t1.express_fee) / 100, 2) as 'expressFee'
         round(sum(t1.express_fee) / 100, 2) as 'expressFee'
         from kwaixiaodian_order_cursor_list t1
         from kwaixiaodian_order_cursor_list t1

+ 24 - 22
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -3939,52 +3939,54 @@
         ORDER BY tag_oid_num DESC limit 5
         ORDER BY tag_oid_num DESC limit 5
     </select>
     </select>
     <select id="shopList" resultType="com.alibaba.fastjson.JSONObject">
     <select id="shopList" resultType="com.alibaba.fastjson.JSONObject">
-        select t2.seller_name as 'sellerName', t1.*
-        from (select seller_id as 'sellerId',
-        count(oid) as 'orderNum',
-        round(sum(case when order_status != 80 then pay_amount else 0 end) / 100,
+        select t1.seller_id as 'sellerId',
+        MAX(t2.shop_title) as 'sellerName',
+        sum(case when t1.order_status = 60 then 1 else 0 end) as 'settledOrderNUm',
+        round(sum(case when t1.order_status = 60 then 1 else 0 end) / count(t1.oid) * 100,
+        2) as 'settledOrderRate',
+        count(t1.oid) as 'orderNum',
+        round(sum(case when t1.order_status != 80 then t1.pay_amount else 0 end) / 100,
         2) as 'payAmount',
         2) as 'payAmount',
-        round(regimental_promotion_rate / 10, 2) as 'regimentalPromotionRate',
-        sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
-        round(sum(case when order_status != 80 then 1 else 0 end) / count(oid) * 100,
+        round(t1.regimental_promotion_rate / 10, 2) as 'regimentalPromotionRate',
+        sum(case when t1.order_status != 80 then 1 else 0 end) as 'validOrderNUm',
+        round(sum(case when t1.order_status != 80 then 1 else 0 end) / count(t1.oid) * 100,
         2) as 'validRadio',
         2) as 'validRadio',
-        sum(case when send_status = 1 then 1 else 0 end) as 'deliveryNum',
-        round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case
-        when order_status != 80
+        sum(case when t1.send_status = 1 then 1 else 0 end) as 'deliveryNum',
+        round(sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) / sum(case
+        when t1.order_status != 80
         then 1
         then 1
         else 0 end) * 100,
         else 0 end) * 100,
         2) as 'shippingGreen',
         2) as 'shippingGreen',
-        sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
-        sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
-        round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case
-        when send_status = 1
+        sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
+        sum(case when t1.send_status = 0 and t1.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
+        round(sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) / sum(case
+        when t1.send_status = 1
         then 1
         then 1
         else 0 end) * 100,
         else 0 end) * 100,
         2) as 'deliveryRadio'
         2) as 'deliveryRadio'
-        from kuaishou_supply_chain
+        from kuaishou_supply_chain t1 LEFT JOIN kuaishou_activity_open_item_list t2 on t1.item_id = t2.item_id
         where 1 = 1
         where 1 = 1
         <if test="start != null and start != ''">
         <if test="start != null and start != ''">
-            and stat_date &gt;= #{start}
+            and t1.stat_date &gt;= #{start}
         </if>
         </if>
         <if test="end != null and end != ''">
         <if test="end != null and end != ''">
-            and stat_date &lt;= #{end}
+            and t1.stat_date &lt;= #{end}
         </if>
         </if>
         <if test="sellerId != null and sellerId != ''">
         <if test="sellerId != null and sellerId != ''">
-            and seller_id = #{sellerId}
+            and t1.seller_id = #{sellerId}
         </if>
         </if>
         <if test='itemIds != null and itemIds.size() > 0'>
         <if test='itemIds != null and itemIds.size() > 0'>
-            and item_id in
+            and t1.item_id in
             <foreach collection="itemIds" item="item" separator=","
             <foreach collection="itemIds" item="item" separator=","
                      open="(" close=")">
                      open="(" close=")">
                 #{item}
                 #{item}
             </foreach>
             </foreach>
 
 
         </if>
         </if>
-        group by seller_id) t1
-        left join kuaishou_seller_info t2
-        on t1.sellerId = t2.seller_id
+        group by t1.seller_id
         order by ${fieId} ${sort}
         order by ${fieId} ${sort}
 
 
+
     </select>
     </select>
     <select id="shopDetail" resultType="com.alibaba.fastjson.JSONObject">
     <select id="shopDetail" resultType="com.alibaba.fastjson.JSONObject">
         SELECT t1.*,
         SELECT t1.*,