|
|
@@ -6,6 +6,7 @@ import com.mokamrp.privates.constant.Constants;
|
|
|
import com.mokamrp.privates.constant.RedisKey;
|
|
|
import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.mapper.UserMapper;
|
|
|
+import com.mokamrp.privates.mapper.vo.WorkRoomVo;
|
|
|
import com.mokamrp.privates.service.UserService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.mokamrp.privates.utils.StringUtils;
|
|
|
@@ -14,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@@ -30,6 +33,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
@Autowired
|
|
|
public StringRedisTemplate redis;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public UserMapper userMapper;
|
|
|
+
|
|
|
public Map<String, Object> doLogin(String phone, String password) {
|
|
|
Map<String, Object> res =this.getMap(new QueryWrapper<User>().eq("phone", phone));
|
|
|
//.验证账户名和密码
|
|
|
@@ -53,4 +59,29 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
res.put("loginStatus", "loginSuccess");
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ public void Insert(Map<String,String> info,String name) {
|
|
|
+
|
|
|
+ User user = new User();
|
|
|
+
|
|
|
+ if(info.get("employeeNo").isEmpty()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(userMapper.selectById(info.get("employeeNo")) != null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ user.setId(Integer.parseInt(info.get("employeeNo").toString()));
|
|
|
+ user.setGender(Integer.parseInt(info.get("gender").toString()));
|
|
|
+ user.setPhone(info.get("tel").toString().replaceAll("/+86",""));
|
|
|
+ user.setPic(info.get("pic").toString());
|
|
|
+ user.setLoginTime(new Date());
|
|
|
+
|
|
|
+ user.setName(name);
|
|
|
+ this.saveOrUpdate(user);
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|