|
|
|
@ -13,9 +13,11 @@ import jnpf.entity.*;
|
|
|
|
|
import jnpf.util.*;
|
|
|
|
|
import jnpf.model.yysinventoryquery.*;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
@ -56,6 +58,9 @@ public class YysInventoryQueryController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private YysInventoryQueryService yysInventoryQueryService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private YysMaterialClassService yysMaterialClassService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 列表
|
|
|
|
@ -68,9 +73,14 @@ public class YysInventoryQueryController {
|
|
|
|
|
public ActionResult list(@RequestBody YysInventoryQueryPagination yysInventoryQueryPagination) throws IOException {
|
|
|
|
|
List<YysInventoryQueryEntity> list = yysInventoryQueryService.getList(yysInventoryQueryPagination);
|
|
|
|
|
List<Map<String, Object>> realList = new ArrayList<>();
|
|
|
|
|
List<YysMaterialClassEntity> list1 = yysMaterialClassService.list();
|
|
|
|
|
Map<String, String> collect = list1.stream().collect(Collectors.toMap(YysMaterialClassEntity::getClassId, YysMaterialClassEntity::getClassName));
|
|
|
|
|
for (YysInventoryQueryEntity entity : list) {
|
|
|
|
|
Map<String, Object> yysInventoryQueryMap = JsonUtil.entityToMap(entity);
|
|
|
|
|
yysInventoryQueryMap.put("id", yysInventoryQueryMap.get("id"));
|
|
|
|
|
if (MapUtils.isNotEmpty(collect) && collect.containsKey(entity.getMaterialClassification())) {
|
|
|
|
|
yysInventoryQueryMap.put("materialClassification", collect.get(entity.getMaterialClassification()));
|
|
|
|
|
}
|
|
|
|
|
//副表数据
|
|
|
|
|
//子表数据
|
|
|
|
|
realList.add(yysInventoryQueryMap);
|
|
|
|
|