记得上下班打卡 | git大法好,push需谨慎

Commit ffaa02a0 authored by 姜秀龙's avatar 姜秀龙

Merge branch 'refs/heads/jxl-slime' into test-ecs

parents ea3bba76 7da998cf
ALTER TABLE `smile_volunteers`
ADD COLUMN `nation` varchar(16) NOT NULL DEFAULT '' COMMENT '民族' AFTER `sex`;
package com.liquidnet.service.goblin.constant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* 中国民族(GB/T 3304),汉族置顶便于前端默认选中。
*/
public final class NationConst {
private NationConst() {
}
public static final List<String> NATIONS = Collections.unmodifiableList(Arrays.asList(
"汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族", "布依族", "朝鲜族",
"满族", "侗族", "瑶族", "白族", "土家族", "哈尼族", "哈萨克族", "傣族", "黎族", "傈僳族",
"佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族", "景颇族", "柯尔克孜族", "土族",
"达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族",
"塔吉克族", "怒族", "乌孜别克族", "俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族",
"独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"
));
private static final Set<String> NATION_SET = Collections.unmodifiableSet(new HashSet<>(NATIONS));
public static boolean isValid(String nation) {
return nation != null && NATION_SET.contains(nation.trim());
}
}
......@@ -28,6 +28,8 @@ public class SmileVolunteersDetailsVo implements Cloneable {
private String idCard;
@ApiModelProperty(value = "性别", example = "")
private Integer sex;
@ApiModelProperty(value = "民族", example = "")
private String nation;
@ApiModelProperty(value = "审核状态", example = "")
private Integer status;
@ApiModelProperty(value = "学校", example = "")
......@@ -65,6 +67,7 @@ public class SmileVolunteersDetailsVo implements Cloneable {
this.setImg(source.getImg());
this.setIdCard(source.getIdCard());
this.setSex(source.getSex());
this.setNation(source.getNation());
this.setStatus(source.getStatus());
this.setSchool(source.getSchool());
this.setSchoolAddress(source.getSchoolAddress());
......
......@@ -36,6 +36,8 @@ public class SmileVolunteersApplyParam implements Serializable {
private String idCard;
@ApiModelProperty(value = "性别[0-未知|1-男|2-女]")
private Integer sex;
@ApiModelProperty(value = "民族,参见 /volunteers/nations")
private String nation;
@ApiModelProperty(value = "学校名称")
private String school;
@ApiModelProperty(value = "学校地址")
......
......@@ -18,4 +18,6 @@ public interface SmileVolunteersService {
ResponseDto<SmileVProjectVo> projectDetails(String uid, String projectId);
ResponseDto<Boolean> apply(SmileVolunteersApplyParam param);
ResponseDto<List<String>> nations();
}
......@@ -16,6 +16,8 @@ public class VolunteersExportVo implements Serializable, Cloneable{
private String idCard;
@Excel(name = "性别", cellType = Excel.ColumnType.STRING)
private String sex;
@Excel(name = "民族", cellType = Excel.ColumnType.STRING)
private String nation;
@Excel(name = "审核状态", cellType = Excel.ColumnType.STRING)
private String status;
@Excel(name = "学校", cellType = Excel.ColumnType.STRING)
......@@ -56,6 +58,7 @@ public class VolunteersExportVo implements Serializable, Cloneable{
this.setName(source.getName());
this.setIdCard(source.getIdCard());
this.setSex(source.getSex());
this.setNation(source.getNation());
this.setStatus(source.getStatus());
this.setSchool(source.getSchool());
// this.setSchoolAddress(source.getSchoolAddress());
......
......@@ -56,6 +56,11 @@ public class SmileVolunteers implements Serializable ,Cloneable{
*/
private Integer sex;
/**
* 民族
*/
private String nation;
/**
* 状态[0-待审核|1-审核通过|2-审核未通过]
*/
......
......@@ -12,6 +12,7 @@ public class VolunteersExportDto implements Serializable, Cloneable {
private String name;
private String idCard;
private String sex;
private String nation;
private String status;
private String school;
private String schoolAddress;
......
......@@ -9,6 +9,7 @@
<result column="name" property="name"/>
<result column="id_card" property="idCard"/>
<result column="sex" property="sex"/>
<result column="nation" property="nation"/>
<result column="status" property="status"/>
<result column="school" property="school"/>
<result column="school_address" property="schoolAddress"/>
......@@ -35,6 +36,7 @@
WHEN sex = 1 THEN '男'
WHEN sex = 2 THEN '女'
ELSE '其他' END) as 'sex',
sv.nation,
(CASE
WHEN sv.status = 0 THEN '待审核'
WHEN sv.status = 1 THEN '审核通过'
......
......@@ -8,6 +8,7 @@ CREATE TABLE `smile_volunteers`
`img` varchar(256) DEFAULT '' COMMENT '头像',
`id_card` varchar(32) DEFAULT '' COMMENT '证件号',
`sex` tinyint(2) DEFAULT 0 COMMENT '性别[0-未知|1-男|2-女]',
`nation` varchar(16) DEFAULT '' COMMENT '民族',
`status` tinyint(2) DEFAULT 0 COMMENT '状态[0-待审核|1-审核通过|2-审核未通过]',
`school` varchar(64) DEFAULT '' COMMENT '学校',
`school_address` varchar(64) DEFAULT '' COMMENT '学校地址',
......
......@@ -44,4 +44,10 @@ public class SmileVolunteersController {
return volunteersService.apply(param);
}
@GetMapping("nations")
@ApiOperation("民族字典(GB/T 3304)")
public ResponseDto<List<String>> nations() {
return volunteersService.nations();
}
}
......@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.IDCard;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.constant.NationConst;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.param.SmileVolunteersApplyParam;
import com.liquidnet.service.goblin.service.manage.SmileFrontService;
......@@ -119,6 +120,12 @@ public class SmileVolunteerServerImpl implements SmileVolunteersService {
if (!utils.validate(param.getName(), param.getIdCard())) {
return ResponseDto.failure("验证身份证失败!");
}
if (StringUtils.isBlank(param.getNation())) {
return ResponseDto.failure("请选择民族");
}
if (!NationConst.isValid(param.getNation())) {
return ResponseDto.failure("民族选项无效");
}
smileRedisUtils.setProjectIdCard(param.getProjectId(), param.getIdCard());
......@@ -135,7 +142,7 @@ public class SmileVolunteerServerImpl implements SmileVolunteersService {
queueUtils.sendMsgByRedis(MQConst.SmileQueue.SMILE_USER.getKey(),
SqlMapping.get("smile_volunteers.apply",
uid, param.getProjectId(), param.getName(), param.getImg(),
param.getIdCard(), param.getSex(), param.getSchool(), param.getSchoolAddress(),
param.getIdCard(), param.getSex(), param.getNation(), param.getSchool(), param.getSchoolAddress(),
param.getSpecialty(), param.getSpecialty2(), param.getPhone(), param.getTeamId1(),
param.getTeamId2(), param.getTeamId3(), param.getIntroduce(), LocalDateTime.now()
));
......@@ -145,4 +152,9 @@ public class SmileVolunteerServerImpl implements SmileVolunteersService {
}
return ResponseDto.success();
}
@Override
public ResponseDto<List<String>> nations() {
return ResponseDto.success(NationConst.NATIONS);
}
}
......@@ -7,4 +7,4 @@ smile_service.delete_user= delete from smile_user where uid=?
#---- 志愿者报名
smile_volunteers.apply = INSERT INTO smile_volunteers (`uid`,`project_id`,`name`,`img`,`id_card`,`sex`,`school`,`school_address`,`specialty`,`specialty2`,`phone`,`team_id1`,`team_id2`,`team_id3`,`introduce`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
\ No newline at end of file
smile_volunteers.apply = INSERT INTO smile_volunteers (`uid`,`project_id`,`name`,`img`,`id_card`,`sex`,`nation`,`school`,`school_address`,`specialty`,`specialty2`,`phone`,`team_id1`,`team_id2`,`team_id3`,`introduce`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment