Commit 79334da6 by dengshichuan

Merge branch 'dsc' into 'develop'

Dsc

See merge request 8timerv2/8timerapiv200!63
parents 1b81adf0 80c6c0fc
...@@ -496,8 +496,8 @@ public class LoginController { ...@@ -496,8 +496,8 @@ public class LoginController {
return ResultUtil.error("注册企业失败2"); 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(); .name(username).build().insert();
if (!b4) { if (!b4) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
...@@ -505,8 +505,8 @@ public class LoginController { ...@@ -505,8 +505,8 @@ public class LoginController {
} }
// 员工企业关联表 // 员工企业关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId()).status(1) QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId())
.userType(CommonEnum.U_TYPE_ADMIN.getType()).build(); .status(1).userType(CommonEnum.U_TYPE_ADMIN.getType()).build();
boolean b3 = qyzxEmpEntAsso.insert(); boolean b3 = qyzxEmpEntAsso.insert();
if (!b3) { if (!b3) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
...@@ -559,31 +559,26 @@ public class LoginController { ...@@ -559,31 +559,26 @@ public class LoginController {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId() List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId());
);
if (qys.size() == 0) if (qys.size() == 0)
return ResultUtil.error("没有任何公司可以查看!"); return ResultUtil.error("没有任何公司可以查看!");
qyzxEmpLogin1.setQys(qys); qyzxEmpLogin1.setQys(qys);
QysDto ctrl = qys.get(0); QysDto ctrl = qys.get(0);
if (qyzxEmpLogin1.getOrgId() != null) { if (qyzxEmpLogin1.getOrgId() != null) {
// for (QysDto qysDto : qys) { for (QysDto qysDto : qys) {
// if (qyzxEmpLogin1.getOrgId().equals(qysDto.getId()) && qysDto.getStatus() == 1) { if (qyzxEmpLogin1.getOrgId().equals(qysDto.getId()) && qysDto.getStatus() == 1) {
// ctrl = qysDto; 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();
} }
// 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)) { if (ctrl.getStatus() == null || ctrl.getStatus().equals(0)) {
return ResultUtil.error("帐号被禁用"); 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