chenrui
2025-04-09 1070eb501c0075e3f40f4506c2d9e5ddb9c597b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.ruoyi.basic.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.basic.mapper.*;
import com.ruoyi.basic.pojo.*;
import com.ruoyi.basic.service.*;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
 
import java.time.LocalDateTime;
 
 
@Service
@AllArgsConstructor
public class IfsInventoryQuantityServiceImpl extends ServiceImpl<IfsInventoryQuantityMapper, IfsInventoryQuantity> implements IfsInventoryQuantityService {
 
    private IfsInventoryQuantityMapper ifsInventoryQuantityMapper;
 
    @Override
    public int addIfsInventory(IfsInventoryQuantity ifsInventoryQuantity) {
        ifsInventoryQuantity.setDeclareDate(LocalDateTime.now());
        if (ifsInventoryQuantity.getId() ==null){
            ifsInventoryQuantity.setState(0);
            ifsInventoryQuantity.setIsInspect(1);
            return  ifsInventoryQuantityMapper.insert(ifsInventoryQuantity);
        }else {
            return ifsInventoryQuantityMapper.updateById(ifsInventoryQuantity);
        }
    }
 
    @Override
    public int delIfsInventory(Integer id) {
        return ifsInventoryQuantityMapper.deleteById(id);
    }
}