|
@@ -98,35 +98,12 @@ public class OperationLogServiceImpl implements OperationLogService {
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
List<OperationLog> list = operationLogMapper.getList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), username, content, startDate, endDate,mobilephone);
|
|
|
String title = "操作日志";
|
|
|
- String[] rowsName = new String[]{"序号", "时间", "用户名","手机号", "操作", "操作前", "操作后"};
|
|
|
- List<Object[]> dataList = newArrayList();
|
|
|
- Object[] objs = null;
|
|
|
- DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- for (int i = 0; i < list.size(); i++) {
|
|
|
- OperationLog operationLog = list.get(i);
|
|
|
- objs = new Object[rowsName.length];
|
|
|
- objs[0] = (i + 1);
|
|
|
- objs[1] = operationLog.getCreateDate().format(df);
|
|
|
- objs[2] = operationLog.getUsername();
|
|
|
- objs[3] = operationLog.getMobilePhone();
|
|
|
- objs[4] = operationLog.getOperationName();
|
|
|
- objs[5] = operationLog.getOldData().replaceAll("&", ",\r\n");
|
|
|
- objs[6] = operationLog.getNewData().replaceAll("&", ",\r\n");
|
|
|
- dataList.add(objs);
|
|
|
+ String[] rowsName;
|
|
|
+ if(loginUser.getSiteType() != null && loginUser.getSiteType() == 2){
|
|
|
+ rowsName = new String[]{"序号", "操作时间", "用户名","手机号", "操作内容"};
|
|
|
+ }else{
|
|
|
+ rowsName= new String[]{"序号", "时间", "用户名","手机号", "操作", "操作前", "操作后"};
|
|
|
}
|
|
|
- ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
|
|
|
- try {
|
|
|
- excelUtil.export(httpServletResponse);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new ServiceException(-900, "导出异常");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public void getPayfeeExcel(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);
|
|
|
- String title = "操作日志";
|
|
|
- String[] rowsName = new String[]{"序号", "操作时间", "用户名","手机号", "操作内容"};
|
|
|
List<Object[]> dataList = newArrayList();
|
|
|
Object[] objs = null;
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
@@ -138,6 +115,10 @@ 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);
|