喻忠伟 2 years ago
commit d7d615dfe8
  1. 13
      ant-design-vue-jeecg/package.json
  2. 187
      ant-design-vue-jeecg/src/App.vue
  3. 4
      ant-design-vue-jeecg/src/views/erp/accessories/ZyAccessoriesList.vue
  4. 2
      ant-design-vue-jeecg/src/views/erp/accessories/modules/ZyAccessoriesForm.vue
  5. 4
      ant-design-vue-jeecg/src/views/erp/fabric/ZyFabricList.vue
  6. 119
      ant-design-vue-jeecg/src/views/message/Speak-TTS.vue
  7. 335
      ant-design-vue-jeecg/src/views/message/ZySpeechMessageList.vue
  8. 114
      ant-design-vue-jeecg/src/views/message/modules/ZySpeechMessageForm.vue
  9. 60
      ant-design-vue-jeecg/src/views/message/modules/ZySpeechMessageModal.vue
  10. 84
      ant-design-vue-jeecg/src/views/message/modules/ZySpeechMessageModal__Style#Drawer.vue
  11. 32
      ant-design-vue-jeecg/src/views/speak/Speak-tts.vue
  12. 328
      ant-design-vue-jeecg/src/views/system/UserAnnouncementList.vue
  13. 3
      ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue
  14. 1
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/accessories/controller/ZyAccessoriesController.java
  15. 6
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/accessories/entity/ZyAccessories.java
  16. 157
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/controller/ZySpeechMessageController.java
  17. 92
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/entity/ZySpeechMessage.java
  18. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/mapper/ZySpeechMessageMapper.java
  19. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/service/IZySpeechMessageService.java
  20. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/service/impl/ZySpeechMessageServiceImpl.java
  21. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java
  22. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/mapper/ZyClothSampleMapper.java

@ -27,14 +27,17 @@
"echarts": "^5.3.0", "echarts": "^5.3.0",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"enquire.js": "^2.1.6", "enquire.js": "^2.1.6",
"html2canvas": "~1.0.0-rc.4",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"js-cookie": "^2.2.0", "js-cookie": "^2.2.0",
"jspdf": "^2.5.1",
"lodash.get": "^4.4.2", "lodash.get": "^4.4.2",
"lodash.pick": "^4.4.0", "lodash.pick": "^4.4.0",
"md5": "^2.2.1", "md5": "^2.2.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"qiankun": "^2.5.1", "qiankun": "^2.5.1",
"qs": "^6.10.3", "qs": "^6.10.3",
"speak-tts": "^2.0.8",
"tinymce": "5.4.1", "tinymce": "5.4.1",
"viser-vue": "^2.4.8", "viser-vue": "^2.4.8",
"vue": "^2.6.10", "vue": "^2.6.10",
@ -52,9 +55,7 @@
"vxe-table": "2.9.13", "vxe-table": "2.9.13",
"vxe-table-plugin-antd": "1.8.10", "vxe-table-plugin-antd": "1.8.10",
"xe-utils": "2.4.8", "xe-utils": "2.4.8",
"xss": "^1.0.13", "xss": "^1.0.13"
"html2canvas": "~1.0.0-rc.4",
"jspdf": "^2.5.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/polyfill": "^7.2.5", "@babel/polyfill": "^7.2.5",
@ -67,11 +68,11 @@
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-vue": "^5.1.0", "eslint-plugin-vue": "^5.1.0",
"html-webpack-plugin": "^4.2.0", "html-webpack-plugin": "^4.2.0",
"html2canvas": "~1.0.0-rc.4",
"jspdf": "^2.5.1",
"less": "^3.9.0", "less": "^3.9.0",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"vue-template-compiler": "^2.6.10", "vue-template-compiler": "^2.6.10"
"html2canvas": "~1.0.0-rc.4",
"jspdf": "^2.5.1"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,

@ -6,39 +6,166 @@
</a-config-provider> </a-config-provider>
</template> </template>
<script> <script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN' import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enquireScreen from '@/utils/device' import enquireScreen from '@/utils/device'
import Speech from "speak-tts";
import {getAction, putAction} from "@api/manage";
export default { export default {
data () { data() {
return { return {
locale: zhCN, locale: zhCN,
}
},
created () {
let that = this
enquireScreen(deviceType => {
// tablet
if (deviceType === 0) {
that.$store.commit('TOGGLE_DEVICE', 'mobile')
that.$store.dispatch('setSidebar', false)
}
// mobile
else if (deviceType === 1) {
that.$store.commit('TOGGLE_DEVICE', 'mobile')
that.$store.dispatch('setSidebar', false)
}
else {
that.$store.commit('TOGGLE_DEVICE', 'desktop')
that.$store.dispatch('setSidebar', true)
}
}) // speech: null,
// // ID
// timer: null,
// //
// millisec: 3000,
// url: {
// list: "/org.jeecg.modules.message/zySpeechMessage/list",
// edit: "/org.jeecg.modules.message/zySpeechMessage/edit",
// },
// // id
// messageList: [],
} }
} },
created() {
let that = this
enquireScreen(deviceType => {
// tablet
if (deviceType === 0) {
that.$store.commit('TOGGLE_DEVICE', 'mobile')
that.$store.dispatch('setSidebar', false)
}
// mobile
else if (deviceType === 1) {
that.$store.commit('TOGGLE_DEVICE', 'mobile')
that.$store.dispatch('setSidebar', false)
} else {
that.$store.commit('TOGGLE_DEVICE', 'desktop')
that.$store.dispatch('setSidebar', true)
}
})
},
// mounted() {
// this.speechInit();
// this.openTimer()
// },
// methods: {
// speechInit() {
// this.speech = new Speech();
// if (this.speech.hasBrowserSupport()) { // returns a boolean
// console.log("this browser,supported TTS")
// } else {
// console.log("sorry,this browser,not supported TTS!!!")
// }
// this.speech.init({
// 'volume': 1,
// 'lang': 'zh-CN',
// 'rate': 1,
// 'pitch': 1,
// 'splitSentences': true,
// }).then((conf) => {
// console.log('...,Speech:', conf)
// }).catch(e => {
// console.error("An error occured while init : ", e)
// })
// },
// //
// MySpeak(obj) {
// let mess = obj['message'];
// console.log("----------speak()-----------" + mess + "");
// this.speech.speak({
// text: mess,
// listeners: {
// //
// onstart: () => {
// console.log("Start utterance")
// },
// //
// onend: () => {
// // console.log("End utterance");
// console.log("------------delete----------" + mess + ",")
// this.updateMessageStatus(obj['id']);
// },
// //
// onresume: () => {
// console.log("Resume utterance")
// },
// },
// }).then(() => {
// // console.log("" + obj['id'] + "")
// })
// },
//
// getMessageList() {
// let parma = {
// "status": '0',
// }
// getAction(this.url.list, parma).then((res) => {
// if (res.success) {
// console.log("------------getMessageList---------->>>:" + JSON.stringify(res.result.records));
// this.messageList = res.result.records;
// this.messageList.forEach(obj => {
// if (obj['status'] === '0') {
// this.MySpeak(obj);
// }
// })
// } else {
// this.$message.warning(res.message)
// }
// }).finally(() => {
// // this.loading = false
// // this.loadData();
// })
// },
//
// updateMessageStatus(id) {
// // console.log("" + id);
// let parma = {
// "id": id,
// "status": '1',
// }
// putAction(this.url.edit, parma).then((res) => {
// if (res.success) {
// for (let i = 0; i < this.messageList.length; i++) {
// if (this.messageList[i].id === id) {
// this.messageList.splice(i, 1);
// }
// }
// } else {
// this.$message.warning(res.message)
// }
// })
// },
//
// openTimer() {
// this.closeTimer()
// console.log(">>>timer" + new Date().toLocaleString() + ",---: " + this.millisec+" ")
// //
// this.timer = setInterval(() => {
// console.log("---:", this.messageList.length)
// if (this.messageList.length === 0) {
// console.log("--------timer is exec,the current time:" + new Date().toLocaleString())
// this.getMessageList();
// } else {
// console.log("----------HOLD DOWN")
// }
// }, this.millisec)
// },
//
// /** */
// closeTimer() {
// if (this.timer) clearInterval(this.timer)
// },
// }
}
</script> </script>
<style> <style>
#app { #app {
height: 100%; height: 100%;
} }
</style> </style>

@ -84,9 +84,9 @@
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)">编辑</a>--> <a @click="handleEdit(record)">编辑</a>
<!-- <a-divider type="vertical" />--> <a-divider type="vertical" />
<!-- --> <!-- -->
<a @click="handleDetail(record.id)">详情</a> <a @click="handleDetail(record.id)">详情</a>

@ -8,7 +8,7 @@
<j-popup <j-popup
v-model="model.typeName" v-model="model.typeName"
field="typeName" field="typeName"
org-fields="nums,contents" org-fields="id,contents"
dest-fields="typeId,typeName" dest-fields="typeId,typeName"
code="zy_accessories_type" code="zy_accessories_type"
:multi="false" :multi="false"

@ -257,11 +257,11 @@ import ZyFabricFormDetailModel from './modules/ZyFabricFormDetailModel'
dataIndex: 'qrcode', dataIndex: 'qrcode',
scopedSlots: {customRender: 'imgeSlot'} scopedSlots: {customRender: 'imgeSlot'}
}, },
{ /* {
title:'等级', title:'等级',
align:"center", align:"center",
dataIndex: 'fabricGrade_dictText' dataIndex: 'fabricGrade_dictText'
}, },*/
{ {
title:'供货商信息', title:'供货商信息',
align:"center", align:"center",

@ -0,0 +1,119 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="mySpeak" icon="search" style="margin-left: 8px">mySpeak</a-button>
<a-button type="primary" @click="play" icon="search" style="margin-left: 8px">读取</a-button>
<a-button type="primary" @click="goahead" icon="search" style="margin-left: 8px">前进</a-button>
<a-button type="primary" @click="paused" icon="reload" style="margin-left: 8px">暂停</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
</a-card>
</template>
<script>
import Speech from 'speak-tts'
export default {
data() {
return {
speech: null
}
},
mounted() {
this.SpeechInit()
},
methods: {
SpeechInit() {
this.speech = new Speech()
this.speech.setLanguage('zh-CN')
/* this.speech.init({
'volume': 1,
// 'lang': 'en-US',
'lang': 'zh-CN',
'rate': 1,
'pitch': 1,
// 'voice':'Google UK English Male',
'splitSentences': true,
'listeners': {
'onvoiceschanged': (voices) => {
console.log("Event voiceschanged", voices)
}
}
})*/
// this.speech.init({
// 'volume': 1,
// 'lang': 'en-GB',
// 'rate': 1,
// 'pitch': 1,
// 'voice':'Google UK English Male',
// 'splitSentences': true,
// 'listeners': {
// 'onvoiceschanged': (voices) => {
// console.log("Event voiceschanged", voices)
// }
// }
// }).then((conf) => {
// console.log("the speech init,the config:",conf)
// })
},
mySpeak() {
this.speech.speak({
text: 'Hello, how are you today ?',
}).then(() => {
console.log("Success !")
}).catch(e => {
console.error("An error occurred :", e)
})
},
//
play() {
this.speech.speak({
text: "today ,tom收款203230元",
listeners: {
//
onstart: () => {
console.log("Start utterance")
},
//
onend: () => {
console.log("End utterance");
},
//
onresume: () => {
console.log("Resume utterance")
},
},
}).then(() => {
console.log("读取成功--------------------------------")
})
},
//
paused() {
this.speech.pause();
},
//
goahead() {
this.speech.resume();
console.log("继续播放-----------------------------")
},
//
// destroyed() {
// this.speech.cancel();
// },
}
}
</script>

@ -0,0 +1,335 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="消息">
<a-input placeholder="请输入消息" v-model="queryParam.message"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="是否已播报">
<j-dict-select-tag type="list" v-model="queryParam.status" dictCode="sfjj"
placeholder="请选择状态"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工单ID">
<a-input placeholder="请输入工单ID" v-model="queryParam.workorderId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="订单商品ID">
<a-input placeholder="请输入订单商品ID" v-model="queryParam.ordergoodsId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="生产计划工序ID">
<a-input placeholder="请输入生产计划工序ID" v-model="queryParam.zyplanprocessId"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<!-- <a @click="handleToggleSearch" style="margin-left: 8px">-->
<!-- {{ toggleSearchStatus ? '收起' : '展开' }}-->
<!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
<!-- </a>-->
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls('生产消息播报')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
<!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
<!-- </a-dropdown>-->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)">编辑</a>-->
<!-- <a-divider type="vertical" />-->
<!-- <a-dropdown>-->
<!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item>-->
<!-- <a @click="handleDetail(record)">详情</a>-->
<!-- </a-menu-item>-->
<!-- <a-menu-item>-->
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
</span>
</a-table>
</div>
<zy-speech-message-modal ref="modalForm" @ok="modalFormOk"></zy-speech-message-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZySpeechMessageModal from './modules/ZySpeechMessageModal'
import Speech from 'speak-tts'
import {getAction, putAction} from "@api/manage";
export default {
name: 'ZySpeechMessageList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZySpeechMessageModal
},
data() {
return {
description: '消息播报管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '消息',
align: "center",
dataIndex: 'message'
},
{
title: '播报状态',
align: "center",
dataIndex: 'status_dictText'
},
{
title: '工单ID',
align: "center",
dataIndex: 'workorderId'
},
{
title: '订单商品ID',
align: "center",
dataIndex: 'ordergoodsId'
},
{
title: '生产计划工序ID',
align: "center",
dataIndex: 'zyplanprocessId'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/org.jeecg.modules.message/zySpeechMessage/list",
edit: "/org.jeecg.modules.message/zySpeechMessage/edit",
getMessageList: "/org.jeecg.modules.message/zySpeechMessage/getMessageList",
delete: "/org.jeecg.modules.message/zySpeechMessage/delete",
deleteBatch: "/org.jeecg.modules.message/zySpeechMessage/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.message/zySpeechMessage/exportXls",
},
dictOptions: {},
superFieldList: [],
speech: null,
// ID
timer: null,
//
millisec: 20000,
/* 数据源 */
messageList: [],
}
},
mounted() {
this.speechInit();
this.openTimer()
},
methods: {
speechInit() {
this.speech = new Speech();
if (this.speech.hasBrowserSupport()) { // returns a boolean
console.log(">>>this browser,supported TTS")
} else {
console.log("XXX----------------------sorry,this browser,not supported TTS!!!")
}
this.speech.init({
'volume': 1,
'lang': 'zh-CN',
'rate': 1,
'pitch': 1,
'splitSentences': true,
}).then((conf) => {
console.log('>>>语音播报初始化完成...,Speech配置参数:', conf)
}).catch(e => {
console.error("XXX------------------------An error occured while init : ", e)
})
},
//
MySpeak(obj) {
let mess = obj['message'];
console.log("----------speak()接受到的消息-----------【" + mess + "】");
this.speech.speak({
text: mess,
listeners: {
//
onstart: () => {
console.log("Start utterance")
},
//
onend: () => {
// console.log("End utterance");
console.log("------------delete----------【" + mess + "】消息播报完成,删除该消息")
this.updateMessageStatus(obj['id']);
},
//
onresume: () => {
console.log("Resume utterance")
},
},
}).then(() => {
// console.log("" + obj['id'] + "")
})
},
getMessageList() {
let parma = {
"status": '0',
}
getAction(this.url.list, parma).then((res) => {
if (res.success) {
console.log("------------getMessageList----------文字转语音消息列表>>>:" + JSON.stringify(res.result.records));
this.messageList = res.result.records;
this.messageList.forEach(obj => {
if (obj['status'] === '0') {
this.MySpeak(obj);
}
})
} else {
this.$message.warning(res.message)
}
}).finally(() => {
// this.loading = false
// this.loadData();
})
},
updateMessageStatus(id) {
// console.log("" + id);
let parma = {
"id": id,
"status": '1',
}
putAction(this.url.edit, parma).then((res) => {
if (res.success) {
for (let i = 0; i < this.messageList.length; i++) {
if (this.messageList[i].id === id) {
//datasource
this.messageList.splice(i, 1);
}
}
} else {
this.$message.warning(res.message)
}
})
},
openTimer() {
this.closeTimer()
console.log(">>>timer初始化完成【" + new Date().toLocaleString() + "】,---执行周期: " + this.millisec + " 毫秒")
//
this.timer = setInterval(() => {
console.log("---未播报消息数量:", this.messageList.length)
// console.log("the messageList:", JSON.stringify(this.messageList));
if (this.messageList.length === 0) {
console.log("--------timer is exec,the current time:" + new Date().toLocaleString())
this.getMessageList();
} else {
console.log("-------上次消息列表未处理完---HOLD DOWN")
}
}, this.millisec)
},
/** 关闭定时器 */
closeTimer() {
if (this.timer) clearInterval(this.timer)
},
//
paused() {
this.speech.pause();
},
//
goahead() {
this.speech.resume();
console.log("继续播放-----------------------------")
},
},
//
destroyed() {
console.log("-----------关闭Timer、Speech---------------")
this.closeTimer();
this.speech.cancel();
},
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,114 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="工单id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workorderId">
<a-input v-model="model.workorderId" placeholder="请输入工单id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产计划工序id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zyplanprocessId">
<a-input v-model="model.zyplanprocessId" placeholder="请输入生产计划工序id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="播报状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<a-input v-model="model.status" placeholder="请输入播报状态" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'ZySpeechMessageForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/org.jeecg.modules.message/zySpeechMessage/add",
edit: "/org.jeecg.modules.message/zySpeechMessage/edit",
queryById: "/org.jeecg.modules.message/zySpeechMessage/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-speech-message-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-speech-message-form>
</j-modal>
</template>
<script>
import ZySpeechMessageForm from './ZySpeechMessageForm'
export default {
name: 'ZySpeechMessageModal',
components: {
ZySpeechMessageForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<zy-speech-message-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-speech-message-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import ZySpeechMessageForm from './ZySpeechMessageForm'
export default {
name: 'ZySpeechMessageModal',
components: {
ZySpeechMessageForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,32 @@
<template>
<el-button type="success" @click="speakTtsSpeech">speak-tts语音播报</el-button>
</template>
<script>
import Speech from "speak-tts"; // es6
export default {
name: "SpeechDemo",
data() {
return {
speech: null,
};
},
mounted() {
this.speechInit();
},
methods: {
speakTtsSpeech() {
this.speech.speak({ text: "公众号:霸道的程序猿" }).then(() => {
console.log("读取成功");
});
},
speechInit() {
this.speech = new Speech();
this.speech.setLanguage("zh-CN");
this.speech.init().then(() => {});
},
},
};
</script>
<style scoped>
</style>

@ -16,7 +16,7 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8" > <a-col :span="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
@ -51,142 +51,212 @@
</template> </template>
<script> <script>
import { filterObj } from '@/utils/util' import {filterObj} from '@/utils/util'
import { getAction,putAction } from '@/api/manage' import {getAction, putAction} from '@/api/manage'
import ShowAnnouncement from '@/components/tools/ShowAnnouncement' import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import DynamicNotice from '@/components/tools/DynamicNotice' import DynamicNotice from '@/components/tools/DynamicNotice'
import Speech from 'speak-tts'
export default {
name: "UserAnnouncementList",
mixins: [JeecgListMixin], export default {
components: { name: "UserAnnouncementList",
DynamicNotice, mixins: [JeecgListMixin],
ShowAnnouncement components: {
}, DynamicNotice,
data () { ShowAnnouncement
return { },
description: '系统通告表管理页面', data() {
queryParam: {}, return {
columns: [{ description: '系统通告表管理页面',
title: '标题', queryParam: {},
align:"center", columns: [{
dataIndex: 'titile' title: '标题',
},{ align: "center",
title: '消息类型', dataIndex: 'titile'
align: "center", }, {
dataIndex: 'msgCategory', title: '消息类型',
customRender: function (text) { align: "center",
if (text == '1') { dataIndex: 'msgCategory',
return "通知公告"; customRender: function (text) {
} else if (text == "2") { if (text == '1') {
return "系统消息"; return "通知公告";
} else { } else if (text == "2") {
return text; return "系统消息";
} } else {
} return text;
},{
title: '发布人',
align:"center",
dataIndex: 'sender'
},{
title: '发布时间',
align:"center",
dataIndex: 'sendTime'
},{
title: '优先级',
align:"center",
dataIndex: 'priority',
customRender:function (text) {
if(text=='L'){
return "低";
}else if(text=="M"){
return "中";
}else if(text=="H"){
return "高";
} else {
return text;
}
}
},{
title: '阅读状态',
align:"center",
dataIndex: 'readFlag',
customRender:function (text) {
if(text=='0'){
return "未读";
}else if(text=="1"){
return "已读";
} else {
return text;
}
} }
},{ }
title: '操作', }, {
dataIndex: 'action', title: '发布人',
align:"center", align: "center",
scopedSlots: { customRender: 'action' }, dataIndex: 'sender'
}], }, {
url: { title: '发布时间',
list: "/sys/sysAnnouncementSend/getMyAnnouncementSend", align: "center",
editCementSend:"sys/sysAnnouncementSend/editByAnntIdAndUserId", dataIndex: 'sendTime'
readAllMsg:"sys/sysAnnouncementSend/readAll", }, {
}, title: '优先级',
loading:false, align: "center",
openPath:'', dataIndex: 'priority',
formData:'' customRender: function (text) {
} if (text == 'L') {
}, return "低";
methods: { } else if (text == "M") {
handleDetail: function(record){ return "中";
this.$refs.sysAnnouncementModal.detail(record); } else if (text == "H") {
this.$refs.sysAnnouncementModal.title="查看"; return "高";
}, } else {
showAnnouncement(record){ return text;
putAction(this.url.editCementSend,{anntId:record.anntId}).then((res)=>{
if(res.success){
this.loadData();
this.syncHeadNotic(record.anntId)
} }
});
if(record.openType==='component'){
this.openPath = record.openPage;
this.formData = {id:record.busId};
this.$refs.showDynamNotice.detail();
}else{
this.$refs.ShowAnnouncement.detail(record);
} }
}, }, {
syncHeadNotic(anntId){ title: '阅读状态',
getAction("sys/annountCement/syncNotic",{anntId:anntId}) align: "center",
}, dataIndex: 'readFlag',
readAll(){ customRender: function (text) {
var that = this; if (text == '0') {
that.$confirm({ return "未读";
title:"确认操作", } else if (text == "1") {
content:"是否全部标注已读?", return "已读";
onOk: function(){ } else {
putAction(that.url.readAllMsg).then((res)=>{ return text;
if(res.success){
that.$message.success(res.message);
that.loadData();
that.syncHeadNotic();
}
});
} }
}); }
}, {
title: '操作',
dataIndex: 'action',
align: "center",
scopedSlots: {customRender: 'action'},
}],
url: {
list: "/sys/sysAnnouncementSend/getMyAnnouncementSend",
editCementSend: "sys/sysAnnouncementSend/editByAnntIdAndUserId",
readAllMsg: "sys/sysAnnouncementSend/readAll",
}, },
loading: false,
openPath: '',
formData: ''
} }
},
mounted() {
this.speechInit();
},
methods: {
handleDetail: function (record) {
this.$refs.sysAnnouncementModal.detail(record);
this.$refs.sysAnnouncementModal.title = "查看";
},
showAnnouncement(record) {
putAction(this.url.editCementSend, {anntId: record.anntId}).then((res) => {
if (res.success) {
this.loadData();
this.syncHeadNotic(record.anntId)
}
});
if (record.openType === 'component') {
this.openPath = record.openPage;
this.formData = {id: record.busId};
this.$refs.showDynamNotice.detail();
} else {
this.$refs.ShowAnnouncement.detail(record);
}
},
syncHeadNotic(anntId) {
getAction("sys/annountCement/syncNotic", {anntId: anntId})
},
readAll() {
var that = this;
that.$confirm({
title: "确认操作",
content: "是否全部标注已读?",
onOk: function () {
putAction(that.url.readAllMsg).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.loadData();
that.syncHeadNotic();
}
});
}
});
},
speechInit() {
this.speech = new Speech();
this.speech.setLanguage('zh-CN');
this.speech.init().then(() => {
console.log('语音播报初始化完成...')
this.MySpeak();
})
},
//
MySpeak() {
this.speech.speak({
text: "测试javascript语音合成",
listeners: {
//
onstart: () => {
console.log("Start utterance")
},
//
onend: () => {
console.log("End utterance");
},
//
onresume: () => {
console.log("Resume utterance")
},
},
}).then(() => {
// alert("MySpeak()...");
console.log("MySpeak()---------------播报完成...")
})
},
//
paused() {
this.speech.pause();
},
//
goahead() {
this.speech.resume();
console.log("继续播放-----------------------------")
},
//
// destroyed() {
// this.speech.cancel();
// },
} }
}
</script> </script>
<style scoped> <style scoped>
.ant-card-body .table-operator{ .ant-card-body .table-operator {
margin-bottom: 18px; margin-bottom: 18px;
} }
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}z .anty-row-operator button {
margin: 0 5px
}
.ant-btn-danger {
background-color: #ffffff
}
z
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp{height: 100%} .ant-modal-cust-warp .ant-modal-content {
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto} height: 90% !important;
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden} overflow-y: hidden
}
</style> </style>

@ -10,7 +10,8 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> <a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" :dictCode="lx" placeholder="请选择类型" @change="getks()"/> <!--<j-dict-select-tag type="list" v-model="model.clothsTypeId" :dictCode="lx" placeholder="请选择类型" @change="getks()"/>-->
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择类型" @change="getks()"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">

@ -106,6 +106,7 @@ public class ZyAccessoriesController extends JeecgController<ZyAccessories, IZyA
public Result<?> edit(@RequestBody ZyAccessories zyAccessories) { public Result<?> edit(@RequestBody ZyAccessories zyAccessories) {
QueryWrapper queryWrapper=new QueryWrapper(); QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("contents",zyAccessories.getContents()); queryWrapper.eq("contents",zyAccessories.getContents());
queryWrapper.ne("id",zyAccessories.getId());
int a= zyAccessoriesService.count(queryWrapper); int a= zyAccessoriesService.count(queryWrapper);
if(a>=1){ if(a>=1){
return Result.error("名称重复,请修改后重试!!"); return Result.error("名称重复,请修改后重试!!");

@ -38,8 +38,12 @@ public class ZyAccessories implements Serializable {
/**类型id*/ /**类型id*/
@Excel(name = "类型id", width = 15) @Excel(name = "类型id", width = 15)
@ApiModelProperty(value = "类型id") @ApiModelProperty(value = "类型id")
@Dict(dictTable = "zy_accessories_type", dicText = "contents", dicCode = "nums") @Dict(dictTable = "zy_accessories_type", dicText = "contents", dicCode = "id")
private java.lang.String typeId; private java.lang.String typeId;
/**类型名称*/
@Excel(name = "类型名称", width = 15)
@ApiModelProperty(value = "类型名称")
private java.lang.String typeName;
/**编号*/ /**编号*/
@Excel(name = "编号", width = 15) @Excel(name = "编号", width = 15)
@ApiModelProperty(value = "编号") @ApiModelProperty(value = "编号")

@ -0,0 +1,157 @@
package org.jeecg.modules.message.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.message.entity.ZySpeechMessage;
import org.jeecg.modules.message.service.IZySpeechMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: 生产消息播报
* @Author: jeecg-boot
* @Date: 2023-04-21
* @Version: V1.0
*/
@Api(tags = "生产消息播报")
@RestController
@RequestMapping("/org.jeecg.modules.message/zySpeechMessage")
@Slf4j
public class ZySpeechMessageController extends JeecgController<ZySpeechMessage, IZySpeechMessageService> {
@Autowired
private IZySpeechMessageService zySpeechMessageService;
/**
* 分页列表查询
*
* @param zySpeechMessage
* @param pageNo
* @param pageSize
* @param req
* @return
*/
// @AutoLog(value = "生产消息播报-分页列表查询")
@ApiOperation(value = "生产消息播报-分页列表查询", notes = "生产消息播报-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZySpeechMessage zySpeechMessage,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZySpeechMessage> queryWrapper = QueryGenerator.initQueryWrapper(zySpeechMessage, req.getParameterMap());
queryWrapper.orderByAsc("create_time");
Page<ZySpeechMessage> page = new Page<ZySpeechMessage>(pageNo, pageSize);
IPage<ZySpeechMessage> pageList = zySpeechMessageService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zySpeechMessage
* @return
*/
@AutoLog(value = "生产消息播报-添加")
@ApiOperation(value = "生产消息播报-添加", notes = "生产消息播报-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZySpeechMessage zySpeechMessage) {
zySpeechMessageService.save(zySpeechMessage);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zySpeechMessage
* @return
*/
// @AutoLog(value = "生产消息播报-编辑")
@ApiOperation(value = "生产消息播报-编辑", notes = "生产消息播报-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZySpeechMessage zySpeechMessage) {
zySpeechMessageService.updateById(zySpeechMessage);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "生产消息播报-通过id删除")
@ApiOperation(value = "生产消息播报-通过id删除", notes = "生产消息播报-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
zySpeechMessageService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "生产消息播报-批量删除")
@ApiOperation(value = "生产消息播报-批量删除", notes = "生产消息播报-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.zySpeechMessageService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "生产消息播报-通过id查询")
@ApiOperation(value = "生产消息播报-通过id查询", notes = "生产消息播报-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
ZySpeechMessage zySpeechMessage = zySpeechMessageService.getById(id);
if (zySpeechMessage == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zySpeechMessage);
}
/**
* 导出excel
*
* @param request
* @param zySpeechMessage
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZySpeechMessage zySpeechMessage) {
return super.exportXls(request, zySpeechMessage, ZySpeechMessage.class, "生产消息播报");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZySpeechMessage.class);
}
}

@ -0,0 +1,92 @@
package org.jeecg.modules.message.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 生产消息播报
* @Author: jeecg-boot
* @Date: 2023-04-21
* @Version: V1.0
*/
@Data
@TableName("zy_speech_message")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "zy_speech_message对象", description = "生产消息播报")
public class ZySpeechMessage implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**
* 订单商品id
*/
@Excel(name = "订单商品id", width = 15)
@ApiModelProperty(value = "订单商品id")
private String ordergoodsId;
/**
* 工单id
*/
@Excel(name = "工单id", width = 15)
@ApiModelProperty(value = "工单id")
private String workorderId;
/**
* 生产计划工序id
*/
@Excel(name = "生产计划工序id", width = 15)
@ApiModelProperty(value = "生产计划工序id")
private String zyplanprocessId;
/**
* 播报状态
*/
@Excel(name = "播报状态", width = 15)
@ApiModelProperty(value = "是否加急")
@Dict(dicCode = "sfjj")
private String status;
@Excel(name = "消息", width = 15)
@ApiModelProperty(value = "消息")
private String message;
}

@ -0,0 +1,15 @@
package org.jeecg.modules.message.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.message.entity.ZySpeechMessage;
/**
* @Description: 生产消息播报
* @Author: jeecg-boot
* @Date: 2023-04-21
* @Version: V1.0
*/
public interface ZySpeechMessageMapper extends BaseMapper<ZySpeechMessage> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.message.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.message.entity.ZySpeechMessage;
/**
* @Description: 生产消息播报
* @Author: jeecg-boot
* @Date: 2023-04-21
* @Version: V1.0
*/
public interface IZySpeechMessageService extends IService<ZySpeechMessage> {
}

@ -0,0 +1,18 @@
package org.jeecg.modules.message.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.message.entity.ZySpeechMessage;
import org.jeecg.modules.message.mapper.ZySpeechMessageMapper;
import org.jeecg.modules.message.service.IZySpeechMessageService;
import org.springframework.stereotype.Service;
/**
* @Description: 生产消息播报
* @Author: jeecg-boot
* @Date: 2023-04-21
* @Version: V1.0
*/
@Service
public class ZySpeechMessageServiceImpl extends ServiceImpl<ZySpeechMessageMapper, ZySpeechMessage> implements IZySpeechMessageService {
}

@ -13,6 +13,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.message.entity.ZySpeechMessage;
import org.jeecg.modules.message.service.IZySpeechMessageService;
import org.jeecg.modules.productplan.entity.ZyProductPlan; import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.productplan.service.IZyProductPlanService;
@ -50,6 +52,9 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
@Autowired @Autowired
private ISysUserService iSysUserService; private ISysUserService iSysUserService;
@Autowired
private IZySpeechMessageService iZySpeechMessageService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -90,6 +95,15 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProductPlan zyProductPlan) { public Result<?> add(@RequestBody ZyProductPlan zyProductPlan) {
zyProductPlanService.create(zyProductPlan); zyProductPlanService.create(zyProductPlan);
//保存生产计划语音播报消息
ZySpeechMessage zySpeechMessage = new ZySpeechMessage();
String productCode = zyProductPlan.getProductCode();
String code = productCode.substring(productCode.length() - 10);
String mess = "工单尾号" + code + ",生产计划已完成制定,请跟进后续生产作业.";
zySpeechMessage.setMessage(mess);
zySpeechMessage.setWorkorderId(productCode);
iZySpeechMessageService.save(zySpeechMessage);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }

@ -19,7 +19,7 @@ public interface ZyClothSampleMapper extends BaseMapper<ZyClothSample> {
@Select("select nums from zy_cloth_sample where style_id=#{styleId} and stylemodel_id=#{stylemodelId} order by nums desc limit 0,1") @Select("select nums from zy_cloth_sample where style_id=#{styleId} and stylemodel_id=#{stylemodelId} order by nums desc limit 0,1")
String findSort(@Param("styleId") String styleId, @Param("stylemodelId") String stylemodelId); String findSort(@Param("styleId") String styleId, @Param("stylemodelId") String stylemodelId);
@Select("select model_code from zy_style_model where id=#{stylemodelId}") @Select("select model_number from zy_style_model where id=#{stylemodelId}")
String findCode(String stylemodelId); String findCode(String stylemodelId);
@Select("select nums from zy_cloths_style where id=#{styleId}") @Select("select nums from zy_cloths_style where id=#{styleId}")

Loading…
Cancel
Save