...
|
...
|
@@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.RequestParam; |
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -53,6 +54,7 @@ public class QRCodeController { |
|
|
@Autowired
|
|
|
private XklMemberRespository xklMemberRespository;
|
|
|
|
|
|
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//小写的mm表示的是分钟
|
|
|
|
|
|
@LogAnnotation
|
|
|
@AntiXSS
|
...
|
...
|
@@ -71,6 +73,7 @@ public class QRCodeController { |
|
|
return new ResponseEntity<>(ResultModel.ok(qrModel), HttpStatus.OK);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@LogAnnotation
|
|
|
@AntiXSS
|
|
|
@Sign
|
...
|
...
|
@@ -128,15 +131,19 @@ public class QRCodeController { |
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.USER_NOT_FOUND), HttpStatus.OK);
|
|
|
}
|
|
|
XklMemberEntity xklMemberEntity = xklMemberRespository.findOne((long) user.getMemberId());
|
|
|
int age = DatetimeTools.getAge(xklMemberEntity.getBirthDate(), new Date());
|
|
|
Date birthDate = new Date();
|
|
|
try {
|
|
|
birthDate = sdf.parse(xklMemberEntity.getBirthDate());
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
int age = DatetimeTools.getAge(birthDate, new Date());
|
|
|
UsrInfoModel usrInfo = new UsrInfoModel(user.getLoginAccount(), xklMemberEntity.getName(),
|
|
|
xklMemberEntity.getIdcard(), xklMemberEntity.getPhone(), xklMemberEntity.getSex(), age, qrcode, genWebloginUrl(qrcode));
|
|
|
xklMemberEntity.getIdcard(), xklMemberEntity.getPhone(), xklMemberEntity.isSex() ? 1 : 0, age, qrcode, genWebloginUrl(qrcode));
|
|
|
return new ResponseEntity<>(ResultModel.ok(usrInfo), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
private static String genWebloginUrl(String qrcode) {
|
|
|
return Constants.WEB_LOGIN_URL + qrcode.trim();
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|