|
|
@@ -12,16 +12,12 @@ import com.template.config.WxOpenidConfig;
|
|
|
import com.template.model.enumModel.eIdentityTypeStatu;
|
|
|
import com.template.model.enumModel.eSchool;
|
|
|
import com.template.model.enumModel.eStatu;
|
|
|
-import com.template.model.pojo.WelcomeAccount;
|
|
|
-import com.template.model.pojo.WelcomeOrg;
|
|
|
-import com.template.model.pojo.WelcomeStudent;
|
|
|
+import com.template.model.pojo.*;
|
|
|
import com.template.model.request.*;
|
|
|
import com.template.model.result.CommonResult;
|
|
|
import com.template.model.result.Wx_user;
|
|
|
import com.template.model.vo.*;
|
|
|
-import com.template.services.WelcomeAccountService;
|
|
|
-import com.template.services.WelcomeOrgService;
|
|
|
-import com.template.services.WelcomeStudentService;
|
|
|
+import com.template.services.*;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -60,6 +56,12 @@ public class LoginController implements LoginControllerAPI {
|
|
|
private WelcomeStudentService welcomeStudentService;
|
|
|
@Resource
|
|
|
private WelcomeOrgService welcomeOrgService;
|
|
|
+ @Resource
|
|
|
+ private WelcomeFamilyService welcomeFamilyService;
|
|
|
+ @Resource
|
|
|
+ private WelcomeAccompanyService welcomeAccompanyService;
|
|
|
+ @Resource
|
|
|
+ private WelcomeArriveSettingService welcomeArriveSettingService;
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(LoginController.class);
|
|
|
|
|
|
@@ -300,8 +302,64 @@ public class LoginController implements LoginControllerAPI {
|
|
|
wlv.setAdmissNum(card_number);
|
|
|
wlv.setName(user_name);
|
|
|
wlv.setPicture(student.getPicture());
|
|
|
+
|
|
|
wlv.setCardId(id_card);
|
|
|
- wlv.setSex(student.getSex());
|
|
|
+ if(StringUtils.hasText(id_card)){
|
|
|
+ if(StringUtils.hasText(student.getSex())){
|
|
|
+ wlv.setSex(student.getSex());
|
|
|
+ }else{
|
|
|
+ String sex = StrUtils.getGender(id_card);
|
|
|
+ wlv.setSex(sex);
|
|
|
+ }
|
|
|
+
|
|
|
+ //家庭成员
|
|
|
+ List<FamilyVo> fvs = new ArrayList<>();
|
|
|
+ List<WelcomeFamily> familys = welcomeFamilyService.getManageByCardId(student.getCardId());
|
|
|
+ if (familys != null && familys.size() > 0) {
|
|
|
+ for (WelcomeFamily wf : familys) {
|
|
|
+ FamilyVo fv = new FamilyVo();
|
|
|
+ fv.setId(wf.getId());
|
|
|
+ fv.setFamilyShip(wf.getFamilyShip());
|
|
|
+ fv.setName(wf.getName());
|
|
|
+ fv.setPhone(wf.getPhone());
|
|
|
+ fv.setWorkUnit(wf.getWorkUnit());
|
|
|
+ fvs.add(fv);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ wlv.setFvs(fvs);
|
|
|
+
|
|
|
+ //陪同人员
|
|
|
+ List<AccompanyVo> avs = new ArrayList<>();
|
|
|
+ List<WelcomeAccompany> accompanys = welcomeAccompanyService.getManageByCardId(student.getCardId());
|
|
|
+ if (accompanys != null && accompanys.size() > 0) {
|
|
|
+ for (WelcomeAccompany ac : accompanys) {
|
|
|
+ AccompanyVo av = new AccompanyVo();
|
|
|
+ av.setId(ac.getId());
|
|
|
+ av.setName(ac.getName());
|
|
|
+ av.setPhone(ac.getPhone());
|
|
|
+ avs.add(av);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wlv.setAvs(avs);
|
|
|
+
|
|
|
+ //时间段
|
|
|
+ List<ArriveTimeVo> atvs = new ArrayList<>();
|
|
|
+ List<WelcomeArriveSetting> wass = welcomeArriveSettingService.queryCheckDatas();
|
|
|
+ if (wass != null && wass.size() > 0) {
|
|
|
+ for (WelcomeArriveSetting was : wass) {
|
|
|
+ ArriveTimeVo atv = new ArriveTimeVo();
|
|
|
+ atv.setId(was.getId());
|
|
|
+ atv.setStartTime(was.getStartTime());
|
|
|
+ atv.setEndTime(was.getEndTime());
|
|
|
+ atv.setTimeStr(was.getStartTime() + "-" + was.getEndTime());
|
|
|
+ atv.setIsCheck((student.getArriveTimeId() != null && was.getId().equals(student.getArriveTimeId())) ? 1 : 0);
|
|
|
+ atvs.add(atv);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wlv.setAtvs(atvs);
|
|
|
+ }
|
|
|
+
|
|
|
wlv.setSchool(campus);
|
|
|
wlv.setSchoolId(campus == null ? 0 : eSchool.stringOf(campus));
|
|
|
|
|
|
@@ -344,6 +402,64 @@ public class LoginController implements LoginControllerAPI {
|
|
|
if (student == null) {
|
|
|
return CommonResult.fail("录取号或身份证错误,登录失败!");
|
|
|
}
|
|
|
+ if(StringUtils.hasText(student.getCardId())){
|
|
|
+ if(StringUtils.hasText(student.getSex())){
|
|
|
+ student.setSex(student.getSex());
|
|
|
+ }else{
|
|
|
+ String sex =StrUtils.getGender(student.getCardId());
|
|
|
+ student.setSex(sex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //家庭成员
|
|
|
+ List<FamilyVo> fvs = new ArrayList<>();
|
|
|
+ List<WelcomeFamily> familys = welcomeFamilyService.getManageByCardId(student.getCardId());
|
|
|
+ if (familys != null && familys.size() > 0) {
|
|
|
+ for (WelcomeFamily wf : familys) {
|
|
|
+ FamilyVo fv = new FamilyVo();
|
|
|
+ fv.setId(wf.getId());
|
|
|
+ fv.setFamilyShip(wf.getFamilyShip());
|
|
|
+ fv.setName(wf.getName());
|
|
|
+ fv.setPhone(wf.getPhone());
|
|
|
+ fv.setWorkUnit(wf.getWorkUnit());
|
|
|
+ fvs.add(fv);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ student.setFvs(fvs);
|
|
|
+
|
|
|
+ //陪同人员
|
|
|
+ List<AccompanyVo> avs = new ArrayList<>();
|
|
|
+ List<WelcomeAccompany> accompanys = welcomeAccompanyService.getManageByCardId(student.getCardId());
|
|
|
+ if (accompanys != null && accompanys.size() > 0) {
|
|
|
+ for (WelcomeAccompany ac : accompanys) {
|
|
|
+ AccompanyVo av = new AccompanyVo();
|
|
|
+ av.setId(ac.getId());
|
|
|
+ av.setName(ac.getName());
|
|
|
+ av.setPhone(ac.getPhone());
|
|
|
+ avs.add(av);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ student.setAvs(avs);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //时间段
|
|
|
+ List<ArriveTimeVo> atvs = new ArrayList<>();
|
|
|
+ List<WelcomeArriveSetting> wass = welcomeArriveSettingService.queryCheckDatas();
|
|
|
+ if (wass != null && wass.size() > 0) {
|
|
|
+ for (WelcomeArriveSetting was : wass) {
|
|
|
+ ArriveTimeVo atv = new ArriveTimeVo();
|
|
|
+ atv.setId(was.getId());
|
|
|
+ atv.setStartTime(was.getStartTime());
|
|
|
+ atv.setEndTime(was.getEndTime());
|
|
|
+ atv.setTimeStr(was.getStartTime() + "-" + was.getEndTime());
|
|
|
+ atv.setIsCheck((student.getArriveTimeId() != null && was.getId().equals(student.getArriveTimeId())) ? 1 : 0);
|
|
|
+ atvs.add(atv);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ student.setAtvs(atvs);
|
|
|
+
|
|
|
long expired = 1000 * 60 * 60 * 24 * 365;
|
|
|
TokenDateVo token = JWTUtil.getToken(student.getCardId(), student.getId(), expired);
|
|
|
student.setToken(token.getToken());
|