|
@@ -27,6 +27,7 @@ import lombok.AllArgsConstructor;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
|
|
|
|
|
|
+import org.springblade.client.entity.CorpsDesc;
|
|
|
import org.springblade.core.excel.util.ExcelUtil;
|
|
import org.springblade.core.excel.util.ExcelUtil;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
@@ -41,6 +42,7 @@ import org.springblade.salesPart.entity.PjProductLaunch;
|
|
|
import org.springblade.salesPart.excel.CorpsDescExportExcel;
|
|
import org.springblade.salesPart.excel.CorpsDescExportExcel;
|
|
|
import org.springblade.salesPart.excel.StockExportExcel;
|
|
import org.springblade.salesPart.excel.StockExportExcel;
|
|
|
import org.springblade.salesPart.goods.service.IGoodsDescService;
|
|
import org.springblade.salesPart.goods.service.IGoodsDescService;
|
|
|
|
|
+import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import org.springblade.salesPart.entity.PjStockDesc;
|
|
import org.springblade.salesPart.entity.PjStockDesc;
|
|
@@ -48,6 +50,7 @@ import org.springblade.salesPart.vo.StockDescVO;
|
|
|
import org.springblade.salesPart.stock.service.IStockDescService;
|
|
import org.springblade.salesPart.stock.service.IStockDescService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -64,7 +67,7 @@ import java.util.List;
|
|
|
public class StockDescController extends BladeController {
|
|
public class StockDescController extends BladeController {
|
|
|
|
|
|
|
|
private final IStockDescService stockDescService;
|
|
private final IStockDescService stockDescService;
|
|
|
- private final IGoodsDescService goodsDescService;
|
|
|
|
|
|
|
+ private final IProductLaunchService productLaunchService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 详情
|
|
* 详情
|
|
@@ -190,4 +193,43 @@ public class StockDescController extends BladeController {
|
|
|
List<PjStockDesc> list = stockDescService.list(lambdaQueryWrapper);
|
|
List<PjStockDesc> list = stockDescService.list(lambdaQueryWrapper);
|
|
|
return R.data(list);
|
|
return R.data(list);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获得未导入到上架管理的库存账
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/getStockList")
|
|
|
|
|
+ @ApiOperationSupport(order = 11)
|
|
|
|
|
+ @ApiOperation(value = "获得未导入到上架管理的库存账", notes = "传入stockDesc")
|
|
|
|
|
+ public R<List<PjStockDesc>> stock(PjStockDesc stockDesc) {
|
|
|
|
|
+ List<PjStockDesc> list = stockDescService.getStockList(stockDesc);
|
|
|
|
|
+
|
|
|
|
|
+ //获得上架管理
|
|
|
|
|
+ LambdaQueryWrapper<PjProductLaunch> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
|
|
|
|
|
+ .eq(PjProductLaunch::getIsDeleted, 0)
|
|
|
|
|
+ .eq(PjProductLaunch::getSalesCompanyId, AuthUtil.getDeptId())
|
|
|
|
|
+ .eq(PjProductLaunch::getBillType, 0);
|
|
|
|
|
+ List<PjProductLaunch> productLaunches = productLaunchService.list(queryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(list)){
|
|
|
|
|
+ list.forEach(e -> {
|
|
|
|
|
+ PjProductLaunch launch = productLaunches.stream().filter(productLaunch -> productLaunch.getGoodsId().equals(e.getGoodsId())).findFirst().orElse(null);
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(launch)){
|
|
|
|
|
+ list.remove(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return R.data(list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 导入库存信息生成上架
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("/submitProductLaunch")
|
|
|
|
|
+ @ApiOperationSupport(order = 12)
|
|
|
|
|
+ @ApiOperation(value = "导入库存信息生成上架", notes = "传入stockDesc")
|
|
|
|
|
+ public R submitProductLaunch(@Valid @RequestBody PjStockDesc stockDesc) {
|
|
|
|
|
+ return stockDescService.submitProductLaunch(stockDesc);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|