提交 b3ce9e23 编写于 作者: ibizdev's avatar ibizdev

MoneyQ 发布系统代码 [后台服务,Demo]

上级 a6f17eda
此差异已折叠。
此差异已折叠。
因为 它太大了无法显示 源差异 。您可以改为 查看blob
#!/bin/bash
cd app_Web
yarn
yarn build
\ No newline at end of file
appindexviewappmenu({
"name":"appmenu"
,"items":[{
"name":"menuitem1"
,"text":"订单管理"
,"type":"MENUITEM"
,"tooltip":"订单管理"
,"iconcls":"fa fa-file-text-o"
,"icon":""
}
,{
"name":"menuitem2"
,"text":"产品管理"
,"type":"MENUITEM"
,"tooltip":"产品管理"
,"items":[{
"name":"menuitem3"
,"text":"硬件产品"
,"type":"MENUITEM"
,"tooltip":"硬件产品"
}
,{
"name":"menuitem4"
,"text":"软件产品"
,"type":"MENUITEM"
,"tooltip":"软件产品"
}
]
}
,{
"name":"menuitem5"
,"text":"系统管理"
,"type":"MENUITEM"
,"tooltip":"系统管理"
}
]
})
\ No newline at end of file
export const Environment = {
// 原型示例数模式
SampleMode: false,
// 应用名称
AppName: 'Web',
// 应用 title
AppTitle: '网页应用示例',
// 应用基础路径
BaseUrl: '../',
// 系统名称
SysName: 'DemoSys',
// 远程登录地址,本地开发调试使用
RemoteLogin: 'ibizutil/login',
// 文件导出
ExportFile: 'ibizutil/download',
// 文件上传
UploadFile: 'ibizutil/upload',
};
\ No newline at end of file
import Vue from 'vue'
import VueI18n from 'vue-i18n'
const vueApp: any = Vue;
vueApp.use(VueI18n);
import zhCn from './lang/zh-CN';
import iviewZhCnLocale from 'iview/src/locale/lang/zh-CN';
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN';
const messages = {
'zh-CN': Object.assign(iviewZhCnLocale, elementZhLocale, zhCn),
};
// 自动根据浏览器系统语言设置语言
const navLang = localStorage.getItem('local') || navigator.language;
const localLang = (navLang === 'zh-CN' || (navLang === 'en-US' && messages.hasOwnProperty('en-US'))) ? navLang : false;
let lang: string = localLang || 'zh-CN';
vueApp.config.lang = lang
// // vue-i18n 6.x+写法
vueApp.locale = () => { };
const i18n = new VueI18n({
locale: lang,
messages
});
export default i18n;
import ibz5orderdetail_en_US from '@locale/lanres/ibz5orderdetail/ibz5orderdetail_en_US';
import ibz5order_en_US from '@locale/lanres/ibz5order/ibz5order_en_US';
import ibz5customer_en_US from '@locale/lanres/ibz5customer/ibz5customer_en_US';
export default {
app: {
gridpage: {
choicecolumns: 'Choice columns',
refresh: 'refresh',
show: 'Show',
records: 'records',
totle: 'totle',
},
tabpage: {
sureclosetip: {
title: 'Close warning',
content: 'Form data Changed, are sure close?',
},
closeall: 'Close all',
closeother: 'Close other',
},
fileUpload: {
caption: 'Upload',
},
searchButton: {
search: 'Search',
reset: 'Reset',
},
// 非实体视图
views: {
appindexview: {
caption: '首页',
},
},
menus: {
appindexview: {
menuitem1: '订单管理',
menuitem2: '产品管理',
menuitem3: '硬件产品',
menuitem4: '软件产品',
menuitem5: '系统管理',
},
},
},
ibz5orderdetail: ibz5orderdetail_en_US,
ibz5order: ibz5order_en_US,
ibz5customer: ibz5customer_en_US,
};
\ No newline at end of file
import ibz5orderdetail_zh_CN from '@locale/lanres/ibz5orderdetail/ibz5orderdetail_zh_CN';
import ibz5order_zh_CN from '@locale/lanres/ibz5order/ibz5order_zh_CN';
import ibz5customer_zh_CN from '@locale/lanres/ibz5customer/ibz5customer_zh_CN';
export default {
app: {
gridpage: {
choicecolumns: '选择列',
refresh: '刷新',
show: '显示',
records: '条',
totle: '共',
},
tabpage: {
sureclosetip: {
title: '关闭提醒',
content: '表单数据已经修改,确定要关闭?',
},
closeall: '关闭所有',
closeother: '关闭其他',
},
fileUpload: {
caption: '上传',
},
searchButton: {
search: '搜索',
reset: '重置',
},
// 非实体视图
views: {
appindexview: {
caption: '首页',
},
},
menus: {
appindexview: {
menuitem1: '订单管理',
menuitem2: '产品管理',
menuitem3: '硬件产品',
menuitem4: '软件产品',
menuitem5: '系统管理',
},
},
},
ibz5orderdetail: ibz5orderdetail_zh_CN,
ibz5order: ibz5order_zh_CN,
ibz5customer: ibz5customer_zh_CN,
};
\ No newline at end of file
export default {
views: {
pickupgridview: {
caption: '客户',
},
pickupview: {
caption: '客户',
},
},
main_grid: {
columns: {
ibz5customername: '客户名称',
updateman: '更新人',
updatedate: '更新时间',
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
},
uiactions: {
},
},
};
\ No newline at end of file
export default {
views: {
pickupgridview: {
caption: '客户',
},
pickupview: {
caption: '客户',
},
},
main_grid: {
columns: {
ibz5customername: '客户名称',
updateman: '更新人',
updatedate: '更新时间',
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
},
uiactions: {
},
},
};
\ No newline at end of file
export default {
views: {
gridview: {
caption: '订单',
},
chartview: {
caption: '订单',
},
editview: {
caption: '订单',
},
},
main_form: {
details: {
group1: '订单基本信息',
druipart1: '',
grouppanel1: '订单明细',
formpage1: '基本信息',
group2: '操作信息',
formpage2: '其它',
srfupdatedate: '更新时间',
srforikey: '',
srfkey: '订单标识',
srfmajortext: '订单名称',
srftempmode: '',
srfuf: '',
srfdeid: '',
srfsourcekey: '',
srfip_amount: '',
orderuid: '订单编号',
ibz5customername: '客户名称',
ibz5ordername: '订单名称',
ordertype: '订单类型',
ordertime: '订单时间',
starttime: '订单开始时间',
endtime: '订单结束时间',
memo: '备注',
amount: '总计',
detailnum: '明细数',
orderstate: '订单状态',
createman: '建立人',
createdate: '建立时间',
updateman: '更新人',
updatedate: '更新时间',
ibz5orderid: '订单标识',
ibz5customerid: '客户标识',
},
uiactions: {
},
},
main_grid: {
columns: {
orderuid: '订单编号',
ibz5ordername: '订单名称',
ibz5customername: '客户名称',
ordertype: '订单类型',
ordertime: '订单时间',
starttime: '订单开始时间',
endtime: '订单结束时间',
amount: '总计',
detailnum: '明细数',
orderstate: '订单状态',
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
},
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem3: {
caption: 'New',
tip: 'tbitem3',
},
tbitem4: {
caption: 'Edit',
tip: 'tbitem4',
},
tbitem6: {
caption: 'Copy',
tip: 'tbitem6',
},
tbitem7: {
caption: '-',
tip: 'tbitem7',
},
tbitem8: {
caption: 'Remove',
tip: 'tbitem8',
},
tbitem9: {
caption: '-',
tip: 'tbitem9',
},
tbitem13: {
caption: 'Export',
tip: 'tbitem13',
},
tbitem10: {
caption: '-',
tip: 'tbitem10',
},
tbitem16: {
caption: '其它',
tip: 'tbitem16',
},
tbitem21: {
caption: 'Export Data Model',
tip: 'tbitem21',
},
tbitem23: {
caption: '数据导入',
tip: 'tbitem23',
},
tbitem17: {
caption: '-',
tip: 'tbitem17',
},
tbitem19: {
caption: 'Filter',
tip: 'tbitem19',
},
tbitem18: {
caption: 'Help',
tip: 'tbitem18',
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: 'Save',
tip: 'tbitem3',
},
tbitem4: {
caption: 'Save And New',
tip: 'tbitem4',
},
tbitem5: {
caption: 'Save And Close',
tip: 'tbitem5',
},
tbitem6: {
caption: '-',
tip: 'tbitem6',
},
tbitem7: {
caption: 'Remove And Close',
tip: 'tbitem7',
},
tbitem8: {
caption: '-',
tip: 'tbitem8',
},
tbitem12: {
caption: 'New',
tip: 'tbitem12',
},
tbitem13: {
caption: '-',
tip: 'tbitem13',
},
tbitem14: {
caption: 'Copy',
tip: 'tbitem14',
},
tbitem16: {
caption: '-',
tip: 'tbitem16',
},
tbitem23: {
caption: '第一个记录',
tip: 'tbitem23',
},
tbitem24: {
caption: '上一个记录',
tip: 'tbitem24',
},
tbitem25: {
caption: '下一个记录',
tip: 'tbitem25',
},
tbitem26: {
caption: '最后一个记录',
tip: 'tbitem26',
},
tbitem21: {
caption: '-',
tip: 'tbitem21',
},
tbitem22: {
caption: 'Help',
tip: 'tbitem22',
},
},
};
\ No newline at end of file
export default {
views: {
gridview: {
caption: '订单',
},
chartview: {
caption: '订单',
},
editview: {
caption: '订单',
},
},
main_form: {
details: {
group1: '订单基本信息',
druipart1: '',
grouppanel1: '订单明细',
formpage1: '基本信息',
group2: '操作信息',
formpage2: '其它',
srfupdatedate: '更新时间',
srforikey: '',
srfkey: '订单标识',
srfmajortext: '订单名称',
srftempmode: '',
srfuf: '',
srfdeid: '',
srfsourcekey: '',
srfip_amount: '',
orderuid: '订单编号',
ibz5customername: '客户名称',
ibz5ordername: '订单名称',
ordertype: '订单类型',
ordertime: '订单时间',
starttime: '订单开始时间',
endtime: '订单结束时间',
memo: '备注',
amount: '总计',
detailnum: '明细数',
orderstate: '订单状态',
createman: '建立人',
createdate: '建立时间',
updateman: '更新人',
updatedate: '更新时间',
ibz5orderid: '订单标识',
ibz5customerid: '客户标识',
},
uiactions: {
},
},
main_grid: {
columns: {
orderuid: '订单编号',
ibz5ordername: '订单名称',
ibz5customername: '客户名称',
ordertype: '订单类型',
ordertime: '订单时间',
starttime: '订单开始时间',
endtime: '订单结束时间',
amount: '总计',
detailnum: '明细数',
orderstate: '订单状态',
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
},
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem3: {
caption: '新建',
tip: '新建',
},
tbitem4: {
caption: '编辑',
tip: '编辑',
},
tbitem6: {
caption: '拷贝',
tip: '拷贝',
},
tbitem7: {
caption: '-',
tip: '',
},
tbitem8: {
caption: '删除',
tip: '删除',
},
tbitem9: {
caption: '-',
tip: '',
},
tbitem13: {
caption: '导出',
tip: '导出',
},
tbitem10: {
caption: '-',
tip: '',
},
tbitem16: {
caption: '其它',
tip: '其它',
},
tbitem21: {
caption: '导出数据模型',
tip: '导出数据模型',
},
tbitem23: {
caption: '数据导入',
tip: '数据导入',
},
tbitem17: {
caption: '-',
tip: '',
},
tbitem19: {
caption: '过滤',
tip: '过滤',
},
tbitem18: {
caption: '帮助',
tip: '帮助',
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: '保存',
tip: '保存',
},
tbitem4: {
caption: '保存并新建',
tip: '保存并新建',
},
tbitem5: {
caption: '保存并关闭',
tip: '保存并关闭',
},
tbitem6: {
caption: '-',
tip: '',
},
tbitem7: {
caption: '删除并关闭',
tip: '删除并关闭',
},
tbitem8: {
caption: '-',
tip: '',
},
tbitem12: {
caption: '新建',
tip: '新建',
},
tbitem13: {
caption: '-',
tip: '',
},
tbitem14: {
caption: '拷贝',
tip: '拷贝',
},
tbitem16: {
caption: '-',
tip: '',
},
tbitem23: {
caption: '第一个记录',
tip: '第一个记录',
},
tbitem24: {
caption: '上一个记录',
tip: '上一个记录',
},
tbitem25: {
caption: '下一个记录',
tip: '下一个记录',
},
tbitem26: {
caption: '最后一个记录',
tip: '最后一个记录',
},
tbitem21: {
caption: '-',
tip: '',
},
tbitem22: {
caption: '帮助',
tip: '帮助',
},
},
};
\ No newline at end of file
export default {
views: {
gridview: {
caption: '订单明细',
},
editview: {
caption: '订单明细',
},
},
main_form: {
details: {
group1: 'IBZ5ORDERDETAIL基本信息',
formpage1: '基本信息',
group2: '操作信息',
formpage2: '其它',
srfupdatedate: '更新时间',
srforikey: '',
srfkey: 'IBZ5ORDERDETAIL标识',
srfmajortext: 'IBZ5ORDERDETAIL名称',
srftempmode: '',
srfuf: '',
srfdeid: '',
srfsourcekey: '',
ibz5orderdetailname: 'IBZ5ORDERDETAIL名称',
createman: '建立人',
createdate: '建立时间',
updateman: '更新人',
updatedate: '更新时间',
ibz5orderdetailid: 'IBZ5ORDERDETAIL标识',
},
uiactions: {
},
},
main_grid: {
columns: {
ibz5orderdetailname: 'IBZ5ORDERDETAIL名称',
updateman: '更新人',
updatedate: '更新时间',
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
},
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem3: {
caption: 'New',
tip: 'tbitem3',
},
tbitem4: {
caption: 'Edit',
tip: 'tbitem4',
},
tbitem6: {
caption: 'Copy',
tip: 'tbitem6',
},
tbitem7: {
caption: '-',
tip: 'tbitem7',
},
tbitem8: {
caption: 'Remove',
tip: 'tbitem8',
},
tbitem9: {
caption: '-',
tip: 'tbitem9',
},
tbitem13: {
caption: 'Export',
tip: 'tbitem13',
},
tbitem10: {
caption: '-',
tip: 'tbitem10',
},
tbitem16: {
caption: '其它',
tip: 'tbitem16',
},
tbitem21: {
caption: 'Export Data Model',
tip: 'tbitem21',
},
tbitem23: {
caption: '数据导入',
tip: 'tbitem23',
},
tbitem17: {
caption: '-',
tip: 'tbitem17',
},
tbitem19: {
caption: 'Filter',
tip: 'tbitem19',
},
tbitem18: {
caption: 'Help',
tip: 'tbitem18',
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: 'Save',
tip: 'tbitem3',
},
tbitem4: {
caption: 'Save And New',
tip: 'tbitem4',
},
tbitem5: {
caption: 'Save And Close',
tip: 'tbitem5',
},
tbitem6: {
caption: '-',
tip: 'tbitem6',
},
tbitem7: {
caption: 'Remove And Close',
tip: 'tbitem7',
},
tbitem8: {
caption: '-',
tip: 'tbitem8',
},
tbitem12: {
caption: 'New',
tip: 'tbitem12',
},
tbitem13: {
caption: '-',
tip: 'tbitem13',
},
tbitem14: {
caption: 'Copy',
tip: 'tbitem14',
},
tbitem16: {
caption: '-',
tip: 'tbitem16',
},
tbitem23: {
caption: '第一个记录',
tip: 'tbitem23',
},
tbitem24: {
caption: '上一个记录',
tip: 'tbitem24',
},
tbitem25: {
caption: '下一个记录',
tip: 'tbitem25',
},
tbitem26: {
caption: '最后一个记录',
tip: 'tbitem26',
},
tbitem21: {
caption: '-',
tip: 'tbitem21',
},
tbitem22: {
caption: 'Help',
tip: 'tbitem22',
},
},
};
\ No newline at end of file
export default {
views: {
gridview: {
caption: '订单明细',
},
editview: {
caption: '订单明细',
},
},
main_form: {
details: {
group1: 'IBZ5ORDERDETAIL基本信息',
formpage1: '基本信息',
group2: '操作信息',
formpage2: '其它',
srfupdatedate: '更新时间',
srforikey: '',
srfkey: 'IBZ5ORDERDETAIL标识',
srfmajortext: 'IBZ5ORDERDETAIL名称',
srftempmode: '',
srfuf: '',
srfdeid: '',
srfsourcekey: '',
ibz5orderdetailname: 'IBZ5ORDERDETAIL名称',
createman: '建立人',
createdate: '建立时间',
updateman: '更新人',
updatedate: '更新时间',
ibz5orderdetailid: 'IBZ5ORDERDETAIL标识',
},
uiactions: {
},
},
main_grid: {
columns: {
ibz5orderdetailname: 'IBZ5ORDERDETAIL名称',
updateman: '更新人',
updatedate: '更新时间',
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
},
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem3: {
caption: '新建',
tip: '新建',
},
tbitem4: {
caption: '编辑',
tip: '编辑',
},
tbitem6: {
caption: '拷贝',
tip: '拷贝',
},
tbitem7: {
caption: '-',
tip: '',
},
tbitem8: {
caption: '删除',
tip: '删除',
},
tbitem9: {
caption: '-',
tip: '',
},
tbitem13: {
caption: '导出',
tip: '导出',
},
tbitem10: {
caption: '-',
tip: '',
},
tbitem16: {
caption: '其它',
tip: '其它',
},
tbitem21: {
caption: '导出数据模型',
tip: '导出数据模型',
},
tbitem23: {
caption: '数据导入',
tip: '数据导入',
},
tbitem17: {
caption: '-',
tip: '',
},
tbitem19: {
caption: '过滤',
tip: '过滤',
},
tbitem18: {
caption: '帮助',
tip: '帮助',
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: '保存',
tip: '保存',
},
tbitem4: {
caption: '保存并新建',
tip: '保存并新建',
},
tbitem5: {
caption: '保存并关闭',
tip: '保存并关闭',
},
tbitem6: {
caption: '-',
tip: '',
},
tbitem7: {
caption: '删除并关闭',
tip: '删除并关闭',
},
tbitem8: {
caption: '-',
tip: '',
},
tbitem12: {
caption: '新建',
tip: '新建',
},
tbitem13: {
caption: '-',
tip: '',
},
tbitem14: {
caption: '拷贝',
tip: '拷贝',
},
tbitem16: {
caption: '-',
tip: '',
},
tbitem23: {
caption: '第一个记录',
tip: '第一个记录',
},
tbitem24: {
caption: '上一个记录',
tip: '上一个记录',
},
tbitem25: {
caption: '下一个记录',
tip: '下一个记录',
},
tbitem26: {
caption: '最后一个记录',
tip: '最后一个记录',
},
tbitem21: {
caption: '-',
tip: '',
},
tbitem22: {
caption: '帮助',
tip: '帮助',
},
},
};
\ No newline at end of file
export const localList: any[] = [
{
type: 'zh-CN',
name: '中文简体',
},
];
\ No newline at end of file
// this is less
.index_view{
width: 100%;
height: 100%;
padding: 0;
margin: 0;
.index_header{
height:50px;
padding:0 20px;
display: flex;
align-items: center;
justify-content: space-between;
.page-logo{
display: flex;
}
.header-left{
display: flex;
align-items: center;
justify-content: space-between;
.el-menu.el-menu--horizontal{
border-bottom: none;
.el-submenu{
border-top: none;
}
}
}
> div {
line-height: 49px;
}
}
.index_content{
background-color:#fff;
height:calc(100vh - 50px);
overflow-x: hidden;
overflow-y: hidden;
}
>.ivu-layout {
>.ivu-layout {
height: calc(100vh - 50px);
}
}
.ivu-layout .ivu-layout-sider .ivu-layout-sider-children .sider-top{
line-height: 58px;
text-align: right;
padding-right: 18px;
}
.ivu-layout .ivu-layout-sider .ivu-layout-sider-children .sider-top .ivu-icon{
font-size: 20px;
padding: 4px;
margin-top: -2px;
cursor: pointer;
}
}
/*** BRGIN:滚动条样式 ***/
::-webkit-scrollbar {
background: transparent;
width: 4px;
height: 4px;
}
::-webkit-scrollbar-thumb {
border-radius: 0;
box-shadow: none;
border: 0;
background-color: #cecece;
}
::-webkit-scrollbar-track {
border-radius: 0;
box-shadow: none;
border: 0;
}
\ No newline at end of file
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { CreateElement } from 'vue';
import './app-index-view.less';
import view_appmenu from '@widget/app/app-index-view-appmenu/app-index-view-appmenu';
@Component({
components: {
view_appmenu,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class AppIndexView extends Vue {
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof AppIndexView
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 数据视图
*
* @type {string}
* @memberof AppIndexView
*/
@Prop() public viewdata!: string;
/**
* 视图标识
*
* @type {string}
* @memberof AppDashboardView
*/
public viewtag: string = 'd102660f119e7edd4be7080d198f98e7';
/**
* 父数据对象
*
* @protected
* @type {*}
* @memberof AppIndexView
*/
protected srfparentdata: any = {};
/**
* 视图模型数据
*
* @type {*}
* @memberof AppIndexView
*/
public model: any = {
srfTitle: '首页建模示例',
srfCaption: 'app.views.appindexview.caption',
srfSubCaption: '',
dataInfo: ''
}
/**
* 处理值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppIndexView
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
_this.engine.setViewData(newVal);
_this.engine.load();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof AppIndexView
*/
public containerModel: any = {
view_appmenu: { name: 'appmenu', type: 'APPMENU' },
};
/**
* 视图状态订阅对象
*
* @private
* @type {Subject<{action: string, data: any}>}
* @memberof AppIndexView
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 引擎初始化
*
* @private
* @memberof AppIndexView
*/
private engineInit(): void {
}
/**
* Vue声明周期
*
* @memberof AppIndexView
*/
public created() {
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
}
/**
* 销毁之前
*
* @memberof AppIndexView
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof AppIndexView
*/
public mounted() {
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
this.viewState.next({ tag: 'appmenu', action: 'load', data: {} });
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof AppIndexView
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', args);
_view.$emit('close');
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* api地址
*
* @private
* @type {string}
* @memberof AppIndexView
*/
private url: string = 'Web/Sample/AppIndexView.do';
/**
* api地址
*
* @private
* @type {string}
* @memberof AppIndexView
*/
private mode: string ='vertical';
/**
* 当前主题
*
* @readonly
* @memberof AppIndexView
*/
get selectTheme() {
if (this.$router.app.$store.state.selectTheme) {
return this.$router.app.$store.state.selectTheme;
} else if (localStorage.getItem('theme-class')) {
return localStorage.getItem('theme-class');
} else {
return 'app_theme_blue';
}
}
/**
* 当前字体
*
* @readonly
* @memberof AppIndexView
*/
get selectFont() {
if (this.$router.app.$store.state.selectFont) {
return this.$router.app.$store.state.selectFont;
} else if (localStorage.getItem('font-family')) {
return localStorage.getItem('font-family');
} else {
return 'Microsoft YaHei';
}
}
/**
* 菜单收缩变化
*/
public collapseChange: boolean = false;
/**
* 菜单收缩点击
*/
public handleClick() {
this.collapseChange = !this.collapseChange;
}
/**
* 默认打开的视图
*
* @type {*}
* @memberof AppIndexView
*/
public defPSAppView: any = {
};
/**
* 应用起始页面
*
* @type {boolean}
* @memberof AppIndexView
*/
public isDefaultPage: boolean = false;
/**
* 绘制视图消息 (上方)
*
* @returns
* @memberof AppIndexView
*/
public renderPosTopMsgs() {
return (
<div class='view-top-messages'>
</div>
);
}
/**
* 绘制视图消息 (下方)
*
* @returns
* @memberof AppIndexView
*/
public renderPosBottomMsgs() {
return (
<div class='view-bottom-messages'>
</div>
);
}
/**
* 绘制内容
*
* @param {CreateElement} h
* @returns
* @memberof AppIndexView
*/
public render(h: CreateElement) {
return (
<div class="index_view app-index-view">
<layout class={{ 'app_theme_blue': 'app_theme_blue' == this.selectTheme ? true : false, 'app-default-theme': 'app-default-theme' == this.selectTheme ? true : false, 'app_theme_darkblue': 'app_theme_darkblue' == this.selectTheme ? true : false }} style={{ 'font-family': this.selectFont, 'height': '100vh' }}>
<header class="index_header">
<div class="page-logo">
<span style="display: inline-block;margin-left: 10px;font-size: 22px;">首页</span>
<div class="top_img" style="line-height: 0 !important;">
<img src="./assets/img/index_pic.png" height="44" />
</div>
</div>
<div class="header-right" style="display: flex;align-items: center;justify-content: space-between;">
<div>
<icon type="md-notifications-outline" style="font-size: 25px;margin: 0 10px;" />
</div>
<div>
<icon type="ios-mail-open-outline" style="font-size: 25px;margin: 0 10px;" />
</div>
<app-lang style='font-size: 15px;padding: 0 10px;'></app-lang>
<app-user></app-user>
<app-theme style="width:45px;display: flex;justify-content: center;"></app-theme>
</div>
</header>
<layout>
<sider width={this.collapseChange ? 64 : 200} hide-trigger v-model={this.collapseChange}>
<div class="sider-top">
<i class="ivu-icon ivu-icon-md-menu" on-click={this.handleClick}></i>
</div>
<view_appmenu
viewState={this.viewState}
showBusyIndicator={true}
collapsechange={this.collapseChange}
mode={this.mode}
selectTheme={this.selectTheme}
isDefaultPage={this.isDefaultPage}
defPSAppView={this.defPSAppView}
name='appmenu'
ref='appmenu'
on-closeview={($event: any) => this.closeView($event)}>
</view_appmenu>
</sider>
<content class="index_content" style={{'width':this.collapseChange ? 'calc(100vw - 64px)' : 'calc(100vw - 200px)'}}>
<tab-page-exp></tab-page-exp>
<app-keep-alive routerList={this.$store.state.historyPathList}>
<router-view key={this.$route.fullPath}></router-view>
</app-keep-alive>
</content>
</layout>
</layout>
</div>
);
}
}
import Vue from 'vue';
import Vuex from 'vuex';
import VueRouter from 'vue-router';
import App from '@/App';
import ElementUi from 'element-ui';
import iView from 'iview';
import { Interceptors } from '@/utils/interceptor/interceptor';
import i18n from '@/locale'
import 'element-ui/lib/theme-chalk/index.css';
import 'iview/dist/styles/iview.css';
import '@/styles/default.less';
// import utils from '@/utils';
import { AppComponents } from '@/app-register';
import { PageComponents } from './page-register';
import { UserComponent } from '@/user-register';
import store from '@/store';
import router from './router';
Vue.config.errorHandler = function (err, vm, info) {
console.log(err);
}
Vue.config.productionTip = false;
Vue.use(Vuex);
Vue.use(VueRouter);;
Vue.use(ElementUi, {
i18n: (key: any, value: any) => i18n.t(key, value)
});
Vue.use(iView, {
i18n: (key: any, value: any) => i18n.t(key, value)
});
// Vue.use(utils);
Vue.use(AppComponents);
Vue.use(PageComponents);
Vue.use(UserComponent);
router.beforeEach((to: any, from: any, next: any) => {
if (to.meta && !to.meta.ignoreAddPage) {
router.app.$store.commit('addPage', to);
}
next();
});
Interceptors.getInstance(router);
new Vue({
i18n,
store,
router,
render: (h: any) => h(App),
}).$mount('#app');
\ No newline at end of file
export const PageComponents = {
install(Vue: any, opt: any) {
}
};
\ No newline at end of file
import Vue from 'vue';
import Router from 'vue-router';
import { Util, AuthGuard } from '@/utils';
Vue.use(Router);
const router = new Router({
routes: [
{
path: '/sample_appindexview/:sample_appindexview?',
name: 'sample_appindexview',
beforeEnter: (to: any, from: any, next: any) => {
const routerParamsName = 'sample_appindexview';
const params: any = {};
if (to.params && to.params[routerParamsName]) {
Object.assign(params, Util.formatMatrixParse(to.params[routerParamsName]));
}
const url: string = 'web/app/web/getappdata';
const auth: Promise<any> = AuthGuard.getInstance().authGuard(url, params, router);
auth.then(() => {
next();
}).catch(() => {
next();
});
},
meta: {
caption: '首页',
viewType: 'APPINDEX',
requireAuth: true,
},
component: () => import('@pages/sample/app-index-view/app-index-view'),
children: [
]
},
{
path: '/login/:login?',
name: 'login',
meta: {
caption: '登录',
viewType: 'login',
requireAuth: false,
ignoreAddPage: true,
},
beforeEnter: (to: any, from: any, next: any) => {
router.app.$store.commit('resetRootStateData');
next();
},
component: () => import('@components/login/login'),
},
{
path: '/404',
component: () => import('@components/404/404')
},
{
path: '/500',
component: () => import('@components/500/500')
},
{
path: '*',
redirect: 'sample_appindexview'
}
],
});
export default router;
/**
* 所有应用视图
*/
export const viewstate: any = {
appviews: [
{
viewtag: 'd102660f119e7edd4be7080d198f98e7',
viewmodule: 'Sample',
viewname: 'AppIndexView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
],
createdviews: [],
}
\ No newline at end of file
/*** BRGIN:菜单样式 ***/
.app-app-menu {
overflow: auto;
height: calc(100% - 58px);
> .el-menu {
border-right: 0;
.el-menu-item {
.ivu-badge {
.ivu-badge-count {
box-shadow: 0 0 0 0px #fff;
}
}
}
.el-submenu__title i, .el-menu-item i {
font-size: 14px;
width: 16px;
}
.el-menu-item, .el-submenu__title {
height: 36px;
font-size: 14px;
line-height: 32px;
}
.el-menu-item, .el-submenu, .el-menu {
border-top: 1px solid #fff;
}
> .el-menu-item, > .el-submenu > .el-submenu__title {
height: 40px;
line-height: 36px;
border-left: 4px solid transparent;
padding-left: 16px !important;
}
.app-menu-icon {
margin-right: 4px;
}
> .el-submenu {
> .el-menu {
> .el-menu-item, > .el-submenu > .el-submenu__title {
padding-left: 44px !important;
}
> .el-submenu {
> .el-menu {
> .el-menu-item, > .el-submenu > .el-submenu__title {
padding-left: 68px !important;
}
}
}
}
}
.active-icon {
font-size: 40px !important;
position: absolute;
right: 0;
line-height: 42px;
color: #fff !important;
display: none;
width: 24px !important;
overflow: hidden;
}
}
.ivu-divider-horizontal {
width: calc(100% - 32px);
min-width: calc(100% - 32px);
margin: 4px auto;
margin-bottom: 1px;
}
.myimg{
position: absolute;
bottom: 7%;
left: 23px;
}
}
.app-popper-menu {
.el-menu-item, .el-submenu__title {
height: 36px;
font-size: 14px;
line-height: 36px;
}
> .el-menu-item, > .el-submenu > .el-submenu__title {
height: 40px;
line-height: 40px;
}
.el-menu-item {
.ivu-badge {
.ivu-badge-count {
box-shadow: 0 0 0 0px #fff;
}
}
}
.ivu-divider-horizontal {
width: calc(100% - 12px);
min-width: calc(100% - 12px);
margin: 4px auto;
margin-bottom: 1px;
}
}
// this is less
const path = require('path');
const os = require('os');
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: './',
// 去除 map 文件
productionSourceMap: false,
outputDir:"../sample-srv/target/classes/META-INF/resources",
devServer: {
host: '0.0.0.0',
port: 8111,
compress: true,
disableHostCheck: true,
proxy: "http://127.0.0.1:8080/Web",
historyApiFallback: {
rewrites: [
{ from: /^\/appindexview$/, to: '/appindexview.html' },
]
}
},
pages: {
appindexview: {
// page 的入口
entry: 'src/pages/sample/app-index-view/main.ts',
// 模板来源
template: 'src/template.html',
// 在 dist/index.html 的输出
filename: 'appindexview.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: '首页建模示例',
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk。
// chunks: ['chunk-vendors', 'chunk-common', 'index']
},
},
// 多核打包
parallel: os.cpus().length > 1,
chainWebpack: (config) => {
config.plugins.delete('preload-appindexview')
config.plugins.delete('prefetch-appindexview')
config.resolve.alias
.set('@ibizsys', resolve('src/ibizsys'))
.set('@pages', resolve('src/pages'))
.set('@components', resolve('src/components'))
.set('@widget', resolve('src/widget'))
.set('@engine', resolve('src/engine'))
.set('@interface', resolve('src/interface'))
.set('@locale', resolve('src/locale'))
},
configureWebpack: config => {
if (Object.is(config.mode, 'production')) {
// 多核启动编译及内存提升
const data = config.plugins[9 + 1];
// 最大进程数
data.workersNumber = os.cpus().length > 4 ? 4 : os.cpus().length; // 会占用额外内存不释放,不建议开发阶段使用
// 单个进程最大使用内存
data.memoryLimit = 4096;
} else {
// 多核启动编译及内存提升
const data = config.plugins[7 + 1];
// 最大进程数
// data.workersNumber = os.cpus().length > 4 ? 4 : os.cpus().length; // 会占用额外内存不释放,不建议开发阶段使用
// 单个进程最大使用内存
data.memoryLimit = 4096;
}
},
}
\ No newline at end of file
#!/bin/bash
mvn clean -f ../sln_Sample/pom.xml
mvn clean -f ../srv_Sample_pub/pom.xml
if [ -d ../srv_Sample_usr ]
then
mvn clean -f ../srv_Sample_usr/pom.xml
fi
mvn install -f ../sln_Sample/pom.xml
mvn install -f ../srv_Sample_pub/pom.xml
if [ -d ../srv_Sample_usr ]
then
mvn install -f ../srv_Sample_usr/pom.xml
fi
\ No newline at end of file
此差异已折叠。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>sample-srv</artifactId>
<name>sample-srv</name>
<packaging>jar</packaging>
<parent>
<artifactId>DemoSys</artifactId>
<groupId>com.ibiz5</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/webapp</directory>
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>src/main/docker</directory>
<filtering>true</filtering>
<includes>
<include>**/Dockerfile</include>
</includes>
<targetPath>../docker</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>demosys</finalName>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<mainClass>com.ibiz5.boot.sampleMain</mainClass>
<outputDirectory>../</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.2.0</version>
<configuration>
<dockerDirectory>target/docker</dockerDirectory>
<registryUrl>registry.ibiz5.com:5000</registryUrl>
<imageName>
registry.ibiz5.com:5000/sadept2/demosys:latest
</imageName>
<imageTags>
<imageTag>latest</imageTag>
</imageTags>
<resources>
<rescource>
<targetPath>/</targetPath>
<directory>../</directory>
<include>demosys.jar</include>
</rescource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>exec-yarn-run-install</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<workingDirectory>../app_Web</workingDirectory>
</configuration>
</execution>
<execution>
<id>exec-yarn-run-build</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument>build</argument>
</arguments>
<workingDirectory>../app_Web</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
IBZ_SLEEP=0 \
JAVA_OPTS=""
CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /sample.jar
EXPOSE 8080
ADD sample.jar /sample.jar
package com.ibiz5.api.orderapi.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5ORDERDETAIL;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5ORDERDETAILDTO {
private Timestamp createdate;
private String ibz5orderdetailname;
private String createman;
private String ibz5uniproductid;
private String ibz5uniproductname;
private String ibz5ordername;
private Integer quantity;
private String updateman;
private Double amount;
private String ibz5orderid;
private String ibz5orderdetailid;
private Timestamp updatedate;
public IBZ5ORDERDETAIL toPO() {
IBZ5ORDERDETAIL po = new IBZ5ORDERDETAIL();
BeanCopier copier=BeanCopier.create(IBZ5ORDERDETAILDTO.class, IBZ5ORDERDETAIL.class, false);
copier.copy(this, po, null);
po.setIbz5orderdetailid(null);
return po;
}
public void fromPO(IBZ5ORDERDETAIL po) {
BeanCopier copier=BeanCopier.create(IBZ5ORDERDETAIL.class, IBZ5ORDERDETAILDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5ORDERDETAILDTO> fromPOPage(Page<IBZ5ORDERDETAIL> poPage) {
if(poPage == null)
return null;
//Page<IBZ5ORDERDETAILDTO> dtoPage=new Page<IBZ5ORDERDETAILDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5ORDERDETAILDTO> dtos=new ArrayList<IBZ5ORDERDETAILDTO>();
for(IBZ5ORDERDETAIL po : poPage.getRecords()) {
IBZ5ORDERDETAILDTO dto = new IBZ5ORDERDETAILDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.orderapi.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5ORDER;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5ORDERDTO {
private String ibz5ordername;
private Integer detailnum;
private String updateman;
private String createman;
private String memo;
private String ibz5orderid;
private Timestamp ordertime;
private String orderstate;
private String ibz5customername;
private Timestamp updatedate;
private Timestamp createdate;
private Timestamp starttime;
private String orderuid;
private String ibz5customerid;
private Timestamp endtime;
private Double amount;
private String ordertype;
List <IBZ5ORDERDETAILDTO> ibz5orderdetailDTOs;
public IBZ5ORDER toPO() {
IBZ5ORDER po = new IBZ5ORDER();
BeanCopier copier=BeanCopier.create(IBZ5ORDERDTO.class, IBZ5ORDER.class, false);
copier.copy(this, po, null);
po.setIbz5orderid(null);
return po;
}
public void fromPO(IBZ5ORDER po) {
BeanCopier copier=BeanCopier.create(IBZ5ORDER.class, IBZ5ORDERDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5ORDERDTO> fromPOPage(Page<IBZ5ORDER> poPage) {
if(poPage == null)
return null;
//Page<IBZ5ORDERDTO> dtoPage=new Page<IBZ5ORDERDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5ORDERDTO> dtos=new ArrayList<IBZ5ORDERDTO>();
for(IBZ5ORDER po : poPage.getRecords()) {
IBZ5ORDERDTO dto = new IBZ5ORDERDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.orderapi.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5ORDERDETAIL;
import com.ibiz5.sample.service.IBZ5ORDERDETAILService;
import com.ibiz5.sample.service.dto.IBZ5ORDERDETAILSearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.orderapi.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5ORDERDETAIL" })
@RestController
@RequestMapping("/rest/orderapi/ibz5orderdetail")
public class IBZ5ORDERDETAILResource {
@Autowired
private IBZ5ORDERDETAILService ibz5orderdetailService;
@ApiOperation(value = "Create", tags = {"IBZ5ORDERDETAIL" }, notes = "Create")
@RequestMapping(method= RequestMethod.POST , value="")
public IBZ5ORDERDETAILDTO createIBZ5ORDERDETAIL(@RequestBody IBZ5ORDERDETAILDTO dto) {
IBZ5ORDERDETAIL po = dto.toPO();
ibz5orderdetailService.create(po);
dto.fromPO(po);
return dto;
}
@ApiOperation(value = "Update", tags = {"IBZ5ORDERDETAIL" }, notes = "Update")
@RequestMapping(method= RequestMethod.POST , value="/{ibz5orderdetailid}")
public IBZ5ORDERDETAILDTO updateIBZ5ORDERDETAIL(@PathVariable String ibz5orderdetailid,@RequestBody IBZ5ORDERDETAILDTO dto) {
IBZ5ORDERDETAIL po = dto.toPO();
po.setIbz5orderdetailid(ibz5orderdetailid);
ibz5orderdetailService.update(po);
dto.fromPO(po);
return dto;
}
}
package com.ibiz5.api.orderapi.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5ORDER;
import com.ibiz5.sample.service.IBZ5ORDERService;
import com.ibiz5.sample.service.dto.IBZ5ORDERSearchFilter;
import com.ibiz5.sample.domain.IBZ5ORDERDETAIL;
import com.ibiz5.sample.service.IBZ5ORDERDETAILService;
import com.ibiz5.sample.service.dto.IBZ5ORDERDETAILSearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.orderapi.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5ORDER" })
@RestController
@RequestMapping("/rest/orderapi/ibz5order")
public class IBZ5ORDERResource {
@Autowired
private IBZ5ORDERService ibz5orderService;
@Autowired
private IBZ5ORDERDETAILService ibz5orderdetailService;
@ApiOperation(value = "Create", tags = {"IBZ5ORDER" }, notes = "Create")
@RequestMapping(method= RequestMethod.POST , value="")
public IBZ5ORDERDTO createIBZ5ORDER(@RequestBody IBZ5ORDERDTO dto) {
IBZ5ORDER po = dto.toPO();
ibz5orderService.create(po);
dto.fromPO(po);
return dto;
}
@ApiOperation(value = "Update", tags = {"IBZ5ORDER" }, notes = "Update")
@RequestMapping(method= RequestMethod.POST , value="/{ibz5orderid}")
public IBZ5ORDERDTO updateIBZ5ORDER(@PathVariable String ibz5orderid,@RequestBody IBZ5ORDERDTO dto) {
IBZ5ORDER po = dto.toPO();
po.setIbz5orderid(ibz5orderid);
ibz5orderService.update(po);
dto.fromPO(po);
return dto;
}
@ApiOperation(value = "Create", tags = {"IBZ5ORDER" }, notes = "Create")
@RequestMapping(method= RequestMethod.POST , value="/{ibz5orderid}/ibz5orderdetail")
public IBZ5ORDERDETAILDTO createIBZ5ORDERDETAIL(@PathVariable String ibz5orderid,@RequestBody IBZ5ORDERDETAILDTO dto) {
IBZ5ORDERDETAIL po = dto.toPO();
ibz5orderdetailService.create(po);
dto.fromPO(po);
return dto;
}
@ApiOperation(value = "Update", tags = {"IBZ5ORDER" }, notes = "Update")
@RequestMapping(method= RequestMethod.POST , value="/{ibz5orderid}/ibz5orderdetail/{ibz5orderdetailid}")
public IBZ5ORDERDETAILDTO updateIBZ5ORDERDETAIL(@PathVariable String ibz5orderid,@PathVariable String ibz5orderdetailid,@RequestBody IBZ5ORDERDETAILDTO dto) {
IBZ5ORDERDETAIL po = dto.toPO();
po.setIbz5orderdetailid(ibz5orderdetailid);
ibz5orderdetailService.update(po);
dto.fromPO(po);
return dto;
}
}
package com.ibiz5.api.productapi.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5CPU;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5CPUDTO {
private Double unitprice;
private String createman;
private String ibz5hardwaretype;
private String producer;
private Timestamp createdate;
private String ibz5cpuid;
private String ibz5cpuname;
private String updateman;
private String unit;
private String productuid;
private Timestamp updatedate;
public IBZ5CPU toPO() {
IBZ5CPU po = new IBZ5CPU();
BeanCopier copier=BeanCopier.create(IBZ5CPUDTO.class, IBZ5CPU.class, false);
copier.copy(this, po, null);
po.setIbz5cpuid(null);
return po;
}
public void fromPO(IBZ5CPU po) {
BeanCopier copier=BeanCopier.create(IBZ5CPU.class, IBZ5CPUDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5CPUDTO> fromPOPage(Page<IBZ5CPU> poPage) {
if(poPage == null)
return null;
//Page<IBZ5CPUDTO> dtoPage=new Page<IBZ5CPUDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5CPUDTO> dtos=new ArrayList<IBZ5CPUDTO>();
for(IBZ5CPU po : poPage.getRecords()) {
IBZ5CPUDTO dto = new IBZ5CPUDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.productapi.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5HARDWARE;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5HARDWAREDTO {
private Timestamp updatedate;
private String ibz5hardwareid;
private String producer;
private Timestamp createdate;
private String productuid;
private String unit;
private String updateman;
private String ibz5hardwaretype;
private String ibz5hardwarename;
private String createman;
private Double unitprice;
public IBZ5HARDWARE toPO() {
IBZ5HARDWARE po = new IBZ5HARDWARE();
BeanCopier copier=BeanCopier.create(IBZ5HARDWAREDTO.class, IBZ5HARDWARE.class, false);
copier.copy(this, po, null);
po.setIbz5hardwareid(null);
return po;
}
public void fromPO(IBZ5HARDWARE po) {
BeanCopier copier=BeanCopier.create(IBZ5HARDWARE.class, IBZ5HARDWAREDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5HARDWAREDTO> fromPOPage(Page<IBZ5HARDWARE> poPage) {
if(poPage == null)
return null;
//Page<IBZ5HARDWAREDTO> dtoPage=new Page<IBZ5HARDWAREDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5HARDWAREDTO> dtos=new ArrayList<IBZ5HARDWAREDTO>();
for(IBZ5HARDWARE po : poPage.getRecords()) {
IBZ5HARDWAREDTO dto = new IBZ5HARDWAREDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.productapi.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5SOFTWARESUIT;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5SOFTWARESUITDTO {
private String createman;
private String ibz5softwaresuitid;
private Timestamp updatedate;
private String updateman;
private String ibz5softwaresuitname;
private Timestamp createdate;
public IBZ5SOFTWARESUIT toPO() {
IBZ5SOFTWARESUIT po = new IBZ5SOFTWARESUIT();
BeanCopier copier=BeanCopier.create(IBZ5SOFTWARESUITDTO.class, IBZ5SOFTWARESUIT.class, false);
copier.copy(this, po, null);
po.setIbz5softwaresuitid(null);
return po;
}
public void fromPO(IBZ5SOFTWARESUIT po) {
BeanCopier copier=BeanCopier.create(IBZ5SOFTWARESUIT.class, IBZ5SOFTWARESUITDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5SOFTWARESUITDTO> fromPOPage(Page<IBZ5SOFTWARESUIT> poPage) {
if(poPage == null)
return null;
//Page<IBZ5SOFTWARESUITDTO> dtoPage=new Page<IBZ5SOFTWARESUITDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5SOFTWARESUITDTO> dtos=new ArrayList<IBZ5SOFTWARESUITDTO>();
for(IBZ5SOFTWARESUIT po : poPage.getRecords()) {
IBZ5SOFTWARESUITDTO dto = new IBZ5SOFTWARESUITDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.productapi.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5STORAGE;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5STORAGEDTO {
private String ibz5hardwaretype;
private String createman;
private String ibz5storageid;
private Timestamp createdate;
private String producer;
private String productuid;
private String updateman;
private String unit;
private String ibz5storagename;
private Timestamp updatedate;
private Double unitprice;
public IBZ5STORAGE toPO() {
IBZ5STORAGE po = new IBZ5STORAGE();
BeanCopier copier=BeanCopier.create(IBZ5STORAGEDTO.class, IBZ5STORAGE.class, false);
copier.copy(this, po, null);
po.setIbz5storageid(null);
return po;
}
public void fromPO(IBZ5STORAGE po) {
BeanCopier copier=BeanCopier.create(IBZ5STORAGE.class, IBZ5STORAGEDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5STORAGEDTO> fromPOPage(Page<IBZ5STORAGE> poPage) {
if(poPage == null)
return null;
//Page<IBZ5STORAGEDTO> dtoPage=new Page<IBZ5STORAGEDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5STORAGEDTO> dtos=new ArrayList<IBZ5STORAGEDTO>();
for(IBZ5STORAGE po : poPage.getRecords()) {
IBZ5STORAGEDTO dto = new IBZ5STORAGEDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.productapi.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5UNIPRODUCT;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5UNIPRODUCTDTO {
private String ibz5uniproductname;
private String ibz5uniproducttype;
private String ibz5uniproductid;
private String updateman;
private Timestamp createdate;
private String unit;
private Timestamp updatedate;
private String createman;
private Double unitprice;
public IBZ5UNIPRODUCT toPO() {
IBZ5UNIPRODUCT po = new IBZ5UNIPRODUCT();
BeanCopier copier=BeanCopier.create(IBZ5UNIPRODUCTDTO.class, IBZ5UNIPRODUCT.class, false);
copier.copy(this, po, null);
po.setIbz5uniproductid(null);
return po;
}
public void fromPO(IBZ5UNIPRODUCT po) {
BeanCopier copier=BeanCopier.create(IBZ5UNIPRODUCT.class, IBZ5UNIPRODUCTDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5UNIPRODUCTDTO> fromPOPage(Page<IBZ5UNIPRODUCT> poPage) {
if(poPage == null)
return null;
//Page<IBZ5UNIPRODUCTDTO> dtoPage=new Page<IBZ5UNIPRODUCTDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5UNIPRODUCTDTO> dtos=new ArrayList<IBZ5UNIPRODUCTDTO>();
for(IBZ5UNIPRODUCT po : poPage.getRecords()) {
IBZ5UNIPRODUCTDTO dto = new IBZ5UNIPRODUCTDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.productapi.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5CPU;
import com.ibiz5.sample.service.IBZ5CPUService;
import com.ibiz5.sample.service.dto.IBZ5CPUSearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.productapi.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5CPU" })
@RestController
@RequestMapping("/rest/productapi/ibz5cpu")
public class IBZ5CPUResource {
@Autowired
private IBZ5CPUService ibz5cpuService;
@ApiOperation(value = "Create", tags = {"IBZ5CPU" }, notes = "Create")
@RequestMapping(method= RequestMethod.POST , value="")
public IBZ5CPUDTO createIBZ5CPU(@RequestBody IBZ5CPUDTO dto) {
IBZ5CPU po = dto.toPO();
ibz5cpuService.create(po);
dto.fromPO(po);
return dto;
}
@ApiOperation(value = "Update", tags = {"IBZ5CPU" }, notes = "Update")
@RequestMapping(method= RequestMethod.PUT , value="/{ibz5cpuid}")
public IBZ5CPUDTO updateIBZ5CPU(@PathVariable String ibz5cpuid,@RequestBody IBZ5CPUDTO dto) {
IBZ5CPU po = dto.toPO();
po.setIbz5cpuid(ibz5cpuid);
ibz5cpuService.update(po);
dto.fromPO(po);
return dto;
}
}
package com.ibiz5.api.productapi.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5HARDWARE;
import com.ibiz5.sample.service.IBZ5HARDWAREService;
import com.ibiz5.sample.service.dto.IBZ5HARDWARESearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.productapi.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5HARDWARE" })
@RestController
@RequestMapping("/rest/productapi/ibz5hardware")
public class IBZ5HARDWAREResource {
@Autowired
private IBZ5HARDWAREService ibz5hardwareService;
}
package com.ibiz5.api.productapi.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5SOFTWARESUIT;
import com.ibiz5.sample.service.IBZ5SOFTWARESUITService;
import com.ibiz5.sample.service.dto.IBZ5SOFTWARESUITSearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.productapi.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5SOFTWARESUIT" })
@RestController
@RequestMapping("/rest/productapi/ibz5softwaresuit")
public class IBZ5SOFTWARESUITResource {
@Autowired
private IBZ5SOFTWARESUITService ibz5softwaresuitService;
}
package com.ibiz5.api.productapi.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5STORAGE;
import com.ibiz5.sample.service.IBZ5STORAGEService;
import com.ibiz5.sample.service.dto.IBZ5STORAGESearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.productapi.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5STORAGE" })
@RestController
@RequestMapping("/rest/productapi/ibz5storage")
public class IBZ5STORAGEResource {
@Autowired
private IBZ5STORAGEService ibz5storageService;
@ApiOperation(value = "Create", tags = {"IBZ5STORAGE" }, notes = "Create")
@RequestMapping(method= RequestMethod.POST , value="")
public IBZ5STORAGEDTO createIBZ5STORAGE(@RequestBody IBZ5STORAGEDTO dto) {
IBZ5STORAGE po = dto.toPO();
ibz5storageService.create(po);
dto.fromPO(po);
return dto;
}
@ApiOperation(value = "Update", tags = {"IBZ5STORAGE" }, notes = "Update")
@RequestMapping(method= RequestMethod.POST , value="/{ibz5storageid}")
public IBZ5STORAGEDTO updateIBZ5STORAGE(@PathVariable String ibz5storageid,@RequestBody IBZ5STORAGEDTO dto) {
IBZ5STORAGE po = dto.toPO();
po.setIbz5storageid(ibz5storageid);
ibz5storageService.update(po);
dto.fromPO(po);
return dto;
}
}
package com.ibiz5.api.productapi.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5UNIPRODUCT;
import com.ibiz5.sample.service.IBZ5UNIPRODUCTService;
import com.ibiz5.sample.service.dto.IBZ5UNIPRODUCTSearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.productapi.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5UNIPRODUCT" })
@RestController
@RequestMapping("/rest/productapi/ibz5uniproduct")
public class IBZ5UNIPRODUCTResource {
@Autowired
private IBZ5UNIPRODUCTService ibz5uniproductService;
}
package com.ibiz5.api.swagger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
@Bean
public Docket docket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("DEFAULT")
.pathMapping("/")
.apiInfo(
new ApiInfoBuilder()
.title("DEFAULT")
.build()
)
.select()
.paths(or(regex("/rest/.*")))
.build()
;
}
@Bean
public Docket productapiDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("产品对外服务")
.pathMapping("/")
.apiInfo(
new ApiInfoBuilder()
.title("产品对外服务")
.version("1")
.build()
)
.select()
.paths(or(regex("/rest/productapi/.*")))
.build()
;
}
@Bean
public Docket webDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("Web端对外服务")
.pathMapping("/")
.apiInfo(
new ApiInfoBuilder()
.title("Web端对外服务")
.version("1")
.build()
)
.select()
.paths(or(regex("/rest/web/.*")))
.build()
;
}
@Bean
public Docket orderapiDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("订单对外服务")
.pathMapping("/")
.apiInfo(
new ApiInfoBuilder()
.title("订单对外服务")
.version("1")
.build()
)
.select()
.paths(or(regex("/rest/orderapi/.*")))
.build()
;
}
}
package com.ibiz5.api.web.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5CUSTOMER;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5CUSTOMERDTO {
private String ibz5customername;
private Timestamp updatedate;
private String updateman;
private Timestamp createdate;
private String createman;
private String ibz5customerid;
public IBZ5CUSTOMER toPO() {
IBZ5CUSTOMER po = new IBZ5CUSTOMER();
BeanCopier copier=BeanCopier.create(IBZ5CUSTOMERDTO.class, IBZ5CUSTOMER.class, false);
copier.copy(this, po, null);
po.setIbz5customerid(null);
return po;
}
public void fromPO(IBZ5CUSTOMER po) {
BeanCopier copier=BeanCopier.create(IBZ5CUSTOMER.class, IBZ5CUSTOMERDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5CUSTOMERDTO> fromPOPage(Page<IBZ5CUSTOMER> poPage) {
if(poPage == null)
return null;
//Page<IBZ5CUSTOMERDTO> dtoPage=new Page<IBZ5CUSTOMERDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5CUSTOMERDTO> dtos=new ArrayList<IBZ5CUSTOMERDTO>();
for(IBZ5CUSTOMER po : poPage.getRecords()) {
IBZ5CUSTOMERDTO dto = new IBZ5CUSTOMERDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.web.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5ORDERDETAIL;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5ORDERDETAILDTO {
private Timestamp createdate;
private String ibz5orderdetailname;
private String createman;
private String ibz5uniproductid;
private String ibz5uniproductname;
private String ibz5ordername;
private Integer quantity;
private String updateman;
private Double amount;
private String ibz5orderid;
private String ibz5orderdetailid;
private Timestamp updatedate;
public IBZ5ORDERDETAIL toPO() {
IBZ5ORDERDETAIL po = new IBZ5ORDERDETAIL();
BeanCopier copier=BeanCopier.create(IBZ5ORDERDETAILDTO.class, IBZ5ORDERDETAIL.class, false);
copier.copy(this, po, null);
po.setIbz5orderdetailid(null);
return po;
}
public void fromPO(IBZ5ORDERDETAIL po) {
BeanCopier copier=BeanCopier.create(IBZ5ORDERDETAIL.class, IBZ5ORDERDETAILDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5ORDERDETAILDTO> fromPOPage(Page<IBZ5ORDERDETAIL> poPage) {
if(poPage == null)
return null;
//Page<IBZ5ORDERDETAILDTO> dtoPage=new Page<IBZ5ORDERDETAILDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5ORDERDETAILDTO> dtos=new ArrayList<IBZ5ORDERDETAILDTO>();
for(IBZ5ORDERDETAIL po : poPage.getRecords()) {
IBZ5ORDERDETAILDTO dto = new IBZ5ORDERDETAILDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.web.dto;
import java.util.ArrayList;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5ORDER;
import lombok.Data;
import java.sql.Timestamp;
import org.springframework.cglib.beans.BeanCopier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Data
public class IBZ5ORDERDTO {
private String ibz5ordername;
private Integer detailnum;
private String updateman;
private String createman;
private String memo;
private String ibz5orderid;
private Timestamp ordertime;
private String orderstate;
private String ibz5customername;
private Timestamp updatedate;
private Timestamp createdate;
private Timestamp starttime;
private String orderuid;
private String ibz5customerid;
private Timestamp endtime;
private Double amount;
private String ordertype;
public IBZ5ORDER toPO() {
IBZ5ORDER po = new IBZ5ORDER();
BeanCopier copier=BeanCopier.create(IBZ5ORDERDTO.class, IBZ5ORDER.class, false);
copier.copy(this, po, null);
po.setIbz5orderid(null);
return po;
}
public void fromPO(IBZ5ORDER po) {
BeanCopier copier=BeanCopier.create(IBZ5ORDER.class, IBZ5ORDERDTO.class, false);
copier.copy(po, this, null);
}
public List<IBZ5ORDERDTO> fromPOPage(Page<IBZ5ORDER> poPage) {
if(poPage == null)
return null;
//Page<IBZ5ORDERDTO> dtoPage=new Page<IBZ5ORDERDTO>(poPage.getCurrent(), poPage.getSize(), poPage.getTotal(), poPage.isSearchCount());
List<IBZ5ORDERDTO> dtos=new ArrayList<IBZ5ORDERDTO>();
for(IBZ5ORDER po : poPage.getRecords()) {
IBZ5ORDERDTO dto = new IBZ5ORDERDTO();
dto.fromPO(po);
dtos.add(dto);
}
//dtoPage.setAsc(poPage.ascs());
//dtoPage.setDesc(poPage.descs());
//dtoPage.setOptimizeCountSql(poPage.optimizeCountSql());
//dtoPage.setRecords(dtos);
return dtos;
}
}
package com.ibiz5.api.web.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5CUSTOMER;
import com.ibiz5.sample.service.IBZ5CUSTOMERService;
import com.ibiz5.sample.service.dto.IBZ5CUSTOMERSearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.web.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5CUSTOMER" })
@RestController
@RequestMapping("/rest/web/ibz5customer")
public class IBZ5CUSTOMERResource {
@Autowired
private IBZ5CUSTOMERService ibz5customerService;
}
package com.ibiz5.api.web.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5ORDERDETAIL;
import com.ibiz5.sample.service.IBZ5ORDERDETAILService;
import com.ibiz5.sample.service.dto.IBZ5ORDERDETAILSearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.web.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5ORDERDETAIL" })
@RestController
@RequestMapping("/rest/web/ibz5orderdetail")
public class IBZ5ORDERDETAILResource {
@Autowired
private IBZ5ORDERDETAILService ibz5orderdetailService;
}
package com.ibiz5.api.web.resource;
import java.util.List;
import com.ibiz5.sample.domain.IBZ5ORDER;
import com.ibiz5.sample.service.IBZ5ORDERService;
import com.ibiz5.sample.service.dto.IBZ5ORDERSearchFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.ibiz5.api.web.dto.*;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@Api(tags = {"IBZ5ORDER" })
@RestController
@RequestMapping("/rest/web/ibz5order")
public class IBZ5ORDERResource {
@Autowired
private IBZ5ORDERService ibz5orderService;
}
package com.ibiz5.app.controller;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.ibiz5.ibizutil.domain.ActionResult;
import com.ibiz5.ibizutil.errors.BadRequestAlertException;
import org.springframework.validation.annotation.Validated;
import org.springframework.http.ResponseEntity;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import com.fasterxml.jackson.databind.node.ObjectNode;
import javax.servlet.http.HttpServletRequest;
@RestController
public class AppMenuController{
@GetMapping(value="/app/ctrl/appindexviewappmenu/get")
public ResponseEntity<JsonNode> appAppindexviewGet(){
JsonNode jsonNode;
try{
InputStream in = this.getClass().getResourceAsStream("/appmenu/app_appindexview.json");
jsonNode = new ObjectMapper().readTree(in);
}
catch(Exception ex){
throw new BadRequestAlertException("操作发生错误","","");
}
return ResponseEntity.ok().body(jsonNode);
}
/**
* 系统预置服务接口
* @return
*/
@RequestMapping(value="/app/app/app/getappdata")
public ResponseEntity<AppData> appGetAppData(@Validated HttpServletRequest request){
AppData appData = new AppData();
return ResponseEntity.ok().body(appData);
}
@GetMapping(value="/web/ctrl/appindexviewappmenu/get")
public ResponseEntity<JsonNode> webAppindexviewGet(){
JsonNode jsonNode;
try{
InputStream in = this.getClass().getResourceAsStream("/appmenu/web_appindexview.json");
jsonNode = new ObjectMapper().readTree(in);
}
catch(Exception ex){
throw new BadRequestAlertException("操作发生错误","","");
}
return ResponseEntity.ok().body(jsonNode);
}
/**
* 系统预置服务接口
* @return
*/
@RequestMapping(value="/web/app/web/getappdata")
public ResponseEntity<AppData> webGetAppData(@Validated HttpServletRequest request){
AppData appData = new AppData();
return ResponseEntity.ok().body(appData);
}
@Data
static protected class AppData{
private String remotetag = null;
private ObjectNode localdata = null;
}
}
package com.ibiz5.app.controller;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ibiz5.ibizutil.domain.ActionResult;
import com.ibiz5.ibizutil.domain.CodeList;
import com.ibiz5.ibizutil.errors.BadRequestAlertException;
import org.springframework.validation.annotation.Validated;
import org.springframework.http.ResponseEntity;
@RestController
public class CodeListController{
@Resource(name="DemoSys_ORDERSTATECodeList")
private com.ibiz5.sample.codelist.ORDERSTATECodeList demoSys_app_ORDERSTATECodeList;
@RequestMapping("/app/app/codelist/demosys/orderstate")
public ResponseEntity<CodeList> appgetDemoSys_ORDERSTATECodeList(){
return ResponseEntity.ok().body(demoSys_app_ORDERSTATECodeList.getCodeList());
}
@RequestMapping("/app/app/codelist/getall")
public ResponseEntity<List<CodeList>> appgetAll(){
List<CodeList> list = new ArrayList<CodeList>();
list.add(demoSys_app_ORDERSTATECodeList.getCodeList());
return ResponseEntity.ok().body(list);
}
@Resource(name="DemoSys_SysOperatorCodeList")
private com.ibiz5.sample.codelist.SysOperatorCodeList demoSys_web_SysOperatorCodeList;
@Resource(name="DemoSys_ORDERSTATECodeList")
private com.ibiz5.sample.codelist.ORDERSTATECodeList demoSys_web_ORDERSTATECodeList;
@RequestMapping("/web/app/codelist/demosys/sysoperator")
public ResponseEntity<CodeList> webgetDemoSys_SysOperatorCodeList(){
return ResponseEntity.ok().body(demoSys_web_SysOperatorCodeList.getCodeList());
}
@RequestMapping("/web/app/codelist/demosys/orderstate")
public ResponseEntity<CodeList> webgetDemoSys_ORDERSTATECodeList(){
return ResponseEntity.ok().body(demoSys_web_ORDERSTATECodeList.getCodeList());
}
@RequestMapping("/web/app/codelist/getall")
public ResponseEntity<List<CodeList>> webgetAll(){
List<CodeList> list = new ArrayList<CodeList>();
list.add(demoSys_web_SysOperatorCodeList.getCodeList());
list.add(demoSys_web_ORDERSTATECodeList.getCodeList());
return ResponseEntity.ok().body(list);
}
}
\ No newline at end of file
平台发布RestController类重写请放入此文件夹
#重写RestController类
注:IDEA中可以打开基类RestController文件,鼠标点中基类RestController类名,按Alt+Enter,弹出的操作菜单中选择Create Subclass,选中此目录完成快速重写
WebMain启动类中设置排除被重写的基类
```java
import org.springframework.cache.annotation.EnableCaching;
@ComponentScans({
@ComponentScan(basePackages = {"com.ibiz5"}
,excludeFilters={@Filter(type=FilterType.REGEX,pattern="com.ibiz5.web.testmodule.controller.TestEntityController")}
),
})
@EnableCaching
public class WebMain extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplicationBuilder builder = new SpringApplicationBuilder(VueR6DevMain.class);
builder.run(args) ;
}
}
```
\ No newline at end of file
package com.ibiz5.boot;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.AnnotationBeanNameGenerator;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.ibiz5.config.liquibase.MasterProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration.class,
org.springframework.boot.autoconfigure.security.oauth2.OAuth2AutoConfiguration.class,
DruidDataSourceAutoConfigure.class,
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration.class,
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration.class
})
@ComponentScans({
@ComponentScan(basePackages = {"com.ibiz5"}
),
})
@MapperScan("com.ibiz5.*.mapper")
@EnableConfigurationProperties({MasterProperties.class})
//@EnableFeignClients(basePackages = {"com.ibiz5" })
//@EnableEurekaClient
public class sampleMain extends SpringBootServletInitializer{
public static void main(String[] args) {
try {
SpringApplicationBuilder builder = new SpringApplicationBuilder(sampleMain.class);
builder.run(args) ;
}catch (Exception e) {
e.printStackTrace();
}
}
}
\ No newline at end of file
package com.ibiz5.config;
import com.github.benmanes.caffeine.cache.CaffeineSpec;
import com.ibiz5.ibizutil.cache.layering.LayeringCacheManager;
import com.ibiz5.ibizutil.cache.setting.FirstCacheSetting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Profile;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* 缓存配置类
* 1级缓存为caffeine
* 2级缓存为redis
*/
@Profile("prod")
@EnableCaching
@Configuration
@EnableConfigurationProperties(CacheProperties.class)
public class CacheConfig {
@Bean
public RedisCacheManager redisCacheManager(RedisConnectionFactory connectionFactory) {
return RedisCacheManager.create(connectionFactory);
}
@Bean
public RedisCacheWriter redisCacheWriter(RedisConnectionFactory connectionFactory){
RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory);
return redisCacheWriter;
}
@Autowired
private RedisCacheWriter redisCacheWriter;
@Autowired
private RedisCacheConfiguration configuration;
@Bean
@Primary
public CacheManager cacheManager() {
LayeringCacheManager layeringCacheManager = new LayeringCacheManager();
setFirstCacheConfig(layeringCacheManager);//Caffeine缓存设置
layeringCacheManager.setAllowNullValues(true); //允许存null,防止缓存击穿
layeringCacheManager.setRedisCacheWriter(redisCacheWriter);
layeringCacheManager.setRedisConfiguration(configuration);
return layeringCacheManager;
}
@Autowired
private CacheProperties cacheProperties;
private void setFirstCacheConfig(LayeringCacheManager layeringCacheManager) {
String specification = cacheProperties.getCaffeine().getSpec();
if (StringUtils.hasText(specification)) {
layeringCacheManager.setCaffeineSpec(CaffeineSpec.parse(specification));
}
Map<String, FirstCacheSetting> firstCacheSettings = new HashMap<>();
layeringCacheManager.setFirstCacheSettings(firstCacheSettings);
}
}
\ No newline at end of file
package com.ibiz5.config;
import org.kie.api.KieBase;
import org.kie.api.KieServices;
import org.kie.api.builder.*;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.internal.io.ResourceFactory;
import org.kie.spring.KModuleBeanFactoryPostProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import java.io.IOException;
@Configuration
public class DroolsAutoConfiguration {
private static final String RULES_PATH = "rules/**/";
@Bean
@ConditionalOnMissingBean(KieFileSystem.class)
public KieFileSystem kieFileSystem() throws IOException {
KieFileSystem kieFileSystem = getKieServices().newKieFileSystem();
for (Resource file : getRuleFiles()) {
kieFileSystem.write(ResourceFactory.newUrlResource(file.getURL()));
}
return kieFileSystem;
}
private Resource[] getRuleFiles() throws IOException {
ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
return resourcePatternResolver.getResources("classpath*:" + RULES_PATH + "**/*.*");
}
@Bean
@ConditionalOnMissingBean(KieContainer.class)
public KieContainer kieContainer() throws IOException {
final KieRepository kieRepository = getKieServices().getRepository();
kieRepository.addKieModule(new KieModule() {
public ReleaseId getReleaseId() {
return kieRepository.getDefaultReleaseId();
}
});
KieBuilder kieBuilder = getKieServices().newKieBuilder(kieFileSystem());
kieBuilder.buildAll();
return getKieServices().newKieContainer(kieRepository.getDefaultReleaseId());
}
private KieServices getKieServices() {
return KieServices.Factory.get();
}
@Bean
@ConditionalOnMissingBean(KieBase.class)
public KieBase kieBase() throws IOException {
return kieContainer().getKieBase();
}
@Bean
@ConditionalOnMissingBean(KieSession.class)
public KieSession kieSession() throws IOException {
return kieContainer().newKieSession();
}
@Bean
@ConditionalOnMissingBean(KModuleBeanFactoryPostProcessor.class)
public KModuleBeanFactoryPostProcessor kiePostProcessor() {
return new KModuleBeanFactoryPostProcessor();
}
}
\ No newline at end of file
package com.ibiz5.config.liquibase;
public interface IProperties {
/**
*获取数据库用户名
*/
String getUsername();
/**
*获取数据库密码
*/
String getPassword();
/**
*获取数据库url
*/
String getUrl();
/**
*获取数据库schema
*/
String getDefaultSchema();
/**
*获取是否同步
*/
String getIsSyncDBSchema();
/**
* liquibase配置文件
*/
String getConf();
}
\ No newline at end of file
package com.ibiz5.config.liquibase;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "spring.datasource.dynamic.datasource.master")
@Data
public class MasterProperties implements IProperties{
private String url;
private String username;
private String password;
private String isSyncDBSchema;
private String defaultSchema;
private String conf;
}
\ No newline at end of file
package com.ibiz5.config.liquibase;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "spring.datasource.dynamic.datasource.tempmaster")
@Data
public class TempMasterProperties implements IProperties{
private String url;
private String username;
private String password;
private String isSyncDBSchema;
private String defaultSchema;
private String conf;
}
\ No newline at end of file
package com.ibiz5.config;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
import org.apache.ibatis.mapping.DatabaseIdProvider;
import java.util.Properties;
import org.springframework.context.annotation.Primary;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.jdbc.DataSourceBuilder;
import com.ibiz5.config.liquibase.IProperties;
import com.ibiz5.config.liquibase.MasterProperties;
import com.ibiz5.config.liquibase.TempMasterProperties;
import org.springframework.beans.factory.annotation.Autowired;
import liquibase.integration.spring.SpringLiquibase;
import org.springframework.util.StringUtils;
import com.alibaba.druid.pool.DruidDataSource;
import org.mybatis.spring.batch.MyBatisCursorItemReader;
import org.apache.ibatis.session.SqlSessionFactory;
@Configuration
public class sampleConf {
@Bean
public PerformanceInterceptor performanceInterceptor() {
PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
/*<!--SQL是否格式化 默认false-->*/
performanceInterceptor.setFormat(true);
return performanceInterceptor;
}
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
/**
* 屏蔽json序列化对象属性为空的错误
* @return
*/
@Bean
public ObjectMapper objectMapper() {
return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
}
/**
* 多数据源切换
* @return
*/
@Bean
public DatabaseIdProvider getDatabaseIdProvider() {
DatabaseIdProvider databaseIdProvider = new VendorDatabaseIdProvider();
Properties p = new Properties();
p.setProperty("Oracle", "oracle");
p.setProperty("MySQL", "mysql");
p.setProperty("DM", "oracle");//达梦数据库使用oracle模式
databaseIdProvider.setProperties(p);
return databaseIdProvider;
}
/**
* 主数据源版本管理
* @param
* @return
*/
@Bean
public SpringLiquibase masterliquibase(MasterProperties masterProperties) {
return LiquibaseInit(masterProperties);
}
/**
* 临时数据源版本管理
* @param
* @return
*/
@Bean
public SpringLiquibase tempMasterliquibase(TempMasterProperties tempMasterProperties) {
return LiquibaseInit(tempMasterProperties);
}
/**
* liquibase初始化数据库
* @param properties
* @return
*/
private SpringLiquibase LiquibaseInit(IProperties properties){
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setUsername(properties.getUsername());
druidDataSource.setPassword(properties.getPassword());
druidDataSource.setUrl(properties.getUrl());
SpringLiquibase liquibase = new SpringLiquibase();
liquibase.setDataSource(druidDataSource);
liquibase.setChangeLog(getChangelog(properties.getIsSyncDBSchema(),properties.getConf()));
liquibase.setContexts("development,test,production");
liquibase.setShouldRun(true);
liquibase.setDefaultSchema(properties.getDefaultSchema());
return liquibase;
}
/**
* 获取数据库差异文件
* @param isSyncDBSchema 是否同步表结构
* @param conf //liquibase配置文件
* @return
*/
private String getChangelog(String isSyncDBSchema,String conf){
String defaultChangelog="classpath:liquibase/empty.xml";
if((!StringUtils.isEmpty(isSyncDBSchema))&&(!StringUtils.isEmpty(conf))){
if(isSyncDBSchema.toLowerCase().equals("true"))
defaultChangelog=conf;
}
return defaultChangelog;
}
/**
* mybatis游标查询 MyBatisCursorItemReader
* @param sqlSessionFactory
* @return
*/
@Bean
public MyBatisCursorItemReader myMyBatisCursorItemReader(SqlSessionFactory sqlSessionFactory) {
MyBatisCursorItemReader reader =new MyBatisCursorItemReader();
reader.setQueryId("");
reader.setSqlSessionFactory(sqlSessionFactory);
return reader;
}
}
\ No newline at end of file
package com.ibiz5.config;
import com.ibiz5.ibizutil.security.AuthenticationEntryPoint;
import com.ibiz5.ibizutil.security.AuthorizationTokenFilter;
import com.ibiz5.ibizutil.service.AuthenticationUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.core.GrantedAuthorityDefaults;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = false)
public class sampleSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private AuthenticationEntryPoint unauthorizedHandler;
@Autowired
private AuthenticationUserService userDetailsService;
/**
* 自定义基于JWT的安全过滤器
*/
@Autowired
AuthorizationTokenFilter authenticationTokenFilter;
@Value("${ibiz.jwt.header:Authorization}")
private String tokenHeader;
@Value("${ibiz.custompermitpath:custompermit}")
private String custompermitpath;
@Value("${ibiz.customanonymouspath:customanonymous}")
private String customanonymouspath;
@Value("${ibiz.auth.path:ibizutil/login}")
private String loginPath;
@Value("${ibiz.file.uploadpath:ibizutil/upload}")
private String uploadpath;
private final String defaultdownloadpath="ibizutil/download/{id}";
@Value("${ibiz.file.downloadpath:"+defaultdownloadpath+"}")
private String downloadpath;
@Value("${ibiz.file.previewpath:ibizutil/preview}")
private String previewpath;
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoderBean());
}
@Bean
GrantedAuthorityDefaults grantedAuthorityDefaults() {
// Remove the ROLE_ prefix
return new GrantedAuthorityDefaults("");
}
@Bean
public PasswordEncoder passwordEncoderBean() {
return new BCryptPasswordEncoder();
}
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity
// 禁用 CSRF
.csrf().disable()
// 授权异常
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
// 不创建会话
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
// 过滤请求
.authorizeRequests()
.antMatchers(
HttpMethod.GET,
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js",
"/**/*.ico",
"/**/assets/**",
"/**/css/**",
"/**/fonts/**",
"/**/js/**",
"/**/img/**",
"/"
).permitAll()
.antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
.antMatchers("/websocket/**").permitAll()
// 文件操作
.antMatchers("/"+downloadpath).permitAll()
.antMatchers("/"+uploadpath).permitAll()
.antMatchers("/"+previewpath+"/**").permitAll()
.antMatchers("/"+custompermitpath+"/**").permitAll()
.antMatchers("/"+customanonymouspath+"/**").anonymous()
.antMatchers("/**/codelist/**").permitAll()
.antMatchers("/**/getappdata").permitAll()
// 系统监控
.antMatchers("/actuator/**").anonymous()
// swagger start
.antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous()
// swagger end
// 接口限流测试
.antMatchers("/test/**").anonymous()
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
.antMatchers("/druid/**").permitAll()
// 所有请求都需要认证
.anyRequest().authenticated()
// 防止iframe 造成跨域
.and().headers().frameOptions().disable();
httpSecurity
.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
}
}
package com.ibiz5.ibizutil;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class SpringContextHolder implements ApplicationContextAware
{
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
SpringContextHolder.applicationContext = applicationContext;
}
public static ApplicationContext getApplicationContext() {
assertApplicationContext();
return applicationContext;
}
@SuppressWarnings("unchecked")
public static <T> T getBean(String beanName) {
assertApplicationContext();
return (T) applicationContext.getBean(beanName);
}
public static <T> T getBean(Class<T> requiredType) {
assertApplicationContext();
return applicationContext.getBean(requiredType);
}
private static void assertApplicationContext() {
if (SpringContextHolder.applicationContext == null) {
throw new RuntimeException("applicaitonContext属性为null,请检查是否注入了SpringContextHolder!");
}
}
}
\ No newline at end of file
package com.ibiz5.ibizutil.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD})
public @interface Audit
{
String fieldLogicName() default "";//字段逻辑名称
String dictName() default "";//代码表名称
String fieldType() default"";//字段类型
String format() default "";//格式化
}
package com.ibiz5.ibizutil.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD})
public @interface Dict
{
String dictName() default "";//代码表转换类
String textField() default "";
}
package com.ibiz5.ibizutil.annotation;
import com.ibiz5.ibizutil.enums.FillMode;
import com.ibiz5.ibizutil.enums.PredefinedType;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD})
public @interface PreField
{
FillMode fill() default FillMode.INSERT_UPDATE;//填充模式 insert or update
PredefinedType preType() default PredefinedType.DEFAULT;//预置属性类型
}
package com.ibiz5.ibizutil.aspect;
import com.ibiz5.ibizutil.annotation.Audit;
import com.ibiz5.ibizutil.domain.EntityBase;
import com.ibiz5.ibizutil.domain.IBZDataAudit;
import com.ibiz5.ibizutil.helper.DataAuditHelper;
import com.ibiz5.ibizutil.helper.IPHelper;
import com.ibiz5.ibizutil.security.AuthenticationUser;
import com.ibiz5.ibizutil.service.IBZDataAuditService;
import com.ibiz5.ibizutil.service.ServiceImplBase;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Field;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Map;
/**
* 实体数据审计切面类
*/
@Aspect
@Component
public class AuditAspect
{
@Autowired
IBZDataAuditService dataAuditService;
/**
* 实体数据建立切面,在成功创建数据后将新增数据内容记录审计日志内(审计明细【AuditInfo】中只记录审计属性变化情况,审计属性在平台属性中配置)
* @param point
*/
@AfterReturning(value = "execution(* com.ibiz5.*.service.*.create(..))")
public void create(JoinPoint point){
HttpServletRequest request=null;
RequestAttributes requestAttributes=RequestContextHolder.getRequestAttributes();
if(requestAttributes!=null){
request=((ServletRequestAttributes)requestAttributes).getRequest();
}
Object [] args = point.getArgs();
if(args.length>0){
Object serviceObj=point.getTarget();
Object serviceParam =args[0];
if (serviceParam instanceof EntityBase && serviceObj instanceof ServiceImplBase){
EntityBase curEntity=(EntityBase)serviceParam;//创建数据
Map<Field, Audit> auditFields= curEntity.getAuditField();
if(auditFields.size()==0)//是否有审计属性
return;
String auditResult = DataAuditHelper.getInstance().CompareAuditObjectByInsert(curEntity,auditFields);//获取审计明细
saveAuditData("创建",curEntity.getClass().getSimpleName(),curEntity.getSrfkey(),request,auditResult,1);//记录审计日志
return;
}
}
}
/**
* 实体数据更新切面,在成功更新数据后将新增数据内容记录审计日志内(审计明细【AuditInfo】中只记录审计属性变化情况,审计属性在平台属性中配置)
* 使用环切【@Around】获取到更新前后的实体数据并进行差异比较,并将差异内容记入审计日志内
* @param point
*/
@Around("execution(* com.ibiz5.*.service.*.update(..))")
public Object update(ProceedingJoinPoint point) throws Throwable {
HttpServletRequest request=null;
RequestAttributes requestAttributes=RequestContextHolder.getRequestAttributes();
if(requestAttributes!=null){
request=((ServletRequestAttributes)requestAttributes).getRequest();
}
Object serviceObj=point.getTarget();
Object args[]=point.getArgs();
if(args.length>0){
Object arg=args[0];
if(arg instanceof EntityBase && serviceObj instanceof ServiceImplBase){
ServiceImplBase service= (ServiceImplBase) serviceObj;
EntityBase curEntity= (EntityBase) arg;
Map<Field, Audit> auditFields= curEntity.getAuditField();
if(auditFields.size()==0)//是否有审计属性
return point.proceed();
EntityBase before_entity= curEntity.getClass().newInstance();
before_entity.setSrfkey(curEntity.getSrfkey());
service.get(before_entity);//获取更新前的数据
point.proceed();//执行更新操作
EntityBase after_entity= curEntity.getClass().newInstance();
after_entity.setSrfkey(curEntity.getSrfkey());
service.get(after_entity);//获取更新后的数据
String auditResult=DataAuditHelper.getInstance().CompareAuditObjectByUpdate(before_entity,after_entity,auditFields);//比较更新前后差异内容
int isDataChanged=1;
if(StringUtils.isEmpty(auditResult))//审计内容是否发生变化
isDataChanged=0;
saveAuditData("更新",curEntity.getClass().getSimpleName(),curEntity.getSrfkey(),request,auditResult,isDataChanged);//记录审计日志
}
}
return true;
}
/**
* 实体数据更新切面,在成功更新数据后将新增数据内容记录审计日志内(审计明细【AuditInfo】中只记录审计属性变化情况,审计属性在平台属性中配置)
* 使用环切【@Around】获取要删除的完整数据,并将审计属性相关信息记录到审计日志中
* @param point
* @return
* @throws Throwable
*/
@Around("execution(* com.ibiz5.*.service.*.remove(..))")
public Object remove(ProceedingJoinPoint point) throws Throwable {
HttpServletRequest request=null;
RequestAttributes requestAttributes=RequestContextHolder.getRequestAttributes();
if(requestAttributes!=null){
request=((ServletRequestAttributes)requestAttributes).getRequest();
}
Object serviceObj=point.getTarget();
Object args[]=point.getArgs();
if(args.length>0){
Object arg=args[0];
if(arg instanceof EntityBase && serviceObj instanceof ServiceImplBase){
ServiceImplBase service= (ServiceImplBase) serviceObj;
EntityBase curEntity= (EntityBase) arg;
Map<Field, Audit> auditFields= curEntity.getAuditField();
if(auditFields.size()==0)//是否有审计属性
return point.proceed();//无审计属性,跳过审计,执行remove
EntityBase remove_entity= curEntity.getClass().newInstance();
remove_entity.setSrfkey(curEntity.getSrfkey());
service.get(remove_entity);//获取要删除的完整数据
point.proceed();//执行remove
String auditResult=DataAuditHelper.getInstance().CompareAuditObjectByRemove(remove_entity,auditFields);//获取审计明细
saveAuditData("删除",curEntity.getClass().getSimpleName(),curEntity.getSrfkey(),request,auditResult,1);//记录审计日志
}
}
return true;
}
/**
* 保存审计数据
* @param auditLogicName
* @param entityName
* @param srfkey
* @param request
* @param auditResult
* @param isDataChanged
*/
private void saveAuditData(String auditLogicName,String entityName,Object srfkey,HttpServletRequest request,String auditResult,int isDataChanged){
IBZDataAudit dataAudit =new IBZDataAudit();
dataAudit.setOppersonid(AuthenticationUser.getAuthenticationUser().getUserid());
dataAudit.setOppersonname(String.format("%s[%s]",AuthenticationUser.getAuthenticationUser().getPersonname(),AuthenticationUser.getAuthenticationUser().getOrgname()));
dataAudit.setAudittype(auditLogicName);
dataAudit.setAuditobject(entityName);
dataAudit.setAuditobjectdata(srfkey);
dataAudit.setOptime(new Timestamp(new Date().getTime()));
if(request!=null)
dataAudit.setIpaddress(IPHelper.getIpAddress(request, AuthenticationUser.getAuthenticationUser()));
dataAudit.setAuditinfo(auditResult);
dataAudit.setIsdatachanged(isDataChanged);
dataAuditService.save(dataAudit);
}
}
\ No newline at end of file
package com.ibiz5.ibizutil.client.uaa;
public class UAAClientCfg {
}
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册