package com.fdkankan.sale.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fdkankan.sale.common.PageInfo; import com.fdkankan.sale.common.RequestBase; import com.fdkankan.sale.common.ResultCode; import com.fdkankan.sale.entity.Part; import com.fdkankan.sale.entity.PartLog; import com.fdkankan.sale.exception.BusinessException; import com.fdkankan.sale.mapper.IPartLogMapper; import com.fdkankan.sale.service.IPartLogService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fdkankan.sale.service.IPartService; import com.fdkankan.sale.vo.response.PartLogVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** *

* 服务实现类 *

* * @author * @since 2022-12-07 */ @Service public class PartLogServiceImpl extends ServiceImpl implements IPartLogService { @Autowired IPartService partService; @Override public void saveLog(Integer partId,Integer count, Long userId,Integer status,String repairId ) { Part part = partService.getById(partId); if(part == null){ throw new BusinessException(ResultCode.PART_NOT_EXITS); } PartLog partLog = new PartLog(); partLog.setPartId(part.getPartId()); partLog.setPartName(part.getPartName()); partLog.setStatus(status); partLog.setCount(count); partLog.setSysUserId(userId); partLog.setRepairId(repairId); this.save(partLog); } @Override public PageInfo pageList(RequestBase param) { Page page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(), param.getPageSize()),0); return PageInfo.PageInfo(page); } }