Bläddra i källkod

律师端订单修改

zhangchen 1 månad sedan
förälder
incheckning
4db8f4daa4

+ 9 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/LawyerConsultationOrderVO.java

@@ -1,5 +1,6 @@
 package shop.alien.entity.store.vo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;
@@ -152,5 +153,13 @@ public class LawyerConsultationOrderVO implements Serializable {
 
     @ApiModelProperty(value = "客户端用户ID")
     private String clientUserPhone;
+
+    @ApiModelProperty(value = "支付宝订单编号")
+    @TableField("alipay_no")
+    private String alipayNo;
+
+    @ApiModelProperty(value = "支付宝订单字符串")
+    @TableField("order_str")
+    private String orderStr;
 }
 

+ 2 - 0
alien-entity/src/main/resources/mapper/LawyerConsultationOrderMapper.xml

@@ -79,6 +79,8 @@
         <result column="nick_name" property="nickName" />
         <result column="personal_introduction" property="personalIntroduction" />
         <result column="expertise_area_info" property="expertiseAreaInfo" />
+        <result column="alipay_no" property="alipayNo" />
+        <result column="order_str" property="orderStr" />
     </resultMap>
 
     <!-- 分頁查詢訂單列表,聯查律師信息 -->

+ 11 - 7
alien-lawyer/src/main/java/shop/alien/lawyer/service/impl/LawyerConsultationOrderServiceImpl.java

@@ -766,18 +766,22 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
 
         // 构建查询条件:查询进行中(2)和已完成(3)状态的订单
         QueryWrapper<LawyerConsultationOrderVO> queryWrapper = new QueryWrapper<>();
+        QueryWrapper<LawyerConsultationOrderVO> queryStatisticsWrapper = new QueryWrapper<>();
+
         if(StringUtils.hasText(orderStatus)){
             queryWrapper.in("lco.order_status", Collections.singletonList(orderStatus));
         } else {
             queryWrapper.in("lco.order_status", Arrays.asList("2", "3"));
         }
         queryWrapper.eq("lco.lawyer_user_id", lawyerId);
+        queryStatisticsWrapper.eq("lco.lawyer_user_id", lawyerId);
         if(StringUtils.hasText(clientUserName)){
             queryWrapper.like("lur.user_name", clientUserName);
+            queryStatisticsWrapper.like("lur.user_name", clientUserName);
         }
         queryWrapper.eq("lco.delete_flag", 0);
+        queryStatisticsWrapper.eq("lco.delete_flag", 0);
         queryWrapper.orderByDesc("lco.created_time");
-
         // 时间范围查询:如果开始时间和结束时间都存在,则进行范围查询
         if (StringUtils.hasText(startDate) && StringUtils.hasText(endDate)) {
             queryWrapper.between("lco.payment_time", startDate + " 00:00:00", endDate + " 23:59:59");
@@ -794,23 +798,23 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
         }
 
         //获取统计信息
-        queryWrapper.groupBy("lco.order_status");
-        List<Map<String, Object>> statisticsInfo =  consultationOrderMapper.getLawyerStatisticsInfo(queryWrapper);
+        queryStatisticsWrapper.groupBy("lco.order_status");
+        List<Map<String, Object>> statisticsInfo =  consultationOrderMapper.getLawyerStatisticsInfo(queryStatisticsWrapper);
 
         Map<Integer, Integer> statusCountMap = new HashMap<>();
         for (Map<String, Object> map : statisticsInfo) {
-            Integer status = (Integer) map.get("status");
-            Long countLong = (Long) map.get("count"); // COUNT(*) 返回类型可能是Long
+            Integer status = (Integer) map.get("order_status");
+            Long countLong = (Long) map.get("order_count"); // COUNT(*) 返回类型可能是Long
             statusCountMap.put(status, countLong.intValue());
         }
 
 
         // 统计进行中订单数量
-        int inProgressCount = statusCountMap.containsKey(2)?Integer.parseInt(statisticsInfo.get(2).toString()): 0;
+        int inProgressCount = statusCountMap.getOrDefault(2, 0);
         resultMap.put("lawyerInProgressOrderCount", inProgressCount);
 
         // 统计已完成订单数量
-        int completeCount = statusCountMap.containsKey(3)?Integer.parseInt(statisticsInfo.get(3).toString()): 0;
+        int completeCount = statusCountMap.getOrDefault(3, 0);
         resultMap.put("lawyerCompleteOrderCount", completeCount);
 
         // 统计订单总数