‘linchangsheng’ 6 mēneši atpakaļ
vecāks
revīzija
e547dcadc9

+ 9 - 3
mall-server-api/src/main/java/com/gree/mall/manager/logic/common/SysDictCompanyLogic.java

@@ -17,6 +17,7 @@ import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.*;
 import com.gree.mall.manager.utils.RedisUtil;
+import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.utils.excel.ExcelUtils;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
@@ -232,12 +233,15 @@ public class SysDictCompanyLogic {
                 .eq(SysDictTypeCompany::getOpen, true)
                 .oneOpt()
                 .orElseThrow(() -> new RemoteServiceException("暂不开放该字典类型配置"));
-        checkRepeatDictCode(param.getDictType(), param.getDictValue(), param.getCompanyWechatId());
+        checkRepeatDictCode(param.getDictType(), param.getDictValue(), param.getCompanyWechatId(),param.getDictCode());
         if(adminUser != null) {
             param.setCompanyName(adminUser.getCompanyName());
             param.setCompanyWechatId(adminUser.getCompanyWechatId());
         }
-        param.setDictCode(IdWorker.getIdStr());
+        if (StringUtil.isEmpty(param.getDictCode())) {
+            param.setDictCode(IdWorker.getIdStr());
+        }
+
         sysDictCompanyService.save(param);
     }
 
@@ -266,10 +270,12 @@ public class SysDictCompanyLogic {
         sysDictCompanyService.updateById(param);
     }
 
-    private void checkRepeatDictCode(String dictType, String value, String companyWechatId) {
+    private void checkRepeatDictCode(String dictType, String value, String companyWechatId,String code) {
         Integer count = sysDictCompanyService.lambdaQuery()
                 .eq(SysDictCompany::getDictType, dictType)
                 .eq(SysDictCompany::getDictValue, value)
+                .eq(SysDictCompany::getDictValue, value)
+                .eq(!StringUtil.isEmpty(code),SysDictCompany::getDictCode, code)
                 .eq(SysDictCompany::getCompanyWechatId, companyWechatId)
                 .count();
         if (count > 0) {

+ 8 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/websit/SettlementOrderLogic.java

@@ -390,11 +390,19 @@ public class SettlementOrderLogic {
 
             WxPayOrderQueryResult wxPayOrderQueryResult = payService.queryOrder("", workerOrder.getOrderId());
 
+            if (!wxPayOrderQueryResult.getReturnCode().equals("SUCCESS")) {
+                continue;
+            }
+
 
             if (!wxPayOrderQueryResult.getResultCode().equals("SUCCESS")) {
                 continue;
             }
 
+            if(!wxPayOrderQueryResult.getTradeState().equals("SUCCESS")){
+                continue;
+            }
+
             AdminWebsit adminWebsit = adminWebsitService.getById(workerOrder.getWebsitId());
 
 

+ 6 - 2
mall-server-sync-api/src/main/java/com/gree/mall/manager/logic/SyncOrderInfoLogic.java

@@ -26,6 +26,7 @@ import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.*;
 import com.gree.mall.manager.utils.RedisUtil;
+import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.utils.http.HttpUtils;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.RequiredArgsConstructor;
@@ -362,6 +363,8 @@ public class SyncOrderInfoLogic {
 
 
 
+                if (StringUtil.isEmpty(s))
+                    continue;
 
 
                 JSONArray jsonArray = JSONUtil.parseArray(s);
@@ -652,7 +655,7 @@ public class SyncOrderInfoLogic {
 
     }
 
-    public void syncDetailFail() {
+    public synchronized void syncDetailFail() {
 
         while (true) {
 
@@ -707,7 +710,8 @@ public class SyncOrderInfoLogic {
                 String s = bodyMap.get("data").toString();
 
 
-
+                if (StringUtil.isEmpty(s))
+                    continue;
 
 
                 JSONArray jsonArray = JSONUtil.parseArray(s);