Ver código fonte

2019/12/31 17:53

jzdsh 4 anos atrás
pai
commit
4c9982815c

+ 14 - 0
src/main/java/com/yc/education/controller/admin/ProviderAdminController.java

@@ -527,6 +527,13 @@ public class ProviderAdminController extends BaseController {
                     provider.setLongitude("0");
                 }
             }
+            /*添加门牌号*/
+            if (provider.getHouseNumber()==null) {
+                provider.setHouseNumber("");
+                provider.setAddress(provider.getStree() + provider.getHouseNumber());
+            }else {
+                provider.setAddress(provider.getStree() + provider.getHouseNumber());
+            }
 
             if (provider.getBrandId() != null) {
                 Brand brand = iBrandService.selectByPrimaryKey(Integer.valueOf(provider.getBrandId()));//查询品牌信息
@@ -798,6 +805,13 @@ public class ProviderAdminController extends BaseController {
             provider.setWashCar("");
             provider.setMaintain("");
 
+            if (provider.getHouseNumber()==null){
+                provider.setHouseNumber("");
+                provider.setAddress(provider.getStree()+provider.getHouseNumber());
+            }else {
+                provider.setAddress(provider.getStree()+provider.getHouseNumber());
+            }
+
             int row = iProviderService.updateNotNull(provider);
 
             String paramType = provider.getParamType();

+ 14 - 1
src/main/java/com/yc/education/controller/admin/SupplierAdminController.java

@@ -402,6 +402,13 @@ public class SupplierAdminController extends BaseController {
                     provider.setLongitude("0");
                 }
             }
+            /*设置门牌号*/
+            if (provider.getHouseNumber()==null){
+                provider.setHouseNumber("");
+                provider.setAddress(provider.getStree()+provider.getHouseNumber());
+            }else {
+                provider.setAddress(provider.getStree()+provider.getHouseNumber());
+            }
             UserInfo userInfo = iUserInfoService.listInfoByTelphone(provider.getAuthPhone());//根据电话号码查询用户信息
             if (userInfo != null) {
                 provider.setUserId(userInfo.getId());//将用户id赋值给userId
@@ -742,7 +749,13 @@ public class SupplierAdminController extends BaseController {
                     provider.setLongitude("0");
                 }
             }
-
+            /*设置门牌号*/
+            if (provider.getHouseNumber()==null){
+                provider.setHouseNumber("");
+                provider.setAddress(provider.getStree()+provider.getHouseNumber());
+            }else {
+                provider.setAddress(provider.getStree()+provider.getHouseNumber());
+            }
 
 
 

+ 28 - 10
src/main/java/com/yc/education/test/SortTest.java

@@ -11,24 +11,42 @@ import java.util.Arrays;
  */
 public class SortTest {
 
-    public static void main(String [] args){
+    public static void main(String[] args) {
 
 
-        int[] arr = {4, 5, 6, 1, 2, 3, 7, 8, 9};
-
+        /*冒泡排序*/
+        int[] arr = {9, 8, 7, 6, 5, 4, 3, 2, 1};
         for (int i = 0; i < arr.length; i++) {
-            for (int j =0; j < arr.length - i-1; j++) {
-                if (arr[j] > arr[j+1]) {
+            for (int j = 0; j < arr.length - i - 1; j++) {
+                if (arr[j] > arr[j + 1]) {
                     int temp;
                     temp = arr[j];
-                    arr[j]=arr[j+1];
-                    arr[j+1]=temp;
+                    arr[j] = arr[j + 1];
+                    arr[j + 1] = temp;
                 }
             }
-            System.out.print(arr[i]+",");
-           System.out.println(Arrays.toString(arr));
         }
-        System.out.println(Arrays.toString(arr));
+        System.out.println("这是冒泡排序:" + Arrays.toString(arr));
+
 
+        /*插入排序*/
+        int[] ist = {8, 9, 7, 6, 5, 4, 3, 2, 1};
+        for (int i = 1; i < ist.length; i++) {
+            for (int j = 0; j < i; j++) {
+                int left = ist[i];
+                if (ist[i] <= ist[j]) {
+                    for (int k = i; k > j; k--) {
+                        ist[k] = ist[k - 1];
+                    }
+                    ist[j] = left;
+                }
+            }
+        }
+        System.out.println("这是插入排序:" + Arrays.toString(ist));
     }
+
+
+
+
+
 }

+ 8 - 0
src/main/webapp/WEB-INF/jsp/admin/providerAdd.jsp

@@ -131,6 +131,7 @@
                 formData.append("city",$("#s_city").val());//市
                 formData.append("district",$("#s_county").val());//区
                 formData.append("stree",$("#stree").val());//街道
+                formData.append("houseNumber",$("#houseNumber").val());//门牌号
                 formData.append("imgLog",$("#imgLog").val());//店铺logo
                 formData.append("serviceItem",$("#serviceItem").val());//优势项目
                 formData.append("businessIntroduce",$("#businessIntroduce").val());//服务介绍
@@ -471,6 +472,13 @@
             </div>
         </div>
 
+            <div class="row cl">
+                <label class="form-label col-xs-4 col-sm-1"><span class="c-red"></span>门牌号:</label>
+                <div class="formControls col-xs-8 col-sm-9">
+                    <input type="text" class="input-text" name="houseNumber" id="houseNumber" />
+                </div>
+            </div>
+
         <%-- <div class="row cl">
              <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>店铺地址:</label>
              <div class="formControls col-xs-8 col-sm-9">

+ 7 - 0
src/main/webapp/WEB-INF/jsp/admin/providerUpdate.jsp

@@ -124,6 +124,7 @@
                 formData.append("city",$("#s_city").val());//市
                 formData.append("district",$("#s_county").val());//区
                 formData.append("stree",$("#stree").val());//街道
+                formData.append("houseNumber",$("#houseNumber").val());//门牌号
                 formData.append("imgLog",$("#imgLog").val());//店铺logo
                 formData.append("serviceItem",$("#serviceItem").val());//优势项目
                 formData.append("businessIntroduce",$("#businessIntroduce").val());//服务介绍
@@ -513,6 +514,12 @@
                         <input type="text" class="input-text" name="stree" id="stree" value="${provider.stree}">
                     </div>
                 </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red"></span>门牌号:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="houseNumber" id="houseNumber" value="${provider.houseNumber}">
+            </div>
+        </div>
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-1"><span class="c-red"></span>店铺logo:</label>
             <div class="formControls col-xs-8 col-sm-9">

+ 7 - 0
src/main/webapp/WEB-INF/jsp/admin/supplierAdd.jsp

@@ -111,6 +111,7 @@
                 formData.append("city",$("#s_city").val());//市
                 formData.append("district",$("#s_county").val());//区
                 formData.append("stree",$("#stree").val());//街道
+                formData.append("houseNumber",$("#houseNumber").val());//门牌号
                 formData.append("imgLog",$("#imgLog").val());//店铺logo
                 formData.append("serviceItem",$("#serviceItem").val());//优势项目
                 formData.append("businessIntroduce",$("#businessIntroduce").val());//服务介绍
@@ -416,6 +417,12 @@
                 <input type="text" class="input-text" name="stree" id="stree" />
             </div>
         </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red"></span>门牌号:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="houseNumber" id="houseNumber" />
+            </div>
+        </div>
 
         <%-- <div class="row cl">
              <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>店铺地址:</label>

+ 7 - 0
src/main/webapp/WEB-INF/jsp/admin/supplierUpdate.jsp

@@ -159,6 +159,7 @@
                 formData.append("city",$("#s_city").val());//市
                 formData.append("district",$("#s_county").val());//区
                 formData.append("stree",$("#stree").val());//街道
+                formData.append("houseNumber",$("#houseNumber").val());//门牌号
                 formData.append("imgLog",$("#imgLog").val());//店铺logo
                 formData.append("serviceItem",$("#serviceItem").val());//优势项目
                 formData.append("businessIntroduce",$("#businessIntroduce").val());//服务介绍
@@ -558,6 +559,12 @@
                    <input type="text" class="input-text" name="stree"  value="${provider.stree}" id="stree"/>
                </div>
            </div>
+           <div class="row cl">
+               <label class="form-label col-xs-4 col-sm-1"><span class="c-red"></span>门牌号:</label>
+               <div class="formControls col-xs-8 col-sm-9">
+                   <input type="text" class="input-text" name="houseNumber"  value="${provider.houseNumber}" id="houseNumber"/>
+               </div>
+           </div>
 
         <%--<div class="row cl">
             <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>店铺地址:</label>