Browse Source

问题修改

xiao547607 3 năm trước cách đây
mục cha
commit
acf4df5835

+ 2 - 0
common/src/main/java/com/jpsoft/campus/modules/base/dto/ApplicationPrimaryDTO.java

@@ -168,4 +168,6 @@ public class ApplicationPrimaryDTO implements Serializable {
 
     @ApiModelProperty(value = "转校插班申报的年级")
     private SchoolNumber schoolNumber;
+
+    private String oldClass;
 }

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

@@ -134,5 +134,8 @@ public class SchoolInfo {
     @ApiModelProperty(value = "类型/1学校/2校区")
     private String type;
 
+    @ApiModelProperty(value = "是否开放报名")
+    private Boolean isOpen;
+
     private List<SchoolNumber> schoolNumbers;
 }

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

@@ -24,6 +24,7 @@
         <result property="parentName" column="parent_name"/>
         <result property="schoolCode" column="school_code"/>
         <result property="type" column="type_"/>
+        <result property="isOpen" column="is_open"/>
     </resultMap>
     <insert id="insert" parameterType="com.jpsoft.campus.modules.base.entity.SchoolInfo">
         <!--
@@ -34,7 +35,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_)
+	    lector_introduction,longitude_,latitude_,code_,introduction_,parent_id,school_code,type_,is_open)
 		values
 		(
             #{id,jdbcType=VARCHAR}
@@ -56,6 +57,7 @@
             ,#{parentId,jdbcType=VARCHAR}
             ,#{schoolCode,jdbcType=VARCHAR}
             ,#{type,jdbcType=VARCHAR}
+            ,#{isOpen,jdbcType= NUMERIC }
 		)
 	]]>
     </insert>
@@ -119,6 +121,9 @@
             <if test="type!=null">
                 type_=#{type,jdbcType=VARCHAR},
             </if>
+            <if test="isOpen!=null">
+                is_open=#{isOpen,jdbcType= NUMERIC },
+            </if>
         </set>
         where id_=#{id}
     </update>
@@ -208,6 +213,7 @@
         select * from base_school_info a
         where find_in_set(#{enrollmentType},a.enrollment_type)
         and a.del_flag=0
+        and a.is_open = 1
         order by a.create_time asc
         ]]>
     </select>

+ 7 - 1
web/src/main/java/com/jpsoft/campus/modules/base/controller/ApplicationPrimaryController.java

@@ -739,7 +739,13 @@ public class ApplicationPrimaryController {
                 map.put("studentOldSchool",studentInfo.getOldSchool());
                 map.put("studentNumber",studentInfo.getStudentNumber());
 
-                map.put("studentFilesList",fileMap2(applicationPrimary.getId(),"学生相关证明"));
+                if("Y".equals(applicationPrimary.getType())) {
+                    map.put("studentFilesList", fileMap2(applicationPrimary.getId(), "学生相关证明(Y)"));
+                }else if("Z".equals(applicationPrimary.getType())){
+                    map.put("studentFilesList", fileMap2(applicationPrimary.getId(), "学生相关证明(Z)"));
+                }else {
+                    map.put("studentFilesList", fileMap2(applicationPrimary.getId(), "学生相关证明"));
+                }
 
                 //申报人信息
                 PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());

+ 62 - 0
web/src/main/java/com/jpsoft/campus/modules/mobile/controller/EnrollControlApiController.java

@@ -5,6 +5,7 @@ import com.jpsoft.campus.modules.base.entity.NewsInfo;
 import com.jpsoft.campus.modules.base.entity.SchoolInfo;
 import com.jpsoft.campus.modules.base.service.EnrollControlService;
 import com.jpsoft.campus.modules.base.service.SchoolInfoService;
+import com.jpsoft.campus.modules.base.service.SchoolNumberService;
 import com.jpsoft.campus.modules.common.dto.MessageResult;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -36,6 +37,9 @@ public class EnrollControlApiController {
     @Autowired
     private SchoolInfoService schoolInfoService;
 
+    @Autowired
+    private SchoolNumberService schoolNumberService;
+
 
     @PostMapping("enableEnroll")
     @ApiOperation(value = "验证能否报名")
@@ -175,4 +179,62 @@ public class EnrollControlApiController {
 
         return messageResult;
     }
+
+    @PostMapping("transferEnable")
+    @ApiOperation(value = "验证能否插班转学报名")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "schoolType", value = "学校类型(1:小学,2:中学)", required = true, paramType = "query"),
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "query"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "query")
+    })
+    public MessageResult<Boolean> transferEnable(String schoolType, String token, @RequestAttribute String subject) {
+
+        MessageResult<Boolean> messageResult = new MessageResult<>();
+
+        boolean result = true;
+        try {
+
+
+            List<SchoolInfo> schoolInfoList = schoolInfoService.findByEnrollmentType(schoolType);
+
+            List<String> studentTypeList = new ArrayList<>();
+            studentTypeList.add("Y");
+            studentTypeList.add("Z");
+
+            int i = 0;
+            for (String type : studentTypeList){
+                List<EnrollControl> enrollControls = enrollControlService.findBySchoolTypeAndStudentType(schoolType, type);
+
+                if (enrollControls.size() == schoolInfoList.size()) {
+                    for (EnrollControl enrollControl : enrollControls) {
+                        if (enrollControl.getStartTime().compareTo(new Date()) > 0) {
+                            i++;
+                        }else if(enrollControl.getEndTime().compareTo(new Date()) < 0){
+                            i++;
+                        }
+                    }
+
+                }else {
+                    break;
+                }
+            }
+            if (i == schoolInfoList.size()*studentTypeList.size()){
+                result = false;
+            }
+
+
+            messageResult.setCode(200);
+            messageResult.setData(result);
+            messageResult.setResult(true);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+
+            messageResult.setData(false);
+            messageResult.setCode(500);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
 }

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

@@ -138,7 +138,7 @@ public class PrimarySchoolApiController {
                 for (String schoolId : schoolIdList){
                     SchoolInfo schoolInfo = schoolInfoService.get(schoolId);
                     if (schoolInfo != null){
-                        if(schoolInfo.getEnrollmentType().contains(schoolType)){
+                        if(schoolInfo.getEnrollmentType().contains(schoolType) && schoolInfo.getIsOpen()){
                             list.add(schoolInfo);
                         }
                     }
@@ -276,16 +276,32 @@ public class PrimarySchoolApiController {
     @GetMapping("queryStudentCertificationList")
     @ApiOperation(value = "查询学生证明及附件")
     @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "报名类型", paramType = "query"),
             @ApiImplicitParam(name = "applicationId", value = "申请表编号", paramType = "query")
     })
-    public MessageResult<List> queryStudentCertificationList(String applicationId){
+    public MessageResult<List> queryStudentCertificationList(String type,String applicationId){
         MessageResult<List> messageResult = new MessageResult<>();
 
         try {
             List<Map> mapList = new ArrayList<>();
             Map<String,Object> dataMap = new HashMap<>();
-
-            DataDictionary studentCertDict = dataDictionaryService.get(DataDictionary.STUDENT_RELATED_CERT_ID);
+            DataDictionary studentCertDict = null;
+            List<DataDictionary> attachments = null;
+            if(StringUtils.isNotEmpty(type)) {
+                if("Y".equals(type)) {
+                    studentCertDict = dataDictionaryService.get("cbc52a2f-5c25-4504-8442-d6c64ea61552");
+                    attachments = dataDictionaryService.findByParentId("cbc52a2f-5c25-4504-8442-d6c64ea61552");
+                }else if("Z".equals(type)){
+                    studentCertDict = dataDictionaryService.get("904fb0bd-e697-42bf-bea4-bea87f5b8126");
+                    attachments = dataDictionaryService.findByParentId("904fb0bd-e697-42bf-bea4-bea87f5b8126");
+                }else{
+                    studentCertDict = dataDictionaryService.get(DataDictionary.STUDENT_RELATED_CERT_ID);
+                    attachments = dataDictionaryService.findByParentId(DataDictionary.STUDENT_RELATED_CERT_ID);
+                }
+            }else{
+                studentCertDict = dataDictionaryService.get(DataDictionary.STUDENT_RELATED_CERT_ID);
+                attachments = dataDictionaryService.findByParentId(DataDictionary.STUDENT_RELATED_CERT_ID);
+            }
 
             dataMap.put("id", studentCertDict.getId());
             dataMap.put("name", studentCertDict.getName());
@@ -293,7 +309,7 @@ public class PrimarySchoolApiController {
             dataMap.put("remark", studentCertDict.getExtended2()); //备注
             dataMap.put("description" , studentCertDict.getExtended3());
 
-            List<DataDictionary> attachments = dataDictionaryService.findByParentId(DataDictionary.STUDENT_RELATED_CERT_ID);
+
 
             List<AttachmentDTO> attachmentDTOList = new ArrayList<>();
 
@@ -437,6 +453,7 @@ public class PrimarySchoolApiController {
                 studentInfo.setAddress(applicationPrimaryDTO.getAddress());
                 studentInfo.setDocumentUrl(applicationPrimaryDTO.getDocumentUrl());
                 studentInfo.setType(applicationPrimaryDTO.getStudentType());
+                studentInfo.setOldClass(applicationPrimaryDTO.getOldClass());
 
                 studentInfo.setCreateTime(new Date());
                 studentInfo.setCreateBy(subject);
@@ -455,6 +472,7 @@ public class PrimarySchoolApiController {
                 studentInfo.setAddress(applicationPrimaryDTO.getAddress());
                 studentInfo.setDocumentUrl(applicationPrimaryDTO.getDocumentUrl());
                 studentInfo.setType(applicationPrimaryDTO.getStudentType());
+                studentInfo.setOldClass(applicationPrimaryDTO.getOldClass());
 
                 studentInfo.setUpdateTime(new Date());
                 studentInfo.setUpdateBy(subject);

+ 29 - 5
web/src/main/java/com/jpsoft/campus/modules/mobile/controller/SchoolInfoApiController.java

@@ -123,19 +123,43 @@ public class SchoolInfoApiController {
         MessageResult<List> messageResult = new MessageResult<>();
 
         try {
-            //List<SchoolNumber> schoolNumberList = schoolNumberService.findByEnrollmentType(enrollmentType);
             List<SchoolInfo> schoolInfoList = schoolInfoService.findByEnrollmentType(enrollmentType);
             List<SchoolInfo> returnList = new ArrayList<>();
 
-            for(SchoolInfo schoolInfo : schoolInfoList){
-                List<SchoolNumber> schoolNumberList = schoolNumberService.findHaveNumberBySchoolId(enrollmentType,schoolInfo.getId());
-                if(schoolNumberList.size() > 0) {
+            for (SchoolInfo schoolInfo : schoolInfoList) {
+                List<SchoolNumber> schoolNumberList = schoolNumberService.findHaveNumberBySchoolId(enrollmentType, schoolInfo.getId());
+                if (schoolNumberList.size() > 0) {
                     schoolInfo.setSchoolNumbers(schoolNumberList);
                     returnList.add(schoolInfo);
                 }
+
+                messageResult.setData(schoolInfoList);
+                messageResult.setResult(true);
             }
+        }
+        catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @GetMapping("querySchoolGradeNumber")
+    @ApiOperation(value = "查询学校的年级以及有多少空位")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "schoolId", value = "学校ID", required = true, paramType = "query"),
+            @ApiImplicitParam(name = "enrollmentType", value = "报名类型(1小学,2初中)", required = true, paramType = "query")
+    })
+    public MessageResult<List> querySchoolGradeNumber(String schoolId,String enrollmentType,String token){
+        MessageResult<List> messageResult = new MessageResult<>();
+
+        try {
+            List<SchoolNumber> schoolNumberList = schoolNumberService.findHaveNumberBySchoolId(enrollmentType,schoolId);
 
-            messageResult.setData(returnList);
+            messageResult.setData(schoolNumberList);
             messageResult.setResult(true);
         }
         catch (Exception ex){