|
@@ -18,6 +18,7 @@ import com.abi.qms.platform.dao.vo.result.ListInspectionCaseVO;
|
|
|
import com.abi.qms.platform.dao.vo.result.ListRoleVO;
|
|
|
import com.abi.qms.platform.dto.req.*;
|
|
|
import com.abi.qms.platform.dto.res.*;
|
|
|
+import com.abi.qms.platform.feign.SkuFeign;
|
|
|
import com.abi.qms.platform.infrastructure.util.AssertUtil;
|
|
|
import com.abi.qms.platform.infrastructure.util.PageUtil;
|
|
|
import com.abi.qms.platform.service.FlowQueryService;
|
|
@@ -31,9 +32,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import io.swagger.models.auth.In;
|
|
|
import jodd.util.StringUtil;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
import java.time.LocalDateTime;
|
|
@@ -68,6 +71,9 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
|
|
|
@Autowired
|
|
|
private FlowQueryService flowQueryService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SkuFeign skuFeign;
|
|
|
+
|
|
|
/**
|
|
|
* 新增案件
|
|
|
*
|
|
@@ -177,12 +183,34 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
|
|
|
*/
|
|
|
@Override
|
|
|
public PageListInspectionCaseRes pageListQuery(PageListInspectionCaseReq pageListReq) {
|
|
|
+ // sku编码或名称
|
|
|
+ String skuInfo = pageListReq.getSkuInfo();
|
|
|
+ if (StringUtils.isNotBlank(skuInfo)) {
|
|
|
+ List<SkuFeign.Sku> skuList = skuFeign.likeQuerySkuByCodeOrName(skuInfo);
|
|
|
+ List<String> skuCodeList = skuList.stream().map(sku -> sku.getSkuCode()).collect(Collectors.toList());
|
|
|
+ if (CollectionUtils.isEmpty(skuCodeList)) {
|
|
|
+ skuCodeList = new ArrayList<>();
|
|
|
+ // 查询不到
|
|
|
+ skuCodeList.add("-1");
|
|
|
+ }
|
|
|
+ pageListReq.setSkuCodeList(skuCodeList);
|
|
|
+ }
|
|
|
+
|
|
|
IPage<ListInspectionCaseVO> pageResult = inspectionCaseMapper.pageListQuery(PageUtil.createPage(pageListReq), pageListReq);
|
|
|
List<ListInspectionCaseVO> inspectionCaseVOList = pageResult.getRecords();
|
|
|
|
|
|
//转换类型
|
|
|
List<PageListInspectionCaseRes.InspectionCaseBean> inspectionCaseBeanList = inspectionCaseVOList.stream()
|
|
|
.parallel().map(s -> {
|
|
|
+ // 查询sku
|
|
|
+ String skuCode = s.getSkuCode();
|
|
|
+ if (StringUtils.isNotBlank(skuCode)) {
|
|
|
+ SkuFeign.Sku sku = skuFeign.getSkuByCode(skuCode);
|
|
|
+ if (sku != null) {
|
|
|
+ s.setSkuName(sku.getSkuName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
PageListInspectionCaseRes.InspectionCaseBean inspectionCaseBean = new PageListInspectionCaseRes.InspectionCaseBean();
|
|
|
BeanUtil.copyProperties(s, inspectionCaseBean);
|
|
|
//经销商
|
|
@@ -318,6 +346,15 @@ public class InspectionCaseServiceImpl implements IInspectionCaseService {
|
|
|
InspectionCaseDetailVO caseDetailVO = inspectionCaseMapper.selectInspectionCaseDetailById(id);
|
|
|
AssertUtil.isNull(caseDetailVO, "此案件未查询到!");
|
|
|
|
|
|
+ //查询sku
|
|
|
+ String skuCode = caseDetailVO.getSkuCode();
|
|
|
+ if (StringUtils.isNotBlank(skuCode)) {
|
|
|
+ SkuFeign.Sku sku = skuFeign.getSkuByCode(skuCode);
|
|
|
+ if (sku != null) {
|
|
|
+ caseDetailVO.setSkuName(sku.getSkuName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
GetInspectionCaseInfoRes getInspectionCaseInfoRes = new GetInspectionCaseInfoRes();
|
|
|
BeanUtil.copyProperties(caseDetailVO, getInspectionCaseInfoRes);
|
|
|
|