Commit 08422e2e by 邓实川 Committed by chenzg

登录bug修改

parent 5e6dd84b
......@@ -496,8 +496,8 @@ public class LoginController {
return ResultUtil.error("注册企业失败2");
}
}
boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId())
boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId()).rzTime(new Date())
.name(username).build().insert();
if (!b4) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
......@@ -505,8 +505,8 @@ public class LoginController {
}
// 员工企业关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId()).status(1)
.userType(CommonEnum.U_TYPE_ADMIN.getType()).build();
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId())
.status(1).userType(CommonEnum.U_TYPE_ADMIN.getType()).build();
boolean b3 = qyzxEmpEntAsso.insert();
if (!b3) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
......@@ -559,31 +559,26 @@ public class LoginController {
} catch (Exception e) {
e.printStackTrace();
}
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId()
);
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId());
if (qys.size() == 0)
return ResultUtil.error("没有任何公司可以查看!");
qyzxEmpLogin1.setQys(qys);
QysDto ctrl = qys.get(0);
if (qyzxEmpLogin1.getOrgId() != null) {
// for (QysDto qysDto : qys) {
// if (qyzxEmpLogin1.getOrgId().equals(qysDto.getId()) && qysDto.getStatus() == 1) {
// ctrl = qysDto;
// }
// System.out.println(qyzxEmpLogin1.getOrgId());
// System.out.println(qysDto);
// }
Optional<QysDto> s = qys.parallelStream()
.filter(item -> item.getStatus() == 1 && qyzxEmpLogin1.getOrgId().equals(item.getId())).findFirst();
System.out.println(s.isPresent());
if (s != null && s.isPresent()) {
ctrl = s.get();
for (QysDto qysDto : qys) {
if (qyzxEmpLogin1.getOrgId().equals(qysDto.getId()) && qysDto.getStatus() == 1) {
ctrl = qysDto;
}
}
// Stream<QysDto> s = qys.stream()
// .filter(item -> item.getStatus() == 1 && qyzxEmpLogin1.getOrgId().equals(item.getId()));
//
// if (s != null) {
// ctrl = s.findFirst().get();
// }
}
if (ctrl.getStatus() == null || ctrl.getStatus().equals(0)) {
return ResultUtil.error("帐号被禁用");
......
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