| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.BaseWarehouseParam; |
| | | import com.consum.base.pojo.query.WarehouseQry; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description 仓库管理 |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseWarehouseParam param) { |
| | | public ResponseValue add() { |
| | | BaseWarehouseParam param = CommonUtil.getObjFromReqBody(BaseWarehouseParam.class); |
| | | BaseWarehouseParam param2 = new BaseWarehouseParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | if (StringUtils.isEmpty(param.getWarehouseName())) { |
| | | return ResponseValue.error("仓库名称为空"); |
| | | } |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList(BaseWarehouseParam param) { |
| | | public ResponseValue queryList() { |
| | | BaseWarehouseParam param = CommonUtil.getObjFromReq(BaseWarehouseParam.class); |
| | | BaseWarehouseParam param2 = new BaseWarehouseParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @PostMapping("/edit") |
| | | public ResponseValue edit(@RequestBody BaseWarehouse baseWarehouse) { |
| | | public ResponseValue edit() { |
| | | BaseWarehouse baseWarehouse = CommonUtil.getObjFromReqBody(BaseWarehouse.class); |
| | | BaseWarehouse param2 = new BaseWarehouse(); |
| | | CommonUtil.copyProperties(baseWarehouse, param2); |
| | | baseWarehouse = param2; |
| | | |
| | | Long id = baseWarehouse.getId(); |
| | | if (id == null || id <= 0) { |
| | | return ResponseValue.error("编辑的仓库不存在"); |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public ResponseValue updateById(@RequestBody BaseWarehouse baseWarehouse) { |
| | | public ResponseValue updateById() { |
| | | BaseWarehouse baseWarehouse = CommonUtil.getObjFromReqBody(BaseWarehouse.class); |
| | | BaseWarehouse param2 = new BaseWarehouse(); |
| | | CommonUtil.copyProperties(baseWarehouse, param2); |
| | | baseWarehouse = param2; |
| | | |
| | | if (baseWarehouse.getId() == null) { |
| | | return ResponseValue.error("仓库id为空"); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "warehouseQry", value = "仓库id和型号id", required = true, dataType = "WarehouseQry", paramType = "query") |
| | | }) |
| | | @GetMapping("/select/number") |
| | | public ResponseValue selectNumber(@Validated WarehouseQry warehouseQry) { |
| | | public ResponseValue selectNumber() { |
| | | WarehouseQry warehouseQry = CommonUtil.getObjFromReq(WarehouseQry.class); |
| | | WarehouseQry param2 = new WarehouseQry(); |
| | | CommonUtil.copyProperties(warehouseQry, param2); |
| | | warehouseQry = param2; |
| | | |
| | | Long warehouseId = warehouseQry.getWarehouseId(); |
| | | if (warehouseId == null) { |
| | | Long agencyId = warehouseQry.getAgencyId(); |