| | |
| | | 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 com.consum.base.service.LWhGoodsService; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | 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.BaseWarehouseService; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description 仓库管理 |
| | |
| | | public class BaseWarehouseController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BaseWarehouseServiceImpl baseWarehouseService; |
| | | private BaseWarehouseService baseWarehouseService; |
| | | @Autowired |
| | | private LWhGoodsService lWhGoodsService; |
| | | |
| | | |
| | | /** |
| | | * @Description 新增 |
| | |
| | | if (StringUtils.isEmpty(param.getWarehouseName())) { |
| | | return ResponseValue.error("仓库名称为空"); |
| | | } |
| | | //TODO 加权限 省级管理员录入所有仓库信息 |
| | | // TODO 加权限 省级管理员录入所有仓库信息 |
| | | |
| | | int result = this.baseWarehouseService.add(param); |
| | | if (result > 0) { |
| | |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | FinSysTenantUser currentUser = this.getSysInfo(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | param.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | GenericPager<BaseWarehouse> pager = this.baseWarehouseService.queryList(param); |
| | | param.setAgencyId(Long.valueOf(currentUser.getTenantId())); |
| | | GenericPager<BaseWarehouse> pager = this.baseWarehouseService.queryList(param, currentUser); |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "根据仓库id和型号id 查询库存", notes = "根据仓库id和型号id 查询库存") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "warehouseQry", value = "仓库id和型号id", required = true, dataType = "WarehouseQry", paramType = "query") |
| | | }) |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "warehouseQry", value = "仓库id和型号id", required = true, |
| | | dataType = "WarehouseQry", paramType = "query")}) |
| | | @GetMapping("/select/number") |
| | | public ResponseValue selectNumber() { |
| | | WarehouseQry warehouseQry = CommonUtil.getObjFromReq(WarehouseQry.class); |
| | |
| | | Long warehouseId = warehouseQry.getWarehouseId(); |
| | | if (warehouseId == null) { |
| | | Long agencyId = warehouseQry.getAgencyId(); |
| | | BaseWarehouse defaultWarehouseByAgencyId = this.baseWarehouseService.getDefaultWarehouseByAgencyId(agencyId); |
| | | BaseWarehouse defaultWarehouseByAgencyId = |
| | | this.baseWarehouseService.getDefaultWarehouseByAgencyId(agencyId); |
| | | warehouseId = defaultWarehouseByAgencyId.getId(); |
| | | } |
| | | Long baseGoodsModelsId = warehouseQry.getBaseGoodsModelsId(); |
| | |
| | | return ResponseValue.success(num); |
| | | } |
| | | |
| | | |
| | | } |
| | | |