Commit f60128ee by jx-art

Merge remote-tracking branch 'origin/feature-changeFlow-221110' into feature-changeFlow-221110

parents 6d4d2bf9 df9a2c6d
......@@ -70,6 +70,7 @@ import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowFile;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowListQueryReq;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowSubmitReq;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.BasicChangeFlowVO;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.CategoryInfoVO;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowExecVO;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowListVO;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowVO;
......@@ -589,15 +590,48 @@ public class ChangeFlowBiz {
List<Long> itemIds = itemList.stream().map(ItemVO::getItemId).collect(Collectors.toList());
// 批量查询spu信息
List<SpuTO> spuTOS = itemService.batchQuerySpuInfo(BatchQuerySpuInfoParam.builder().ids(itemIds)
.commonProps(new ArrayList<>()).spuProps(new ArrayList<>()).build());
.commonProps(new ArrayList<>()).spuProps(new ArrayList<>()).build());
// 批量查询物理类目
Map<Long, List<SimplePhyCateGoryResultCo>> categoryChain = itemService
.queryBySpuIds(CommonIdsParamQuery.builder().ids(itemIds).build());
// 批量查询品控类目
List<ItemBasicInfoVO> itemBasicInfoVOList = new ArrayList<>();
.queryBySpuIds(CommonIdsParamQuery.builder().ids(itemIds).build());
List<ItemBasicInfoVO> itemBasicInfoVOS = itemList.stream().map(itemVO -> {
ItemBasicInfoVO itemBasicInfoVO = new ItemBasicInfoVO();
Long itemId = itemVO.getItemId();
itemBasicInfoVO.setItemId(itemId);
itemBasicInfoVO.setItemName(itemVO.getItemName());
itemBasicInfoVO.setQcCategory(null);
List<SimplePhyCateGoryResultCo> simplePhyCateGoryResultCos = categoryChain.get(itemId);
if (CollectionUtils.isEmpty(simplePhyCateGoryResultCos)) {
throw ExceptionFactory.createBiz(ResponseCode.THIRD_ERR, "未查询到物理类目");
}
List<CategoryInfoVO> categoryInfoVOS = simplePhyCateGoryResultCos.stream().map(phy -> {
CategoryInfoVO categoryInfoVO = new CategoryInfoVO();
categoryInfoVO.setId(phy.getId());
categoryInfoVO.setName(phy.getName());
return categoryInfoVO;
}).collect(Collectors.toList());
itemBasicInfoVO.setPhyCategory(categoryInfoVOS);
Optional<SpuTO> optionalSpuTO = spuTOS.stream().filter(spu -> spu.getId() == itemId).findAny();
if (!optionalSpuTO.isPresent()) {
throw ExceptionFactory.createBiz(ResponseCode.THIRD_ERR, "未查询到商品详情");
}
SpuTO spuTO = optionalSpuTO.get();
Map<String, String> propertyMap = spuTO.getPropertyMap();
itemBasicInfoVO.setItemSetupType(Integer.valueOf(propertyMap.get("itemSetupType")));
String businessForm = propertyMap.get("businessForm");
int business = StringUtils.isBlank(businessForm) ? 0 : Integer.parseInt(businessForm);
itemBasicInfoVO.setBusinessForm(business);
itemBasicInfoVO.setStatus(spuTO.getStatus());
itemBasicInfoVO.setProjectCommander(null);
itemBasicInfoVO.setPurchaseCommander(null);
itemBasicInfoVO.setSQECommander(null);
itemBasicInfoVO.setPlanCommander(null);
return itemBasicInfoVO;
}).collect(Collectors.toList());
changeFlowVO.setItemBasicInfoList(itemBasicInfoVOS);
}
} else {
changeFlowVO.setItemBasicInfoList(null);
}
changeFlowVO.setChangeState(changeRecord.getState());
changeFlowVO.setChangeCreator(changeRecord.getCreator());
......
/**
* @(#)QCService.java, 2022/12/2.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.biz.service.rpc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.netease.mail.yanxuan.change.integration.qc.QcRpcService;
import com.netease.mail.yanxuan.change.integration.qc.meta.QcCategoryVO;
import lombok.extern.slf4j.Slf4j;
/**
* @Author zcwang
* @Date 2022/12/2
*/
@Slf4j
@Component
public class QCService {
@Autowired
private QcRpcService qcRpcService;
public QcCategoryVO getQcCategoryListByItemId(Long itemId) {
log.info("[QCService-getQcCategoryListByItemId] request of query={}", itemId);
AjaxResult<QcCategoryVO> response = qcRpcService.getQcCategoryListByItemId(itemId);
log.info("[QCService-getQcCategoryListByItemId] response of query QcCategoryList ={}",
JSON.toJSONString(response));
if (Boolean.TRUE.equals(response.isSuccess())) {
return response.getData();
}
log.error("[op:rpc-getQcCategoryListByItemId] query QcCategoryList failed, query={}, errMsg={}", itemId,
response.getMsg());
return null;
}
}
\ No newline at end of file
/**
* @(#)ProfitTypeEnum.java, 2022/12/2.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.common.enums;
/**
* @Author zcwang
* @Date 2022/12/2
*/
public enum ProfitTypeEnum {
RISK_CONTROL(1, "风险控制类"),
REDUCE_COST(2, "降本类"),
PRODUCT_IMPROVE(3, "商品改善"),
REPLACE_CERTIFICATES_WHEN_EXPIRE(4, "证件到期更换"),
OTHER(5, "其他"),
NO(6, "无");
private Integer type;
private String desc;
ProfitTypeEnum(Integer type, String desc) {
this.type = type;
this.desc = desc;
}
public Integer getType() {
return type;
}
}
\ No newline at end of file
/**
* @(#)QCRpcService.java, 2022/12/2.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.integration.qc;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.netease.mail.yanxuan.change.integration.qc.meta.QcCategoryVO;
import com.netease.yanxuan.missa.client.annotation.MissaClient;
/**
* @Author zcwang
* @Date 2022/12/2
*/
@Service
@MissaClient(serviceCode = "yanxuan-qc-api")
public interface QcRpcService {
@PostMapping("/xhr/item/getQcCategoryListByItemId.json")
AjaxResult<QcCategoryVO> getQcCategoryListByItemId(Long itemId);
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.integration.item.meta;
package com.netease.mail.yanxuan.change.integration.qc.meta;
import java.io.Serializable;
......
......@@ -4,7 +4,7 @@
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.integration.item.meta;
package com.netease.mail.yanxuan.change.integration.qc.meta;
import java.util.List;
......@@ -25,8 +25,7 @@ public class QcCategoryVO extends QcCategory {
public static QcCategoryVO init(QcCategory qcCategory) {
QcCategoryVO qcCategoryVO = new QcCategoryVO();
//编译报错临时添加。。。。。。。
//BeanUtils.copy(qcCategory, qcCategoryVO);
BeanUtils.copyProperties(qcCategory, qcCategoryVO);
qcCategoryVO.setChildren(Lists.newArrayList());
return qcCategoryVO;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment