123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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;
- /**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author
- * @since 2022-12-07
- */
- @Service
- public class PartLogServiceImpl extends ServiceImpl<IPartLogMapper, PartLog> 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<PartLogVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(), param.getPageSize()),0);
- return PageInfo.PageInfo(page);
- }
- }
|