|
|
|
package com.epmet.controller;
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.annotation.LoginUser;
|
|
|
|
import com.epmet.commons.tools.annotation.RequirePermission;
|
|
|
|
import com.epmet.commons.tools.enums.RequirePermissionEnum;
|
|
|
|
import com.epmet.commons.tools.page.PageData;
|
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto;
|
|
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil;
|
|
|
|
import com.epmet.commons.tools.utils.Result;
|
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils;
|
|
|
|
import com.epmet.dto.form.LogOperationListFormDTO;
|
|
|
|
import com.epmet.dto.region.LogOperationResultDTO;
|
|
|
|
import com.epmet.service.LogOperationService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@RequestMapping("log/operation")
|
|
|
|
@RestController
|
|
|
|
public class LogOperationController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private LogOperationService logOperationService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private LoginUserUtil loginUserUtil;
|
|
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
|
@RequirePermission(requirePermission = RequirePermissionEnum.MORE_SYSTEM_LOG_LIST)
|
|
|
|
public Result<List<LogOperationResultDTO>> listLogOperations(@RequestBody LogOperationListFormDTO input, HttpServletRequest request) {
|
|
|
|
ValidatorUtils.validateEntity(input);
|
|
|
|
String condition = input.getCondition();
|
|
|
|
Integer pageNo = input.getPageNo();
|
|
|
|
Integer pageSize = input.getPageSize();
|
|
|
|
|
|
|
|
String customerId = loginUserUtil.getLoginUserCustomerId();
|
|
|
|
List<LogOperationResultDTO> resultList = logOperationService.listOperationLogs(condition, customerId, pageNo, pageSize);
|
|
|
|
if (CollectionUtils.isEmpty(resultList)) {
|
|
|
|
resultList = new ArrayList<>();
|
|
|
|
}
|
|
|
|
return new Result<List<LogOperationResultDTO>>().ok(resultList);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 数字社区-操作记录
|
|
|
|
* @param formDTO
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@PostMapping("page")
|
|
|
|
public Result<PageData<LogOperationResultDTO>> page(@RequestBody LogOperationListFormDTO formDTO, @LoginUser TokenDto tokenDto){
|
|
|
|
return new Result<PageData<LogOperationResultDTO>>().ok(logOperationService.page(loginUserUtil.getLoginUserCustomerId(),
|
|
|
|
formDTO.getStartTime(),
|
|
|
|
formDTO.getEndTime(),
|
|
|
|
formDTO.getOperatorName(),
|
|
|
|
formDTO.getOperatorMobile(),
|
|
|
|
formDTO.getPageNo(),
|
|
|
|
formDTO.getPageSize(),
|
|
|
|
formDTO.getCategory(),tokenDto));
|
|
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("complementLogOperation")
|
|
|
|
public Result complementLogOperation(){
|
|
|
|
logOperationService.complementLogOperation();
|
|
|
|
return new Result();
|
|
|
|
}
|
|
|
|
}
|