Parcourir la source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	mall-server-api/src/main/java/com/gree/mall/manager/schedule/OrderBaseSchedule.java
FengChaoYu il y a 1 semaine
Parent
commit
7d2cc99c36

+ 1 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/common/outside/WechatLogic.java

@@ -68,8 +68,8 @@ public class WechatLogic extends OutsideBaseApi{
         String s = HttpUtils.requestPostForm(pcUrl + "/wechat/pub/auth", map, null);
         ResponseHelper<String> result = JSONUtil.toBean(s, new TypeReference<ResponseHelper<String>>() {
         }, false);
+        log.info("获取绑定公众号openid:{}",result);
         String s1 = checkData(result);
-        log.info("获取绑定公众号openid:{}",s1);
         return s1;
     }
 

+ 9 - 19
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();
 
@@ -1081,11 +1076,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)
-
                 .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();
 
@@ -1095,11 +1088,9 @@ public class PayOrderLogic {
                 .like(!StringUtil.isEmpty(settlementType), WorkerOrder::getSettlementType, settlementType)
                 .eq(!StringUtil.isEmpty(orderId), WorkerOrder::getOrderId, orderId)
                 .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 +1099,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();
 

+ 6 - 4
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/policy/WorkerLogic.java

@@ -290,12 +290,14 @@ public class WorkerLogic {
 
         PolicyOrderDetail policyOrderDetail = BeanUtil.toBean(policyOrder, PolicyOrderDetail.class);
 
-        Policy policy = policyService.getById(policyOrderDetail.getPolicyId());
 
+        Policy policy = policyService.getById(policyOrderDetail.getPolicyId());
 
-        List<PolicyRange> policyRanges = policyRangeService.lambdaQuery().eq(PolicyRange::getPolicyId, policy.getId()).list();
-        policyOrderDetail.setPolicy(policy);
-        policyOrderDetail.setPolicyRanges(policyRanges);
+        if (policy == null){
+            List<PolicyRange> policyRanges = policyRangeService.lambdaQuery().eq(PolicyRange::getPolicyId, policy.getId()).list();
+            policyOrderDetail.setPolicy(policy);
+            policyOrderDetail.setPolicyRanges(policyRanges);
+        }
 
         List<AgreementPolicy> agreementPolicies = agreementPolicyService.lambdaQuery().eq(AgreementPolicy::getPolicyId, policy.getId()).list();
 

+ 14 - 1
mall-server-api/src/main/java/com/gree/mall/manager/schedule/OrderBaseSchedule.java

@@ -80,7 +80,7 @@ public class OrderBaseSchedule {
      * 每天五点结算所有结算单
      */
     @Transactional
-    @Scheduled(cron = "0 20 17 * * *")
+    @Scheduled(cron = "0 0 17 * * ?")
   //  @Scheduled(fixedDelay = 60  * 1000)
     public void fenzhang() throws WxPayException {
         List<SettlementOrder> settlementOrders = settlementOrderService.lambdaQuery().in(SettlementOrder::getStatus, "WAIT").list();
@@ -91,6 +91,19 @@ public class OrderBaseSchedule {
 
     }
 
+/*    @Transactional
+    @Scheduled(cron = "0 30 17 * * ?")
+    //  @Scheduled(fixedDelay = 60  * 1000)
+    public void fenzhang2() throws WxPayException {
+        List<SettlementOrder> settlementOrders = settlementOrderService.lambdaQuery().in(SettlementOrder::getStatus, "WAIT").list();
+
+        for (SettlementOrder settlementOrder : settlementOrders) {
+            wechatLogic.shareSettlementAmountCorn(settlementOrder);
+        }
+
+    }*/
+
+
     @Transactional
     @Scheduled(fixedDelay = 60  * 1000)
     public synchronized void fenzhangQingKuang() throws WxPayException {

+ 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