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.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 list = dao.serchByCondition(obj); if (list != null && list.size() > 0) { model.setCode(1); model.setData(list); } 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; } }