Przeglądaj źródła

Merge branch 'dev-mysql' into feature_release-tomysql

liusw 7 lat temu
rodzic
commit
2481576c64

+ 1 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -422,8 +422,7 @@ public class ProductServiceImpl implements ProductService {
         }
         Date date = new Date();
         // 删除原有的替代料数据
-        List<ProductReplace> existReplaces = productReplaceDao.findByProductIdOrderByDetno(productId);
-        productReplaceDao.delete(existReplaces);
+        productReplaceDao.deleteByProductId(productId);
         for (ProductReplace productReplace : productReplaceList) {
             if (productReplace.getUserUU() == null) {
                 productReplace.setUserUU(SystemSession.getUser().getUserUU());

+ 3 - 2
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreInServiceImpl.java

@@ -174,13 +174,14 @@ public class StoreInServiceImpl implements StoreInService {
 		}else {
 			StoreIn returnStoreIn;
 			StoreIn storeInsOne = storeIns.get(0);
-			EnterpriseSimple enterpriseSimple = EnterpriseSimple.translateSimple(SystemSession.getUser().getEnterprise());
+			/*EnterpriseSimple enterpriseSimple = EnterpriseSimple.translateSimple(SystemSession.getUser().getEnterprise());
 			if (enterpriseSimple.getEnName().equals(storeInsOne.getEnterprise().getEnName())) {
 				returnStoreIn = storeInsOne;
 			} else {
 				storeInsOne.setEnterprise(enterpriseSimple);
 				returnStoreIn = storeDao.save(storeInsOne);
-			}
+			}*/
+			returnStoreIn = storeInsOne;
 			Set<Qualification> qualifications = returnStoreIn.getQualifications();
 			Set<Qualification> qualificationsSort = getQualificationsSort();
 			qualificationsSort.addAll(qualifications);

+ 9 - 1
src/main/webapp/WEB-INF/views/normal/adminWithNav.html

@@ -397,7 +397,15 @@
 				<div class="span7" style="padding: 20px;">
 					<p class="help-block">提示:选择的图片单张大小不超过3MB,支持jpg,jpeg,gif,bmp,png</p>
 					<div class="upload-container" ng-disabled="getImages().length == images.length">
-						<div id="uploadify" on-success="onUploadSuccess($data)" uploadify="{buttonText:'选择图片'}"></div>
+						<!--<div id="uploadify" on-success="onUploadSuccess($data)" uploadify="{buttonText:'选择图片'}"></div>-->
+						<div image-upload
+								 on-success="onUploadSuccess($data)"
+								 non-preview="true"
+								 data-src="static/img/example/upload-apply.png"
+						>
+
+						</div>
+						<!--<input id="uploadify"  type="file" value="选择图片" onchange="angular.element(this).scope().onUploadSuccess(this.files)()" />-->
 					</div>
 				</div>
 				<div class="span5">

+ 2 - 2
src/main/webapp/resources/js/admin/controllers/AuditBrandDetailCtrl.js

@@ -198,10 +198,10 @@ define([ 'app/app' ], function(app) {
 		$scope.onUploadSuccess = function(data){
 			var path = data.path;
 			path = path.substring(0, path.lastIndexOf('.')) + "_150x90" + path.substr(path.lastIndexOf('.'));
-			$scope.$apply(function(){
+			// $scope.$apply(function(){
 				$scope.image.src = data.path;
 				$scope.image.thumb = path;
-			});
+			// });
 		};
 		$scope.close = function() {
 			$modalInstance.dismiss();

+ 2 - 2
src/main/webapp/resources/view/vendor/left_nav.html

@@ -60,7 +60,7 @@
 				<!-- 我的店铺申述 store -->
 				<span  ui-sref="vendor_store_maintain" ng-if="store && store.status && store.status !== 'OPENED'">我的店铺</span>
 			</li>
-			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><a  ui-sref="vendorSeekPurchase">求购询价</a></li>
+			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><span ui-sref="vendorSeekPurchase">求购询价</span></li>
 		<li ng-class="{'active' : active == 'vendor_logistics'}">
 			<span  ui-sref="vendor_logistics" ng-hide="store && (!store.status || store.status === 'OPENED')">物流管理</span>
 			<span  ui-sref="vendor_deliveryRule" ng-if="store && (!store.status || store.status === 'OPENED')">物流管理</span>
@@ -96,7 +96,7 @@
 				<!-- 我的店铺申述 store -->
 				<span ng-click="promptUpdate()" class="disabled"  ng-if="store && store.status && store.status !== 'OPENED'">店铺管理</span>
 			</li>
-			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><a ng-click="promptUpdate()" class="disabled">求购询价</a></li>
+			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><span ng-click="promptUpdate()" class="disabled">求购询价</span></li>
 			<li ng-class="{'active' : active == 'vendor_logistics'}"><span ng-click="promptUpdate()" class="disabled">物流管理</span></li>
 			<li ng-class="{'active' : active == 'vendor_invoice'}"><span ng-click="promptUpdate()" class="disabled" >发票管理</span></li>
 			<!--	<li ng-class="{'active' : active == 'vendor_logistics'}"><span  ui-sref="vendor_logistics">物流管理</span></li>-->

+ 84 - 0
src/test/java/com/uas/platform/b2c/common/gor/GorTest.java

@@ -0,0 +1,84 @@
+package com.uas.platform.b2c.common.gor;
+
+import com.uas.platform.core.util.HttpUtil;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * 测试模拟发起请求<br/>
+ * 用于测试Gor流量复制
+ * @author suntg
+ * @date 2018年5月8日17:26:46
+ */
+public class GorTest {
+
+//    private static String HOST_URL = "http://localhost:20210/article";
+
+    private static String HOST_URL = "http://192.168.253.6:20218/article";
+
+    public static void main(String[] args) {
+        generalTest();
+    }
+
+    /**
+     * 集成测试
+     */
+    public static void generalTest() {
+        int i = 0, getCount = 0, postCount = 0;
+        while (i < 10000) {
+            Random random = new Random();
+            // 随机事件,50-150ms
+            int timer = 50 + random.nextInt(100);
+            // 随机类型,1 get请求,2 post请求
+            int type = 1 + random.nextInt(2);
+            switch (type) {
+                case 1 :
+                    testGetApi();
+                    System.out.println("i: " + i + ", send get request.");
+                    getCount ++;
+                    break;
+                case 2 :
+                    testPostApi();
+                    System.out.println("i: " + i + ", send post request.");
+                    postCount ++;
+                    break;
+            }
+            try {
+                Thread.sleep(timer);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+            i++;
+        }
+        System.out.println(i + " requests send, " + getCount + " getRequest, " + postCount + " postRequest.");
+    }
+
+    /**
+     * 发起get请求
+     */
+    public static void testGetApi() {
+        try {
+            HttpUtil.sendGetRequest(HOST_URL, null);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 发起post请求
+     */
+    public static void testPostApi() {
+        try {
+            Map<String, Object> params = new HashMap<String, Object>();
+            // 生成随机的字符串
+            String uuid = UUID.randomUUID().toString().replaceAll("-", "");
+            params.put("content", uuid);
+            HttpUtil.sendPostRequest(HOST_URL, params, false, false);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}