New file |
| | |
| | | package com.matrix.system.common.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.OperationLog; |
| | | import com.matrix.system.common.bean.reqVO.OperationLogReqVo; |
| | | import com.matrix.system.common.bean.respVO.OperationLogRespVo; |
| | | import com.matrix.system.common.dao.OperationLogDao; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 单据操作日志 |
| | | */ |
| | | @Service |
| | | public class OperationLogServiceImpl extends ServiceImpl<OperationLogDao, OperationLog> implements OperationLogService { |
| | | |
| | | @Autowired |
| | | OperationLogDao operationLogDao; |
| | | |
| | | @Override |
| | | public void saveOperation(Long companyId, Long shopId, Long userId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum, |
| | | Long billId, String billNo, Long vipId, String note) { |
| | | save(OperationLog.builder() |
| | | .companyId(companyId) |
| | | .shopId(shopId) |
| | | .opeUserId(userId) |
| | | .opeFunction(operationFunctionEnum.getValue()) |
| | | .opeBut(operationButtonEnum.getValue()) |
| | | .billId(billId) |
| | | .billNo(billNo) |
| | | .vipId(vipId) |
| | | .note(note) |
| | | .ip(WebUtil.getCustomerIp()).build()); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveOperation(Long companyId, Long shopId, Long userId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum, |
| | | Long billId, String billNo, Long vipId) { |
| | | save(OperationLog.builder() |
| | | .companyId(companyId) |
| | | .shopId(shopId) |
| | | .opeUserId(userId) |
| | | .opeFunction(operationFunctionEnum.getValue()) |
| | | .opeBut(operationButtonEnum.getValue()) |
| | | .billId(billId) |
| | | .billNo(billNo) |
| | | .vipId(vipId) |
| | | .ip(WebUtil.getCustomerIp()).build()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void saveOperation(Long companyId, Long shopId, Long userId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum |
| | | , String note) { |
| | | save(OperationLog.builder() |
| | | .companyId(companyId) |
| | | .shopId(shopId) |
| | | .opeUserId(userId) |
| | | .opeFunction(operationFunctionEnum.getValue()) |
| | | .opeBut(operationButtonEnum.getValue()) |
| | | .note(note) |
| | | .ip(WebUtil.getCustomerIp()).build()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Page<OperationLogRespVo> selectPage(Page<OperationLogReqVo> page, OperationLogReqVo operationLogReqVo) { |
| | | |
| | | Page<OperationLogRespVo> voPage=operationLogDao.selectPageList(page, operationLogReqVo); |
| | | voPage.getRecords().stream().forEach(e->{ |
| | | e.setOpeFunctionLabel(OperationFunctionEnum.getByValue(e.getOpeFunction())); |
| | | e.setOpeButLabel(OperationButtonEnum.getByValue(e.getOpeBut())); |
| | | }); |
| | | |
| | | return voPage; |
| | | } |
| | | |
| | | } |