liding
2025-04-09 c9edd54471c28af5de9bd61541f8bd18451aa95d
原辅料下单新增更新删除
已修改1个文件
已添加3个文件
79 ■■■■■ 文件已修改
basic-server/src/main/java/com/ruoyi/basic/controller/IfsInventoryQuantityController.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/IfsInventoryQuantityService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/impl/IfsInventoryQuantityServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/controller/IfsInventoryQuantityController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.ruoyi.basic.controller;
import com.ruoyi.basic.pojo.IfsInventoryQuantity;
import com.ruoyi.basic.service.IfsInventoryQuantityService;
import com.ruoyi.common.core.domain.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
@Api(tags = "原辅材下单")
@AllArgsConstructor
@RestController
@RequestMapping("/ifsInventoryQuantity")
public class IfsInventoryQuantityController {
     private IfsInventoryQuantityService ifsInventoryQuantityService;
     @PostMapping("/addIfsInventory")
     public Result addIfsInventory(@RequestBody IfsInventoryQuantity ifsInventoryQuantity) {
          return Result.success(ifsInventoryQuantityService.addIfsInventory(ifsInventoryQuantity));
     }
     @ApiOperation(value = "删除")
     @DeleteMapping("/delIfsInventory")
     public Result<?> delIfsInventory(Integer id) {
          return Result.success(ifsInventoryQuantityService.delIfsInventory(id));
     }
}
basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java
@@ -213,4 +213,7 @@
    @ApiModelProperty("单位")
    private String inspectionType;
    @ApiModelProperty("过期时间")
    private String expirationTime;
}
basic-server/src/main/java/com/ruoyi/basic/service/IfsInventoryQuantityService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
package com.ruoyi.basic.service;
import com.ruoyi.basic.pojo.IfsInventoryQuantity;
public interface IfsInventoryQuantityService {
    int addIfsInventory(IfsInventoryQuantity ifsInventoryQuantity);
    int delIfsInventory(Integer id);
}
basic-server/src/main/java/com/ruoyi/basic/service/impl/IfsInventoryQuantityServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
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);
    }
}