Kaynağa Gözat

修复缺陷

liuyuqiang 2 yıl önce
ebeveyn
işleme
c8f2bc4d3a

+ 3 - 2
sooka-admin/src/main/java/com/sooka/web/controller/schooldistrict/BtpSchoolPvController.java

@@ -21,6 +21,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
@@ -155,7 +156,7 @@ public class BtpSchoolPvController extends BaseController {
     /**
      * 查询委(村)列表
      */
-    @PostMapping("/getVillagesBySTypeAndPId")
+    @GetMapping("/getVillagesBySTypeAndPId")
     @ResponseBody
     public List<BtpSchoolPv> getVillagesBySTypeAndPId(BtpSchoolPv btpSchoolPv) {
         if (StringUtils.isNull(btpSchoolPv.getpId()) || StringUtils.isBlank(btpSchoolPv.getSchoolType())) {
@@ -170,7 +171,7 @@ public class BtpSchoolPvController extends BaseController {
     @Log(title = "学区查询", businessType = BusinessType.SELECT)
     @PostMapping("/getSchoolName")
     @ResponseBody
-    public AjaxResult getSchoolName(BtpSchoolPv btpSchoolPv) {
+    public AjaxResult getSchoolName(@Validated BtpSchoolPv btpSchoolPv) {
         // 验证码校验
         if (ShiroConstants.CAPTCHA_ERROR.equals(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA))) {
             return AjaxResult.error(MessageUtils.message("user.jcaptcha.error"));

+ 1 - 2
sooka-admin/src/main/resources/templates/eduindex.html

@@ -324,10 +324,9 @@
 			$('#pId').change(function() {
 				$('#vId').empty();
 				if (this.value != "") {
-					$.post(prefix + "/getVillagesBySTypeAndPId", {
+					$.get(prefix + "/getVillagesBySTypeAndPId", {
 						schoolType: schoolType, pId: this.value
 					}, function(result) {
-						$('.imgcode').click();
 						$('#vId').append(getData(result));
 					});
 				} else {

+ 5 - 0
sooka-schooldistrict/src/main/java/com/sooka/schooldistrict/domain/BtpSchoolPv.java

@@ -5,6 +5,8 @@ import com.sooka.common.core.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import javax.validation.constraints.NotNull;
+
 /**
  * 学区配置对象 btp_school_pv
  *
@@ -20,11 +22,13 @@ public class BtpSchoolPv extends BaseEntity {
     /**
      * 派出所id
      */
+    @NotNull
     private Long pId;
 
     /**
      * 委(村)id
      */
+    @NotNull
     private Long vId;
 
     /**
@@ -33,6 +37,7 @@ public class BtpSchoolPv extends BaseEntity {
     private Long schoolId;
 
     @Excel(name = "学校类型", dictType = "school_type")
+    @NotNull
     private String schoolType;
 
     @Excel(name = "学校")