|
|
@@ -12,7 +12,10 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
-import org.jeecg.modules.kc.entity.KcStockDetail;
|
|
|
+import org.jeecg.modules.kc.entity.*;
|
|
|
+import org.jeecg.modules.kc.enums.StorageEnum;
|
|
|
+import org.jeecg.modules.kc.service.IKcDepositoryInGoodsService;
|
|
|
+import org.jeecg.modules.kc.service.IKcGoodsService;
|
|
|
import org.jeecg.modules.kc.service.IKcStockDetailService;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -20,6 +23,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
+import org.jeecg.modules.kc.service.IKcSupplierInGoodsService;
|
|
|
+import org.jeecg.modules.rooms.entity.CesGoodsUnit;
|
|
|
+import org.jeecg.modules.rooms.service.CesGoodsUnitServiceImpl;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
@@ -50,7 +56,12 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
public class KcStockDetailController extends JeecgController<KcStockDetail, IKcStockDetailService> {
|
|
|
@Autowired
|
|
|
private IKcStockDetailService kcStockDetailService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private IKcGoodsService kcGoodsService;
|
|
|
+ @Autowired
|
|
|
+ private CesGoodsUnitServiceImpl cesGoodsUnitService;
|
|
|
+ @Autowired
|
|
|
+ private IKcSupplierInGoodsService kcSupplierInGoodsService;
|
|
|
/**
|
|
|
* 分页列表查询
|
|
|
*
|
|
|
@@ -70,9 +81,23 @@ public class KcStockDetailController extends JeecgController<KcStockDetail, IKcS
|
|
|
QueryWrapper<KcStockDetail> queryWrapper = QueryGenerator.initQueryWrapper(kcStockDetail, req.getParameterMap());
|
|
|
Page<KcStockDetail> page = new Page<KcStockDetail>(pageNo, pageSize);
|
|
|
IPage<KcStockDetail> pageList = kcStockDetailService.page(page, queryWrapper);
|
|
|
+ pageList.getRecords().forEach(item -> {
|
|
|
+ KcSupplierInGoods kcSupplierInGoods = kcSupplierInGoodsService.getById(item.getSupplierInGoodsId());
|
|
|
+ if (kcSupplierInGoods != null) {
|
|
|
+ KcGoods kcGoods = kcGoodsService.getById(kcSupplierInGoods.getGoodsId());
|
|
|
+ if (kcGoods != null) {
|
|
|
+ item.setSpec(kcGoods.getSpec());
|
|
|
+ item.setName(kcGoods.getName());
|
|
|
+ CesGoodsUnit cesGoodsUnit = cesGoodsUnitService.getById(kcGoods.getGoodUnit());
|
|
|
+ if (cesGoodsUnit != null) {
|
|
|
+ item.setGoodUnit(cesGoodsUnit.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 添加
|
|
|
*
|
|
|
@@ -87,7 +112,7 @@ public class KcStockDetailController extends JeecgController<KcStockDetail, IKcS
|
|
|
kcStockDetailService.save(kcStockDetail);
|
|
|
return Result.OK("添加成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 编辑
|
|
|
*
|
|
|
@@ -102,7 +127,7 @@ public class KcStockDetailController extends JeecgController<KcStockDetail, IKcS
|
|
|
kcStockDetailService.updateById(kcStockDetail);
|
|
|
return Result.OK("编辑成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 通过id删除
|
|
|
*
|
|
|
@@ -117,7 +142,7 @@ public class KcStockDetailController extends JeecgController<KcStockDetail, IKcS
|
|
|
kcStockDetailService.removeById(id);
|
|
|
return Result.OK("删除成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 批量删除
|
|
|
*
|
|
|
@@ -132,7 +157,7 @@ public class KcStockDetailController extends JeecgController<KcStockDetail, IKcS
|
|
|
this.kcStockDetailService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
return Result.OK("批量删除成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 通过id查询
|
|
|
*
|