|
@@ -141,9 +141,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
private LocaleInformationMapper localeInformationMapper;
|
|
|
@Resource
|
|
|
private CompanyReportMapper companyReportMapper;
|
|
|
+ @Resource
|
|
|
+ private ThirdPartyInterfaceMapper thirdPartyInterfaceMapper;
|
|
|
//登录网页端
|
|
|
@Override
|
|
|
- public HttpRespMsg loginAdmin(String username, String password) {
|
|
|
+ public HttpRespMsg loginAdmin(String username, String password,Integer key) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
//根据电话号码获取账号信息
|
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("phone", username));
|
|
@@ -157,7 +159,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
httpRespMsg.setError(MessageUtils.message("user.duplicate"));
|
|
|
} else if (userList.get(0).getIsActive() == 0) {
|
|
|
httpRespMsg.setError(MessageUtils.message("user.inactive"));
|
|
|
- } else if (MD5Util.getPassword(password).equals(userList.get(0).getPassword())) {
|
|
|
+ } else if ((key==0?MD5Util.getPassword(password):password).equals(userList.get(0).getPassword())) {
|
|
|
//查看该公司非会员公司,只能允许试用三天,超时不可登录
|
|
|
Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", userList.get(0).getCompanyId()));
|
|
|
//公司未办理会员
|
|
@@ -209,6 +211,34 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg loginAdminByThirdParty(String jobNumber, String token) {
|
|
|
+ HttpRespMsg httpRespMsg;
|
|
|
+ List<ThirdPartyInterface> thirdPartyInterfaceList = thirdPartyInterfaceMapper.selectList(new QueryWrapper<ThirdPartyInterface>().eq("token", token));
|
|
|
+ if(thirdPartyInterfaceList!=null&&thirdPartyInterfaceList.size()>0){
|
|
|
+ ThirdPartyInterface thirdPartyInterface = thirdPartyInterfaceList.get(0);
|
|
|
+ if(thirdPartyInterface.getExpireTime().isBefore(LocalDateTime.now())){
|
|
|
+ httpRespMsg=new HttpRespMsg();
|
|
|
+ httpRespMsg.setError("token失效");
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ Integer companyId = thirdPartyInterface.getCompanyId();
|
|
|
+ User user = userMapper.selectOne(new QueryWrapper<User>().eq("job_number", jobNumber).eq("company_id", companyId));
|
|
|
+ if(user!=null){
|
|
|
+ httpRespMsg=loginAdmin(user.getPhone(),user.getPassword(),1);
|
|
|
+ }else{
|
|
|
+ httpRespMsg=new HttpRespMsg();
|
|
|
+ httpRespMsg.setError("工号为"+jobNumber+"的员工在工时系统中不存在");
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ httpRespMsg=new HttpRespMsg();
|
|
|
+ httpRespMsg.setError("token错误");
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public void setUserRoleMenu(UserVO user) {
|
|
|
Integer roleId = user.getRoleId();
|