修改对接接口
This commit is contained in:
+2
-2
@@ -75,11 +75,11 @@ public class SrmsApiController {
|
||||
@PostMapping("/getByLawsProductDesign")
|
||||
public JSONObject getByLawsProductDesign(@RequestBody JSONObject json, HttpServletRequest req){
|
||||
try {
|
||||
Result<List<ProductDesign>> re = srmsApiService.getByLawsProductDesign(json,req);
|
||||
Result<List<JSONObject>> re = srmsApiService.getByLawsProductDesign(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr(re.getMessage()));
|
||||
}
|
||||
List<ProductDesign> list = re.getResult();
|
||||
List<JSONObject> list = re.getResult();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
jsonResponses.put("Rows",list);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
|
||||
+1
-2
@@ -3,7 +3,6 @@ package com.jero.modules.docking.srms.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.docking.srms.dto.ProductDesign;
|
||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||
import com.jero.modules.docking.srms.vo.StandardPageVO;
|
||||
import com.jero.modules.docking.srms.vo.StandardTree;
|
||||
@@ -45,7 +44,7 @@ public interface SrmsApiService {
|
||||
* @param req
|
||||
* @return com.jero.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
||||
*/
|
||||
Result<List<ProductDesign>> getByLawsProductDesign(JSONObject json, HttpServletRequest req);
|
||||
Result<List<JSONObject>> getByLawsProductDesign(JSONObject json, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 获取所有体系数据
|
||||
|
||||
+27
-20
@@ -282,7 +282,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<ProductDesign>> getByLawsProductDesign(JSONObject json, HttpServletRequest req) {
|
||||
public Result<List<JSONObject>> getByLawsProductDesign(JSONObject json, HttpServletRequest req) {
|
||||
// 验证token
|
||||
String token = req.getHeader(X_ACCESS_TOKEN);
|
||||
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
||||
@@ -311,11 +311,17 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
listProductDesign.add(productDesign);
|
||||
}
|
||||
try {
|
||||
List<JSONObject> listObj = new ArrayList<>();
|
||||
for (ProductDesign productDesign : listProductDesign) {
|
||||
String str = lawsStandardMapper.getStandardByProductDesign(productDesign.getStandardNumber(),productDesign.getQueryLabels());
|
||||
productDesign.setItemContent(str);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("ID",productDesign.getId());
|
||||
obj.put("queryLabels",productDesign.getQueryLabels());
|
||||
obj.put("itemContent",str);
|
||||
obj.put(STANDARD_NUMBER,productDesign.getStandardNumber());
|
||||
listObj.add(obj);
|
||||
}
|
||||
return Result.OK(listProductDesign);
|
||||
return Result.OK(listObj);
|
||||
}catch (Exception e){
|
||||
log.error("设计导航-产品设计条款查询异常:",e);
|
||||
return Result.error("操作失败" + e.getMessage());
|
||||
@@ -353,26 +359,27 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
}
|
||||
|
||||
private void getStandardTree(List<StandardTree> listStandardTreeAll, List<LawsTreeNodeModel> listEnterprise,String nodeName) {
|
||||
if (!CollectionUtils.isEmpty(listEnterprise)) {
|
||||
Optional<LawsTreeNodeModel> op = listEnterprise.stream().filter(o -> StringUtils.isBlank(o.getParentId())).findFirst();
|
||||
if (op.isPresent()) {
|
||||
LawsTreeNodeModel lawsTreeNodeModel = op.get();
|
||||
StandardTree standardTree = new StandardTree();
|
||||
standardTree.setNodeCode(lawsTreeNodeModel.getNodeCode());
|
||||
standardTree.setNodeName(lawsTreeNodeModel.getNodeName());
|
||||
if (!CollectionUtils.isEmpty(lawsTreeNodeModel.getChildren())) {
|
||||
List<StandardTree> sub = getTree(lawsTreeNodeModel.getChildren());
|
||||
if (!CollectionUtils.isEmpty(sub)) {
|
||||
standardTree.setChildren(sub);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(listEnterprise)) {
|
||||
return;
|
||||
}
|
||||
Optional<LawsTreeNodeModel> op = listEnterprise.stream().filter(o -> StringUtils.isBlank(o.getParentId())).findFirst();
|
||||
if (op.isPresent()) {
|
||||
LawsTreeNodeModel lawsTreeNodeModel = op.get();
|
||||
StandardTree standardTree = new StandardTree();
|
||||
standardTree.setNodeCode(lawsTreeNodeModel.getNodeCode());
|
||||
standardTree.setNodeName(lawsTreeNodeModel.getNodeName());
|
||||
if (!CollectionUtils.isEmpty(lawsTreeNodeModel.getChildren())) {
|
||||
List<StandardTree> sub = getTree(lawsTreeNodeModel.getChildren());
|
||||
if (!CollectionUtils.isEmpty(sub)) {
|
||||
standardTree.setChildren(sub);
|
||||
}
|
||||
if(!StringUtils.isBlank(nodeName)){
|
||||
if(!CollectionUtils.isEmpty(lawsTreeNodeModel.getChildren()) || lawsTreeNodeModel.getNodeName().contains(nodeName)){
|
||||
listStandardTreeAll.add(standardTree);
|
||||
}
|
||||
}else{
|
||||
}
|
||||
if(!StringUtils.isBlank(nodeName)){
|
||||
if(!CollectionUtils.isEmpty(lawsTreeNodeModel.getChildren()) || lawsTreeNodeModel.getNodeName().contains(nodeName)){
|
||||
listStandardTreeAll.add(standardTree);
|
||||
}
|
||||
}else{
|
||||
listStandardTreeAll.add(standardTree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user