he2802 1 éve
szülő
commit
4eb13ca3fc

+ 21 - 95
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -260,105 +260,23 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         //给模板绑定数据
         Calendar rightNow = Calendar.getInstance();
         Map<String, Object> bindingMap = new HashMap<>();
-//        if (ObjectUtils.isNull(maps.get("name"))){
-//            bindingMap.put("username", " ");
-//        }else {
-//            bindingMap.put("username", JSONObject.parseObject(String.valueOf(maps.get("name")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("s"))){
-//            bindingMap.put("s", "");
-//        }else {
-//            bindingMap.put("s", JSONObject.parseObject(String.valueOf(maps.get("sex")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("post"))){
-//            bindingMap.put("post", "");
-//        }else {
-//            bindingMap.put("post", JSONObject.parseObject(String.valueOf(maps.get("apply_post")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("idcard"))){
-//            bindingMap.put("idcard", "");
-//        }else {
-//            bindingMap.put("idcard", JSONObject.parseObject(String.valueOf(maps.get("idcard")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("phone"))){
-//            bindingMap.put("phone", "");
-//        }else {
-//            bindingMap.put("phone", JSONObject.parseObject(String.valueOf(maps.get("telphone")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("school"))){
-//            bindingMap.put("school", "");
-//        }else {
-//            bindingMap.put("school", JSONObject.parseObject(String.valueOf(maps.get("school")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("edu"))){
-//            bindingMap.put("edu", "");
-//        }else {
-//            bindingMap.put("edu", JSONObject.parseObject(String.valueOf(maps.get("education")), UserProfileFit.class).getValue());
-//        }
-//        String major = maps.get("major");
-//        if (ObjectUtils.isNull(major)){
-//            bindingMap.put("major", "");
-//        }else {
-//            bindingMap.put("major", JSONObject.parseObject(String.valueOf(maps.get("major")), UserProfileFit.class).getValue());
-//        }
-//        if (StringUtils.isBlank(maps.get("cname"))){
-//            bindingMap.put("cname", "");
-//        }else {
-//            bindingMap.put("cname", JSONObject.parseObject(String.valueOf(maps.get("unit_contact")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("cphone"))){
-//            bindingMap.put("cphone", "");
-//        }else {
-//            bindingMap.put("cphone", JSONObject.parseObject(String.valueOf(maps.get("unit_tel")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("image"))){
-//            bindingMap.put("image", "");
-//        }else {
-//            bindingMap.put("image", ALIYUN_OSS_ENDPOINT + "/" + JSONObject.parseObject(String.valueOf(maps.get("commitment_electr_signature")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("y"))){
-//            bindingMap.put("y", "");
-//        }else {
-//            bindingMap.put("y", Convert.toStr(rightNow.get(Calendar.YEAR)));
-//        }
-//        if (ObjectUtils.isNull(maps.get("m"))){
-//            bindingMap.put("m", "");
-//        }else {
-//            bindingMap.put("m", rightNow.get(Calendar.MONTH) + 1);
-//        }
-//        if (ObjectUtils.isNull(maps.get("d"))){
-//            bindingMap.put("d", "");
-//        }else {
-//            bindingMap.put("d", rightNow.get(Calendar.DAY_OF_MONTH));
-//        }
-//        if (ObjectUtils.isNull(maps.get("time"))){
-//            bindingMap.put("time", "");
-//        }else {
-//            bindingMap.put("time", JSONObject.parseObject(String.valueOf(maps.get("graduation_time")), UserProfileFit.class).getValue());
-//        }
-//        if (ObjectUtils.isNull(maps.get("year"))){
-//            bindingMap.put("year", "");
-//        }else {
-//            bindingMap.put("year", JSONObject.parseObject(String.valueOf(maps.get("working_years")), UserProfileFit.class).getValue());
-//        }
 
-
-        bindingMap.put("username", JSONObject.parseObject(String.valueOf(maps.get("name")), UserProfileFit.class).getValue());
-        bindingMap.put("s", JSONObject.parseObject(String.valueOf(maps.get("sex")), UserProfileFit.class).getValue());
-        bindingMap.put("post", JSONObject.parseObject(String.valueOf(maps.get("apply_post")), UserProfileFit.class).getValue());
-        bindingMap.put("idcard", JSONObject.parseObject(String.valueOf(maps.get("idcard")), UserProfileFit.class).getValue());
-        bindingMap.put("phone", JSONObject.parseObject(String.valueOf(maps.get("telphone")), UserProfileFit.class).getValue());
-        bindingMap.put("school", JSONObject.parseObject(String.valueOf(maps.get("school")), UserProfileFit.class).getValue());
-        bindingMap.put("edu", JSONObject.parseObject(String.valueOf(maps.get("education")), UserProfileFit.class).getValue());
-        bindingMap.put("major", JSONObject.parseObject(String.valueOf(maps.get("major")), UserProfileFit.class).getValue());
-        bindingMap.put("cname", JSONObject.parseObject(String.valueOf(maps.get("unit_contact")), UserProfileFit.class).getValue());
-        bindingMap.put("cphone", JSONObject.parseObject(String.valueOf(maps.get("unit_tel")), UserProfileFit.class).getValue());
-        bindingMap.put("image", ALIYUN_OSS_ENDPOINT + "/" + JSONObject.parseObject(String.valueOf(maps.get("commitment_electr_signature")), UserProfileFit.class).getValue());
+        bindingMap.put("username", jsonHandle(maps,"username"));
+        bindingMap.put("s", jsonHandle(maps,"s"));
+        bindingMap.put("post", jsonHandle(maps,"post"));
+        bindingMap.put("idcard", jsonHandle(maps,"idcard"));
+        bindingMap.put("phone", jsonHandle(maps,"phone"));
+        bindingMap.put("school", jsonHandle(maps,"school"));
+        bindingMap.put("edu", jsonHandle(maps,"edu"));
+        bindingMap.put("major", jsonHandle(maps,"major"));
+        bindingMap.put("cname", jsonHandle(maps,"cname"));
+        bindingMap.put("cphone", jsonHandle(maps,"cphone"));
+        bindingMap.put("image", ALIYUN_OSS_ENDPOINT + "/" + jsonHandle(maps,"commitment_electr_signature"));
         bindingMap.put("y", Convert.toStr(rightNow.get(Calendar.YEAR)));
         bindingMap.put("m", rightNow.get(Calendar.MONTH) + 1);
         bindingMap.put("d", rightNow.get(Calendar.DAY_OF_MONTH));
-        bindingMap.put("time", JSONObject.parseObject(String.valueOf(maps.get("graduation_time")), UserProfileFit.class).getValue());
-        bindingMap.put("year", JSONObject.parseObject(String.valueOf(maps.get("working_years")), UserProfileFit.class).getValue());
+        bindingMap.put("time", jsonHandle(maps,"graduation_time"));
+        bindingMap.put("year", jsonHandle(maps,"working_years"));
         File touch = FileUtil.touch(ZHONGZHENG_PROFILE + imgIndex+"word.html");
         //默认freemake配置
         Configuration configuration = new Configuration();
@@ -393,6 +311,14 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         return upload;
     }
 
+    private String jsonHandle(Map<String,String> maps,String key){
+        UserProfileFit userProfileFit = JSONObject.parseObject(String.valueOf(maps.get(key)), UserProfileFit.class);
+        if (ObjectUtils.isNull(userProfileFit) || ObjectUtils.isNull(userProfileFit.getValue())){
+            return "";
+        }
+        return userProfileFit.getValue();
+    }
+
     @Override
     public String addWord(UserProfileAddBo bo) throws IOException {
         UserProfileQueryBo userProfileQueryBo = new UserProfileQueryBo();

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserSubscribeStudentExportVo.java

@@ -34,6 +34,9 @@ public class UserSubscribeStudentExportVo {
 	@ApiModelProperty("手机号")
 	private String telphone;
 
+	@Excel(name = "座位号")
+	@ApiModelProperty("座位号")
+	private String seatNumber;
 
 	@Excel(name = "学历")
 	@ApiModelProperty("学历")

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserVo.java

@@ -315,7 +315,8 @@ public class UserVo {
 	private String applySiteEndTime;
 	@ApiModelProperty("预约ID")
 	private Long subscribeId;
-
+	@ApiModelProperty("考场座位号")
+	private String seatNumber;
 	public void setNull(){
 		this.setOpenId(null);
 /*		this.setIdCardImg1(null);

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserSubscribeMapper.xml

@@ -126,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="applySiteStartTime" column="apply_site_start_time"/>
         <result property="applySiteEndTime" column="apply_site_end_time"/>
         <result property="subscribeId" column="subscribe_id"/>
+        <result property="seatNumber" column="seat_number"/>
     </resultMap>
 
     <select id="listSubscribe" parameterType="com.zhongzheng.modules.user.bo.UserSubscribeQueryBo" resultMap="UserSubscribeVo">