Selaa lähdekoodia

上传市平台

shuzhan 9 kuukautta sitten
vanhempi
commit
e5612c7faa

+ 3 - 0
common/src/main/java/com/jpsoft/campus/modules/base/dao/ApplicationPrimaryDAO.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.jpsoft.campus.modules.base.dto.ApplicationPrimaryDTO;
 import com.jpsoft.campus.modules.base.entity.ApplicationPrimary;
+import com.jpsoft.campus.modules.base.entity.EnrolInfo;
 import org.springframework.stereotype.Repository;
 import java.util.Map;
 import com.jpsoft.campus.modules.common.dto.Sort;
@@ -24,4 +25,6 @@ public interface ApplicationPrimaryDAO {
 	List<ApplicationPrimary> findByStudentId(String id);
 	ApplicationPrimary findByStudentNameAndIdCard(String studentName, String idCard,String schoolId);
 	List<ApplicationPrimary> findByIds(List<String> ids);
+	List<EnrolInfo> findOffice();
+	ApplicationPrimary findByOfficeCode(String officeCode);
 }

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

@@ -130,4 +130,7 @@ public class ApplicationPrimary {
 
     @ApiModelProperty(value = "转校插班申报的年级")
     private SchoolNumber schoolNumber;
+
+    @ApiModelProperty(value = "上传状态(0未上传,1上传成功,2失败")
+    private String uploadStatus;
 }

+ 35 - 0
common/src/main/java/com/jpsoft/campus/modules/base/entity/EnrolInfo.java

@@ -0,0 +1,35 @@
+package com.jpsoft.campus.modules.base.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+
+@Data
+@ApiModel(value = "")
+public class EnrolInfo {
+
+	private String areaCode;
+	private String areaName;
+	private String EnrolitemID;
+	private String studentName;
+	private String registerAddr;
+	private String studentIDNumber;
+	private String school;
+	private String sex;
+	private String currentAddr;
+	private String sourceType;
+	private String birthDate;
+	private String guardianIDNumber;
+	private String guardianMobile;
+	private String guardianName;
+	private String guardianEdu;
+	private String guardianRelation;
+	private String guardianOrganization;
+	private Integer Enrolitemconfirm;
+	private String EnrolitemOpinion;
+}

+ 4 - 0
common/src/main/java/com/jpsoft/campus/modules/base/service/ApplicationPrimaryService.java

@@ -6,6 +6,7 @@ import com.github.pagehelper.Page;
 import com.jpsoft.campus.modules.base.dto.ApplicationPrimaryDTO;
 import com.jpsoft.campus.modules.base.entity.ApplicationPrimary;
 import com.jpsoft.campus.modules.base.entity.ApprovalInfo;
+import com.jpsoft.campus.modules.base.entity.EnrolInfo;
 import com.jpsoft.campus.modules.common.dto.Sort;
 
 public interface ApplicationPrimaryService {
@@ -24,4 +25,7 @@ public interface ApplicationPrimaryService {
 	ApplicationPrimary findByStudentNameAndIdCard(String studentName, String idCard,String schoolId);
 
 	List<ApplicationPrimary> findByIds(List<String> ids);
+	List<EnrolInfo> findOffice();
+
+	ApplicationPrimary findByOfficeCode(String officeCode);
 }

+ 11 - 0
common/src/main/java/com/jpsoft/campus/modules/base/service/impl/ApplicationPrimaryServiceImpl.java

@@ -8,6 +8,7 @@ import javax.annotation.Resource;
 import com.jpsoft.campus.modules.base.dao.ApplicationPrimaryDAO;
 import com.jpsoft.campus.modules.base.dto.ApplicationPrimaryDTO;
 import com.jpsoft.campus.modules.base.entity.ApplicationPrimary;
+import com.jpsoft.campus.modules.base.entity.EnrolInfo;
 import com.jpsoft.campus.modules.base.service.ApplicationPrimaryService;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -105,4 +106,14 @@ public class ApplicationPrimaryServiceImpl implements ApplicationPrimaryService
 	public List<ApplicationPrimary> findByIds(List<String> ids){
 		return applicationPrimaryDAO.findByIds(ids);
 	}
+
+	@Override
+	public List<EnrolInfo> findOffice(){
+		return applicationPrimaryDAO.findOffice();
+	}
+
+	@Override
+	public ApplicationPrimary findByOfficeCode(String officeCode){
+		return applicationPrimaryDAO.findByOfficeCode(officeCode);
+	}
 }

+ 52 - 1
common/src/main/resources/mapper/base/ApplicationPrimary.xml

@@ -28,6 +28,7 @@
         <result property="offerImg" column="offer_img"/>
         <result property="newType" column="new_type"/>
         <result property="schoolNumberId" column="school_number_id"/>
+        <result property="uploadStatus" column="upload_status"/>
         <association property="schoolNumber" column="school_number_id"
                      select="com.jpsoft.campus.modules.base.dao.SchoolNumberDAO.get"></association>
     </resultMap>
@@ -41,7 +42,7 @@
 		insert into base_application_primary
 	    (id_,create_by,create_time,update_by,update_time,del_flag,type_,
 	    status_,category_id,now_address,person_id,student_id,street_id,community_id,school_id,hit_,offer_id,
-	    is_send,send_time,offer_code,offer_img,new_type,school_number_id
+	    is_send,send_time,offer_code,offer_img,new_type,school_number_id,upload_status
 	    )
 		values
 		(
@@ -68,6 +69,7 @@
 			,#{offerImg,jdbcType=VARCHAR}
 			,#{newType,jdbcType=VARCHAR}
 			,#{schoolNumberId,jdbcType=VARCHAR}
+			,#{uploadStatus,jdbcType=VARCHAR}
 		)
 	]]>
     </insert>
@@ -143,6 +145,9 @@
             <if test="schoolNumberId!=null">
                 school_number_id=#{schoolNumberId,jdbcType=VARCHAR},
             </if>
+            <if test="uploadStatus!=null">
+                upload_status=#{uploadStatus,jdbcType=VARCHAR},
+            </if>
         </set>
         where id_=#{id}
     </update>
@@ -375,4 +380,50 @@
         </foreach>
         order by create_time asc
     </select>
+    <select id="findOffice" resultType="com.jpsoft.campus.modules.base.entity.EnrolInfo">
+        SELECT
+        '421003' AS areaCode,
+        '荆州经济技术开发区' AS areaName,
+        a.offer_code AS enrolitemID,
+        b.name_ AS studentName,
+        b.residence_address AS registerAddr,
+        b.id_card AS studentIDNumber,
+        d.name_ AS school,
+        IF
+        ( b.sex_ = 2, '女', '男' ) AS sex,
+        b.address_ AS currentAddr,
+        a.type_ AS sourceType,
+        DATE_FORMAT( STR_TO_DATE( SUBSTR( b.id_card, 7, 8 ), '%Y%m%d' ), '%Y-%m-%d' ) AS birthDate,
+        c.id_card AS guardianIDNumber,
+        c.phone_ AS guardianMobile,
+        c.name_ AS guardianName,
+        '未填写' AS guardianEdu,
+        f.name_ AS guardianRelation,
+        '未填写' AS guardianOrganization,
+        1 AS Enrolitemconfirm,
+        '审核通过' AS EnrolitemOpinion
+        FROM
+        base_application_primary a
+        LEFT JOIN base_student_info b ON a.student_id = b.id_
+        LEFT JOIN base_person_info c ON a.person_id = c.id_
+        LEFT JOIN base_school_info d ON a.offer_id = d.id_
+        LEFT JOIN base_person_student e ON c.id_ = e.person_id
+        AND b.id_ = e.student_id
+        left join sys_data_dictionary f on e.relationship_ = f.id_
+        WHERE
+        a.del_flag = 0
+        AND b.del_flag = 0
+        AND c.del_flag = 0
+        AND e.del_flag = 0
+        and a.status_ = '90'
+        AND (a.upload_status is null or a.upload_status = '')
+        limit 100
+    </select>
+    <select id="findByOfficeCode" resultMap="ApplicationPrimaryMap">
+        select * from base_application_primary
+        where del_flag=0
+        and status_ = '90'
+        and offer_code = #{officeCode}
+        limit 1
+    </select>
 </mapper>

+ 3 - 1
web/src/main/java/com/jpsoft/campus/config/WebMvcConfig.java

@@ -60,7 +60,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/mobile/schoolInfoApi/typeList")
 				.excludePathPatterns("/mobile/schoolInfoApi/detail")
 				.excludePathPatterns("/mobile/newsApi/**")
-
+				//.excludePathPatterns("/mobile/personInfoApi/uploadUser")
+				//.excludePathPatterns("/mobile/personInfoApi/dwonUserMessage")
+				//.excludePathPatterns("/mobile/personInfoApi/updateUploadStatus")
 		;
 	}
 }

+ 70 - 4
web/src/main/java/com/jpsoft/campus/modules/mobile/controller/PersonInfoApiController.java

@@ -1,17 +1,16 @@
 package com.jpsoft.campus.modules.mobile.controller;
 
-import com.jpsoft.campus.modules.base.entity.ApplicationMiddle;
-import com.jpsoft.campus.modules.base.entity.ApplicationPrimary;
-import com.jpsoft.campus.modules.base.entity.StudentInfo;
+import com.alibaba.fastjson.TypeReference;
+import com.jpsoft.campus.modules.base.entity.*;
 import com.jpsoft.campus.modules.base.service.ApplicationMiddleService;
 import com.jpsoft.campus.modules.base.service.ApplicationPrimaryService;
 import com.jpsoft.campus.modules.base.service.StudentInfoService;
+import com.jpsoft.campus.modules.wechat.controller.EventCallback;
 import io.swagger.annotations.ApiModelProperty;
 import net.sf.json.JSON;
 import net.sf.json.JSONObject;
 import com.jpsoft.campus.config.BaiduConfig;
 import com.jpsoft.campus.config.OSSConfig;
-import com.jpsoft.campus.modules.base.entity.PersonInfo;
 import com.jpsoft.campus.modules.base.service.PersonInfoService;
 import com.jpsoft.campus.modules.common.dto.MessageResult;
 import com.jpsoft.campus.modules.common.utils.*;
@@ -541,4 +540,71 @@ public class PersonInfoApiController {
 
         return messageResult;
     }
+
+    @PostMapping("uploadUser")
+    public MessageResult<Map> uploadUser(EnrolInfo enrolInfo) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            if(enrolInfo != null){
+                messageResult.setResult(true);
+            }else{
+                messageResult.setResult(false);
+            }
+
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("dwonUserMessage")
+    public MessageResult<List<EnrolInfo>> dwonUserMessage() {
+        MessageResult<List<EnrolInfo>> messageResult = new MessageResult<>();
+
+        try {
+//            List<EnrolInfo> primaryList = applicationPrimaryService.findOffice();
+//
+//            if(primaryList.size() > 0){
+//                messageResult.setData(primaryList);
+//                messageResult.setResult(true);
+//            }else{
+//                messageResult.setResult(false);
+//            }
+
+            messageResult.setResult(false);
+
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("updateUploadStatus")
+    public MessageResult<Boolean> updateUploadStatus(String id,String code) {
+        MessageResult<Boolean> messageResult = new MessageResult<>();
+        try {
+//            ApplicationPrimary applicationPrimary = applicationPrimaryService.findByOfficeCode(id);
+//            applicationPrimary.setUploadStatus(code);
+//            applicationPrimaryService.update(applicationPrimary);
+            messageResult.setResult(true);
+
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
 }