| | |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Description 物品模板 |
| | |
| | | } |
| | | |
| | | int result = this.baseGoodsTemplateService.add(param, this.getCurrentUser()); |
| | | if (result > 0) return ResponseValue.success(1); |
| | | if (result > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | | return ResponseValue.error("新增失败!"); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 根据物品id查询物品详情 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/9/26 |
| | | */ |
| | |
| | | return ResponseValue.error("物品id为空"); |
| | | } |
| | | BaseGoodsTemplateVo vo = this.baseGoodsTemplateService.getById(id); |
| | | if (vo == null) return ResponseValue.error("查询失败!"); |
| | | if (vo == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | | } |
| | | return ResponseValue.success("查询成功!", vo); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/25 |
| | | */ |
| | |
| | | if (goodsTemplate.getId() == null) { |
| | | return ResponseValue.error("物品id为空"); |
| | | } |
| | | int num = this.baseGoodsTemplateService.updateById(goodsTemplate,this.getCurrentUser()); |
| | | int num = this.baseGoodsTemplateService.updateById(goodsTemplate, this.getCurrentUser()); |
| | | |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("删除失败!"); |
| | | } |
| | | |
| | | /** |
| | | * @Description 查询仓库类型(数据字典) |
| | | * @Description 查询仓库类型(数据字典) |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据分类id查询物品模板 |
| | | * @Description 根据分类id查询物品模板 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | |
| | | return ResponseValue.success(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/query/goodsTemplate") |
| | | public ResponseValue getByAgencyId(Long agencyId) { |
| | | if (agencyId == null) { |
| | | return ResponseValue.error("机构id为空"); |
| | | } |
| | | List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.queryByAgencyId(agencyId); |
| | | if (list == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | | } |
| | | return ResponseValue.success("查询成功!", list); |
| | | } |
| | | |
| | | |
| | | } |