Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

guq 7 years ago
parent
commit
6408501826

+ 1 - 4
applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/VendorApi.java

@@ -2,13 +2,10 @@ package com.usoftchina.saas.document.api;
 
 import com.usoftchina.saas.auth.client.interceptor.ServiceFeignInterceptor;
 import com.usoftchina.saas.base.Result;
-import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.dto.VendorListDTO;
-import com.usoftchina.saas.page.PageRequest;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -20,6 +17,6 @@ public interface VendorApi {
      * @param id
      * @return
      */
-    @GetMapping("/read/{id}")
+    @GetMapping("/vendor/read/{id}")
     Result<VendorListDTO> getDataById(@PathVariable("id") Long id);
 }

+ 1 - 1
applications/document/document-server/src/main/resources/application.yml

@@ -98,4 +98,4 @@ b2b:
     inquiry: https://test-inquiry.uuzcc.cn
     Component: https://test-mall.uuzcc.cn
     product: http://test-product.uuzcc.cn
-    common: https://test-b2b.uuzcc.cn
+    common: http://test-b2b.uuzcc.cn

+ 1 - 1
applications/money/money-server/src/main/resources/application.yml

@@ -84,4 +84,4 @@ b2b:
     inquiry: https://test-inquiry.uuzcc.cn
     Component: https://test-mall.uuzcc.cn
     product: http://test-product.uuzcc.cn
-    common: https://test-b2b.uuzcc.cn
+    common: http://test-b2b.uuzcc.cn

+ 2 - 4
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -194,10 +194,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             calcPurchase(pu_id);
             //日志记录
             messageLogService.save(baseDTO);
-
-            //上传至B2B
-            uploadB2B(pu_id);
-
             return baseDTO;
         }
         //校验有来源的验收验退币别是否与源单据一致
@@ -639,6 +635,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         getMapper().updateByPrimaryKeySelective(purchase);
         //日志
         messageLogService.audit(docBaseDTO);
+        //上传至B2B
+        uploadB2B(id);
         return result;
     }
 

+ 1 - 1
applications/purchase/purchase-server/src/main/resources/application.yml

@@ -96,4 +96,4 @@ b2b:
     inquiry: https://test-inquiry.uuzcc.cn
     Component: https://test-mall.uuzcc.cn
     product: http://test-product.uuzcc.cn
-    common: https://test-b2b.uuzcc.cn
+    common: http://test-b2b.uuzcc.cn

+ 1 - 1
applications/sale/sale-server/src/main/resources/application.yml

@@ -96,4 +96,4 @@ b2b:
     inquiry: https://test-inquiry.uuzcc.cn
     Component: https://test-mall.uuzcc.cn
     product: http://test-product.uuzcc.cn
-    common: https://test-b2b.uuzcc.cn
+    common: http://test-b2b.uuzcc.cn

+ 1 - 1
applications/transfers/mall-api/src/test/resources/application.yml

@@ -3,4 +3,4 @@ b2b:
     inquiry: https://test-inquiry.uuzcc.cn
     Component: https://test-mall.uuzcc.cn
     product: http://test-product.uuzcc.cn
-    common: https://test-b2b.uuzcc.cn
+    common: http://test-b2b.uuzcc.cn

+ 9 - 2
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendPurchaseTask.java

@@ -26,6 +26,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -67,10 +68,16 @@ public class SendPurchaseTask extends Executable {
             LOGGER.info("PurchaseDetailDTO={}, b2bPurchaseDetailList={}", JsonUtils.toJsonString(purchaseFormDTO.getItems()), JsonUtils.toJsonString(b2bPurchaseDetailList));
 
             b2bPurchase.setPurchaseDetails(b2bPurchaseDetailList);
-
-            boolean success = SendUtil.sendToB2B(b2bConfig.getCommon() + purchaseUrl, JsonUtils.toJsonString(b2bPurchase), companyDTO.getAccessKey());
+            //添加身份ID
+            String url = b2bConfig.getCommon() + purchaseUrl + "?access_id=" + companyDTO.getUu();
+            //将数据改为数据格式
+            List<Purchase> data = new ArrayList<Purchase>();
+            data.add(b2bPurchase);
+            boolean success = SendUtil.sendToB2B(url, JsonUtils.toJsonString(data), companyDTO.getAccessKey());
             if (success) {
                 purchaseApi.updateB2BStatus(Long.parseLong(messageInfo.getBizId()), "已上传");
+            }else{
+                throw new Exception("处理失败");
             }
         }
 

+ 6 - 0
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/utils/SendUtil.java

@@ -3,6 +3,8 @@ package com.usoftchina.saas.transfers.utils;
 import com.usoftchina.saas.utils.JsonUtils;
 import com.usoftchina.saas.utils.http.HttpUtil;
 import com.usoftchina.saas.utils.http.HttpUtil.Response;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -14,6 +16,8 @@ import java.util.Map;
  */
 public class SendUtil {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(SendUtil.class);
+
     /**
      *  发送请求给B2B
      * @param url         URL
@@ -25,6 +29,8 @@ public class SendUtil {
     public static boolean sendToB2B(String url, String data, String accessSecretKey) throws Exception {
         Map<String, String> params = new HashMap<String, String>();
         params.put("data", JsonUtils.toJsonString(data));
+        LOGGER.info("url={}, accessSecretKey={}", url, accessSecretKey);
+        LOGGER.info("data={}", data);
         Response response = HttpUtil.sendPostRequest(url, params, true, accessSecretKey);
         if (response.getStatusCode() == 200){
             return true;

+ 1 - 1
applications/transfers/transfers-server/src/main/resources/application.yml

@@ -95,4 +95,4 @@ b2b:
     inquiry: https://test-inquiry.uuzcc.cn
     Component: https://test-mall.uuzcc.cn
     product: http://test-product.uuzcc.cn
-    common: https://test-b2b.uuzcc.cn
+    common: http://test-b2b.uuzcc.cn

+ 1 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/AccountController.java

@@ -519,6 +519,7 @@ public class AccountController {
 
     //清空缓存
     @RequestMapping("/cache/clearAll")
+    @IgnoreAuth
     public Result clearAll() {
         CompanyCache.current().clear();
         AccountCache.current().clear();

+ 5 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/http/HttpUtil.java

@@ -48,6 +48,8 @@ import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.protocol.HTTP;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.RequestMethod;
 
@@ -60,6 +62,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
  */
 @SuppressWarnings("deprecation")
 public class HttpUtil {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HttpUtil.class);
 	
 	/** 
 	 * 绕过验证 
@@ -754,6 +758,7 @@ public class HttpUtil {
 			buf.append("&_signature=").append(HmacUtils.encode(message, signKey));
 		} else
 			buf.deleteCharAt(buf.length() - 1);
+		LOGGER.info("send URL={}", buf.toString());
 		return buf.toString();
 	}