| | |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description 物品模板 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/24 |
| | | */ |
| | | @Api(value = "物品模板", tags = "物品模板") |
| | | // @Api(value = "物品模板", tags = "物品模板") |
| | | @RestController |
| | | @RequestMapping("/pc/base/goods/template") |
| | | public class BaseGoodsTemplateController extends BaseController { |
| | |
| | | } |
| | | if (StringUtils.isEmpty(param.getGoodsName())) { |
| | | return ResponseValue.error("物品名称为空"); |
| | | } |
| | | BaseCategory baseCategory = new BaseCategory(); |
| | | baseCategory.setId(param2.getCategoryId()); |
| | | BaseCategory baseCategory1 = this.baseCategoryService.get(baseCategory); |
| | | if (baseCategory1 == null) { |
| | | return ResponseValue.error("分类不存在"); |
| | | } |
| | | if (baseCategory1.getLevels() != 3) { |
| | | return ResponseValue.error("分类不正确"); |
| | | } |
| | | // 判断同一分类下的物品名称是否重复 |
| | | BaseGoodsTemplate goodsTemplate = |
| | |
| | | if (CollectionUtils.isEmpty(models)) { |
| | | return ResponseValue.error("物品型号为空"); |
| | | } |
| | | |
| | | BaseCategory baseCategory = new BaseCategory(); |
| | | baseCategory.setId(param2.getCategoryId()); |
| | | BaseCategory baseCategory1 = this.baseCategoryService.get(baseCategory); |
| | | if (baseCategory1 == null) { |
| | | return ResponseValue.error("分类不存在"); |
| | | } |
| | | if (baseCategory1.getLevels() != 3) { |
| | | return ResponseValue.error("分类不正确"); |
| | | } |
| | | int num = this.baseGoodsTemplateService.updateBaseGoodsTemplate(param); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("编辑失败!"); |
| | | } |
| | |
| | | return ResponseValue.success("查询成功!", list); |
| | | } |
| | | |
| | | @ApiOperation(value = "调拨查询机构下所有仓库下的分类模板信息", notes = "调拨查询机构下所有仓库下的分类模板信息") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "agencyId", value = "父级机构id", required = true, dataType = "java.lang.Long", |
| | | paramType = "query"), |
| | | @ApiImplicitParam(name = "categoryId", value = "分类id", required = true, dataType = "Long", |
| | | paramType = "query")}) |
| | | // // @ApiOperation(value = "调拨查询机构下所有仓库下的分类模板信息", notes = "调拨查询机构下所有仓库下的分类模板信息") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "agencyId", value = "父级机构id", required = true, dataType = "java.lang.Long", |
| | | // paramType = "query"), |
| | | // @ApiImplicitParam(name = "categoryId", value = "分类id", required = true, dataType = "Long", |
| | | // paramType = "query")}) |
| | | @GetMapping("/query/warehouse/goods") |
| | | public ResponseValue queryWarehouseGoods(Long agencyId, Long categoryId) { |
| | | |