Commit 668e68ee authored by diaoruifeng's avatar diaoruifeng

Merge remote-tracking branch 'origin/master'

parents a9837f2e 83624e4d
...@@ -95,7 +95,7 @@ public class OperLogAspect { ...@@ -95,7 +95,7 @@ public class OperLogAspect {
// modelNote.setCostTime(time); // modelNote.setCostTime(time);
modelAudit.setAuditCtime(LocalDateTime.now()); modelAudit.setAuditCtime(LocalDateTime.now());
modelAuditService.createModelNote(modelAudit); modelAuditService.createModelAudit(modelAudit);
} }
private int getOperateType(String methodName, int operateType) { private int getOperateType(String methodName, int operateType) {
......
...@@ -17,12 +17,11 @@ public class ExportUtils { ...@@ -17,12 +17,11 @@ public class ExportUtils {
/** /**
* 校验Header Manipulation * 校验Header Manipulation
*
* @param header 参数 * @param header 参数
* @return 数据 * @return 数据
*/ */
public static String headerManipulation(String header) { public static String headerManipulation(String header) {
if (StringUtils.isNullOrEmpty(header)) { if(StringUtils.isNullOrEmpty(header)){
return header; return header;
} }
String regex = "[`~!@#$%^&*()\\+\\=\\{}|:\"?><【】\\/r\\/n]"; String regex = "[`~!@#$%^&*()\\+\\=\\{}|:\"?><【】\\/r\\/n]";
...@@ -57,9 +56,9 @@ public class ExportUtils { ...@@ -57,9 +56,9 @@ public class ExportUtils {
out.flush(); out.flush();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
throw new ServiceException(ResultCode.INTERNAL_SERVER_ERROR); throw new ServiceException(com.pms.ocp.common.constants.ResultCode.INTERNAL_SERVER_ERROR);
} finally { } finally {
if (out != null) { if (out != null){
try { try {
out.close(); out.close();
} catch (IOException e) { } catch (IOException e) {
...@@ -80,7 +79,6 @@ public class ExportUtils { ...@@ -80,7 +79,6 @@ public class ExportUtils {
/** /**
* Workbook导出浏览器 * Workbook导出浏览器
* 文件导出添加跨域 Access-Control-Allow-Origin * 文件导出添加跨域 Access-Control-Allow-Origin
*
* @param response * @param response
* @param fileName * @param fileName
* @param workbook * @param workbook
......
...@@ -2,10 +2,7 @@ package com.pms.ocp.common.utils; ...@@ -2,10 +2,7 @@ package com.pms.ocp.common.utils;
import com.pms.ocp.model.entity.TreeNode; import com.pms.ocp.model.entity.TreeNode;
import java.util.ArrayList; import java.util.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author huxiuwu * @author huxiuwu
...@@ -20,7 +17,7 @@ public class TreeUtils { ...@@ -20,7 +17,7 @@ public class TreeUtils {
List<T> treeList = new ArrayList<>(); List<T> treeList = new ArrayList<>();
for(T treeNode : treeNodes) { for(T treeNode : treeNodes) {
if (pid.equals(treeNode.getPid())) { if (pid.equals(treeNode.getpCode())) {
treeList.add(findChildren(treeNodes, treeNode)); treeList.add(findChildren(treeNodes, treeNode));
} }
} }
...@@ -33,7 +30,7 @@ public class TreeUtils { ...@@ -33,7 +30,7 @@ public class TreeUtils {
*/ */
private static <T extends TreeNode> T findChildren(List<T> treeNodes, T rootNode) { private static <T extends TreeNode> T findChildren(List<T> treeNodes, T rootNode) {
for(T treeNode : treeNodes) { for(T treeNode : treeNodes) {
if(rootNode.getId().equals(treeNode.getPid())) { if(rootNode.getCode().equals(treeNode.getpCode())) {
rootNode.getChildren().add(findChildren(treeNodes, treeNode)); rootNode.getChildren().add(findChildren(treeNodes, treeNode));
} }
} }
...@@ -47,18 +44,21 @@ public class TreeUtils { ...@@ -47,18 +44,21 @@ public class TreeUtils {
List<T> result = new ArrayList<>(); List<T> result = new ArrayList<>();
//list转map //list转map
Map<Long, T> nodeMap = new LinkedHashMap<>(treeNodes.size()); Map<String, T> nodeMap = new LinkedHashMap<>(treeNodes.size());
for(T treeNode : treeNodes){ for(T treeNode : treeNodes){
nodeMap.put(treeNode.getId(), treeNode); nodeMap.put(treeNode.getCode(), treeNode);
} }
for(T node : nodeMap.values()) { for(T node : nodeMap.values()) {
T parent = nodeMap.get(node.getPid()); T parent = nodeMap.get(node.getpCode());
if(parent != null && !(node.getId().equals(parent.getId()))){ if(parent != null && (node.getpCode().equals(parent.getCode()))
&& (!"".equals(node.getpCode())|| !"".equals(parent.getCode()))){
if (parent.getChildren() == null){
parent.setChildren(new LinkedList<>());
}
parent.getChildren().add(node); parent.getChildren().add(node);
continue; continue;
} }
result.add(node); result.add(node);
} }
......
...@@ -53,6 +53,16 @@ public class ModelBaseController { ...@@ -53,6 +53,16 @@ public class ModelBaseController {
@Autowired @Autowired
private ModelRelationService modelRelationService; private ModelRelationService modelRelationService;
/**
* 模型分类-查询
*
* @return
*/
// @ApiOperation("模型分类-查询")
// @GetMapping("/get/model/type")
// public ResponseVO getModelType() {
// return modelGroupService.getModelType();
// }
/** /**
* 模型-增加 * 模型-增加
...@@ -150,7 +160,7 @@ public class ModelBaseController { ...@@ -150,7 +160,7 @@ public class ModelBaseController {
@ApiOperation("模型订阅-增加") @ApiOperation("模型订阅-增加")
@PostMapping("/create/model/subscribe") @PostMapping("/create/model/subscribe")
public ResponseVO createModelSubscribe(@RequestBody ModelSubscribeDTO modelSubscribeDTO) { public ResponseVO createModelSubscribe(@RequestBody ModelSubscribeDTO modelSubscribeDTO) {
return ResponseVO.ok(modelSubscribeService.createModelIssue(modelSubscribeDTO)); return ResponseVO.ok(modelSubscribeService.createModelSubscribe(modelSubscribeDTO));
} }
/** /**
...@@ -161,7 +171,7 @@ public class ModelBaseController { ...@@ -161,7 +171,7 @@ public class ModelBaseController {
@ApiOperation("模型订阅-删除/批量删除") @ApiOperation("模型订阅-删除/批量删除")
@PostMapping("/delete/model/subscribe") @PostMapping("/delete/model/subscribe")
public ResponseVO deleteModelSubscribe(@ApiParam(value = "订阅编号集合") @RequestBody List<String> ids) { public ResponseVO deleteModelSubscribe(@ApiParam(value = "订阅编号集合") @RequestBody List<String> ids) {
return ResponseVO.ok(modelSubscribeService.deleteBatchModelIssue(ids)); return ResponseVO.ok(modelSubscribeService.deleteBatchModelSubscribe(ids));
} }
/** /**
...@@ -178,7 +188,7 @@ public class ModelBaseController { ...@@ -178,7 +188,7 @@ public class ModelBaseController {
@ApiParam(value = "每页数量") @RequestParam(value = "pageSize", required = false) Integer pageSize) { @ApiParam(value = "每页数量") @RequestParam(value = "pageSize", required = false) Integer pageSize) {
PageHelper.startPage(currentPage, pageSize); PageHelper.startPage(currentPage, pageSize);
List<ModelSubscribe> modelSubscribeList = modelSubscribeService.getModelIssueList(objId, modelCode, subsCompanyCode); List<ModelSubscribe> modelSubscribeList = modelSubscribeService.getModelSubscribeList(objId, modelCode, subsCompanyCode);
PageInfo<ModelSubscribe> pageInfo = new PageInfo<>(modelSubscribeList); PageInfo<ModelSubscribe> pageInfo = new PageInfo<>(modelSubscribeList);
return ResponseVO.ok(pageInfo); return ResponseVO.ok(pageInfo);
...@@ -193,7 +203,7 @@ public class ModelBaseController { ...@@ -193,7 +203,7 @@ public class ModelBaseController {
@GetMapping("/get/model/note") @GetMapping("/get/model/note")
public ResponseVO getModelNote(@RequestParam(value = "modelCode") String modelCode) { public ResponseVO getModelNote(@RequestParam(value = "modelCode") String modelCode) {
List<ModelAudit> modelAuditList = modelAuditService.getModelNoteList(modelCode); List<ModelAudit> modelAuditList = modelAuditService.getModelAuditList(modelCode);
return ResponseVO.ok(modelAuditList); return ResponseVO.ok(modelAuditList);
} }
...@@ -219,7 +229,7 @@ public class ModelBaseController { ...@@ -219,7 +229,7 @@ public class ModelBaseController {
public ResponseVO exportModelNote(HttpServletResponse response, public ResponseVO exportModelNote(HttpServletResponse response,
@ApiParam(value = "模型编码") @RequestParam(value = "modelCode", required = false) String modelCode) throws IOException { @ApiParam(value = "模型编码") @RequestParam(value = "modelCode", required = false) String modelCode) throws IOException {
// 查询要导出的数据 // 查询要导出的数据
List<ModelAudit> modelAuditList = modelAuditService.getModelNoteList(modelCode); List<ModelAudit> modelAuditList = modelAuditService.getModelAuditList(modelCode);
//users集合转成export集合 //users集合转成export集合
List<ModelAuditVO> exportVOList = modelAuditList.stream().map(modelNote -> { List<ModelAuditVO> exportVOList = modelAuditList.stream().map(modelNote -> {
...@@ -319,4 +329,10 @@ public class ModelBaseController { ...@@ -319,4 +329,10 @@ public class ModelBaseController {
return ResponseVO.ok(modelRelationService.deleteModelRelation(objId, modelCode)); return ResponseVO.ok(modelRelationService.deleteModelRelation(objId, modelCode));
} }
@ApiOperation("模型列表-导航树")
@GetMapping("/delete/model/modelListNavigation")
public ResponseVO modelListNavigation(@RequestParam(required = false) String searchCondition) {
return modelSubscribeService.modelListNavigation(searchCondition);
}
} }
...@@ -2,7 +2,11 @@ package com.pms.ocp.mapper; ...@@ -2,7 +2,11 @@ package com.pms.ocp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pms.ocp.model.entity.ModelSubscribe; import com.pms.ocp.model.entity.ModelSubscribe;
import com.pms.ocp.model.entity.TreeNode;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @Auther: wangjian * @Auther: wangjian
...@@ -12,4 +16,8 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -12,4 +16,8 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ModelSubscribeMapper extends BaseMapper<ModelSubscribe> { public interface ModelSubscribeMapper extends BaseMapper<ModelSubscribe> {
List<TreeNode> selectOrganData();
List<TreeNode> selectModelAndModelGroup(@Param("searchCondition") String searchCondition);
} }
...@@ -2,7 +2,7 @@ package com.pms.ocp.model; ...@@ -2,7 +2,7 @@ package com.pms.ocp.model;
public interface Response { public interface Response {
boolean SUCCESS = true; public static final boolean SUCCESS = true;
int SUCCESS_CODE = 0; public static final int SUCCESS_CODE = 0;
} }
package com.pms.ocp.model.entity; package com.pms.ocp.model.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -9,43 +12,42 @@ import java.util.List; ...@@ -9,43 +12,42 @@ import java.util.List;
* @version 1.0 * @version 1.0
* @date 2022/3/8 17:53 * @date 2022/3/8 17:53
*/ */
public class TreeNode<T> implements Serializable { @Data
@ApiModel("树节点表")
public class TreeNode implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
*/ */
private Long id;
@ApiModelProperty("编码")
private String code;
/** /**
* 上级ID * 上级ID
*/ */
private Long pid; @ApiModelProperty("父类编码")
/** private String pCode;
* 子节点列表
*/
private List<T> children = new ArrayList<>();
public Long getId() { @ApiModelProperty("名称")
return id; private String name;
}
public void setId(Long id) { @ApiModelProperty("公司编码")
this.id = id; private String companyCode;
}
public Long getPid() { @ApiModelProperty("子类")
return pid; private List<TreeNode> children;
}
public void setPid(Long pid) { @ApiModelProperty("子类")
this.pid = pid; private int belongLevel;
}
public List<T> getChildren() { public String getCode() {
return children; return code == null ? "":code;
} }
public String getpCode() {
public void setChildren(List<T> children) { return pCode == null ? "": pCode;
this.children = children; }
public String getCompanyCode() {
return companyCode == null ? "":companyCode;
} }
} }
package com.pms.ocp.model.vo; package com.pms.ocp.model.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -8,6 +10,7 @@ import lombok.Data; ...@@ -8,6 +10,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -26,6 +29,7 @@ public class OcpModelGroupVO implements Serializable { ...@@ -26,6 +29,7 @@ public class OcpModelGroupVO implements Serializable {
* 主键 * 主键
*/ */
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
@TableId(value = "obj_id", type = IdType.ASSIGN_ID)
private String objId; private String objId;
/** /**
* 模型分类名称 * 模型分类名称
......
...@@ -18,7 +18,7 @@ public interface ModelAuditService { ...@@ -18,7 +18,7 @@ public interface ModelAuditService {
* @param modelAudit * @param modelAudit
* @return * @return
*/ */
Integer createModelNote(ModelAudit modelAudit); Integer createModelAudit(ModelAudit modelAudit);
/** /**
* 删除模型事记 * 删除模型事记
...@@ -26,7 +26,7 @@ public interface ModelAuditService { ...@@ -26,7 +26,7 @@ public interface ModelAuditService {
* @param modelId * @param modelId
* @return * @return
*/ */
Integer deleteModelNote(String modelId); Integer deleteModelAudit(String modelId);
/** /**
* 更新模型事记 * 更新模型事记
...@@ -34,7 +34,7 @@ public interface ModelAuditService { ...@@ -34,7 +34,7 @@ public interface ModelAuditService {
* @param modelAudit * @param modelAudit
* @return * @return
*/ */
Integer updateModelNote(ModelAudit modelAudit); Integer updateModelAudit(ModelAudit modelAudit);
/** /**
* 获取模型事记 * 获取模型事记
...@@ -42,7 +42,7 @@ public interface ModelAuditService { ...@@ -42,7 +42,7 @@ public interface ModelAuditService {
* @param * @param
* @return * @return
*/ */
List<ModelAudit> getModelNoteList(String modelCode); List<ModelAudit> getModelAuditList(String modelCode);
/** /**
* 获取模型事记列表 * 获取模型事记列表
...@@ -50,13 +50,6 @@ public interface ModelAuditService { ...@@ -50,13 +50,6 @@ public interface ModelAuditService {
* @param modelId * @param modelId
* @return * @return
*/ */
ModelAudit getModelNote(String modelId); ModelAudit getModelAudit(String modelId);
// /**
// * 获取模型事记
// *
// * @param
// * @return
// */
// Boolean exportModelNote(String modelCode);
} }
...@@ -2,6 +2,7 @@ package com.pms.ocp.service; ...@@ -2,6 +2,7 @@ package com.pms.ocp.service;
import com.pms.ocp.model.dto.ModelSubscribeDTO; import com.pms.ocp.model.dto.ModelSubscribeDTO;
import com.pms.ocp.model.entity.ModelSubscribe; import com.pms.ocp.model.entity.ModelSubscribe;
import com.pms.ocp.model.vo.ResponseVO;
import java.util.List; import java.util.List;
...@@ -18,7 +19,7 @@ public interface ModelSubscribeService { ...@@ -18,7 +19,7 @@ public interface ModelSubscribeService {
* @param modelSubscribeDTO * @param modelSubscribeDTO
* @return * @return
*/ */
Integer createModelIssue(ModelSubscribeDTO modelSubscribeDTO); Integer createModelSubscribe(ModelSubscribeDTO modelSubscribeDTO);
/** /**
* 删除模型订阅 * 删除模型订阅
...@@ -26,7 +27,7 @@ public interface ModelSubscribeService { ...@@ -26,7 +27,7 @@ public interface ModelSubscribeService {
* @param modelId * @param modelId
* @return * @return
*/ */
Integer deleteModelIssue(String modelId); Integer deleteModelSubscribe(String modelId);
/** /**
* 批量删除模型订阅 * 批量删除模型订阅
...@@ -34,7 +35,7 @@ public interface ModelSubscribeService { ...@@ -34,7 +35,7 @@ public interface ModelSubscribeService {
* @param ids * @param ids
* @return * @return
*/ */
Integer deleteBatchModelIssue(List<String> ids); Integer deleteBatchModelSubscribe(List<String> ids);
/** /**
* 更新模型订阅 * 更新模型订阅
...@@ -42,7 +43,7 @@ public interface ModelSubscribeService { ...@@ -42,7 +43,7 @@ public interface ModelSubscribeService {
* @param modelSubscribe * @param modelSubscribe
* @return * @return
*/ */
Integer updateModelIssue(ModelSubscribe modelSubscribe); Integer updateModelSubscribe(ModelSubscribe modelSubscribe);
/** /**
* 获取模型订阅 * 获取模型订阅
...@@ -50,7 +51,7 @@ public interface ModelSubscribeService { ...@@ -50,7 +51,7 @@ public interface ModelSubscribeService {
* @param * @param
* @return * @return
*/ */
List<ModelSubscribe> getModelIssueList(String objId, String modelCode, String subsCompanyCode); List<ModelSubscribe> getModelSubscribeList(String objId, String modelCode, String subsCompanyCode);
/** /**
* 获取模型订阅列表 * 获取模型订阅列表
...@@ -58,5 +59,8 @@ public interface ModelSubscribeService { ...@@ -58,5 +59,8 @@ public interface ModelSubscribeService {
* @param modelId * @param modelId
* @return * @return
*/ */
ModelSubscribeDTO getModelIssue(String modelId); ModelSubscribeDTO getModelSubscribe(String modelId);
ResponseVO modelListNavigation(String searchCondition);
} }
...@@ -22,22 +22,22 @@ public class ModelAuditServiceImpl implements ModelAuditService { ...@@ -22,22 +22,22 @@ public class ModelAuditServiceImpl implements ModelAuditService {
private ModelAuditMapper modelAuditMapper; private ModelAuditMapper modelAuditMapper;
@Override @Override
public Integer createModelNote(ModelAudit modelAudit) { public Integer createModelAudit(ModelAudit modelAudit) {
return modelAuditMapper.insert(modelAudit); return modelAuditMapper.insert(modelAudit);
} }
@Override @Override
public Integer deleteModelNote(String modelId) { public Integer deleteModelAudit(String modelId) {
return null; return null;
} }
@Override @Override
public Integer updateModelNote(ModelAudit modelAudit) { public Integer updateModelAudit(ModelAudit modelAudit) {
return null; return null;
} }
@Override @Override
public List<ModelAudit> getModelNoteList(String modelCode) { public List<ModelAudit> getModelAuditList(String modelCode) {
QueryWrapper<ModelAudit> wrapper = new QueryWrapper<>(); QueryWrapper<ModelAudit> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(ModelAudit::getModelCode, modelCode); wrapper.lambda().eq(ModelAudit::getModelCode, modelCode);
...@@ -45,16 +45,8 @@ public class ModelAuditServiceImpl implements ModelAuditService { ...@@ -45,16 +45,8 @@ public class ModelAuditServiceImpl implements ModelAuditService {
} }
@Override @Override
public ModelAudit getModelNote(String modelId) { public ModelAudit getModelAudit(String modelId) {
return null; return null;
} }
// @Override
// public Boolean exportModelNote(String modelCode) {
// List<ModelNote> modelNoteList = getModelNoteList(modelCode);
//
// ExcelUtils.exportExcel(modelNoteList, "导出事记", "导出事记", ModelNote.class, "测试user.xls", re
//
// return true;
// }
} }
package com.pms.ocp.service.impl; package com.pms.ocp.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pms.ocp.common.constants.CodeEnum;
import com.pms.ocp.common.utils.TreeUtils;
import com.pms.ocp.mapper.ModelSubscribeMapper; import com.pms.ocp.mapper.ModelSubscribeMapper;
import com.pms.ocp.model.dto.ModelSubscribeDTO; import com.pms.ocp.model.dto.ModelSubscribeDTO;
import com.pms.ocp.model.entity.ModelSubscribe; import com.pms.ocp.model.entity.ModelSubscribe;
import com.pms.ocp.model.entity.TreeNode;
import com.pms.ocp.model.vo.ResponseVO;
import com.pms.ocp.service.ModelSubscribeService; import com.pms.ocp.service.ModelSubscribeService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -11,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -11,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List; import java.util.List;
/** /**
...@@ -26,7 +32,7 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService { ...@@ -26,7 +32,7 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService {
private ModelSubscribeMapper modelSubscribeMapper; private ModelSubscribeMapper modelSubscribeMapper;
@Override @Override
public Integer createModelIssue(ModelSubscribeDTO modelSubscribeDTO) { public Integer createModelSubscribe(ModelSubscribeDTO modelSubscribeDTO) {
ModelSubscribe modelSubscribe = new ModelSubscribe(); ModelSubscribe modelSubscribe = new ModelSubscribe();
...@@ -38,7 +44,7 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService { ...@@ -38,7 +44,7 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService {
} }
@Override @Override
public Integer deleteModelIssue(String modelId) { public Integer deleteModelSubscribe(String modelId) {
return null; return null;
} }
...@@ -49,17 +55,17 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService { ...@@ -49,17 +55,17 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService {
* @return * @return
*/ */
@Override @Override
public Integer deleteBatchModelIssue(List<String> ids) { public Integer deleteBatchModelSubscribe(List<String> ids) {
return modelSubscribeMapper.deleteBatchIds(ids); return modelSubscribeMapper.deleteBatchIds(ids);
} }
@Override @Override
public Integer updateModelIssue(ModelSubscribe modelSubscribe) { public Integer updateModelSubscribe(ModelSubscribe modelSubscribe) {
return null; return null;
} }
@Override @Override
public List<ModelSubscribe> getModelIssueList(String objId, String modelCode, String subsCompanyCode) { public List<ModelSubscribe> getModelSubscribeList(String objId, String modelCode, String subsCompanyCode) {
QueryWrapper<ModelSubscribe> queryWrapper = new QueryWrapper(); QueryWrapper<ModelSubscribe> queryWrapper = new QueryWrapper();
if (StringUtils.isNotEmpty(objId)) { if (StringUtils.isNotEmpty(objId)) {
...@@ -78,7 +84,41 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService { ...@@ -78,7 +84,41 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService {
} }
@Override @Override
public ModelSubscribeDTO getModelIssue(String modelId) { public ModelSubscribeDTO getModelSubscribe(String modelId) {
return null; return null;
} }
/**
* 服务列表导航树
* @author huxiuwu
* @date 2022/3/11
*
* @return pms.ocp.model.vo.ResponseVO
**/
@Override
public ResponseVO modelListNavigation(String searchCondition) {
//查询模型和模型属性表列表
List<TreeNode> modelProperList = modelSubscribeMapper.selectModelAndModelGroup(searchCondition);
if (CollectionUtil.isEmpty(modelProperList)){
return ResponseVO.error(CodeEnum.NO_DATA);
}
List<TreeNode> modelGroupList = TreeUtils.build(modelProperList);
//查询组织机构表
List<TreeNode> organList = modelSubscribeMapper.selectOrganData();
//将分类放入各自所属于的组织机构下
organList.forEach(org
->{
modelGroupList.forEach(group->{
if (org.getCompanyCode().equals(group.getCompanyCode())){
if(org.getChildren() == null){
org.setChildren(new LinkedList<>());
}
org.getChildren().add(group);
}
});
});
List<TreeNode> result = TreeUtils.build(organList);
return ResponseVO.ok(result);
}
} }
...@@ -6,7 +6,7 @@ spring: ...@@ -6,7 +6,7 @@ spring:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
# jdbc-url: jdbc:postgresql://192.168.43.20:33072/pms3?currentSchema=public&stringtype=unspecified&TimeZone=Asia/Shanghai&useAffectedRows=true # jdbc-url: jdbc:postgresql://192.168.43.20:33072/pms3?currentSchema=public&stringtype=unspecified&TimeZone=Asia/Shanghai&useAffectedRows=true
# jdbc-url: jdbc:postgresql://172.20.10.9:33072/pms3?currentSchema=public&stringtype=unspecified&TimeZone=Asia/Shanghai&useAffectedRows=true # jdbc-url: jdbc:postgresql://172.20.10.9:33072/pms3?currentSchema=public&stringtype=unspecified&TimeZone=Asia/Shanghai&useAffectedRows=true
url: jdbc:postgresql://localhost:5432/postgres?currentSchema=operating_platform&stringtype=unspecified&TimeZone=Asia/Shanghai&useAffectedRows=true url: jdbc:postgresql://localhost:5432/operating_platform?stringtype=unspecified&TimeZone=Asia/Shanghai&useAffectedRows=true
knife4j: knife4j:
enable: true enable: true
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pms.ocp.mapper.ModelSubscribeMapper">
<resultMap id="modelAndModelGroupMap" type="com.pms.ocp.model.entity.TreeNode" >
<result column="model_group_code" property="code"/>
<result column="model_group_pcode" property="pCode"/>
<result column="group_company_code" property="companyCode"/>
<result column="model_group_name" property="name"/>
<result column="groupModelBelongLevel" property="belongLevel"/>
<collection property="children" ofType="com.pms.ocp.model.entity.TreeNode">
<result column="model_name" property="name"/>
<result column="model_code" property="code"/>
<result column="modelLevel" property="belongLevel"/>
</collection>
</resultMap>
<select id="selectModelAndModelGroup" parameterType="java.lang.String" resultMap="modelAndModelGroupMap">
select
2 AS groupModelBelongLevel,
3 AS modelLevel,
omg.model_group_pcode,
omg.group_company_code,
omg.model_group_name,
omg.model_group_code,
omb.model_name,
omb.model_code
from
ocp_model_group as omg
left join
ocp_model_base omb
on omg.model_group_code = omb.model_group_code
<if test="searchCondition != null and searchCondition != '' ">
where
model_name LIKE concat('%',#{searchCondition}::text ,'%')
</if>
</select>
<select id="selectOrganData" resultType="com.pms.ocp.model.entity.TreeNode">
select
1 AS belongLevel,
parent_id AS pCode,
org_name AS name ,
org_id AS code,
org_code AS companyCode
from
t_public_organization
where
trim(org_level) != ''
and
org_level::int4 &lt;= 3
</select>
</mapper>
\ No newline at end of file
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
on oamr.model_code = omb.model_code on oamr.model_code = omb.model_code
INNER JOIN ocp_api_base oab INNER JOIN ocp_api_base oab
on oamr.api_code = oab.api_code on oamr.api_code = oab.api_code
where oamr.api_code = #{apiCode} where oamr.obj_id = #{objId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
oa LEFT JOIN ocp_api_base ab on oa LEFT JOIN ocp_api_base ab on
oa.api_code = ab.api_code INNER JOIN oa.api_code = ab.api_code INNER JOIN
ocp_tenant_base ot on ot.tenant_code = ocp_tenant_base ot on ot.tenant_code =
oa.tenant_code where oa.api_code = #{apiCode} oa.tenant_code where oa.obj_id = #{objId}
</select> </select>
......
...@@ -10,11 +10,9 @@ ...@@ -10,11 +10,9 @@
</select> </select>
<select id="OtaById" resultType="com.pms.ocp.model.entity.OcpTenantAudit"> <select id="OtaById" resultType="com.pms.ocp.model.entity.OcpTenantAudit">
SELECT * from ocp_api_tenant_rel oatr select * from ocp_tenant_audit ota
LEFT JOIN ocp_tenant_audit ota LEFT JOIN ocp_tenant_base otb
on oatr.tenant_code = ota.tenant_code on ota.tenant_code = otb.tenant_code
INNER JOIN ocp_api_base oab where ota.obj_id = #{objId}
on oatr.api_code = oab.api_code
where oatr.tenant_code = #{tenantCode}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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