parent
8d31889ccf
commit
f96b5701f4
|
|
@ -6,16 +6,19 @@ import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.lang.TypeReference;
|
import cn.hutool.core.lang.TypeReference;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.nflg.product.base.core.api.BaseApi;
|
import com.nflg.product.base.core.api.BaseApi;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||||
import com.nflg.product.bomnew.constant.ReportConstant;
|
import com.nflg.product.bomnew.constant.ReportConstant;
|
||||||
|
import com.nflg.product.bomnew.pojo.entity.MaterialMainEntity;
|
||||||
import com.nflg.product.bomnew.pojo.query.ChildBomReportQuery;
|
import com.nflg.product.bomnew.pojo.query.ChildBomReportQuery;
|
||||||
import com.nflg.product.bomnew.pojo.query.CompareReportQuery;
|
import com.nflg.product.bomnew.pojo.query.CompareReportQuery;
|
||||||
import com.nflg.product.bomnew.pojo.query.ReverseReportQuery;
|
import com.nflg.product.bomnew.pojo.query.ReverseReportQuery;
|
||||||
import com.nflg.product.bomnew.pojo.vo.*;
|
import com.nflg.product.bomnew.pojo.vo.*;
|
||||||
import com.nflg.product.bomnew.service.CompareReportService;
|
import com.nflg.product.bomnew.service.CompareReportService;
|
||||||
import com.nflg.product.bomnew.service.ForwardReportService;
|
import com.nflg.product.bomnew.service.ForwardReportService;
|
||||||
|
import com.nflg.product.bomnew.service.MaterialMainService;
|
||||||
import com.nflg.product.bomnew.service.ReverseReportService;
|
import com.nflg.product.bomnew.service.ReverseReportService;
|
||||||
import com.nflg.product.bomnew.util.EecExcelUtil;
|
import com.nflg.product.bomnew.util.EecExcelUtil;
|
||||||
import com.nflg.product.bomnew.util.VUtils;
|
import com.nflg.product.bomnew.util.VUtils;
|
||||||
|
|
@ -34,7 +37,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Api(tags = "BOM-报表接口")
|
@Api(tags = "BOM-报表接口")
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -50,6 +56,8 @@ public class BomReportApi extends BaseApi {
|
||||||
@Resource
|
@Resource
|
||||||
CompareReportService compareReportService;
|
CompareReportService compareReportService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
MaterialMainService materialMainService;
|
||||||
|
|
||||||
@PostMapping("reverseReport")
|
@PostMapping("reverseReport")
|
||||||
@ApiOperation("bom-反查")
|
@ApiOperation("bom-反查")
|
||||||
|
|
@ -123,8 +131,15 @@ public class BomReportApi extends BaseApi {
|
||||||
if (resultVO != null) {
|
if (resultVO != null) {
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
//物料描述从 物料主数据获取 by 10002327 240926
|
||||||
return ResultVO.success(forwardReportService.factoryBomType(query));
|
ReportBomVO r = forwardReportService.factoryBomType(query);
|
||||||
|
if(!r.getChildNodes().isEmpty()){
|
||||||
|
Set<String> materialNoSet = r.getChildNodes().stream().map(BaseMaterialVO::getMaterialNo).collect(Collectors.toSet());
|
||||||
|
List<MaterialMainEntity> materialMainList = materialMainService.list(Wrappers.<MaterialMainEntity>lambdaQuery().in(MaterialMainEntity::getMaterialNo,materialNoSet));
|
||||||
|
Map<String,String> materialMainMap = materialMainList.stream().collect(Collectors.toMap(MaterialMainEntity::getMaterialNo,MaterialMainEntity::getMaterialDesc,(k1, k2)->k1));
|
||||||
|
r.getChildNodes().forEach(c -> c.setMaterialDesc(materialMainMap.getOrDefault(c.getMaterialNo(),c.getMaterialDesc())));
|
||||||
|
}
|
||||||
|
return ResultVO.success(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,12 +99,12 @@ public class DQBomApi extends BaseApi {
|
||||||
@ApiOperation("分页查询数据")
|
@ApiOperation("分页查询数据")
|
||||||
public ResultVO<Page<BomNewDQbomVO>> getPageList(@Valid @RequestBody @NotNull BomNewDQbomPageQuery query) {
|
public ResultVO<Page<BomNewDQbomVO>> getPageList(@Valid @RequestBody @NotNull BomNewDQbomPageQuery query) {
|
||||||
// 电气BOM正式表查询无须添加时间条件 by 10002327 240918
|
// 电气BOM正式表查询无须添加时间条件 by 10002327 240918
|
||||||
// if (query.getStatus() == 2) {
|
if (query.getStatus() == 2) {
|
||||||
// if (StrUtil.isBlank(query.getStartDate()) && StrUtil.isBlank(query.getEndDate())) {
|
if (StrUtil.isAllBlank(query.getDrawingNo(),query.getMaterialNo(),query.getMaterialName(),query.getStartDate(),query.getEndDate())) {
|
||||||
// query.setStartDate(LocalDateTimeUtil.format(LocalDateTime.now().plusDays(-2), "yyyy-MM-dd"));
|
query.setStartDate(LocalDateTimeUtil.format(LocalDateTime.now().plusDays(-2), "yyyy-MM-dd"));
|
||||||
// query.setEndDate(LocalDateTimeUtil.format(LocalDateTime.now().plusDays(1), "yyyy-MM-dd"));
|
query.setEndDate(LocalDateTimeUtil.format(LocalDateTime.now().plusDays(1), "yyyy-MM-dd"));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
return ResultVO.success(dQBomService.getPageList(query));
|
return ResultVO.success(dQBomService.getPageList(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue