Browse Source

no message

FengChaoYu 1 week ago
parent
commit
f2e90299cc

+ 4 - 17
src/main/java/com/gree/mall/manager/logic/common/WechatLogic.java

@@ -3,30 +3,21 @@ package com.gree.mall.manager.logic.common;
 import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.json.JSONUtil;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.TypeReference;
 import com.github.binarywang.wxpay.bean.profitsharing.*;
 import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
-import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
 import com.github.binarywang.wxpay.bean.result.WxPayRefundResult;
-import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.ProfitSharingService;
 import com.github.binarywang.wxpay.service.WxPayService;
-import com.gree.mall.manager.bean.PayDetail;
 import com.gree.mall.manager.config.wx.WxConfiguration;
-import com.gree.mall.manager.constant.Constant;
-import com.gree.mall.manager.enums.OrderShareStatusEnum;
 import com.gree.mall.manager.exception.RemoteServiceException;
-import com.gree.mall.manager.logic.order.OrderShareLogic;
-import com.gree.mall.manager.plus.entity.AdminCompanyWechat;
 import com.gree.mall.manager.plus.entity.OrderInfo;
 import com.gree.mall.manager.plus.entity.OrderShare;
-import com.gree.mall.manager.plus.entity.OrderSharePayInfo;
-import com.gree.mall.manager.plus.service.OrderSharePayInfoService;
-import com.gree.mall.manager.utils.*;
+import com.gree.mall.manager.utils.ArithUtils;
+import com.gree.mall.manager.utils.HttpUtils;
+import com.gree.mall.manager.utils.StringUtil;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.error.WxErrorException;
@@ -35,10 +26,6 @@ import org.jdom.Document;
 import org.jdom.Element;
 import org.jdom.JDOMException;
 import org.jdom.input.SAXBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import java.io.ByteArrayInputStream;
@@ -80,7 +67,7 @@ public class WechatLogic {
      * @param orderInfo
      */
     public void deliver(OrderInfo orderInfo,String openId) throws WxErrorException {
-        String token = this.getAccessToken(orderInfo.getCompanyWechatId());
+        String token = this.getAccessToken(orderInfo.getPayWorkerCodeId());
         String url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token="+token;
         Map<String,Object> map = new HashMap<>();
         map.put("access_token",token);

+ 1 - 1
src/main/java/com/gree/mall/manager/logic/count/CountLogic.java

@@ -99,7 +99,7 @@ public class CountLogic {
                 adminUserCom.getAdminCompanyIds(), adminUserCom.getAdminWebsitIds());
         //各时段统计
         List<OrderInfo> list = orderInfoService.lambdaQuery()
-                .in(CollectionUtils.isNotEmpty(adminUserCom.getAdminCompanyIds()), OrderInfo::getCompanyWechatId, adminUserCom.getAdminCompanyIds())
+                .in(CollectionUtils.isNotEmpty(adminUserCom.getAdminCompanyIds()), OrderInfo::getCompanyId, adminUserCom.getAdminCompanyIds())
                 .in(CollectionUtils.isNotEmpty(adminUserCom.getAdminWebsitIds()), OrderInfo::getWebsitId, adminUserCom.getAdminWebsitIds())
                 .notIn(OrderInfo::getOrderStatus, Arrays.asList(OrderStatusEnum.CLOSE.toString(), OrderStatusEnum.NOPAY.toString(), OrderStatusEnum.TIMEOUT.toString()))
                 .between(OrderInfo::getCreateTime, startTime, endTime).list();

+ 0 - 2
src/main/java/com/gree/mall/manager/logic/goods/GoodsLogic.java

@@ -1050,8 +1050,6 @@ public class GoodsLogic {
                                 .setInnerShareAmount(BigDecimal.ZERO)
                                 .setInnerSharePercent((double) 0)
                                 .setStockNum(0)
-                                .setJindName("")
-                                .setJindUnit("")
                                 .setCreateTime(DateUtil.date())
                                 .insert();
 

+ 1 - 1
src/main/java/com/gree/mall/manager/logic/order/OrderLogic.java

@@ -1016,7 +1016,7 @@ public class OrderLogic {
             if (orderInfo == null || !orderInfo.getOrderStatus().equals(OrderStatusEnum.YFH.toString())) {
                 return;
             }
-            final AdminCompanyWechat companyWechat = adminCompanyWechatService.getById(orderInfo.getCompanyWechatId());
+            final AdminCompanyWechat companyWechat = adminCompanyWechatService.getById(orderInfo.getPayWorkerCodeId());
             orderInfo.setOrderStatus(OrderStatusEnum.OVER.toString());
             orderInfo.setOverTime(new Date());
             orderInfo.updateById();

+ 1 - 1
src/main/java/com/gree/mall/manager/logic/order/OrderRefundLogic.java

@@ -278,7 +278,7 @@ public class OrderRefundLogic {
         }
         if (!orderRefund.getPayType().equals("云闪付")) {
             wechatLogic.refund(orderRefund.getOrderId(), orderRefund.getOrderRefundId(), orderRefund.getPayAmount().doubleValue()
-                    , orderRefund.getRefundAmount().doubleValue(), orderRefund.getCompanyWechatId());
+                    , orderRefund.getRefundAmount().doubleValue(), orderRefund.getPayWorkerCodeId());
         } else {
             umsLogic.refund(orderRefund.getOrderId(), orderRefund.getPayAmount().doubleValue()
                     , orderRefund.getRefundAmount().doubleValue(), orderRefund.getWebsitId());

+ 3 - 5
src/main/java/com/gree/mall/manager/logic/ums/SupplementRecordLogic.java

@@ -44,12 +44,11 @@ public class SupplementRecordLogic {
     @Transactional(rollbackFor = Exception.class)
     public String generateSupplementRecord(String orderId) {
         final OrderInfo orderInfo = orderInfoService.getById(orderId);
-        AdminCompanyWechat companyWechat = adminCompanyWechatService.getById(orderInfo.getCompanyWechatId());
 
-        return this.generateSupplementRecord(orderInfo, companyWechat);
+        return this.generateSupplementRecord(orderInfo);
     }
 
-    public String generateSupplementRecord(OrderInfo orderInfo, AdminCompanyWechat companyWechat) {
+    public String generateSupplementRecord(OrderInfo orderInfo) {
         final AdminUserCom adminUser = commonLogic.getAdminUser();
         final AdminWebsit adminWebsit = adminWebsitService.getById(orderInfo.getWebsitId());
         if (!orderInfo.getPayType().equals("云闪付")
@@ -110,7 +109,7 @@ public class SupplementRecordLogic {
 
         final String newElecAppBrandAndModel = validStr ? goodsName : null;
 
-        record.setCompanyWechatId(orderInfo.getCompanyWechatId())
+        record.setCompanyId(orderInfo.getCompanyId())
                 .setWebsitId(orderInfo.getWebsitId())
                 .setOrderId(orderInfo.getOrderId())
                 .setTraceId(traceId)
@@ -224,7 +223,6 @@ public class SupplementRecordLogic {
 
         record.setStatus("SUBMIT");
         if (StringUtils.isBlank(record.getId())) {
-            final AdminCompanyWechat companyWechat = adminCompanyWechatService.getById(record.getCompanyWechatId());
             String traceId = adminWebsit.getYunSpCode() + IdUtil.fastSimpleUUID();
             record.setCreateTime(DateUtil.date())
                     .setCreateBy(adminUser.getNickName())

+ 1 - 37
src/main/java/com/gree/mall/manager/schedule/YueHuanXinSchedule.java

@@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.gree.mall.manager.bean.ums.SubsidyApplyTraceBean;
 import com.gree.mall.manager.logic.common.UMSLogic;
 import com.gree.mall.manager.logic.ums.FileSftpUploaderLogic;
-import com.gree.mall.manager.plus.entity.AdminCompanyWechat;
 import com.gree.mall.manager.plus.entity.AdminWebsit;
 import com.gree.mall.manager.plus.entity.UmsSupplementRecord;
 import com.gree.mall.manager.plus.service.AdminCompanyWechatService;
@@ -59,29 +58,17 @@ public class YueHuanXinSchedule {
             return;
         }
 
-        final List<AdminCompanyWechat> companyWechatList = adminCompanyWechatService.lambdaQuery()
-                .list();
-
         final List<AdminWebsit> websitList = adminWebsitService.lambdaQuery()
                 .in(AdminWebsit::getWebsitId, recordList.stream()
                         .map(UmsSupplementRecord::getWebsitId)
                         .collect(Collectors.toList()))
                 .list();
 
-        final Map<String, AdminCompanyWechat> companyWechatMap = companyWechatList.stream()
-                .collect(Collectors.toMap(AdminCompanyWechat::getCompanyWechatId, Function.identity()));
-
         final Map<String, AdminWebsit> adminWebsitMap = websitList.stream()
                 .collect(Collectors.toMap(AdminWebsit::getWebsitId, Function.identity()));
 
         for (UmsSupplementRecord record : recordList) {
-            final AdminCompanyWechat companyWechat = companyWechatMap.get(record.getCompanyWechatId());
             final AdminWebsit websit = adminWebsitMap.get(record.getWebsitId());
-            if (Objects.isNull(companyWechat)) {
-                record.setErrCount(record.getErrCount() + 1)
-                        .setSysErr("缺少商户信息");
-                continue;
-            }
             if (Objects.isNull(websit)) {
                 record.setErrCount(record.getErrCount() + 1)
                         .setSysErr("缺少商家信息");
@@ -207,29 +194,18 @@ public class YueHuanXinSchedule {
             return;
         }
 
-        final List<AdminCompanyWechat> companyWechatList = adminCompanyWechatService.lambdaQuery()
-                .list();
-
         final List<AdminWebsit> websitList = adminWebsitService.lambdaQuery()
                 .in(AdminWebsit::getWebsitId, recordList.stream()
                         .map(UmsSupplementRecord::getWebsitId)
                         .collect(Collectors.toList()))
                 .list();
 
-        final Map<String, AdminCompanyWechat> companyWechatMap = companyWechatList.stream()
-                .collect(Collectors.toMap(AdminCompanyWechat::getCompanyWechatId, Function.identity()));
-
         final Map<String, AdminWebsit> adminWebsitMap = websitList.stream()
                 .collect(Collectors.toMap(AdminWebsit::getWebsitId, Function.identity()));
 
         for (UmsSupplementRecord record : recordList) {
-            final AdminCompanyWechat companyWechat = companyWechatMap.get(record.getCompanyWechatId());
             final AdminWebsit websit = adminWebsitMap.get(record.getWebsitId());
-            if (Objects.isNull(companyWechat)) {
-                record.setErrCount(record.getErrCount() + 1)
-                        .setSysErr("缺少商户信息");
-                continue;
-            }
+
             if (Objects.isNull(websit)) {
                 record.setErrCount(record.getErrCount() + 1)
                         .setSysErr("缺少商家信息");
@@ -281,29 +257,17 @@ public class YueHuanXinSchedule {
             return;
         }
 
-        final List<AdminCompanyWechat> companyWechatList = adminCompanyWechatService.lambdaQuery()
-                .list();
-
         final List<AdminWebsit> websitList = adminWebsitService.lambdaQuery()
                 .in(AdminWebsit::getWebsitId, recordList.stream()
                         .map(UmsSupplementRecord::getWebsitId)
                         .collect(Collectors.toList()))
                 .list();
 
-        final Map<String, AdminCompanyWechat> companyWechatMap = companyWechatList.stream()
-                .collect(Collectors.toMap(AdminCompanyWechat::getCompanyWechatId, Function.identity()));
-
         final Map<String, AdminWebsit> adminWebsitMap = websitList.stream()
                 .collect(Collectors.toMap(AdminWebsit::getWebsitId, Function.identity()));
 
         for (UmsSupplementRecord record : recordList) {
-            final AdminCompanyWechat companyWechat = companyWechatMap.get(record.getCompanyWechatId());
             final AdminWebsit websit = adminWebsitMap.get(record.getWebsitId());
-            if (Objects.isNull(companyWechat)) {
-                record.setErrCount(record.getErrCount() + 1)
-                        .setSysErr("缺少商户信息");
-                continue;
-            }
             if (Objects.isNull(websit)) {
                 record.setErrCount(record.getErrCount() + 1)
                         .setSysErr("缺少商家信息");