| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- package com.minpay.huicai.personmanage.action;
- import com.minpay.common.bean.User;
- import com.minpay.common.format.IFormatService;
- import com.minpay.db.table.mapper.ImLogMapper;
- import com.minpay.db.table.model.ImLog;
- import com.minpay.db.table.own.mapper.UserMapper;
- import com.mysql.jdbc.StringUtils;
- import com.startup.minpay.frame.business.IMINAction;
- import com.startup.minpay.frame.business.MINHttpServletRequestContext;
- import com.startup.minpay.frame.business.res.MINActionResult;
- import com.startup.minpay.frame.constant.IMINBusinessConstant;
- import com.startup.minpay.frame.exception.MINBusinessException;
- import com.startup.minpay.frame.jdbc.MINRowBounds;
- import com.startup.minpay.frame.service.base.IMINDataBaseService;
- import com.startup.minpay.frame.service.base.Service;
- import com.startup.minpay.frame.session.MINSession;
- import com.startup.minpay.frame.target.MINAction;
- import com.startup.minpay.frame.target.MINComponent;
- import com.startup.minpay.frame.target.MINParam;
- import com.startup.minpay.util.Str;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * 日志查询
- * @author xbh
- *
- */
- @MINComponent
- public class LogManageAction implements IMINAction {
- public final static String QUERY_LOGS = "queryLogs";
- public final static String DELETE_LOGS = "deleteLogs";
-
-
- /**
- * 查询操作员
- * @param session
- * @param page
- * @param limit
- * @param roleid
- * @param branchid
- * @param agent
- * @param school
- * @param name
- * @param logonname
- * @param stt
- * @param fapRequest
- * @return
- * @throws MINBusinessException
- */
- @MINAction(value = QUERY_LOGS)
- public MINActionResult userQuery(
- MINSession session,
- @MINParam(key = "page", defaultValue = "1") int page,
- @MINParam(key = "limit", defaultValue = "3") int limit,
- @MINParam(key = "roleid") String roleid,
- @MINParam(key = "branchid") String branchid,
- @MINParam(key = "agent") String agent,
- @MINParam(key = "date") String date,
- @MINParam(key = "school") String school,
- @MINParam(key = "name") String name,
- @MINParam(key = "logonname") String logonname,
- @MINParam(key = "stt") String stt,
- @MINParam(key = "desc") String desc,
- MINHttpServletRequestContext fapRequest
- ) throws MINBusinessException {
-
- MINActionResult res = new MINActionResult();
- User user = session.getUser();
- // 创建查询条件
- Map<String, String> p = new HashMap<String, String>();
- //设置所属机构筛选条件
- //String branchId = "";
- p.put("branchid", branchid);
- //p.put("date", date);
- if(!Str.isEmptyMaskNull(date)) {
- String [] datas = date.split("-");
- p.put("date1", datas[0].trim() + "000000");
- p.put("date2", datas[1].trim() + "235959");
- }
- if (!Str.isEmptyMaskNull(roleid)) {
- p.put("roleid", roleid);
- }
- if (!Str.isEmptyMaskNull(name)) {
- p.put("name", name);
- }
- if (!Str.isEmptyMaskNull(logonname)) {
- p.put("logonname", logonname);
- }
- if (!Str.isEmptyMaskNull(stt)) {
- p.put("stt", stt);
- }
- if (!Str.isEmptyMaskNull(desc)) {
- p.put("desc", desc);
- }
- MINRowBounds rows = new MINRowBounds(page, limit);
-
- // 查询
- List<Map<String, String>> ls = Service.lookup(IMINDataBaseService.class).getMybatisMapper(UserMapper.class).queryLogs(p, rows);
-
- ls = Service.lookup(IFormatService.class).formatDateTime(ls, "logdatetime");
-
- // 设置返回值
- res.set(IMINBusinessConstant.F_PAGING_LAY, ls);
- String ro = String.valueOf(rows.getCount());
- res.set(IMINBusinessConstant.F_PAGING_COUNT, ro);
- return res;
- }
- @MINAction(value = DELETE_LOGS)
- public MINActionResult deleteLogs(
- MINSession session,
- @MINParam(key = "id") String id,
- MINHttpServletRequestContext fapRequest
- ) throws MINBusinessException {
- if(StringUtils.isNullOrEmpty(id)){
- throw new MINBusinessException("请求数据异常!");
- }
- MINActionResult res = new MINActionResult();
- User user = session.getUser();
- ImLog imLog = new ImLog();
- imLog.setLogno(id);
- imLog.setState("1");
- // 查询
- Service.lookup(IMINDataBaseService.class).getMybatisMapper(ImLogMapper.class).updateByPrimaryKeySelective(imLog);
- // 设置返回值
- return res;
- }
-
- }
|