New file |
| | |
| | | package com.fgkj.services;
|
| | |
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.fgkj.actions.ActionUtil;
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BaseDAOFactory;
|
| | | import com.fgkj.dao.impl.User_logImpl;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.dto.User_log;
|
| | |
|
| | | public class User_logService {
|
| | | private ServiceModel model;
|
| | | private BaseDAO dao;
|
| | |
|
| | | public User_logService() {
|
| | | model = new ServiceModel();
|
| | | dao = BaseDAOFactory.getBaseDAO(BaseDAO.USER_LOG);
|
| | | }
|
| | |
|
| | | public ServiceModel add(Object obj) {
|
| | | Boolean bl = dao.add(obj);
|
| | | if (bl) {
|
| | | model.setCode(1);
|
| | | model.setMsg("添加成功!");
|
| | | } else {
|
| | | model.setMsg("添加失败!");
|
| | | }
|
| | | return model;
|
| | |
|
| | | }
|
| | | public ServiceModel addPro(Object obj) {
|
| | | Boolean bl =((User_logImpl)dao).addPro(obj);
|
| | | if (bl) {
|
| | | model.setCode(1);
|
| | | model.setMsg("添加成功!");
|
| | | } else {
|
| | | model.setMsg("添加失败!");
|
| | | }
|
| | | return model;
|
| | |
|
| | | }
|
| | |
|
| | | public ServiceModel update(Object obj) {
|
| | | Boolean bl = dao.update(obj);
|
| | | if (bl) {
|
| | | model.setCode(1);
|
| | | model.setMsg("修改成功!");
|
| | | } else {
|
| | | model.setMsg("修改失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | |
|
| | | public ServiceModel delete(Object obj) {
|
| | | Boolean bl = dao.del(obj);
|
| | | if (bl) {
|
| | | model.setCode(1);
|
| | | model.setMsg("删除成功!");
|
| | | } else {
|
| | | model.setMsg("删除失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | /*//5.4用户操作记录查询(根据用户名和操作类型)
|
| | | public ServiceModel serchByCondition(Object obj) {
|
| | | List<Batt_User_Permit> list = dao.serchByCondition(obj);
|
| | | // for (Batt_User_Permit b : list) {
|
| | | // System.out.println(b.getUlog());
|
| | | // }
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | model.setCode(1);
|
| | | model.setData(list);
|
| | | }
|
| | | // System.out.println(model);
|
| | | return model;
|
| | | }
|
| | | */
|
| | | public ServiceModel searchAll() {
|
| | | List list = dao.searchAll();
|
| | | // for (Object object : list) {
|
| | | // System.out.println(object);
|
| | | // }
|
| | | // System.out.println(list);
|
| | | if (list != null && list.size() > 0) {
|
| | | model.setCode(1);
|
| | | model.setData(list);
|
| | | }
|
| | | return model;
|
| | | }
|
| | | |
| | | /*//0.2当前时间的操作记录
|
| | | public ServiceModel serchByInfo(Object obj){
|
| | | User_log ulog=(User_log) obj;
|
| | | List<Batt_User_Permit> list=dao.serchByInfo(ulog);
|
| | | // for (Batt_User_Permit b : list) {
|
| | | // System.out.println(b);
|
| | | // }
|
| | | if(list!=null&&list.size()>0){
|
| | | model.setCode(1);
|
| | | model.setData(list);
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("查询失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | */
|
| | |
|
| | | public static void main(String[] args) throws ParseException {
|
| | | |
| | | }
|
| | |
|
| | | }
|