Commit d774347f authored by mlchun's avatar mlchun

1.注册信息优化

parent 22eeac2a
...@@ -27,7 +27,7 @@ public class SwaggerConfig { ...@@ -27,7 +27,7 @@ public class SwaggerConfig {
@Bean @Bean
public Docket createRestApi() { public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
// .host("byyl.zjhmit.com") .host("byyl.zjhmit.com")
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
//加了ApiOperation注解的类,才生成接口文档 //加了ApiOperation注解的类,才生成接口文档
......
...@@ -21,6 +21,8 @@ import org.apache.commons.codec.digest.DigestUtils; ...@@ -21,6 +21,8 @@ import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -159,6 +161,19 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -159,6 +161,19 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
userEntity.setCreateDate(new Date()); userEntity.setCreateDate(new Date());
userEntity.setIdCardNo(dto.getIdCardNo()); userEntity.setIdCardNo(dto.getIdCardNo());
userEntity.setCommunityName(dto.getCommunityName()); userEntity.setCommunityName(dto.getCommunityName());
userEntity.setHealthStatus("良好"); //TODO
String year = dto.getIdCardNo().toString().substring(6, 10);
String month = dto.getIdCardNo().toString().substring(10, 12);
String day = dto.getIdCardNo().toString().substring(12, 14);
String time = year+"-"+month+"-"+day;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date();
try {
date = sdf.parse(time);
} catch (ParseException e) {
e.printStackTrace();
}
userEntity.setBirthday(date);
userEntity.setGender(Integer.parseInt(dto.getIdCardNo().toString().substring(16, 17)) % 2 == 1 ? "男" : "女"); userEntity.setGender(Integer.parseInt(dto.getIdCardNo().toString().substring(16, 17)) % 2 == 1 ? "男" : "女");
userEntity.setOpenid(dto.getOpenid()); userEntity.setOpenid(dto.getOpenid());
insert(userEntity); insert(userEntity);
......
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