‘linchangsheng’ 2 周之前
父節點
當前提交
14c40d7954

+ 9 - 17
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/order/PayOrderLogic.java

@@ -1065,14 +1065,9 @@ public class PayOrderLogic {
                 .eq(!StringUtil.isEmpty(goodsType), WorkerOrder::getGoodsType, goodsType)
                 .like(!StringUtil.isEmpty(settlementType), WorkerOrder::getSettlementType, settlementType)
                 .eq(!StringUtil.isEmpty(orderId), WorkerOrder::getOrderId, orderId)
-                .and(item -> item
-                        .eq(WorkerOrder::getPayStatus,"CANCEL")
-
-                        .or(iter -> iter.eq(WorkerOrder::getRefundStatus, IsYesNoEnum.YES.getKey()))
-                )
-                .and(item -> item.eq(WorkerOrder::getUserId,currentCompanyWechat.getUser().getUserId())
-                        .or(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber())).eq(WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
-                )
+                .eq(WorkerOrder::getPayStatus,"CANCEL")
+                .eq(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
+                .eq(StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getIdentity,currentCompanyWechat.getUser().getIdCard())
                 .between(!StringUtil.isEmpty(startTime), WorkerOrder::getCreateTime, startTime, endTime)
                 .in(WorkerOrder::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId()).count();
 
@@ -1083,9 +1078,8 @@ public class PayOrderLogic {
                 .eq(!StringUtil.isEmpty(orderId), WorkerOrder::getOrderId, orderId)
 
                 .eq( WorkerOrder::getPayStatus, "WAIT")
-                .and(item -> item.eq(WorkerOrder::getUserId,currentCompanyWechat.getUser().getUserId())
-                        .or().eq(WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
-                )
+                .eq(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
+                .eq(StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getIdentity,currentCompanyWechat.getUser().getIdCard())
                 .between(!StringUtil.isEmpty(startTime), WorkerOrder::getCreateTime, startTime, endTime)
                 .in(WorkerOrder::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId()).count();
 
@@ -1097,9 +1091,8 @@ public class PayOrderLogic {
                 .eq(WorkerOrder::getRefundStatus, IsYesNoEnum.NO.getKey())
 
                 .eq( WorkerOrder::getPayStatus, PayStatusEnum.PAID.getKey())
-                .and(item -> item.eq(WorkerOrder::getUserId,currentCompanyWechat.getUser().getUserId())
-                        .or().eq(WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
-                )
+                .eq(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
+                .eq(StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getIdentity,currentCompanyWechat.getUser().getIdCard())
                 .between(!StringUtil.isEmpty(startTime), WorkerOrder::getCreateTime, startTime, endTime)
                 .in(WorkerOrder::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId()).count();
 
@@ -1108,9 +1101,8 @@ public class PayOrderLogic {
                 .eq(!StringUtil.isEmpty(goodsType), WorkerOrder::getGoodsType, goodsType)
                 .like(!StringUtil.isEmpty(settlementType), WorkerOrder::getSettlementType, settlementType)
                 .eq(!StringUtil.isEmpty(orderId), WorkerOrder::getOrderId, orderId)
-                .and(item -> item.eq(WorkerOrder::getUserId,currentCompanyWechat.getUser().getUserId())
-                        .or().eq(WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
-                )
+                .eq(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
+                .eq(StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getIdentity,currentCompanyWechat.getUser().getIdCard())
                 .between(!StringUtil.isEmpty(startTime), WorkerOrder::getCreateTime, startTime, endTime)
                 .in(WorkerOrder::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId()).count();
 

+ 1 - 1
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1685,7 +1685,7 @@
         ${ex.orderBy}
     </select>
     <select id="workerSignConfirmCount" resultType="java.lang.Integer">
-        SELECT COUNT(*) FROM (
+         FROM (
             SELECT
                 IF(IFNULL(d.create_time, 1)=1, 1, 0) AS status
             FROM