| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- package com.zhcs.dt.service.system.user.impl;
- import java.util.List;
- import javax.annotation.Resource;
- import org.springframework.stereotype.Service;
- import com.zhcs.dt.dao.DaoSupport;
- import com.zhcs.dt.entity.Page;
- import com.zhcs.dt.entity.system.User;
- import com.zhcs.dt.service.system.user.UserManager;
- import com.zhcs.dt.util.PageData;
- /** 系统用户
- * @author fh313596790qq(青苔)
- * 修改时间:2015.11.2
- */
- @Service("userService")
- public class UserService implements UserManager{
- @Resource(name = "daoSupport")
- private DaoSupport dao;
-
- /**登录判断
- * @param pd
- * @return
- * @throws Exception
- */
- public PageData getUserByNameAndPwd(PageData pd)throws Exception{
- return (PageData)dao.findForObject("UserMapper.getUserInfo", pd);
- }
-
- /**更新登录时间
- * @param pd
- * @throws Exception
- */
- public void updateLastLogin(PageData pd)throws Exception{
- dao.update("UserMapper.updateLastLogin", pd);
- }
-
- /**保存用户皮肤
- * @param pd
- * @throws Exception
- */
- public void saveSkin(PageData pd)throws Exception{
- dao.update("UserMapper.saveSkin", pd);
- }
-
- /**通过用户ID获取用户信息和角色信息
- * @param USER_ID
- * @return
- * @throws Exception
- */
- public User getUserAndRoleById(String USER_ID) throws Exception {
- return (User) dao.findForObject("UserMapper.getUserAndRoleById", USER_ID);
- }
-
- /**通过USERNAEME获取数据
- * @param pd
- * @return
- * @throws Exception
- */
- public PageData findByUsername(PageData pd)throws Exception{
- return (PageData)dao.findForObject("UserMapper.findByUsername", pd);
- }
-
- /**列出某角色下的所有用户
- * @param pd
- * @return
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public List<PageData> listAllUserByRoldId(PageData pd) throws Exception {
- return (List<PageData>) dao.findForList("UserMapper.listAllUserByRoldId", pd);
- }
-
- /**保存用户IP
- * @param pd
- * @throws Exception
- */
- public void saveIP(PageData pd)throws Exception{
- dao.update("UserMapper.saveIP", pd);
- }
-
- /**用户列表
- * @param page
- * @return
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public List<PageData> listUsers(Page page)throws Exception{
- return (List<PageData>) dao.findForList("UserMapper.userlistPage", page);
- }
-
- /**用户列表(弹窗选择用)
- * @param page
- * @return
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public List<PageData> listUsersBystaff(Page page)throws Exception{
- return (List<PageData>) dao.findForList("UserMapper.userBystafflistPage", page);
- }
-
- /**通过邮箱获取数据
- * @param pd
- * @return
- * @throws Exception
- */
- public PageData findByUE(PageData pd)throws Exception{
- return (PageData)dao.findForObject("UserMapper.findByUE", pd);
- }
-
- /**通过编号获取数据
- * @param pd
- * @return
- * @throws Exception
- */
- public PageData findByUN(PageData pd)throws Exception{
- return (PageData)dao.findForObject("UserMapper.findByUN", pd);
- }
-
- /**通过id获取数据
- * @param pd
- * @return
- * @throws Exception
- */
- public PageData findById(PageData pd)throws Exception{
- return (PageData)dao.findForObject("UserMapper.findById", pd);
- }
-
- /**保存用户
- * @param pd
- * @throws Exception
- */
- public void saveU(PageData pd)throws Exception{
- dao.save("UserMapper.saveU", pd);
- }
-
- /**修改用户
- * @param pd
- * @throws Exception
- */
- public void editU(PageData pd)throws Exception{
- dao.update("UserMapper.editU", pd);
- }
-
- /**删除用户
- * @param pd
- * @throws Exception
- */
- public void deleteU(PageData pd)throws Exception{
- dao.delete("UserMapper.deleteU", pd);
- }
-
- /**批量删除用户
- * @param USER_IDS
- * @throws Exception
- */
- public void deleteAllU(String[] USER_IDS)throws Exception{
- dao.delete("UserMapper.deleteAllU", USER_IDS);
- }
-
- /**用户列表(全部)
- * @param USER_IDS
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public List<PageData> listAllUser(PageData pd)throws Exception{
- return (List<PageData>) dao.findForList("UserMapper.listAllUser", pd);
- }
-
- /**获取总数
- * @param pd
- * @throws Exception
- */
- public PageData getUserCount(String value)throws Exception{
- return (PageData)dao.findForObject("UserMapper.getUserCount", value);
- }
- /**公司列表(全部)
- * @param
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public List<String> listAllCompany() throws Exception {
- // TODO Auto-generated method stub
- return (List<String>) dao.findForList("UserMapper.listAllCompany", "");
- }
-
- /**获取该公司所有路段
- * @param company
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public List<String> getAllRoadName(String company) throws Exception {
- // TODO Auto-generated method stub
- return (List<String>) dao.findForList("UserMapper.getAllRoadName", company);
- }
- @Override
- public void insertAPIUser(PageData pd) throws Exception {
- dao.save("UserMapper.insertAPIUser", pd);
- }
- @Override
- public void deleteAPIUser(PageData pd) throws Exception {
- dao.delete("UserMapper.deleteAPIUser", pd);
- }
- @Override
- public void editAPIUser(PageData pd) throws Exception {
- dao.update("UserMapper.editAPIUser", pd);
- }
- }
|