Explorar o código

询价指引指令关闭,企业初始化客户信息

hejq %!s(int64=8) %!d(string=hai) anos
pai
achega
940233d199

+ 16 - 0
src/main/java/com/uas/platform/b2b/dao/CustomerDao.java

@@ -2,6 +2,7 @@ package com.uas.platform.b2b.dao;
 
 
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.jpa.repository.query.Procedure;
 import org.springframework.data.repository.query.Param;
 import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Repository;
 
 
@@ -21,4 +22,19 @@ public interface CustomerDao extends JpaSpecificationExecutor<Customer>, Generic
      */
      */
     @Query("select count(p), p.status from Customer p where p.id in :ids group by p.status")
     @Query("select count(p), p.status from Customer p where p.id in :ids group by p.status")
     List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
     List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
+
+    /**
+     * 初始化客户分配
+     *
+     * @param enuu 企业uu号
+     * @param useruu 个人uu号
+     */
+    @Procedure(procedureName = "init_customer")
+    void initCustomer(Long enuu, Long useruu);
+
+    /**
+     * 初始化客户分配,自动寻找符合条件的企业、用户进行分配
+     */
+    @Procedure(procedureName = "init_customer_all")
+    void initCustomerAll();
 }
 }

+ 126 - 126
src/main/webapp/resources/js/common/directives.js

@@ -1,128 +1,128 @@
-define(['angular'], function(angular) {
-	'use strict';
-	angular.module('common.directives', []).directive('scrollTable', [function(){
-		// table 固定表头
-		return {
-			restrict : 'A',
-			link : function(scope, element, attrs, ngModel) {
-				var header = element.find('.table-header-wrap'), body = element.find('.table-body-wrap');
-				if(header && body) {
-					body.bind('scroll', function() {
-						header.scrollLeft(body.scrollLeft());
-	                });
-				}
-			}
-		};
-	}])
-	.directive("slideFollow",function($timeout){
-		return {
-			restrict : 'E',
-			replace : true,
-			scope : {
-				id : "@",
-				datasetData : "="
-			},
-			template : "<span ng-repeat = 'data in datasetData'><img src='static/img/all/circle.png' class='circle'/>{{data.option}}<img src='static/img/home/new.png' class='new'/></span>",
-			link : function(scope, elem, attrs) {
-				$timeout(function(){
-					var className = $("." + $(elem).parent()[0].className);
-					console.log(className);
-					var i = 0, sh;
-					var liLength = className.children("span").length;
-					var liWidth = className.children("span").width() + parseInt(className.children("span").css('border-bottom-width'));
-					className.html(className.html() + className.html());
-					// 开启定时器
-					sh = setInterval(slide, 500);
-					function slide(){
-						if (parseInt(className.css("margin-left")) > (-liLength * liWidth)) {
-							console.log('1' +className.css("margin-left"));
-							console.log(-liLength * liWidth)
-							i++;
-							className.animate({
-								marginLeft : -liWidth * i + "px"
-							}, 1000);
-						} else {
-							i = 0;
-							className.css("margin-left", "0px");
-						}
-					}
+define(['angular'], function (angular) {
+    'use strict';
+    angular.module('common.directives', []).directive('scrollTable', [function () {
+        // table 固定表头
+        return {
+            restrict: 'A',
+            link: function (scope, element, attrs, ngModel) {
+                var header = element.find('.table-header-wrap'), body = element.find('.table-body-wrap');
+                if (header && body) {
+                    body.bind('scroll', function () {
+                        header.scrollLeft(body.scrollLeft());
+                    });
+                }
+            }
+        };
+    }])
+        .directive("slideFollow", function ($timeout) {
+            return {
+                restrict: 'E',
+                replace: true,
+                scope: {
+                    id: "@",
+                    datasetData: "="
+                },
+                template: "<span ng-repeat = 'data in datasetData'><img src='static/img/all/circle.png' class='circle'/>{{data.option}}<img src='static/img/home/new.png' class='new'/></span>",
+                link: function (scope, elem, attrs) {
+                    $timeout(function () {
+                        var className = $("." + $(elem).parent()[0].className);
+                        console.log(className);
+                        var i = 0, sh;
+                        var liLength = className.children("span").length;
+                        var liWidth = className.children("span").width() + parseInt(className.children("span").css('border-bottom-width'));
+                        className.html(className.html() + className.html());
+                        // 开启定时器
+                        sh = setInterval(slide, 500);
+                        function slide() {
+                            if (parseInt(className.css("margin-left")) > (-liLength * liWidth)) {
+                                console.log('1' + className.css("margin-left"));
+                                console.log(-liLength * liWidth)
+                                i++;
+                                className.animate({
+                                    marginLeft: -liWidth * i + "px"
+                                }, 1000);
+                            } else {
+                                i = 0;
+                                className.css("margin-left", "0px");
+                            }
+                        }
 
 
-					// 清除定时器
-					className.hover(function(){
-						clearInterval(sh);
-					},function(){
-						clearInterval(sh);
-						sh = setInterval(slide,1000);
-					})
-				},0)
-			}
-		}
-	});
-	/**
-	 * uiTour directive
-	 *
-	 * @example:
-	 *   <ul ui-tour="currentStep">
-	 *     <li target="#someId">
-	 *       First Tooltip
-	 *       <a ng-click="currentStep=currentStep+1">Next</a>
-	 *     </li>
-	 *     <li target=".items:eq(2)" name="two">
-	 *       Second Tooltip
-	 *       <a ng-click="currentStep=currentStep-1">Prev</a>
-	 *     </li>
-	 *     <li target=".items:eq(2)">
-	 *       Third Tooltip
-	 *       <a ng-click="currentStep='two'">Go directly to 'two'</a>
-	 *       <a ng-click="currentStep=0">Done</a>
-	 *     </li>
-	 *   </ul>
-	 */
-	angular.module('ui.tour', [])
-
-		.directive('uiTour', ['$timeout', '$parse', function($timeout, $parse){
-			return {
-				link: function($scope, $element, $attributes) {
-					var model = $parse($attributes.uiTour);
-
-					// Watch model and change steps
-					$scope.$watch($attributes.uiTour, function(newVal, oldVal){
-						if (angular.isNumber(newVal)) {
-							showStep(newVal)
-						} else {
-							if (angular.isString(newVal)) {
-								var stepNumber = 0,
-									children = $element.children()
-								angular.forEach(children, function(step, index) {
-									if (angular.element(step).attr('name') === newVal)
-										stepNumber = index+1;
-								});
-								model.assign($scope, stepNumber);
-							} else {
-								model.assign($scope, newVal && 1 || 0);
-							}
-						}
-					});
-
-					// Show step
-					function showStep(stepNumber) {
-						var elm, at, children = $element.children().removeClass('active');
-						elm = children.eq(stepNumber - 1);
-						if (stepNumber) {
-							at = elm.attr('at');
-							$timeout(function(){
-								var target = angular.element(elm.attr('target'))[0];
-								if (elm.attr('overlay') !== undefined) {
-									$('.tour-overlay').addClass('active').css({}).addClass('in');
-								}
-								elm.addClass('active');
-							});
-						} else {
-							$('.tour-overlay').removeClass('in');
-							$('.tour-overlay').removeClass('active');
-						}
-					}
-				}
-			};
-		}]);
+                        // 清除定时器
+                        className.hover(function () {
+                            clearInterval(sh);
+                        }, function () {
+                            clearInterval(sh);
+                            sh = setInterval(slide, 1000);
+                        })
+                    }, 0)
+                }
+            }
+        });
+    /**
+     * uiTour directive
+     *
+     * @example:
+     *   <ul ui-tour="currentStep">
+     *     <li target="#someId">
+     *       First Tooltip
+     *       <a ng-click="currentStep=currentStep+1">Next</a>
+     *     </li>
+     *     <li target=".items:eq(2)" name="two">
+     *       Second Tooltip
+     *       <a ng-click="currentStep=currentStep-1">Prev</a>
+     *     </li>
+     *     <li target=".items:eq(2)">
+     *       Third Tooltip
+     *       <a ng-click="currentStep='two'">Go directly to 'two'</a>
+     *       <a ng-click="currentStep=0">Done</a>
+     *     </li>
+     *   </ul>
+     */
+    // angular.module('ui.tour', [])
+    //
+    //     .directive('uiTour', ['$timeout', '$parse', function ($timeout, $parse) {
+    //         return {
+    //             link: function ($scope, $element, $attributes) {
+    //                 var model = $parse($attributes.uiTour);
+    //
+    //                 // Watch model and change steps
+    //                 $scope.$watch($attributes.uiTour, function (newVal, oldVal) {
+    //                     if (angular.isNumber(newVal)) {
+    //                         showStep(newVal)
+    //                     } else {
+    //                         if (angular.isString(newVal)) {
+    //                             var stepNumber = 0,
+    //                                 children = $element.children()
+    //                             angular.forEach(children, function (step, index) {
+    //                                 if (angular.element(step).attr('name') === newVal)
+    //                                     stepNumber = index + 1;
+    //                             });
+    //                             model.assign($scope, stepNumber);
+    //                         } else {
+    //                             model.assign($scope, newVal && 1 || 0);
+    //                         }
+    //                     }
+    //                 });
+    //
+    //                 // Show step
+    //                 function showStep(stepNumber) {
+    //                     var elm, at, children = $element.children().removeClass('active');
+    //                     elm = children.eq(stepNumber - 1);
+    //                     if (stepNumber) {
+    //                         at = elm.attr('at');
+    //                         $timeout(function () {
+    //                             var target = angular.element(elm.attr('target'))[0];
+    //                             if (elm.attr('overlay') !== undefined) {
+    //                                 $('.tour-overlay').addClass('active').css({}).addClass('in');
+    //                             }
+    //                             elm.addClass('active');
+    //                         });
+    //                     } else {
+    //                         $('.tour-overlay').removeClass('in');
+    //                         $('.tour-overlay').removeClass('active');
+    //                     }
+    //                 }
+    //             }
+    //         };
+    //     }]);
 });
 });