hym vor 4 Jahren
Ursprung
Commit
bc86e931d5

+ 10 - 12
src/main/java/com/zoniot/ccrc/service/impl/OperationLogServiceImpl.java

@@ -3,7 +3,9 @@ package com.zoniot.ccrc.service.impl;
 import com.alibaba.fastjson.JSON;
 
 import com.github.pagehelper.PageHelper;
+import com.zoniot.ccrc.commom.exception.ServiceException;
 import com.zoniot.ccrc.commom.model.Pagination;
+import com.zoniot.ccrc.commom.utils.ExcelUtil;
 import com.zoniot.ccrc.commom.utils.UserUtil;
 import com.zoniot.ccrc.dao.DeviceMapper;
 import com.zoniot.ccrc.dao.OperationLogMapper;
@@ -90,15 +92,13 @@ public class OperationLogServiceImpl implements OperationLogService {
 
     @Override
     public void getExcel(String username,  String content, LocalDateTime startDate, LocalDateTime endDate,String mobilephone, HttpServletResponse httpServletResponse) {
-      /*  LoginUser loginUser = UserUtil.getCurrentUser();
-        List<OperationLog> list = operationLogMapper.getList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), username, content, startDate, endDate,mobilephone);
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        List<OperationLog> list = operationLogMapper.getList(loginUser.getSiteId(), null, username, content, startDate, endDate,mobilephone);
         String title = "操作日志";
         String[] rowsName;
-        if(loginUser.getSiteType() != null && loginUser.getSiteType() == 2){
-            rowsName = new String[]{"序号", "操作时间", "用户名","手机号", "操作内容"};
-        }else{
-            rowsName= new String[]{"序号", "时间", "用户名","手机号", "操作", "操作前", "操作后"};
-        }
+
+            rowsName= new String[]{"序号", "时间", "用户名","手机号", "操作"};
+
         List<Object[]> dataList = newArrayList();
         Object[] objs = null;
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@@ -110,10 +110,8 @@ public class OperationLogServiceImpl implements OperationLogService {
             objs[2] = operationLog.getUsername();
             objs[3] = operationLog.getMobilePhone();
             objs[4] = operationLog.getOperationName();
-            if(loginUser.getSiteType() == null || loginUser.getSiteType() != 2) {
-                objs[5] = operationLog.getOldData().replaceAll("&", ",\r\n");
-                objs[6] = operationLog.getNewData().replaceAll("&", ",\r\n");
-            }
+
+
             dataList.add(objs);
         }
         ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
@@ -121,7 +119,7 @@ public class OperationLogServiceImpl implements OperationLogService {
             excelUtil.export(httpServletResponse);
         } catch (Exception e) {
             throw new ServiceException(-900, "导出异常");
-        }*/
+        }
     }
 }