Commit 7169a736 by “zcwang”

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

parents 740963d5 5c00c67b
...@@ -8,6 +8,7 @@ import com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum; ...@@ -8,6 +8,7 @@ import com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum;
import com.netease.mail.yanxuan.change.dal.entity.ChangeConfig; import com.netease.mail.yanxuan.change.dal.entity.ChangeConfig;
import com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeCommanderPO; import com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeCommanderPO;
import com.netease.mail.yanxuan.change.dal.meta.model.rpc.GoodsResponseSqeRpc; import com.netease.mail.yanxuan.change.dal.meta.model.rpc.GoodsResponseSqeRpc;
import com.netease.mail.yanxuan.change.integration.flow.PfuApiRpcService;
import com.netease.mail.yanxuan.change.integration.flow.QcApiRpcService; import com.netease.mail.yanxuan.change.integration.flow.QcApiRpcService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -28,6 +29,9 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -28,6 +29,9 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
@Autowired @Autowired
private QcApiRpcService qcApiRpcService; private QcApiRpcService qcApiRpcService;
@Autowired
private PfuApiRpcService pfuApiRpcService;
@Override @Override
public String queryCommanderInfo(ChangeCommanderPO changeCommander) { public String queryCommanderInfo(ChangeCommanderPO changeCommander) {
//获取模板名称 //获取模板名称
...@@ -58,7 +62,7 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -58,7 +62,7 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
* @param commander 商品的关联角色 * @param commander 商品的关联角色
* @return * @return
*/ */
private String queryGoodsCommander(ChangeCommanderEnum commanderEnum,List<String> goodsInfos,String commander){ private String queryGoodsCommander(ChangeCommanderEnum commanderEnum,List<Long> goodsInfos,String commander){
if (commanderEnum.getId() != 3 || goodsInfos == null || goodsInfos.size() == 0 || commander == null){ if (commanderEnum.getId() != 3 || goodsInfos == null || goodsInfos.size() == 0 || commander == null){
return "类型错误 或者未选择商品"; return "类型错误 或者未选择商品";
} }
...@@ -70,15 +74,20 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -70,15 +74,20 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
//记录出现的所有值 //记录出现的所有值
List<String> commanders = new ArrayList<String>(); List<String> commanders = new ArrayList<String>();
//遍历取出所有商品关联的人 //遍历取出所有商品关联的人
for (String goods:goodsInfos) { if (commander.equals("商品BU")) {
if (commander.equals("商品BU")) {
} else if (commander.equals("采购")) { } else if (commander.equals("采购")) {
} else if (commander.equals("计划")) { } else if (commander.equals("计划")) {
String detail = pfuApiRpcService.getDetail(goodsInfos);
} else if (commander.equals("SQE")) { JSONObject jsonObject = JSONObject.parseObject(detail);
String detail = qcApiRpcService.getDetail(Integer.valueOf(goods)); Map<String,JSONObject> rpcMap = JSONObject.parseObject(jsonObject.get("data").toString(), Map.class);
for (String rpc : rpcMap.keySet()){
commanders.add(rpcMap.get(rpc).get("uid").toString());
}
} else if (commander.equals("SQE")) {
for (Long goods:goodsInfos) {
String detail = qcApiRpcService.getDetail(goods.intValue());
JSONObject jsonObject = JSONObject.parseObject(detail); JSONObject jsonObject = JSONObject.parseObject(detail);
GoodsResponseSqeRpc data = jsonObject.getObject("data", GoodsResponseSqeRpc.class); GoodsResponseSqeRpc data = jsonObject.getObject("data", GoodsResponseSqeRpc.class);
if (data != null){ if (data != null){
......
...@@ -25,6 +25,6 @@ public class ChangeCommanderPO { ...@@ -25,6 +25,6 @@ public class ChangeCommanderPO {
/** /**
* 商品信息 * 商品信息
*/ */
private List<String> goodsInfos; private List<Long> goodsInfos;
} }
package com.netease.mail.yanxuan.change.integration.flow;
import com.netease.yanxuan.missa.client.annotation.MissaClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author WangJiaXiang
* @date 2022/11/24/024$
* 查询商品BU
*/
@Service
@MissaClient(serviceCode = "yanxuan-itemcenter-admin")
public interface ItemcenterApiRpcService {
/**
* 根据商品Id 查询商品BU
* @param goodsId
* @return
*/
@PostMapping(value = "/yxicadmin/api/xhr/item/group/itemIds.json")
String getDetail(@RequestBody List<Long> goodsId);
}
...@@ -5,6 +5,7 @@ import com.netease.mail.yanxuan.change.common.bean.AjaxResult; ...@@ -5,6 +5,7 @@ import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.netease.mail.yanxuan.change.biz.service.change.AdminChangeConfigService; import com.netease.mail.yanxuan.change.biz.service.change.AdminChangeConfigService;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeConfigQueryReq; import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeConfigQueryReq;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeConfigReq; import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeConfigReq;
import com.netease.mail.yanxuan.change.integration.flow.ItemcenterApiRpcService;
import com.netease.mail.yanxuan.change.integration.flow.PfuApiRpcService; import com.netease.mail.yanxuan.change.integration.flow.PfuApiRpcService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -106,10 +107,13 @@ public class ChangeConfigController { ...@@ -106,10 +107,13 @@ public class ChangeConfigController {
@Autowired @Autowired
private PfuApiRpcService pfuApiRpcService; private PfuApiRpcService pfuApiRpcService;
@Autowired
private ItemcenterApiRpcService itemcenterApiRpcService;
@PostMapping("/test") @PostMapping("/test")
public String queryExecuteUserByItemId(@RequestBody List<Long> goodsId){ public String queryExecuteUserByItemId(@RequestBody List<Long> goodsId){
String detail = pfuApiRpcService.getDetail(goodsId); String detail = itemcenterApiRpcService.getDetail(goodsId);
JSONObject jsonObject = JSONObject.parseObject(detail); JSONObject jsonObject = JSONObject.parseObject(detail);
Map<String,JSONObject> map = JSONObject.parseObject(jsonObject.get("data").toString(), Map.class); Map<String,JSONObject> map = JSONObject.parseObject(jsonObject.get("data").toString(), Map.class);
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
......
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