| | |
| | | package com.consum.base.controller; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import io.swagger.annotations.Api; |
| | | |
| | | @Api(value = "物品型号", tags = "物品型号") |
| | | @RestController |
| | | @RequestMapping("/pc/warehouse/procureModel") |
| | | public class LWhProcureModelController extends BaseController { |
| | |
| | | LWhProcureModelQry param2 = new LWhProcureModelQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | List<Map<String, Object>> ffOrderByGoodsIdAndDept = lWhProcureModelService.getFfOrderByGoodsIdAndDept(param.getBaseGoodsTemplateId(), param.getDepartmentId()); |
| | | List<Map<String, Object>> ffOrderByGoodsIdAndDept = |
| | | lWhProcureModelService.getFfOrderByGoodsIdAndDept(param.getBaseGoodsTemplateId(), param.getDepartmentId()); |
| | | if (CollectionUtils.isEmpty(ffOrderByGoodsIdAndDept)) { |
| | | return ResponseValue.success(); |
| | | } |
| | |
| | | LWhProcureModelQry param2 = new LWhProcureModelQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | List<Map<String, Object>> ffOrderByGoodsIdAndDept = lWhProcureModelService.getGoodsUseInfoByFfOrderAndGoodId(param.getBaseGoodsTemplateId(), param.getTransBusinessId()); |
| | | List<Map<String, Object>> ffOrderByGoodsIdAndDept = lWhProcureModelService |
| | | .getGoodsUseInfoByFfOrderAndGoodId(param.getBaseGoodsTemplateId(), param.getTransBusinessId()); |
| | | if (CollectionUtils.isEmpty(ffOrderByGoodsIdAndDept)) { |
| | | return ResponseValue.success(); |
| | | } |
| | | // 按型号分组返回 |
| | | return ResponseValue.success(ffOrderByGoodsIdAndDept.stream() |
| | | .collect(Collectors.groupingBy(map -> map.get("baseGoodsModelsId")))); |
| | | return ResponseValue.success( |
| | | ffOrderByGoodsIdAndDept.stream().collect(Collectors.groupingBy(map -> map.get("baseGoodsModelsId")))); |
| | | } |
| | | |
| | | |
| | | } |