瀏覽代碼

学校添加片区

shuzhan 3 年之前
父節點
當前提交
69b2448d78

+ 3 - 0
common/src/main/java/com/jpsoft/campus/modules/base/entity/SchoolInfo.java

@@ -142,5 +142,8 @@ public class SchoolInfo {
     @ApiModelProperty(value = "是否开放报名")
     private Boolean isOpen;
 
+    @ApiModelProperty(value = "排序号")
+    private Integer sortNo;
+
     private List<SchoolNumber> schoolNumbers;
 }

+ 3 - 0
common/src/main/java/com/jpsoft/campus/modules/base/entity/StudentInfo.java

@@ -129,4 +129,7 @@ public class StudentInfo {
 
     @ApiModelProperty(value = "原班级")
     private String oldClass;
+
+    @ApiModelProperty(value = "户籍地址")
+    private String residenceAddress;
 }

+ 8 - 3
common/src/main/resources/mapper/base/SchoolInfo.xml

@@ -27,6 +27,7 @@
         <result property="isOpen" column="is_open"/>
         <result property="district" column="district_"/>
         <result property="districtMiddle" column="district_middle"/>
+        <result property="sortNo" column="sort_no"/>
     </resultMap>
     <insert id="insert" parameterType="com.jpsoft.campus.modules.base.entity.SchoolInfo">
         <!--
@@ -37,7 +38,7 @@
         <![CDATA[
 		insert into base_school_info
 	    (id_,create_by,create_time,update_by,update_time,del_flag,name_,logo_,enrollment_type,address_,phone_,
-	    lector_introduction,longitude_,latitude_,code_,introduction_,parent_id,school_code,type_,is_open,district_,district_middle)
+	    lector_introduction,longitude_,latitude_,code_,introduction_,parent_id,school_code,type_,is_open,district_,district_middle,sort_no)
 		values
 		(
             #{id,jdbcType=VARCHAR}
@@ -62,6 +63,7 @@
             ,#{isOpen,jdbcType= NUMERIC }
             ,#{district,jdbcType=VARCHAR}
             ,#{districtMiddle,jdbcType=VARCHAR}
+            ,#{sortNo,jdbcType=NUMERIC}
 		)
 	]]>
     </insert>
@@ -134,6 +136,9 @@
             <if test="districtMiddle!=null">
                 district_middle=#{districtMiddle,jdbcType=VARCHAR},
             </if>
+            <if test="sortNo!=null">
+                sort_no=#{sortNo,jdbcType= NUMERIC },
+            </if>
         </set>
         where id_=#{id}
     </update>
@@ -191,7 +196,7 @@
         where find_in_set(#{enrollmentType},a.enrollment_type)
         and a.del_flag=0
         and a.type_ = '1'
-        order by a.create_time asc
+        order by a.sort_no asc
     </select>
     <select id="countByParentId" resultType="long">
         select count(*) from base_school_info
@@ -224,7 +229,7 @@
         where find_in_set(#{enrollmentType},a.enrollment_type)
         and a.del_flag=0
         and a.is_open = 1
-        order by a.create_time asc
+        order by a.sort_no asc
         ]]>
     </select>
 </mapper>

+ 7 - 1
common/src/main/resources/mapper/base/StudentInfo.xml

@@ -27,6 +27,7 @@
         <result property="studentNumber" column="student_number"/>
         <result property="oldSchool" column="old_school"/>
         <result property="oldClass" column="old_class"/>
+        <result property="residenceAddress" column="residence_address"/>
     </resultMap>
     <insert id="insert" parameterType="com.jpsoft.campus.modules.base.entity.StudentInfo">
         <!--
@@ -38,7 +39,7 @@
 		insert into base_student_info
 	    (id_,create_by,create_time,update_by,update_time,del_flag,name_,old_name,sex_,card_type,
 	    id_card,document_url,birthday_,register_name,register_tel,status_,nation_,is_policy,type_,address_,
-	    student_number,old_school,old_class)
+	    student_number,old_school,old_class,residence_address)
 		values
 		(
             #{id,jdbcType=VARCHAR}
@@ -64,6 +65,7 @@
             ,#{studentNumber,jdbcType=VARCHAR}
             ,#{oldSchool,jdbcType=VARCHAR}
             ,#{oldClass,jdbcType=VARCHAR}
+            ,#{residenceAddress,jdbcType=VARCHAR}
 		)
 	]]>
     </insert>
@@ -139,6 +141,10 @@
             <if test="oldClass!=null">
                 old_class=#{oldClass,jdbcType=VARCHAR},
             </if>
+            <if test="residenceAddress!=null">
+                residence_address=#{residenceAddress,jdbcType=VARCHAR},
+            </if>
+
         </set>
         where id_=#{id}
     </update>

+ 9 - 5
web/src/main/java/com/jpsoft/campus/modules/base/controller/ApplicationPrimaryController.java

@@ -378,12 +378,16 @@ public class ApplicationPrimaryController {
             List<AttachmentDTO> attachmentDTOList = new ArrayList<>();
             AttachmentDTO attachmentDTO = new AttachmentDTO();
             DataDictionary dataDictionary = dataDictionaryService.findByParentIdAndValue(DataDictionary.STUDENT_RELATED_CERT_ID,"3");
-            attachmentDTO.setId(dataDictionary.getId());
-            attachmentDTO.setName(dataDictionary.getName());
+            if(dataDictionary != null) {
+                attachmentDTO.setId(dataDictionary.getId());
+                attachmentDTO.setName(dataDictionary.getName());
+
+                List<String> studentFilesList = studentFilesService.findUrlByApplicationIdAndFileType(applicationPrimaryDTO.getApplicationId(),attachmentDTO.getId());
+                attachmentDTO.setFiles(studentFilesList);
+                attachmentDTOList.add(attachmentDTO);
+            }
+
 
-            List<String> studentFilesList = studentFilesService.findUrlByApplicationIdAndFileType(applicationPrimaryDTO.getApplicationId(),attachmentDTO.getId());
-            attachmentDTO.setFiles(studentFilesList);
-            attachmentDTOList.add(attachmentDTO);
 
             applicationPrimaryDTO.setStudentCertificationFileList(attachmentDTOList);
             applicationPrimaryDTO.setRelationshipName(dataDictionaryService.getName(applicationPrimaryDTO.getRelationship()));

+ 18 - 18
web/src/main/java/com/jpsoft/campus/modules/mobile/controller/PrimarySchoolApiController.java

@@ -121,7 +121,7 @@ public class PrimarySchoolApiController {
     @GetMapping("queryDistrictSchoolList")
     @ApiOperation(value = "查询社区学校列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "社区编号", required = true, paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "社区编号", required = false, paramType = "query"),
             @ApiImplicitParam(name = "schoolType", value = "学校类型 (1小学2初中,不传默认为小学)", required = false, paramType = "query")
     })
     public MessageResult<List> queryDistrictSchoolList(String id,
@@ -130,22 +130,22 @@ public class PrimarySchoolApiController {
         MessageResult<List> messageResult = new MessageResult<>();
 
         try {
-            DistrictInfo districtInfo = districtInfoService.get(id);
-
-            List<String> schoolIdList = Arrays.asList(districtInfo.getSchoolId().split(","));
-            List<SchoolInfo> list = new ArrayList<>();
-            if (schoolIdList.size()>0){
-                for (String schoolId : schoolIdList){
-                    SchoolInfo schoolInfo = schoolInfoService.get(schoolId);
-                    if (schoolInfo != null){
-                        if(schoolInfo.getEnrollmentType().contains(schoolType) && schoolInfo.getIsOpen()){
-                            list.add(schoolInfo);
-                        }
-                    }
-                }
-            }
+            //DistrictInfo districtInfo = districtInfoService.get(id);
+            //List<String> schoolIdList = Arrays.asList(districtInfo.getSchoolId().split(","));
+//            List<SchoolInfo> list = new ArrayList<>();
+//            if (schoolIdList.size()>0){
+//                for (String schoolId : schoolIdList){
+//                    SchoolInfo schoolInfo = schoolInfoService.get(schoolId);
+//                    if (schoolInfo != null){
+//                        if(schoolInfo.getEnrollmentType().contains(schoolType) && schoolInfo.getIsOpen()){
+//                            list.add(schoolInfo);
+//                        }
+//                    }
+//                }
+//            }
+            List<SchoolInfo> schoolIdList = schoolInfoService.findByEnrollmentType(schoolType);
 
-            messageResult.setData(list);
+            messageResult.setData(schoolIdList);
             messageResult.setResult(true);
         }
         catch (Exception ex){
@@ -621,11 +621,11 @@ public class PrimarySchoolApiController {
             List<Sort> sortList = new ArrayList<>();
             sortList.add(new Sort("create_time","desc"));
 
-            List<ApplicationPrimary> applicationPrimaryList = applicationPrimaryDAO.search(searchParams,sortList);
+            //List<ApplicationPrimary> applicationPrimaryList = applicationPrimaryDAO.search(searchParams,sortList);
 
             Map<String,Object> map = new HashMap<>();
             map.put("id",applicationPrimary.getId());
-            map.put("num",applicationPrimaryList.size());
+            //map.put("num",applicationPrimaryList.size());
 
             messageResult.setData(map);
             messageResult.setResult(true);

二進制
web/src/main/resources/static/primary_tzs.jpg