basic-server/src/main/java/com/ruoyi/basic/controller/IfsInventoryQuantityController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
basic-server/src/main/java/com/ruoyi/basic/service/IfsInventoryQuantityService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
basic-server/src/main/java/com/ruoyi/basic/service/impl/IfsInventoryQuantityServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | 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); } }