新增SKU查询商品信息接口

- 在多个Controller中添加根据SKU查询商品信息的接口
- 在Service和Mapper中实现相应的查询方法- 在Mapper XML中添加SKU查询的SQL语句
This commit is contained in:
lijiaqi 2024-10-12 14:48:21 +08:00
parent 674a730d86
commit 41697a508e
32 changed files with 424 additions and 43 deletions

View File

@ -161,7 +161,6 @@ public class PurchaseOrderController extends DefaultBaseController {
PurchaseOrderWithReceiveDto data = purchaseOrderService.getWithReceive(id); PurchaseOrderWithReceiveDto data = purchaseOrderService.getWithReceive(id);
PurchaseOrderWithReceiveBo result = new PurchaseOrderWithReceiveBo(data); PurchaseOrderWithReceiveBo result = new PurchaseOrderWithReceiveBo(data);
return InvokeResultBuilder.success(result); return InvokeResultBuilder.success(result);
} }

View File

@ -19,10 +19,12 @@ import com.lframework.xingyun.sc.bo.retail.out.PrintRetailOutSheetBo;
import com.lframework.xingyun.sc.bo.retail.out.QueryRetailOutSheetBo; import com.lframework.xingyun.sc.bo.retail.out.QueryRetailOutSheetBo;
import com.lframework.xingyun.sc.bo.retail.out.QueryRetailOutSheetWithReturnBo; import com.lframework.xingyun.sc.bo.retail.out.QueryRetailOutSheetWithReturnBo;
import com.lframework.xingyun.sc.bo.retail.out.RetailOutSheetWithReturnBo; import com.lframework.xingyun.sc.bo.retail.out.RetailOutSheetWithReturnBo;
import com.lframework.xingyun.sc.bo.sale.SaleProductBo;
import com.lframework.xingyun.sc.dto.purchase.receive.GetPaymentDateDto; import com.lframework.xingyun.sc.dto.purchase.receive.GetPaymentDateDto;
import com.lframework.xingyun.sc.dto.retail.RetailProductDto; import com.lframework.xingyun.sc.dto.retail.RetailProductDto;
import com.lframework.xingyun.sc.dto.retail.out.RetailOutSheetFullDto; import com.lframework.xingyun.sc.dto.retail.out.RetailOutSheetFullDto;
import com.lframework.xingyun.sc.dto.retail.out.RetailOutSheetWithReturnDto; import com.lframework.xingyun.sc.dto.retail.out.RetailOutSheetWithReturnDto;
import com.lframework.xingyun.sc.dto.sale.SaleProductDto;
import com.lframework.xingyun.sc.entity.RetailOutSheet; import com.lframework.xingyun.sc.entity.RetailOutSheet;
import com.lframework.xingyun.sc.excel.retail.out.RetailOutSheetExportModel; import com.lframework.xingyun.sc.excel.retail.out.RetailOutSheetExportModel;
import com.lframework.xingyun.sc.service.retail.RetailOutSheetService; import com.lframework.xingyun.sc.service.retail.RetailOutSheetService;
@ -388,6 +390,31 @@ public class RetailOutSheetController extends DefaultBaseController {
return InvokeResultBuilder.success(results); return InvokeResultBuilder.success(results);
} }
/**
* 根据SKU查询商品
*/
@ApiOperation("根据SKU查询可零售商品")
@ApiImplicitParams({
@ApiImplicitParam(value = "仓库ID", name = "scId", paramType = "query", required = true),
@ApiImplicitParam(value = "SKU", name = "sku", paramType = "query", required = true)})
@HasPermission({"retail:out:add", "retail:out:modify", "retail:return:add",
"retail:return:modify"})
@GetMapping("/product/sku")
public InvokeResult<RetailProductBo> searchRetailProductBySku(
@NotBlank(message = "仓库ID不能为空") String scId, String sku, Boolean isReturn) {
if (StringUtil.isBlank(sku)) {
throw new DefaultClientException("SKU不能为空");
}
RetailProductDto dto = retailOutSheetService.queryRetailBySku(sku, isReturn);
if (dto == null) {
throw new DefaultClientException("该SKU不存在");
}
RetailProductBo bo = new RetailProductBo(scId, dto);
return InvokeResultBuilder.success(bo);
}
/** /**
* 查询商品列表 * 查询商品列表

View File

@ -12,12 +12,14 @@ import com.lframework.starter.web.resp.PageResult;
import com.lframework.starter.web.utils.ExcelUtil; import com.lframework.starter.web.utils.ExcelUtil;
import com.lframework.starter.web.utils.PageResultUtil; import com.lframework.starter.web.utils.PageResultUtil;
import com.lframework.xingyun.core.bo.print.A4ExcelPortraitPrintBo; import com.lframework.xingyun.core.bo.print.A4ExcelPortraitPrintBo;
import com.lframework.xingyun.sc.bo.purchase.PurchaseProductBo;
import com.lframework.xingyun.sc.bo.sale.GetSaleOrderBo; import com.lframework.xingyun.sc.bo.sale.GetSaleOrderBo;
import com.lframework.xingyun.sc.bo.sale.PrintSaleOrderBo; import com.lframework.xingyun.sc.bo.sale.PrintSaleOrderBo;
import com.lframework.xingyun.sc.bo.sale.QuerySaleOrderBo; import com.lframework.xingyun.sc.bo.sale.QuerySaleOrderBo;
import com.lframework.xingyun.sc.bo.sale.QuerySaleOrderWithOutBo; import com.lframework.xingyun.sc.bo.sale.QuerySaleOrderWithOutBo;
import com.lframework.xingyun.sc.bo.sale.SaleOrderWithOutBo; import com.lframework.xingyun.sc.bo.sale.SaleOrderWithOutBo;
import com.lframework.xingyun.sc.bo.sale.SaleProductBo; import com.lframework.xingyun.sc.bo.sale.SaleProductBo;
import com.lframework.xingyun.sc.dto.purchase.PurchaseProductDto;
import com.lframework.xingyun.sc.dto.sale.SaleOrderFullDto; import com.lframework.xingyun.sc.dto.sale.SaleOrderFullDto;
import com.lframework.xingyun.sc.dto.sale.SaleOrderWithOutDto; import com.lframework.xingyun.sc.dto.sale.SaleOrderWithOutDto;
import com.lframework.xingyun.sc.dto.sale.SaleProductDto; import com.lframework.xingyun.sc.dto.sale.SaleProductDto;
@ -343,7 +345,7 @@ public class SaleOrderController extends DefaultBaseController {
"sale:return:add", "sale:return:modify"}) "sale:return:add", "sale:return:modify"})
@GetMapping("/product/search") @GetMapping("/product/search")
public InvokeResult<List<SaleProductBo>> searchSaleProducts( public InvokeResult<List<SaleProductBo>> searchSaleProducts(
@NotBlank(message = "仓库ID不能为空") String scId, String condition, Boolean isReturn) { @NotBlank(message = "仓库ID不能为空") String scId, String condition, Boolean isReturn) {
if (isReturn == null) { if (isReturn == null) {
isReturn = false; isReturn = false;
@ -353,7 +355,7 @@ public class SaleOrderController extends DefaultBaseController {
} }
PageResult<SaleProductDto> pageResult = saleOrderService.querySaleByCondition(getPageIndex(), PageResult<SaleProductDto> pageResult = saleOrderService.querySaleByCondition(getPageIndex(),
getPageSize(), condition, isReturn); getPageSize(), condition, isReturn);
List<SaleProductBo> results = CollectionUtil.emptyList(); List<SaleProductBo> results = CollectionUtil.emptyList();
List<SaleProductDto> datas = pageResult.getDatas(); List<SaleProductDto> datas = pageResult.getDatas();
if (!CollectionUtil.isEmpty(datas)) { if (!CollectionUtil.isEmpty(datas)) {
@ -363,6 +365,31 @@ public class SaleOrderController extends DefaultBaseController {
return InvokeResultBuilder.success(results); return InvokeResultBuilder.success(results);
} }
/**
* 根据SKU查询商品
*/
@ApiOperation("根据SKU查询可销售商品")
@ApiImplicitParams({
@ApiImplicitParam(value = "仓库ID", name = "scId", paramType = "query", required = true),
@ApiImplicitParam(value = "SKU", name = "sku", paramType = "query", required = true)})
@HasPermission({"sale:order:add", "sale:order:modify", "sale:out:add", "sale:out:modify",
"sale:return:add", "sale:return:modify"})
@GetMapping("/product/sku")
public InvokeResult<SaleProductBo> searchSaleProductBySku(
@NotBlank(message = "仓库ID不能为空") String scId, String sku, Boolean isReturn){
if (StringUtil.isBlank(sku)) {
throw new DefaultClientException("SKU不能为空");
}
SaleProductDto dto = saleOrderService.querySaleBySku(sku, isReturn);
if (dto == null) {
throw new DefaultClientException("该SKU不存在");
}
SaleProductBo bo = new SaleProductBo(scId, dto);
return InvokeResultBuilder.success(bo);
}
/** /**
* 查询商品列表 * 查询商品列表
*/ */

View File

@ -249,6 +249,25 @@ public class PreTakeStockSheetController extends DefaultBaseController {
return InvokeResultBuilder.success(results); return InvokeResultBuilder.success(results);
} }
/**
* 根据SKU查询商品列表
*/
@ApiOperation("根据SKU查询预先盘点单商品列表")
@ApiImplicitParam(value = "SKU", name = "sku", paramType = "query", required = true)
@HasPermission({"stock:take:pre:add", "stock:take:pre:modify"})
@GetMapping("/product/sku")
public InvokeResult<PreTakeStockProductBo> searchProductBySku(String sku) {
if (StringUtil.isBlank(sku)) {
throw new DefaultClientException("SKU不能为空");
}
PreTakeStockProductDto dto = preTakeStockSheetService.queryPreTakeStockBySku(sku);
if (dto == null) {
throw new DefaultClientException("该SKU不存在");
}
PreTakeStockProductBo bo = new PreTakeStockProductBo(dto);
return InvokeResultBuilder.success(bo);
}
/** /**
* 查询商品列表 * 查询商品列表
*/ */

View File

@ -22,34 +22,17 @@ import com.lframework.xingyun.sc.enums.TakeStockPlanType;
import com.lframework.xingyun.sc.excel.stock.take.sheet.TakeStockSheetExportModel; import com.lframework.xingyun.sc.excel.stock.take.sheet.TakeStockSheetExportModel;
import com.lframework.xingyun.sc.service.stock.take.TakeStockPlanService; import com.lframework.xingyun.sc.service.stock.take.TakeStockPlanService;
import com.lframework.xingyun.sc.service.stock.take.TakeStockSheetService; import com.lframework.xingyun.sc.service.stock.take.TakeStockSheetService;
import com.lframework.xingyun.sc.vo.stock.take.sheet.ApprovePassTakeStockSheetVo; import com.lframework.xingyun.sc.vo.stock.take.sheet.*;
import com.lframework.xingyun.sc.vo.stock.take.sheet.ApproveRefuseTakeStockSheetVo; import io.swagger.annotations.*;
import com.lframework.xingyun.sc.vo.stock.take.sheet.BatchApprovePassTakeStockSheetVo; import org.springframework.beans.factory.annotation.Autowired;
import com.lframework.xingyun.sc.vo.stock.take.sheet.BatchApproveRefuseTakeStockSheetVo; import org.springframework.validation.annotation.Validated;
import com.lframework.xingyun.sc.vo.stock.take.sheet.CreateTakeStockSheetVo; import org.springframework.web.bind.annotation.*;
import com.lframework.xingyun.sc.vo.stock.take.sheet.QueryTakeStockSheetProductVo;
import com.lframework.xingyun.sc.vo.stock.take.sheet.QueryTakeStockSheetVo;
import com.lframework.xingyun.sc.vo.stock.take.sheet.UpdateTakeStockSheetVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import org.springframework.beans.factory.annotation.Autowired; import java.util.List;
import org.springframework.validation.annotation.Validated; import java.util.stream.Collectors;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 盘点单 Controller * 盘点单 Controller
@ -175,6 +158,38 @@ public class TakeStockSheetController extends DefaultBaseController {
return InvokeResultBuilder.success(results); return InvokeResultBuilder.success(results);
} }
/**
* 根据SKU查询商品列表
*/
@ApiOperation("根据SKU查询商品列表")
@ApiImplicitParams({
@ApiImplicitParam(value = "盘点任务ID", name = "planId", paramType = "query", required = true),
@ApiImplicitParam(value = "SKU", name = "sku", paramType = "query", required = true)})
@HasPermission({"stock:take:sheet:add", "stock:take:sheet:modify"})
@GetMapping("/product/sku")
public InvokeResult<TakeStockSheetProductBo> searchProductBySku(
@NotBlank(message = "盘点任务ID不能为空") String planId,
String sku) {
if (StringUtil.isBlank(sku)) {
throw new DefaultClientException("SKU不能为空");
}
TakeStockPlan takeStockPlan = takeStockPlanService.getById(planId);
if (takeStockPlan.getTakeType() == TakeStockPlanType.SIMPLE) {
planId = null;
}
TakeStockSheetProductDto dto = takeStockSheetService.queryTakeStockBySku(planId, sku);
if (dto == null) {
throw new DefaultClientException("SKU不存在");
}
TakeStockSheetProductBo bo = new TakeStockSheetProductBo(dto, planId, takeStockPlan.getScId());
return InvokeResultBuilder.success(bo);
}
/** /**
* 查询商品列表 * 查询商品列表
*/ */

View File

@ -176,6 +176,27 @@ public class ScTransferOrderController extends DefaultBaseController {
return InvokeResultBuilder.success(results); return InvokeResultBuilder.success(results);
} }
/**
* 根据SKU查询商品列表
*/
@ApiOperation("根据SKU查询商品列表")
@ApiImplicitParams({
@ApiImplicitParam(value = "仓库ID", name = "scId", paramType = "query", required = true),
@ApiImplicitParam(value = "SKU", name = "sku", paramType = "query", required = true)})
@HasPermission({"stock:sc-transfer:add", "stock:sc-transfer:modify"})
@GetMapping("/product/sku")
public InvokeResult<ScTransferProductBo> searchProductBySku(@NotBlank(message = "仓库ID不能为空") String scId,
String sku) {
if (StringUtil.isBlank(sku)) {
throw new DefaultClientException("SKU不能为空");
}
ScTransferProductDto dto = scTransferOrderService.queryScTransferBySku(scId,sku);
if (dto == null) {
throw new DefaultClientException("该SKU不存在");
}
ScTransferProductBo bo = new ScTransferProductBo(scId, dto);
return InvokeResultBuilder.success(bo);
}
/** /**
* 查询商品列表 * 查询商品列表
*/ */

View File

@ -1,19 +1,24 @@
package com.lframework.xingyun.sc.controller.ydool; package com.lframework.xingyun.sc.controller.ydool;
import com.lframework.starter.web.annotations.OpenApi; import com.lframework.starter.web.annotations.OpenApi;
import com.lframework.starter.web.annotations.security.HasPermission;
import com.lframework.starter.web.controller.DefaultBaseController; import com.lframework.starter.web.controller.DefaultBaseController;
import com.lframework.starter.web.resp.InvokeResult; import com.lframework.starter.web.resp.InvokeResult;
import com.lframework.starter.web.resp.InvokeResultBuilder; import com.lframework.starter.web.resp.InvokeResultBuilder;
import com.lframework.xingyun.basedata.service.product.ProductService; import com.lframework.xingyun.basedata.service.product.ProductService;
import com.lframework.xingyun.sc.bo.purchase.GetPurchaseOrderBo;
import com.lframework.xingyun.sc.dto.purchase.PurchaseOrderFullDto;
import com.lframework.xingyun.sc.service.purchase.PurchaseOrderService; import com.lframework.xingyun.sc.service.purchase.PurchaseOrderService;
import com.lframework.xingyun.sc.vo.ydool.YdoolApproveOrderVo; import com.lframework.xingyun.sc.vo.ydool.YdoolApproveOrderVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
/** /**
* 云朵里采购订单管理 * 云朵里采购订单管理
@ -43,4 +48,21 @@ public class YdoolPurchaseOrderController extends DefaultBaseController {
return InvokeResultBuilder.success(); return InvokeResultBuilder.success();
} }
/**
* 根据ID查询
*/
@ApiOperation("根据ID查询")
@ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true)
@OpenApi
@GetMapping
public InvokeResult<GetPurchaseOrderBo> findById(
@NotBlank(message = "订单ID不能为空") String id) {
PurchaseOrderFullDto data = purchaseOrderService.getDetail(id);
GetPurchaseOrderBo result = new GetPurchaseOrderBo(data);
return InvokeResultBuilder.success(result);
}
} }

View File

@ -1,21 +1,23 @@
package com.lframework.xingyun.sc.controller.ydool; package com.lframework.xingyun.sc.controller.ydool;
import com.lframework.starter.web.annotations.OpenApi; import com.lframework.starter.web.annotations.OpenApi;
import com.lframework.starter.web.annotations.security.HasPermission;
import com.lframework.starter.web.controller.DefaultBaseController; import com.lframework.starter.web.controller.DefaultBaseController;
import com.lframework.starter.web.resp.InvokeResult; import com.lframework.starter.web.resp.InvokeResult;
import com.lframework.starter.web.resp.InvokeResultBuilder; import com.lframework.starter.web.resp.InvokeResultBuilder;
import com.lframework.xingyun.sc.bo.retail.out.GetRetailOutSheetBo;
import com.lframework.xingyun.sc.dto.retail.out.RetailOutSheetFullDto;
import com.lframework.xingyun.sc.service.retail.RetailOutSheetService; import com.lframework.xingyun.sc.service.retail.RetailOutSheetService;
import com.lframework.xingyun.sc.vo.ydool.YdoolApproveOrderVo; import com.lframework.xingyun.sc.vo.ydool.YdoolApproveOrderVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
/** /**
* 云朵里零售出库单管理 * 云朵里零售出库单管理
@ -41,4 +43,22 @@ public class YdoolRetailOutSheetController extends DefaultBaseController {
retailOutSheetService.approve(vo); retailOutSheetService.approve(vo);
return InvokeResultBuilder.success(); return InvokeResultBuilder.success();
} }
/**
* 根据ID查询
*/
@ApiOperation("根据ID查询")
@ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true)
@OpenApi
@GetMapping
public InvokeResult<GetRetailOutSheetBo> findById(
@NotBlank(message = "订单ID不能为空") String id) {
RetailOutSheetFullDto data = retailOutSheetService.getDetail(id);
GetRetailOutSheetBo result = new GetRetailOutSheetBo(data);
return InvokeResultBuilder.success(result);
}
} }

View File

@ -1,21 +1,23 @@
package com.lframework.xingyun.sc.controller.ydool; package com.lframework.xingyun.sc.controller.ydool;
import com.lframework.starter.web.annotations.OpenApi; import com.lframework.starter.web.annotations.OpenApi;
import com.lframework.starter.web.annotations.security.HasPermission;
import com.lframework.starter.web.controller.DefaultBaseController; import com.lframework.starter.web.controller.DefaultBaseController;
import com.lframework.starter.web.resp.InvokeResult; import com.lframework.starter.web.resp.InvokeResult;
import com.lframework.starter.web.resp.InvokeResultBuilder; import com.lframework.starter.web.resp.InvokeResultBuilder;
import com.lframework.xingyun.sc.bo.sale.GetSaleOrderBo;
import com.lframework.xingyun.sc.dto.sale.SaleOrderFullDto;
import com.lframework.xingyun.sc.service.sale.SaleOrderService; import com.lframework.xingyun.sc.service.sale.SaleOrderService;
import com.lframework.xingyun.sc.vo.ydool.YdoolApproveOrderVo; import com.lframework.xingyun.sc.vo.ydool.YdoolApproveOrderVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
/** /**
* 云朵里销售订单管理 * 云朵里销售订单管理
@ -40,4 +42,21 @@ public class YdoolSaleOrderController extends DefaultBaseController {
saleOrderService.approve(vo); saleOrderService.approve(vo);
return InvokeResultBuilder.success(); return InvokeResultBuilder.success();
} }
/**
* 根据ID查询
*/
@ApiOperation("根据ID查询")
@ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true)
@OpenApi
@GetMapping
public InvokeResult<GetSaleOrderBo> findById(@NotBlank(message = "订单ID不能为空") String id) {
SaleOrderFullDto data = saleOrderService.getDetail(id);
GetSaleOrderBo result = new GetSaleOrderBo(data);
return InvokeResultBuilder.success(result);
}
} }

View File

@ -1,21 +1,24 @@
package com.lframework.xingyun.sc.controller.ydool; package com.lframework.xingyun.sc.controller.ydool;
import com.lframework.starter.common.exceptions.impl.DefaultClientException;
import com.lframework.starter.web.annotations.OpenApi; import com.lframework.starter.web.annotations.OpenApi;
import com.lframework.starter.web.annotations.security.HasPermission;
import com.lframework.starter.web.controller.DefaultBaseController; import com.lframework.starter.web.controller.DefaultBaseController;
import com.lframework.starter.web.resp.InvokeResult; import com.lframework.starter.web.resp.InvokeResult;
import com.lframework.starter.web.resp.InvokeResultBuilder; import com.lframework.starter.web.resp.InvokeResultBuilder;
import com.lframework.xingyun.sc.bo.stock.adjust.stock.StockAdjustSheetFullBo;
import com.lframework.xingyun.sc.dto.stock.adjust.stock.StockAdjustSheetFullDto;
import com.lframework.xingyun.sc.service.stock.adjust.StockAdjustSheetService; import com.lframework.xingyun.sc.service.stock.adjust.StockAdjustSheetService;
import com.lframework.xingyun.sc.vo.ydool.YdoolApproveOrderVo; import com.lframework.xingyun.sc.vo.ydool.YdoolApproveOrderVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
/** /**
* 云朵里库存调整单 Controller * 云朵里库存调整单 Controller
@ -41,4 +44,25 @@ public class YdoolStockAdjustSheetController extends DefaultBaseController {
stockAdjustSheetService.approve(vo); stockAdjustSheetService.approve(vo);
return InvokeResultBuilder.success(); return InvokeResultBuilder.success();
} }
/**
* 根据ID查询
*/
@ApiOperation("根据ID查询")
@ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true)
@OpenApi
@GetMapping("/detail")
public InvokeResult<StockAdjustSheetFullBo> getDetail(
@NotBlank(message = "id不能为空") String id) {
StockAdjustSheetFullDto data = stockAdjustSheetService.getDetail(id);
if (data == null) {
throw new DefaultClientException("库存调整单不存在!");
}
StockAdjustSheetFullBo result = new StockAdjustSheetFullBo(data);
return InvokeResultBuilder.success(result);
}
} }

View File

@ -758,6 +758,11 @@ public class RetailOutSheetServiceImpl extends
} }
} }
@Override
public RetailProductDto queryRetailBySku(String sku, Boolean isReturn) {
RetailProductDto data = getBaseMapper().queryRetailBySku(sku, isReturn);
return data;
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)

View File

@ -662,6 +662,13 @@ public class SaleOrderServiceImpl extends BaseMpServiceImpl<SaleOrderMapper, Sal
} }
} }
@Override
public SaleProductDto querySaleBySku(String sku, Boolean isReturn) {
SaleProductDto data = getBaseMapper().querySaleBySku(sku,
isReturn);
return data;
}
private void create(SaleOrder order, CreateSaleOrderVo vo) { private void create(SaleOrder order, CreateSaleOrderVo vo) {
StoreCenter sc = storeCenterService.findById(vo.getScId()); StoreCenter sc = storeCenterService.findById(vo.getScId());

View File

@ -239,6 +239,12 @@ public class PreTakeStockSheetServiceImpl extends
return pageResult; return pageResult;
} }
@Override
public PreTakeStockProductDto queryPreTakeStockBySku(String sku) {
PreTakeStockProductDto data = getBaseMapper().queryPreTakeStockBySku(sku);
return data;
}
@Override @Override
public void cleanCacheByKey(Serializable key) { public void cleanCacheByKey(Serializable key) {

View File

@ -491,6 +491,12 @@ public class TakeStockSheetServiceImpl extends
return pageResult; return pageResult;
} }
@Override
public TakeStockSheetProductDto queryTakeStockBySku(String planId, String sku) {
TakeStockSheetProductDto data = getBaseMapper().queryTakeStockBySku(planId, sku);
return data;
}
@Override @Override
public void cleanCacheByKey(Serializable key) { public void cleanCacheByKey(Serializable key) {

View File

@ -503,6 +503,13 @@ public class ScTransferOrderServiceImpl extends
return pageResult; return pageResult;
} }
@Override
public ScTransferProductDto queryScTransferBySku(String scId, String sku) {
ScTransferProductDto data = getBaseMapper().queryScTransferBySku(scId,
sku);
return data;
}
@Override @Override
public void cleanCacheByKey(Serializable key) { public void cleanCacheByKey(Serializable key) {

View File

@ -94,4 +94,16 @@ public interface PreTakeStockSheetMapper extends BaseMapper<PreTakeStockSheet> {
@DataPermission(template = "category", alias = "c") @DataPermission(template = "category", alias = "c")
}) })
List<PreTakeStockProductDto> queryPreTakeStockList(@Param("vo") QueryPreTakeStockProductVo vo); List<PreTakeStockProductDto> queryPreTakeStockList(@Param("vo") QueryPreTakeStockProductVo vo);
/**
* 根据SKU查询预先盘点单商品信息
* @param sku
* @return
*/
@DataPermissions(type = SysDataPermissionDataPermissionType.PRODUCT, value = {
@DataPermission(template = "product", alias = "g"),
@DataPermission(template = "brand", alias = "b"),
@DataPermission(template = "category", alias = "c")
})
PreTakeStockProductDto queryPreTakeStockBySku(@Param("sku")String sku);
} }

View File

@ -117,4 +117,17 @@ public interface RetailOutSheetMapper extends BaseMapper<RetailOutSheet> {
* @return * @return
*/ */
RetailProductDto getRetailById(String id); RetailProductDto getRetailById(String id);
/**
* 根据SKU查询可零售商品信息
*
* @param sku
* @return
*/
@DataPermissions(type = SysDataPermissionDataPermissionType.PRODUCT, value = {
@DataPermission(template = "product", alias = "g"),
@DataPermission(template = "brand", alias = "b"),
@DataPermission(template = "category", alias = "c")
})
RetailProductDto queryRetailBySku(@Param("sku")String sku, @Param("isReturn")Boolean isReturn);
} }

View File

@ -115,4 +115,17 @@ public interface SaleOrderMapper extends BaseMapper<SaleOrder> {
* @return * @return
*/ */
SaleProductDto getSaleById(String id); SaleProductDto getSaleById(String id);
/**
* 根据SKU查询
* @param sku
* @param isReturn
* @return
*/
@DataPermissions(type = SysDataPermissionDataPermissionType.PRODUCT, value = {
@DataPermission(template = "product", alias = "g"),
@DataPermission(template = "brand", alias = "b"),
@DataPermission(template = "category", alias = "c")
})
SaleProductDto querySaleBySku( @Param("sku") String sku,@Param("isReturn") Boolean isReturn);
} }

View File

@ -75,4 +75,17 @@ public interface ScTransferOrderMapper extends BaseMapper<ScTransferOrder> {
}) })
List<ScTransferProductDto> queryScTransferList( List<ScTransferProductDto> queryScTransferList(
@Param("vo") QueryScTransferProductVo vo); @Param("vo") QueryScTransferProductVo vo);
/**
* 根据SKU查询库存成本调整单商品信息
* @param scId
* @param sku
* @return
*/
@DataPermissions(type = SysDataPermissionDataPermissionType.PRODUCT, value = {
@DataPermission(template = "product", alias = "g"),
@DataPermission(template = "brand", alias = "b"),
@DataPermission(template = "category", alias = "c")
})
ScTransferProductDto queryScTransferBySku(@Param("scId")String scId, @Param("sku")String sku);
} }

View File

@ -11,9 +11,10 @@ import com.lframework.xingyun.template.core.annotations.permission.DataPermissio
import com.lframework.xingyun.template.core.annotations.sort.Sort; import com.lframework.xingyun.template.core.annotations.sort.Sort;
import com.lframework.xingyun.template.core.annotations.sort.Sorts; import com.lframework.xingyun.template.core.annotations.sort.Sorts;
import com.lframework.xingyun.template.core.components.permission.SysDataPermissionDataPermissionType; import com.lframework.xingyun.template.core.components.permission.SysDataPermissionDataPermissionType;
import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* <p> * <p>
* 盘点单 Mapper 接口 * 盘点单 Mapper 接口
@ -89,4 +90,18 @@ public interface TakeStockSheetMapper extends BaseMapper<TakeStockSheet> {
@DataPermission(template = "category", alias = "c") @DataPermission(template = "category", alias = "c")
}) })
List<TakeStockSheetProductDto> queryTakeStockList(@Param("vo") QueryTakeStockSheetProductVo vo); List<TakeStockSheetProductDto> queryTakeStockList(@Param("vo") QueryTakeStockSheetProductVo vo);
/**
* 根据SKU查询盘点单商品信息
*
* @param planId
* @param sku
* @return
*/
@DataPermissions(type = SysDataPermissionDataPermissionType.PRODUCT, value = {
@DataPermission(template = "product", alias = "g"),
@DataPermission(template = "brand", alias = "b"),
@DataPermission(template = "category", alias = "c")
})
TakeStockSheetProductDto queryTakeStockBySku(@Param("planId") String planId, @Param("sku") String sku);
} }

View File

@ -185,4 +185,12 @@ public interface RetailOutSheetService extends BaseMpService<RetailOutSheet> {
* @param vo * @param vo
*/ */
void approve(YdoolApproveOrderVo vo); void approve(YdoolApproveOrderVo vo);
/**
* 根据SKU查询零售商品信息
* @param sku
* @param isReturn
* @return
*/
RetailProductDto queryRetailBySku(String sku, Boolean isReturn);
} }

View File

@ -183,4 +183,12 @@ public interface SaleOrderService extends BaseMpService<SaleOrder> {
* @param vo * @param vo
*/ */
void approve(YdoolApproveOrderVo vo); void approve(YdoolApproveOrderVo vo);
/**
* 根据SKU查询销售商品信息
*
* @param sku
* @return
*/
SaleProductDto querySaleBySku(String sku, Boolean isReturn);
} }

View File

@ -113,4 +113,10 @@ public interface PreTakeStockSheetService extends BaseMpService<PreTakeStockShee
PageResult<PreTakeStockProductDto> queryPreTakeStockList(Integer pageIndex, Integer pageSize, PageResult<PreTakeStockProductDto> queryPreTakeStockList(Integer pageIndex, Integer pageSize,
QueryPreTakeStockProductVo vo); QueryPreTakeStockProductVo vo);
/**
* 根据SKU查询预先盘点单商品列表
* @param sku
* @return
*/
PreTakeStockProductDto queryPreTakeStockBySku(String sku);
} }

View File

@ -153,4 +153,12 @@ public interface TakeStockSheetService extends BaseMpService<TakeStockSheet> {
*/ */
PageResult<TakeStockSheetProductDto> queryTakeStockList(Integer pageIndex, Integer pageSize, PageResult<TakeStockSheetProductDto> queryTakeStockList(Integer pageIndex, Integer pageSize,
QueryTakeStockSheetProductVo vo); QueryTakeStockSheetProductVo vo);
/**
* 根据SKU查询盘点单商品信息
* @param planId
* @param sku
* @return
*/
TakeStockSheetProductDto queryTakeStockBySku(String planId, String sku);
} }

View File

@ -135,4 +135,12 @@ public interface ScTransferOrderService extends BaseMpService<ScTransferOrder> {
*/ */
PageResult<ScTransferProductDto> queryScTransferList(Integer pageIndex, Integer pageSize, PageResult<ScTransferProductDto> queryScTransferList(Integer pageIndex, Integer pageSize,
QueryScTransferProductVo vo); QueryScTransferProductVo vo);
/**
* 根据SKU查询商品列表
* @param scId
* @param sku
* @return
*/
ScTransferProductDto queryScTransferBySku(String scId, String sku);
} }

View File

@ -336,7 +336,7 @@
<include refid="PurchaseProductDto_sql"/> <include refid="PurchaseProductDto_sql"/>
WHERE g.id = #{id} WHERE g.id = #{id}
</select> </select>
<select id="queryPurchaseBySku" resultType="com.lframework.xingyun.sc.dto.purchase.PurchaseProductDto"> <select id="queryPurchaseBySku" resultMap="PurchaseProductDto">
<include refid="PurchaseProductDto_sql"/> <include refid="PurchaseProductDto_sql"/>
<where> <where>
AND g.sku_code = #{sku} AND g.sku_code = #{sku}

View File

@ -361,4 +361,15 @@
<include refid="RetailProductDto_sql"/> <include refid="RetailProductDto_sql"/>
WHERE g.id = #{id} WHERE g.id = #{id}
</select> </select>
<select id="queryRetailBySku" resultMap="RetailProductDto">
<include refid="RetailProductDto_sql"/>
<where>
AND g.sku_code = #{sku}
<if test="isReturn != null and isReturn">
AND g.product_type = 1
</if>
AND g.available = TRUE
</where>
ORDER BY g.code
</select>
</mapper> </mapper>

View File

@ -349,4 +349,16 @@
<include refid="SaleProductDto_sql"/> <include refid="SaleProductDto_sql"/>
WHERE g.id = #{id} WHERE g.id = #{id}
</select> </select>
<select id="querySaleBySku" resultMap="SaleProductDto">
<include refid="SaleProductDto_sql"/>
<where>
AND
g.sku_code = #{sku}
<if test="isReturn != null and isReturn">
AND g.product_type = 1
</if>
AND g.available = TRUE
</where>
ORDER BY g.code
</select>
</mapper> </mapper>

View File

@ -175,7 +175,7 @@
ORDER BY g.code ORDER BY g.code
</select> </select>
<select id="queryStockAdjustBySku" <select id="queryStockAdjustBySku"
resultType="com.lframework.xingyun.sc.dto.stock.adjust.stock.StockAdjustProductDto"> resultMap="StockAdjustProductDto">
<include refid="StockAdjustProductDto_sql"/> <include refid="StockAdjustProductDto_sql"/>
<where> <where>
AND g.sku_code = #{sku} AND g.sku_code = #{sku}

View File

@ -220,4 +220,13 @@
</where> </where>
ORDER BY g.code ORDER BY g.code
</select> </select>
<select id="queryPreTakeStockBySku"
resultMap="PreTakeStockProductDto">
<include refid="PreTakeStockProductDto_sql"/>
<where>
AND g.sku_code = #{sku}
AND g.product_type = 1
</where>
ORDER BY g.code
</select>
</mapper> </mapper>

View File

@ -224,4 +224,16 @@
</where> </where>
ORDER BY g.code ORDER BY g.code
</select> </select>
<select id="queryTakeStockBySku"
resultMap="TakeStockSheetProductDto">
<include refid="TakeStockSheetProductDto_sql"/>
<where>
AND g.sku_code = #{sku}
<if test="planId != null and planId != ''">
AND g.id IN (SELECT product_id FROM tbl_take_stock_plan_detail WHERE plan_id = #{planId})
</if>
AND g.product_type = 1
</where>
ORDER BY g.code
</select>
</mapper> </mapper>

View File

@ -174,4 +174,13 @@
</where> </where>
ORDER BY g.code ORDER BY g.code
</select> </select>
<select id="queryScTransferBySku"
resultMap="ScTransferProductDto">
<include refid="ScTransferProductDto_sql"/>
<where>
AND ps.sc_id = #{scId}
AND g.sku_code = #{sku}
</where>
ORDER BY g.code
</select>
</mapper> </mapper>