Browse Source

Merge branch 'zxm' of http://124.70.32.114:3100/zhangxiaomeng/kechengfuzhu into wzx

# Conflicts:
#	kcui/src/view/Home.vue
#	src/main/java/com/main/woka/Common/util/KcInfo.java
#	src/main/java/com/main/woka/Web/Controller/KcTlFileController.java
wzx
linsheng0116 1 year ago
parent
commit
819b85e864
  1. 124
      .idea/uiDesigner.xml
  2. 14
      kcui/src/api/kcInfo.js
  3. BIN
      kcui/src/assets/img/jiantou.png
  4. BIN
      kcui/src/assets/img/rightBox.png
  5. BIN
      kcui/src/assets/img/rightHead.png
  6. BIN
      kcui/src/assets/img/rightList.png
  7. BIN
      kcui/src/assets/img/tt.png
  8. BIN
      kcui/src/assets/img/typeHead.png
  9. 2
      kcui/src/assets/js/graphvis.min.20241008.js
  10. 28
      kcui/src/components/Foot.vue
  11. 28
      kcui/src/components/Head.vue
  12. 14
      kcui/src/router/router.js
  13. 25
      kcui/src/view/Home.vue
  14. 288
      kcui/src/view/TWInfo.vue
  15. 47
      src/main/java/com/main/woka/Web/Controller/KcInfoController.java
  16. 2
      src/main/java/com/main/woka/Web/Dao/KcInfoRelation.java
  17. 2
      src/main/java/com/main/woka/Web/Dao/KcSetInfo.java
  18. 2
      src/main/java/com/main/woka/Web/Dao/KcTlFile.java
  19. 14
      src/main/java/com/main/woka/Web/Mapper/KcFileMapper.java
  20. 4
      src/main/java/com/main/woka/Web/Mapper/KcInfoRelationMapper.java
  21. 3
      src/main/java/com/main/woka/Web/Service/impl/KcTlFileServiceImpl.java
  22. 6
      src/main/java/com/main/woka/Web/Service/impl/WordSplitter.java
  23. 43
      src/main/resources/Mapper/KcFileMapper.xml
  24. 12
      src/main/resources/Mapper/KcInfoRelationMapper.xml

124
.idea/uiDesigner.xml

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

14
kcui/src/api/kcInfo.js

@ -0,0 +1,14 @@
import request from '@/utils/request';
import {getToken} from "@/utils/auth";
export function getDocList(data) {
return request({
url: '/kcDoc/getDocList',
method: 'post',
data:data,
headers: {
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
}
})
}

BIN
kcui/src/assets/img/jiantou.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

BIN
kcui/src/assets/img/rightBox.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
kcui/src/assets/img/rightHead.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
kcui/src/assets/img/rightList.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 KiB

BIN
kcui/src/assets/img/tt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
kcui/src/assets/img/typeHead.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

2
kcui/src/assets/js/graphvis.min.20241008.js

@ -2622,7 +2622,7 @@
}
}
else {
console.log(this.radius)
return (
(x - this.cx) * (x - this.cx) + (y - this.cy) * (y - this.cy) <
this.radius * this.scaleX * this.radius * this.scaleX

28
kcui/src/components/Foot.vue

@ -0,0 +1,28 @@
<template>
<div style="width: 100%;height: 5vw;">
<img src="../assets/img/foot.png" style="width: 100%;object-fit: contain;">
</div>
</template>
<script>
export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'foot',
data() {
return{
}
},
methods:{
},
mounted() {
}
}
</script>
<style scoped>
</style>

28
kcui/src/components/Head.vue

@ -0,0 +1,28 @@
<template>
<div style="width: 100%;height: 8.8%;">
<img src="../assets/img/head.png" style="width: 100%;object-fit: contain;">
</div>
</template>
<script>
export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'head',
data() {
return{
}
},
methods:{
},
mounted() {
}
}
</script>
<style scoped>
</style>

14
kcui/src/router/router.js

@ -1,7 +1,7 @@
//1.导入vue 和 vuerouter 的包
import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '@/view/Home.vue'
import Home from '@/view/Home.vue'
import Book from '@/view/Book.vue'
import Calculator from "@/view/Calculator.vue";
import TwInfo from '@/view/TWInfo.vue'
@ -13,11 +13,11 @@ Vue.use(VueRouter)
export default new VueRouter({
routes: [ //配置路由,这里是个数组
// { //每一个链接都是一个对象
// path: '/', //链接路径
// name: 'Home', //路由名称,
// component: Home //对应的组件模板
// },
{ //每一个链接都是一个对象
path: '/', //链接路径
name: 'Home', //路由名称,
component: Home //对应的组件模板
},
{ //每一个链接都是一个对象
path: '/Book', //链接路径
name: 'Book', //路由名称,
@ -29,7 +29,7 @@ export default new VueRouter({
component: Calculator
},
{ //每一个链接都是一个对象
path: '/', //链接路径
path: '/TwInfo', //链接路径
name: 'TwInfo', //路由名称,
component: TwInfo //对应的组件模板
},

25
kcui/src/view/Home.vue

@ -3,14 +3,17 @@
<div style="width: 100%;height: 4vw;background-color: #42b983;">
<div style="background-color: silver;width: 3vw;height: 2vw;line-height: 2vw;text-align: center;" @click="goBook">跳转1</div>
</div>
<div style="width: 100%;height: 100%;">
<div style="width: 100%;height: 80%;">
<div class="gContainer">
<div id="graph-panel" style="width: 100%;height: 100%;"></div>
</div>
</div>
<!-- 弹窗 -->
<div v-if="isModalVisible" class="modal-overlay" @click.self="closeModal">
<div v-if="isModalVisible" style="height: 5vw;width: 100%;" class="modal-overlay" @click.self="closeModal">
<div class="modal-content">
<h3>请输入分支内容</h3>
<label for="fileId">fileId:</label>
@ -127,9 +130,11 @@ export default {
this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents);
},
async showPopup(node) {
console.log("o----------")
console.log(node)
this.selectedNode = node;
this.newBranchParentId = node.properties.docId;
this.newBranchLevel = node.properties.level - 1;
try {
const response = await this.getFileIdByDocId({ docId: node.properties.docId });
@ -140,6 +145,7 @@ export default {
return;
}
this.newBranchLevel = parseInt(node.properties.level) + 1;
this.isModalVisible = true; //
},
getFileIdByDocId(data) {
@ -246,8 +252,11 @@ export default {
var nodeList = data.nodes;
var lineList = data.links;
var allOne = ""
var allOne = nodeList[0].docId
console.log(nodeList)
if(nodeList!=undefined){
allOne = nodeList[0].docId
for (let a = 0; a < nodeList.length; a++) {
const group = parseInt(nodeList[a].group, 10);
const style = this.getNodeStyle(group);
@ -255,12 +264,16 @@ export default {
nodes.push({
id: nodeList[a].id,
label: nodeList[a].name,
properties: { name: nodeList[a].name, docId: nodeList[a].docId, parent: allOne },
properties: { name: nodeList[a].name, docId: nodeList[a].docId, parent: allOne, leve: nodeList[a].group },
...style // style
});
}
}
// var allOne = nodeList[0].docId
if(lineList!=undefined){
for (let b = 0; b < lineList.length; b++) {
var bbb = {name: lineList[b].relate}
@ -273,6 +286,8 @@ export default {
lineWidth: 3,
})
}
}
this.demoData = {
"nodes": nodes,

288
kcui/src/view/TWInfo.vue

@ -0,0 +1,288 @@
<template>
<div style="width: 100%;height: 100%;background-color: #00173a">
<headInfo></headInfo>
<!-- 这是内容界面 -->
<div class="content">
<div class="leftContent">
<div class="leftBox1">
<div style="width: 50%;margin: 0 auto;">
<p style="font-size: 1vw;">Hi,{{ userName }}~</p>
<p style="font-size: 0.7vw;">欢迎使用课程辅助系统</p>
</div>
</div>
<div class="leftBox2">
<div class="muluBox">
<img src="../assets/img/leftBox.png" style="width: 100%;object-fit: contain;z-index: 1;position: absolute;">
<div class="muluList">
<div v-for="item in mulu" :key="item">
<div class="oneMulu" v-if="page!=item">
<div style="width: 80%;text-align: center;">{{ item }}</div>
<img src="../assets/img/jiantou.png"
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 13%;">
</div>
<div class="oneMuluXuan" v-else>
<div style="width: 72%;text-align: center;">{{ item }}</div>
<img src="../assets/img/jiantou.png"
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 8%;">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="rightContent">
<img src="../assets/img/rightBox.png"
style="height: 98%;width: 100%;margin-top: 1%;position: absolute;z-index: 1;">
<div class="rigthHeadInfo" style="position: relative;" >
<div
style="display: flex;flex-direction: row;position: absolute;z-index: 1;margin-top: 2.9vw;margin-left: 3%;">
<div v-for="item in typeList" :key="item" style="position: relative;margin-right: 1vw;" @click="changeType(item)">
<img src="../assets/img/typeHead.png" style="width: 7vw;object-fit: contain;" >
<div style="position: absolute;z-index: 12121;color: #ffffff;top: 0.3vw;left: 1.8vw;" >{{ item }}</div>
</div>
</div>
<div style="width: 94%;height:3vw;position: absolute;z-index: 1;top: 4.9vw;left: 3%;background-color: #0c3068;box-shadow: 0px -9px 10px 0px rgb(75,230,255);"></div>
<!-- <img src="../assets/img/rightHead.png"-->
<!-- style="width: 96%;height:5vw;position: absolute;z-index: 1;top: 3.1vw;left: 2%;">-->
<div style="width: 94.4%;height: 2.9vw;position: absolute;z-index: 2;margin-left: 2.6%;top: 5vw;">
<div
style="width: 100%;height: 100%;display: flex;flex-direction: row;line-height: 2.9vw;text-align: center;color: #ffffff;">
<div style="width: 10%;">序号</div>
<div style="width: 20%;">标题</div>
<div style="width: 60%;">图片</div>
<div style="width: 10%;">详情</div>
</div>
</div>
</div>
<div class="rightList">
<img src="../assets/img/rightList.png" style="width: 100%;height: 95%;position: absolute;z-index: 1;"/>
<div class="rightListContent">
<div class="oneRight" v-for="item in contentList" :key="item">
<div style="width: 8%;">{{ item.id }}</div>
<div style="width: 22%;">{{ item.name }}</div>
<div style="width: 60%;">图片</div>
<div style="width: 10%;text-decoration: underline;font-style: italic;">点击查看详情</div>
</div>
</div>
<div class="pageList">
<div style="float: left;margin-right: 0.1vw;" @click="choosePage(onePagesList[0]-1)">...</div>
<div v-for="item in onePagesList" :key="item" @click="choosePage(item)">
<div style="width: 1.4vw;height: 1.4vw;border-radius: 50%;background-color: #082e56;margin-top: 0.25vw;font-size: 0.5vw;
text-align: center;line-height: 1.6vw;margin-left: 1vw;margin-right: 1vw; box-shadow: inset 0 0 14px 1px rgb(75,230,255);">{{item}}</div>
</div>
<div style="float: left;margin-left: 0.1vw;">...</div>
</div>
</div>
</div>
</div>
<div style="width: 100%;height: 3%;position: fixed;bottom: 0px;">
<foot></foot>
</div>
</div>
</template>
<script>
import headInfo from '@/components/Head.vue';
import Foot from "@/components/Foot.vue";
import {getDocList} from "@/api/kcInfo";
export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'TWInfo',
components: {Foot, headInfo},
data() {
return {
userName: "李明",
mulu: ["图文认知", "视频资源", "动画显示", "计算模块", "知识图谱", "帮助文档"],
page: "图文认知",
typeList: ["海洋大气", "海洋文学", "海洋地理", "复杂水声", "复杂电磁"],
contentList: [],
selectName: "",
twType: "",
pageSize: 6,
pageNum: 1,
total: 0,
totalPage: 0,
pagesList: [],
onePagesList:[],
}
},
methods: {
changeType(item){
console.log("dhjasdhkahdkjahskjhdkj")
this.twType = item;
this.getContentList();
},
choosePage(item){
console.log(item);
this.pageNum = item;
this.getContentList();
},
getContentList() {
var data = {
name: this.selectName,
twType: this.twType,
pageNum: this.pageNum,
pageSize: this.pageSize
}
getDocList(data).then((res) => {
console.log(res);
this.contentList = res.data.list;
this.total = res.data.total;
this.totalPage = res.data.totalPages;
var aaa = 0;
this.onePagesList =[];
this.pagesList = [];
if(this.pageNum<this.totalPage-3){
for (let i = this.pageNum; i <= this.totalPage; i++) {
this.pagesList.push(i);
this.onePagesList.push(i);
aaa = aaa+1;
console.log(aaa);
if(aaa==4){
break;
}
}
}
console.log(this.onePagesList)
})
}
},
mounted() {
this.getContentList();
}
}
</script>
<style scoped>
.content {
width: 100%;
height: 86%;
}
.leftContent {
width: 14%;
height: 100%;
float: left;
}
.leftBox1 {
width: 100%;
height: 10%;
margin-top: 12%;
color: #7cdeff;
}
.leftBox2 {
width: 100%;
height: 90%;
}
.muluBox {
margin: 3% 14%;
height: 92%;
width: 72%;
position: relative;
}
.muluList {
width: 100%;
height: 90%;
//background-color: #7cdeff;
display: flex;
flex-direction: column;
position: absolute;
z-index: 2;
margin-top: 20%;
}
.oneMulu {
width: 80%;
height: 2.5vw;
line-height: 2.5vw;
font-size: 0.9vw;
border-bottom: 1px solid #0d3455;
margin-left: 10%;
color: #d1d3d7;
display: flex;
flex-direction: row;
}
.oneMuluXuan {
background-image: url("../assets/img/xuan.png");
width: 90%;
height: 2.5vw;
line-height: 2.5vw;
font-size: 0.9vw;
color: #d1d3d7;
display: flex;
flex-direction: row;
padding-left: 10%;
}
.rightContent {
width: 84%;
height: 100%;
float: left;
position: relative;
}
.rigthHeadInfo {
width: 100%;
}
.rightList {
width: 94.6%;
height: 76%;
position: absolute;
z-index: 2;
//background-color: #42b983;
margin-top: 11%;
margin-left: 2.6%;
margin-bottom: 5%;
}
.rightListContent {
width: 100%;
height: 100%;
position: absolute;
z-index: 2;
top: 1%;
}
.oneRight {
width: 98%;
height: 5vw;
line-height: 5vw;
//background-color: #42b983;
margin: 0 1%;
display: flex;
flex-direction: row;
text-align: center;
color: #ffffff;
}
.pageList {
height: 1.5vw;
width: 20%;
//background-color: pink;
margin: 0 40%;
position: absolute;
z-index: 2;
bottom: -0.5%;
display: flex;
flex-direction: row;
color: #ffffff;
}
</style>

47
src/main/java/com/main/woka/Web/Controller/KcInfoController.java

@ -0,0 +1,47 @@
package com.main.woka.Web.Controller;
import com.main.woka.Common.core.AjaxResult;
import com.main.woka.Web.Dao.GraphQuery;
import com.main.woka.Web.Dao.KcInfo;
import com.main.woka.Web.Mapper.KcFileMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/kcDoc")
public class KcInfoController extends BaseController {
@Autowired
KcFileMapper kcFileMapper;
@PostMapping(value = "/getDocList")
public AjaxResult getDocList(@RequestBody KcInfo kcInfo) {
int pageNum = kcInfo.getPageNum() == null ? 1 : kcInfo.getPageNum();
int pageSize = kcInfo.getPageSize() == null ? 10 : kcInfo.getPageSize();
int offset = (pageNum - 1) * pageSize;
kcInfo.setOffset(offset);
Long total = kcFileMapper.getKcCount(kcInfo);
List<KcInfo> list = kcFileMapper.getkcList(kcInfo);
int totalPages = (int) Math.ceil((double) total / pageSize);
AjaxResult ajax = new AjaxResult();
ajax.put("list",list);
ajax.put("total",total);
ajax.put("totalPages",totalPages);
ajax.put("pageSize",pageSize);
return AjaxResult.success(ajax);
}
}

2
src/main/java/com/main/woka/Common/util/KcInfoRelation.java → src/main/java/com/main/woka/Web/Dao/KcInfoRelation.java

@ -1,4 +1,4 @@
package com.main.woka.Common.util;
package com.main.woka.Web.Dao;
import com.main.woka.Common.core.BaseEntity;

2
src/main/java/com/main/woka/Common/util/KcSetInfo.java → src/main/java/com/main/woka/Web/Dao/KcSetInfo.java

@ -1,4 +1,4 @@
package com.main.woka.Common.util;
package com.main.woka.Web.Dao;
import com.main.woka.Common.annotation.Excel;
import com.main.woka.Common.core.BaseEntity;

2
src/main/java/com/main/woka/Common/util/KcTlFile.java → src/main/java/com/main/woka/Web/Dao/KcTlFile.java

@ -1,4 +1,4 @@
package com.main.woka.Common.util;
package com.main.woka.Web.Dao;
import java.io.Serializable;
import java.util.Date;

14
src/main/java/com/main/woka/Web/Mapper/KcFileMapper.java

@ -1,8 +1,8 @@
package com.main.woka.Web.Mapper;
import com.main.woka.Common.util.KcInfo;
import com.main.woka.Common.util.KcInfoRelation;
import com.main.woka.Common.util.KcTlFile;
import com.main.woka.Web.Dao.KcInfo;
import com.main.woka.Web.Dao.KcInfoRelation;
import com.main.woka.Web.Dao.KcTlFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -77,5 +77,13 @@ public interface KcFileMapper {
//多条件查询图文资源
List<KcInfo> getkcList(KcInfo kcInfo);
//查询总条数
Long getKcCount(KcInfo kcInfo);
}

4
src/main/java/com/main/woka/Web/Mapper/KcInfoRelationMapper.java

@ -1,7 +1,7 @@
package com.main.woka.Web.Mapper;
import com.main.woka.Common.util.KcInfoRelation;
import com.main.woka.Common.util.KcTlFile;
import com.main.woka.Web.Dao.KcInfoRelation;
import com.main.woka.Web.Dao.KcTlFile;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

3
src/main/java/com/main/woka/Web/Service/impl/KcTlFileServiceImpl.java

@ -1,6 +1,9 @@
package com.main.woka.Web.Service.impl;
import com.main.woka.Common.util.*;
import com.main.woka.Web.Dao.KcInfo;
import com.main.woka.Web.Dao.KcInfoRelation;
import com.main.woka.Web.Dao.KcTlFile;
import com.main.woka.Web.Mapper.KcFileMapper;
import com.main.woka.Web.Mapper.KcInfoRelationMapper;
import org.neo4j.driver.v1.StatementResult;

6
src/main/java/com/main/woka/Web/Service/impl/WordSplitter.java

@ -1,7 +1,7 @@
package com.main.woka.Web.Service.impl;
import com.main.woka.Common.util.KcInfo;
import com.main.woka.Common.util.KcSetInfo;
import com.main.woka.Web.Dao.KcInfo;
import com.main.woka.Web.Dao.KcSetInfo;
import com.main.woka.Web.Mapper.KcFileMapper;
import org.apache.poi.xwpf.usermodel.*;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
@ -1004,7 +1004,7 @@ public class WordSplitter {
doc.setName(title);
doc.setLevel(Long.valueOf(level));
doc.setTwUrl(path);
doc.setFileId(fileId);
doc.setFileId(Long.valueOf(String.valueOf(fileId)));
docList.add(doc);

43
src/main/resources/Mapper/KcFileMapper.xml

@ -5,7 +5,7 @@
<mapper namespace="com.main.woka.Web.Mapper.KcFileMapper">
<resultMap type="com.main.woka.Common.util.KcInfo" id="KcInfoResult">
<resultMap type="com.main.woka.Web.Dao.KcInfo" id="KcInfoResult">
<result property="id" column="id"/>
<result property="type" column="type"/>
<result property="name" column="name"/>
@ -28,7 +28,7 @@
<result property="jsType" column="js_type"/>
</resultMap>
<resultMap id="KcTlFileResult" type="com.main.woka.Common.util.KcTlFile">
<resultMap id="KcTlFileResult" type="com.main.woka.Web.Dao.KcTlFile">
<result property="id" column="id"/>
<result property="fileUrl" column="file_url"/>
<result property="createTime" column="create_time"/>
@ -57,7 +57,7 @@
<insert id="insertDoc" parameterType="com.main.woka.Common.util.KcInfo" useGeneratedKeys="true" keyProperty="id">
<insert id="insertDoc" parameterType="com.main.woka.Web.Dao.KcInfo" useGeneratedKeys="true" keyProperty="id">
insert into kcfz.kc_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
@ -116,7 +116,7 @@
<!-- where id = #{id}-->
<!-- </update>-->
<update id="updateDocById" parameterType="com.main.woka.Common.util.KcInfo">
<update id="updateDocById" parameterType="com.main.woka.Web.Dao.KcInfo">
update kc_info
<set>
<if test="name != null and name != ''">name = #{name},</if>
@ -272,4 +272,39 @@
where id = #{id}
</update>
<!-- 新代码 -->
<select id="getkcList" resultMap="KcInfoResult">
select * from kc_info
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="type != null">and type = #{type}</if>
<if test="parentId != null">and parent_id = #{parentId}</if>
<if test="fileId != null">and file_id = #{fileId}</if>
<if test="level != null">and level = #{level}</if>
<if test="twType != null and twType != ''">and tw_type = #{twType}</if>
<if test="spType != null and spType != ''">and sp_type = #{spType}</if>
<if test="dwType != null and dwType != ''">and dw_type = #{dwType}</if>
<if test="jsType != null and jsType != ''">and js_type = #{jsType}</if>
</where>
LIMIT #{pageSize} OFFSET #{offset}
</select>
<select id="getKcCount" resultType="java.lang.Long">
select count(id)
from kc_info
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="type != null">and type = #{type}</if>
<if test="parentId != null">and parent_id = #{parentId}</if>
<if test="fileId != null">and file_id = #{fileId}</if>
<if test="level != null">and level = #{level}</if>
<if test="twType != null and twType != ''">and tw_type = #{twType}</if>
<if test="spType != null and spType != ''">and sp_type = #{spType}</if>
<if test="dwType != null and dwType != ''">and dw_type = #{dwType}</if>
<if test="jsType != null and jsType != ''">and js_type = #{jsType}</if>
</where>
</select>
</mapper>

12
src/main/resources/Mapper/KcInfoRelationMapper.xml

@ -5,7 +5,7 @@
<mapper namespace="com.main.woka.Web.Mapper.KcInfoRelationMapper">
<resultMap type="com.main.woka.Common.util.KcInfoRelation" id="KcInfoRelationResult">
<resultMap type="com.main.woka.Web.Dao.KcInfoRelation" id="KcInfoRelationResult">
<result property="id" column="id"/>
<result property="sourceId" column="source_id"/>
<result property="targetId" column="target_id"/>
@ -16,7 +16,7 @@
</resultMap>
<insert id="insertDocRelation" parameterType="com.main.woka.Common.util.KcInfoRelation" useGeneratedKeys="true"
<insert id="insertDocRelation" parameterType="com.main.woka.Web.Dao.KcInfoRelation" useGeneratedKeys="true"
keyProperty="id">
insert into kc_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -36,7 +36,7 @@
from kc_relation where is_graph = 0</select>
<insert id="insertFile" parameterType="com.main.woka.Common.util.KcTlFile" useGeneratedKeys="true" keyProperty="id">
<insert id="insertFile" parameterType="com.main.woka.Web.Dao.KcTlFile" useGeneratedKeys="true" keyProperty="id">
INSERT INTO kc_tl_file (file_url, create_time,update_time, create_by, update_by,file_name)
VALUES (
@ -57,7 +57,7 @@
select id, source_id, target_id, relation, source_name, target_name,is_graph
from kc_relation </sql>
<select id="selectKcRelationshipList" parameterType="com.main.woka.Common.util.KcInfoRelation" resultMap="KcInfoRelationResult">
<select id="selectKcRelationshipList" parameterType="com.main.woka.Web.Dao.KcInfoRelation" resultMap="KcInfoRelationResult">
<include refid="selectKcRelationshipVo"/>
<where>
<if test="relation != null and relation != ''"> and relation = #{relation}</if>
@ -72,7 +72,7 @@
<include refid="selectKcRelationshipVo"/>
where id = #{id}
</select>
<insert id="insertKcRelationship" parameterType="com.main.woka.Common.util.KcInfoRelation" useGeneratedKeys="true" keyProperty="id">
<insert id="insertKcRelationship" parameterType="com.main.woka.Web.Dao.KcInfoRelation" useGeneratedKeys="true" keyProperty="id">
insert into kc_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="relation != null and relation != ''">relation,</if>
@ -91,7 +91,7 @@
<if test="isGraph != null">#{isGraph},</if>
</trim>
</insert>
<update id="updateKcRelationship" parameterType="com.main.woka.Common.util.KcInfoRelation">
<update id="updateKcRelationship" parameterType="com.main.woka.Web.Dao.KcInfoRelation">
update kc_relation
<trim prefix="SET" suffixOverrides=",">
<if test="relation != null and relation != ''">relation = #{relation},</if>

Loading…
Cancel
Save