Browse Source

修复期货bug,增加接口和配置

master
cgx 5 months ago
parent
commit
a666ff11cd
15 changed files with 895 additions and 33 deletions
  1. +163
    -0
      admin-hanhai-vue/src/views/picConfig/TbConfList.vue
  2. +109
    -0
      admin-hanhai-vue/src/views/picConfig/modules/TbConfForm.vue
  3. +84
    -0
      admin-hanhai-vue/src/views/picConfig/modules/TbConfModal.Style#Drawer.vue
  4. +60
    -0
      admin-hanhai-vue/src/views/picConfig/modules/TbConfModal.vue
  5. +0
    -16
      admin-hanhai-vue/src/views/tbConf/TbConfList.vue
  6. +162
    -0
      admin-hanhai-vue/src/views/textConf/TbConfList.vue
  7. +109
    -0
      admin-hanhai-vue/src/views/textConf/modules/TbConfForm.vue
  8. +84
    -0
      admin-hanhai-vue/src/views/textConf/modules/TbConfModal.Style#Drawer.vue
  9. +60
    -0
      admin-hanhai-vue/src/views/textConf/modules/TbConfModal.vue
  10. +30
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/tbConf/controller/TbConfController.java
  11. +11
    -2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/controller/IndexController.java
  12. +11
    -14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/controller/ProductController.java
  13. +2
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/service/IndexService.java
  14. +8
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/service/impl/IndexServiceImpl.java
  15. +2
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/entity/ProductReq.java

+ 163
- 0
admin-hanhai-vue/src/views/picConfig/TbConfList.vue View File

@ -0,0 +1,163 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 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">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<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>
<tb-conf-modal ref="modalForm" @ok="modalFormOk"></tb-conf-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TbConfModal from './modules/TbConfModal'
export default {
name: 'TbConfList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TbConfModal
},
data () {
return {
description: 'tb_conf管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'配置图片',
align:"center",
dataIndex: 'value',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'配置项',
align:"center",
dataIndex: 'info'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/tbConf/tbConf/picList",
delete: "/tbConf/tbConf/delete",
deleteBatch: "/tbConf/tbConf/deleteBatch",
exportXlsUrl: "/tbConf/tbConf/exportXls",
importExcelUrl: "tbConf/tbConf/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'Text',value:'value',text:'配置值',dictCode:''})
fieldList.push({type:'string',value:'info',text:'配置项',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 109
- 0
admin-hanhai-vue/src/views/picConfig/modules/TbConfForm.vue View File

@ -0,0 +1,109 @@
<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="配置图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="value">
<j-image-upload isMultiple v-model="model.value" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="配置项" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="info">
<a-input v-model="model.info" 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: 'TbConfForm',
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: "/tbConf/tbConf/add",
edit: "/tbConf/tbConf/edit",
queryById: "/tbConf/tbConf/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>

+ 84
- 0
admin-hanhai-vue/src/views/picConfig/modules/TbConfModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tb-conf-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tb-conf-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 TbConfForm from './TbConfForm'
export default {
name: 'TbConfModal',
components: {
TbConfForm
},
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>

+ 60
- 0
admin-hanhai-vue/src/views/picConfig/modules/TbConfModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tb-conf-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tb-conf-form>
</j-modal>
</template>
<script>
import TbConfForm from './TbConfForm'
export default {
name: 'TbConfModal',
components: {
TbConfForm
},
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
- 16
admin-hanhai-vue/src/views/tbConf/TbConfList.vue View File

@ -9,22 +9,6 @@
</div> </div>
<!-- 查询区域-END --> <!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button type="primary" icon="download" @click="handleExportXls('tb_conf')">导出</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 --> <!-- table区域-begin -->
<div> <div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">


+ 162
- 0
admin-hanhai-vue/src/views/textConf/TbConfList.vue View File

@ -0,0 +1,162 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 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">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<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>
<tb-conf-modal ref="modalForm" @ok="modalFormOk"></tb-conf-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TbConfModal from './modules/TbConfModal'
export default {
name: 'TbConfList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TbConfModal
},
data () {
return {
description: 'tb_conf管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'协议配置',
align:"center",
dataIndex: 'value',
scopedSlots: {customRender: 'htmlSlot'}
},
{
title:'配置项',
align:"center",
dataIndex: 'info'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/tbConf/tbConf/textList",
delete: "/tbConf/tbConf/delete",
deleteBatch: "/tbConf/tbConf/deleteBatch",
exportXlsUrl: "/tbConf/tbConf/exportXls",
importExcelUrl: "tbConf/tbConf/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'Text',value:'value',text:'配置值',dictCode:''})
fieldList.push({type:'string',value:'info',text:'配置项',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 109
- 0
admin-hanhai-vue/src/views/textConf/modules/TbConfForm.vue View File

@ -0,0 +1,109 @@
<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="协议配置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="value">
<j-editor v-model="model.value" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="配置项" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="info">
<a-input v-model="model.info" 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: 'TbConfForm',
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: "/tbConf/tbConf/add",
edit: "/tbConf/tbConf/edit",
queryById: "/tbConf/tbConf/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>

+ 84
- 0
admin-hanhai-vue/src/views/textConf/modules/TbConfModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tb-conf-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tb-conf-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 TbConfForm from './TbConfForm'
export default {
name: 'TbConfModal',
components: {
TbConfForm
},
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>

+ 60
- 0
admin-hanhai-vue/src/views/textConf/modules/TbConfModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tb-conf-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tb-conf-form>
</j-modal>
</template>
<script>
import TbConfForm from './TbConfForm'
export default {
name: 'TbConfModal',
components: {
TbConfForm
},
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>

+ 30
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/tbConf/controller/TbConfController.java View File

@ -57,7 +57,36 @@ public class TbConfController extends JeecgController<TbConf, ITbConfService> {
IPage<TbConf> pageList = tbConfService.page(page, queryWrapper); IPage<TbConf> pageList = tbConfService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
@ApiOperation(value="tb_conf-分页列表查询", notes="tb_conf-分页列表查询")
@GetMapping(value = "/textList")
public Result<IPage<TbConf>> queryPageTextList(TbConf tbConf,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TbConf> queryWrapper = QueryGenerator.initQueryWrapper(tbConf, req.getParameterMap());
Page<TbConf> page = new Page<TbConf>(pageNo, pageSize);
queryWrapper.eq("dict_group","sys_text");
IPage<TbConf> pageList = tbConfService.page(page, queryWrapper);
return Result.OK(pageList);
}
@ApiOperation(value="tb_conf-分页列表查询", notes="tb_conf-分页列表查询")
@GetMapping(value = "/picList")
public Result<IPage<TbConf>> queryPagePicList(TbConf tbConf,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TbConf> queryWrapper = QueryGenerator.initQueryWrapper(tbConf, req.getParameterMap());
Page<TbConf> page = new Page<TbConf>(pageNo, pageSize);
queryWrapper.eq("dict_group","sys_pic");
IPage<TbConf> pageList = tbConfService.page(page, queryWrapper);
return Result.OK(pageList);
}
/** /**
* 添加 * 添加
* *


+ 11
- 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/controller/IndexController.java View File

@ -63,7 +63,7 @@ public class IndexController {
List<JSONObject> strings = JSON.parseArray(String.valueOf(data), JSONObject.class); List<JSONObject> strings = JSON.parseArray(String.valueOf(data), JSONObject.class);
//取前12条数据返回 //取前12条数据返回
List<JSONObject> collect = strings.stream().limit(12).collect(Collectors.toList()); List<JSONObject> collect = strings.stream().limit(12).collect(Collectors.toList());
jsonObject.put("data",collect);
jsonObject.put("data", collect);
return Result.ok(jsonObject); return Result.ok(jsonObject);
} }
@ -79,7 +79,7 @@ public class IndexController {
@ApiOperation(value = "获取banner列表") @ApiOperation(value = "获取banner列表")
@RequestMapping(value = "/bannerList", method = RequestMethod.POST) @RequestMapping(value = "/bannerList", method = RequestMethod.POST)
public Result<Map<Integer, List<WebBanner>>> bannerList(@RequestHeader("X-Access-Token") String token) {
public Result<Map<Integer, List<WebBanner>>> bannerList(@RequestHeader(value = "X-Access-Token", required = false) String token) {
return indexService.bannerList(); return indexService.bannerList();
} }
@ -97,4 +97,13 @@ public class IndexController {
} }
@ApiOperation(value = "获取平台隐私政策,协议等")
@RequestMapping(value = "/getSysText", method = RequestMethod.POST)
public Result getSysText(@RequestHeader(value = "X-Access-Token", required = false) String token) {
Result<?> indexInfo = indexService.getSysText(token);
return indexInfo;
}
} }

+ 11
- 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/controller/ProductController.java View File

@ -66,11 +66,12 @@ public class ProductController extends JeecgController<TbProduct, ProductService
@GetMapping(value = "/productList") @GetMapping(value = "/productList")
public Result<IPage<TbProduct>> queryPageList( public Result<IPage<TbProduct>> queryPageList(
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "productType") Integer productType,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
log.info("产品报价分页列表参数{}", JSONObject.toJSONString(req.getParameterMap())); log.info("产品报价分页列表参数{}", JSONObject.toJSONString(req.getParameterMap()));
QueryWrapper<TbProduct> queryWrapper = QueryGenerator.initQueryWrapper(new TbProduct(), req.getParameterMap()); QueryWrapper<TbProduct> queryWrapper = QueryGenerator.initQueryWrapper(new TbProduct(), req.getParameterMap());
queryWrapper.eq("audit_status", 1)
queryWrapper.eq("audit_status", 1).eq("product_type", productType)
.orderByDesc("sort_num", "create_time"); .orderByDesc("sort_num", "create_time");
Page<TbProduct> page = new Page<TbProduct>(pageNo, pageSize); Page<TbProduct> page = new Page<TbProduct>(pageNo, pageSize);
IPage<TbProduct> pageList = tbProductService.page(page, queryWrapper); IPage<TbProduct> pageList = tbProductService.page(page, queryWrapper);
@ -109,16 +110,14 @@ public class ProductController extends JeecgController<TbProduct, ProductService
} }
@ApiOperation(value="撤单", notes="撤单")
@ApiOperation(value = "撤单", notes = "撤单")
@GetMapping(value = "/noShow") @GetMapping(value = "/noShow")
public Result<String> noShow(@RequestParam(name="id",required=true ) String id , @RequestHeader("X-Access-Token") String token) {
public Result<String> noShow(@RequestParam(name = "id", required = true) String id, @RequestHeader("X-Access-Token") String token) {
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiAccount(token); HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiAccount(token);
QueryWrapper<TbProduct> productQueryWrapper = new QueryWrapper<>(); QueryWrapper<TbProduct> productQueryWrapper = new QueryWrapper<>();
productQueryWrapper.eq("user_id", hanHaiMember.getId()).eq("id", id); productQueryWrapper.eq("user_id", hanHaiMember.getId()).eq("id", id);
TbProduct one = tbProductService.getOne(productQueryWrapper); TbProduct one = tbProductService.getOne(productQueryWrapper);
if (ValidateTool.isNull(one)){
if (ValidateTool.isNull(one)) {
return Result.error("参数错误!"); return Result.error("参数错误!");
} }
one.setShowStatus(1); one.setShowStatus(1);
@ -127,7 +126,6 @@ public class ProductController extends JeecgController<TbProduct, ProductService
} }
/** /**
* 添加 * 添加
* *
@ -142,7 +140,7 @@ public class ProductController extends JeecgController<TbProduct, ProductService
} }
@ApiOperation(value="清关申请", notes="清关申请")
@ApiOperation(value = "清关申请", notes = "清关申请")
@PostMapping(value = "/addCustoms") @PostMapping(value = "/addCustoms")
public Result<String> addCustoms(@RequestBody CustomsReq customsReq, @RequestHeader("X-Access-Token") String token) { public Result<String> addCustoms(@RequestBody CustomsReq customsReq, @RequestHeader("X-Access-Token") String token) {
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiAccount(token); HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiAccount(token);
@ -154,16 +152,16 @@ public class ProductController extends JeecgController<TbProduct, ProductService
} }
@ApiOperation(value="下订单", notes="订单")
@ApiOperation(value = "下订单", notes = "订单")
@PostMapping(value = "/addProductOrder") @PostMapping(value = "/addProductOrder")
public Result<String> addProductOrder(@RequestBody ProductOrderReq productOrderReq, @RequestHeader("X-Access-Token") String token) { public Result<String> addProductOrder(@RequestBody ProductOrderReq productOrderReq, @RequestHeader("X-Access-Token") String token) {
if (ValidateTool.isNull(productOrderReq)){
if (ValidateTool.isNull(productOrderReq)) {
return Result.error("参数不能为空!"); return Result.error("参数不能为空!");
} }
if (ValidateTool.isNull(productOrderReq.getNum())){
if (ValidateTool.isNull(productOrderReq.getNum())) {
return Result.error("请选择数量"); return Result.error("请选择数量");
} }
if (ValidateTool.isNull(productOrderReq.getProductId())){
if (ValidateTool.isNull(productOrderReq.getProductId())) {
return Result.error("请选择产品"); return Result.error("请选择产品");
} }
Result result = tbProductService.addProductOrder(productOrderReq, token); Result result = tbProductService.addProductOrder(productOrderReq, token);
@ -187,7 +185,7 @@ public class ProductController extends JeecgController<TbProduct, ProductService
} }
@ApiOperation(value="确认/取消订单", notes="确认/取消订单")
@ApiOperation(value = "确认/取消订单", notes = "确认/取消订单")
@PostMapping(value = "/updateOrder") @PostMapping(value = "/updateOrder")
public Result<String> updateOrder(@RequestBody UpdateOrderReq updateOrderReq, @RequestHeader("X-Access-Token") String token) { public Result<String> updateOrder(@RequestBody UpdateOrderReq updateOrderReq, @RequestHeader("X-Access-Token") String token) {
@ -196,5 +194,4 @@ public class ProductController extends JeecgController<TbProduct, ProductService
} }
} }

+ 2
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/service/IndexService.java View File

@ -12,6 +12,8 @@ public interface IndexService {
//获取首页基础信息 //获取首页基础信息
Result<?> getIndexInfo(String token); Result<?> getIndexInfo(String token);
Result<?> getSysText(String token);
Result<Map<Integer, List<WebBanner>>> bannerList(); Result<Map<Integer, List<WebBanner>>> bannerList();
} }

+ 8
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/service/impl/IndexServiceImpl.java View File

@ -85,4 +85,12 @@ public class IndexServiceImpl implements IndexService {
Map<Integer, List<WebBanner>> collect = bannerList.stream().sorted(Comparator.comparing(WebBanner::getSort).reversed()).collect(Collectors.groupingBy(WebBanner::getType)); Map<Integer, List<WebBanner>> collect = bannerList.stream().sorted(Comparator.comparing(WebBanner::getSort).reversed()).collect(Collectors.groupingBy(WebBanner::getType));
return Result.ok(collect); return Result.ok(collect);
} }
@Override
public Result<?> getSysText(String token) {
QueryWrapper<TbConf> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("dict_group", "sys_text");
List<TbConf> list = tbConfService.list(queryWrapper);
return Result.ok(list);
}
} }

+ 2
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/entity/ProductReq.java View File

@ -33,6 +33,8 @@ public class ProductReq implements Serializable {
@Excel(name = "单价", width = 15) @Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价") @ApiModelProperty(value = "单价")
private BigDecimal price; private BigDecimal price;
@ApiModelProperty(value = "期货现货 0期货 1 现货")
private java.lang.Integer productType;
/**暂定数量、*/ /**暂定数量、*/
@Excel(name = "暂定数量、", width = 15) @Excel(name = "暂定数量、", width = 15)
@ApiModelProperty(value = "暂定数量、") @ApiModelProperty(value = "暂定数量、")


Loading…
Cancel
Save