| | |
| | | package com.fgkj.services; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.fgkj.mapper.impl.UserMapper; |
| | | import org.apache.commons.io.FileUtils; |
| | | |
| | | import com.fgkj.controller.ActionUtil; |
| | | import com.fgkj.mapper.BaseDAO; |
| | | import com.fgkj.dto.Roles; |
| | | import com.fgkj.util.*; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.dto.User; |
| | | import com.fgkj.dto.UserClient; |
| | | import com.fgkj.dto.UserRole; |
| | | import com.fgkj.mapper.impl.UserMapper; |
| | | import com.fgkj.report.FileUtil; |
| | | import com.opensymphony.xwork2.ActionSupport; |
| | | import com.opensymphony.xwork2.LocaleProvider; |
| | | import com.opensymphony.xwork2.TextProvider; |
| | | import com.opensymphony.xwork2.util.ValueStack; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class UserService extends ActionUtil{ |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Autowired |
| | | import javax.annotation.Resource; |
| | | @Service |
| | | public class UserService { |
| | | |
| | | @Resource |
| | | private UserMapper mapper; |
| | | |
| | | // 添加员工 |
| | |
| | | // if (map == null) { |
| | | // map = new HashMap<String, UserClient>(); |
| | | // } else { |
| | | // UserClient client = map.get(user.getUname()); |
| | | // UserClient client = map.get(user.getuName()); |
| | | // if (client != null) { |
| | | // map.remove(user.getUname()); |
| | | // map.remove(user.getuName()); |
| | | // } |
| | | // } |
| | | // //map.put(user.getUname(), new UserClient(ActionUtil.getRequest().getRemoteAddr(), user)); |
| | | // //map.put(user.getuName(), new UserClient(ActionUtil.getRequest().getRemoteAddr(), user)); |
| | | // application.setAttribute("users", map); |
| | | // } |
| | | |
| | |
| | | if (map != null && map.size()>0) { |
| | | User user = (User) ActionUtil.getSession().getAttribute("user"); |
| | | if(user!=null){ |
| | | UserClient client = map.get(user.getUname()); |
| | | UserClient client = map.get(user.getuName()); |
| | | if(client!=null){ |
| | | if (!ActionUtil.getRequest().getRemoteAddr().equals(client.getIp())) { |
| | | model.setCode(1); |