|
@@ -20,6 +20,7 @@ import com.fjhx.utils.Assert;
|
|
|
import com.fjhx.utils.FileClientUtil;
|
|
|
import com.fjhx.utils.wrapperUtil.IWrapper;
|
|
|
import com.fjhx.utils.wrapperUtil.KeywordData;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.system.entity.Dept;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
@@ -100,7 +101,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
|
|
|
// 查询库存量
|
|
|
if (Func.isNotEmpty(condition.get("warehouseId"))) {
|
|
|
- //产品ID集合
|
|
|
+ // 产品ID集合
|
|
|
List<Long> ids = page.getRecords().stream().map(item -> Convert.toLong(item.get("id"))).distinct().collect(Collectors.toList());
|
|
|
List<Stock> stocks = stockService.lambdaQuery().eq(Stock::getWarehouseId, condition.get("warehouseId")).in(Stock::getGoodsId, ids).list();
|
|
|
if (Func.isNotEmpty(stocks)) {
|
|
@@ -108,6 +109,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 产品部门
|
|
|
for (Map<String, Object> record : records) {
|
|
|
Dept dept = deptMap.get(Convert.toLong(record.get("deptId")));
|
|
|
record.put("deptName", dept == null ? "" : dept.getDeptName());
|
|
@@ -125,7 +127,14 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
@Override
|
|
|
public void add(ProductInfoVo productInfoVo) {
|
|
|
|
|
|
+ Long deptId = 0L;
|
|
|
+ String deptIdStr = AuthUtil.getDeptId();
|
|
|
+ if (ObjectUtil.isNotEmpty(deptIdStr)) {
|
|
|
+ deptId = Convert.toLong(deptIdStr.split(",")[0]);
|
|
|
+ }
|
|
|
+
|
|
|
productInfoVo.setComputingTime(new Date());
|
|
|
+ productInfoVo.setDeptId(deptId);
|
|
|
|
|
|
synchronized (this) {
|
|
|
if (productInfoVo.getDefinition() != null && productInfoVo.getDefinition().equals(1)) {
|