Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
IM
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBizPOC_20003
IM
提交
868ac125
提交
868ac125
编写于
4月 08, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
3b165782
变更
18
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
1288 行增加
和
0 行删除
+1288
-0
en-US.ts
app_Web/src/locale/lang/en-US.ts
+2
-0
zh-CN.ts
app_Web/src/locale/lang/zh-CN.ts
+2
-0
ps_en_US.ts
app_Web/src/locale/lanres/ps/ps_en_US.ts
+3
-0
ps_zh_CN.ts
app_Web/src/locale/lanres/ps/ps_zh_CN.ts
+2
-0
pss.ts
app_Web/src/mock/entity/pss/pss.ts
+300
-0
index.ts
app_Web/src/mock/index.ts
+1
-0
entity-service-register.ts
app_Web/src/service/entity-service-register.ts
+1
-0
ps-service-base.ts
app_Web/src/service/ps/ps-service-base.ts
+172
-0
ps-service.ts
app_Web/src/service/ps/ps-service.ts
+25
-0
ps-ui-service-base.ts
app_Web/src/uiservice/ps/ps-ui-service-base.ts
+210
-0
ps-ui-service.ts
app_Web/src/uiservice/ps/ps-ui-service.ts
+21
-0
ui-service-register.ts
app_Web/src/uiservice/ui-service-register.ts
+1
-0
PSController.java
...rc/main/java/com/ibiz/web/ps/controller/PSController.java
+98
-0
PS.java
...p/im-app-web/src/main/java/com/ibiz/web/ps/domain/PS.java
+258
-0
PSFeignClient.java
...eb/src/main/java/com/ibiz/web/ps/feign/PSFeignClient.java
+46
-0
PSSearchContext.java
...src/main/java/com/ibiz/web/ps/filter/PSSearchContext.java
+16
-0
PSService.java
...-web/src/main/java/com/ibiz/web/ps/service/PSService.java
+95
-0
PSPermission.java
...ava/com/ibiz/web/security/permission/ps/PSPermission.java
+35
-0
未找到文件。
app_Web/src/locale/lang/en-US.ts
浏览文件 @
868ac125
...
...
@@ -4,6 +4,7 @@ import orguser_en_US from '@locale/lanres/org-user/org-user_en_US';
import
im_en_US
from
'@locale/lanres/im/im_en_US'
;
import
bc_en_US
from
'@locale/lanres/bc/bc_en_US'
;
import
org_en_US
from
'@locale/lanres/org/org_en_US'
;
import
ps_en_US
from
'@locale/lanres/ps/ps_en_US'
;
import
orgdept_en_US
from
'@locale/lanres/org-dept/org-dept_en_US'
;
import
fj_en_US
from
'@locale/lanres/fj/fj_en_US'
;
...
...
@@ -52,6 +53,7 @@ export default {
im
:
im_en_US
,
bc
:
bc_en_US
,
org
:
org_en_US
,
ps
:
ps_en_US
,
orgdept
:
orgdept_en_US
,
fj
:
fj_en_US
,
};
\ No newline at end of file
app_Web/src/locale/lang/zh-CN.ts
浏览文件 @
868ac125
...
...
@@ -4,6 +4,7 @@ import orguser_zh_CN from '@locale/lanres/org-user/org-user_zh_CN';
import
im_zh_CN
from
'@locale/lanres/im/im_zh_CN'
;
import
bc_zh_CN
from
'@locale/lanres/bc/bc_zh_CN'
;
import
org_zh_CN
from
'@locale/lanres/org/org_zh_CN'
;
import
ps_zh_CN
from
'@locale/lanres/ps/ps_zh_CN'
;
import
orgdept_zh_CN
from
'@locale/lanres/org-dept/org-dept_zh_CN'
;
import
fj_zh_CN
from
'@locale/lanres/fj/fj_zh_CN'
;
...
...
@@ -52,6 +53,7 @@ export default {
im
:
im_zh_CN
,
bc
:
bc_zh_CN
,
org
:
org_zh_CN
,
ps
:
ps_zh_CN
,
orgdept
:
orgdept_zh_CN
,
fj
:
fj_zh_CN
,
};
\ No newline at end of file
app_Web/src/locale/lanres/ps/ps_en_US.ts
0 → 100644
浏览文件 @
868ac125
export
default
{
};
\ No newline at end of file
app_Web/src/locale/lanres/ps/ps_zh_CN.ts
0 → 100644
浏览文件 @
868ac125
export
default
{
};
\ No newline at end of file
app_Web/src/mock/entity/pss/pss.ts
0 → 100644
浏览文件 @
868ac125
此差异已折叠。
点击以展开。
app_Web/src/mock/index.ts
浏览文件 @
868ac125
...
...
@@ -13,5 +13,6 @@ import './entity/org-users/org-users';
import
'./entity/ims/ims'
;
import
'./entity/bcs/bcs'
;
import
'./entity/orgs/orgs'
;
import
'./entity/pss/pss'
;
import
'./entity/org-depts/org-depts'
;
import
'./entity/fjs/fjs'
;
app_Web/src/service/entity-service-register.ts
浏览文件 @
868ac125
...
...
@@ -45,6 +45,7 @@ export class EntityServiceRegister {
this
.
allEntityService
.
set
(
'im'
,
()
=>
import
(
'@/service/im/im-service'
));
this
.
allEntityService
.
set
(
'bc'
,
()
=>
import
(
'@/service/bc/bc-service'
));
this
.
allEntityService
.
set
(
'org'
,
()
=>
import
(
'@/service/org/org-service'
));
this
.
allEntityService
.
set
(
'ps'
,
()
=>
import
(
'@/service/ps/ps-service'
));
this
.
allEntityService
.
set
(
'orgdept'
,
()
=>
import
(
'@/service/org-dept/org-dept-service'
));
this
.
allEntityService
.
set
(
'fj'
,
()
=>
import
(
'@/service/fj/fj-service'
));
}
...
...
app_Web/src/service/ps/ps-service-base.ts
0 → 100644
浏览文件 @
868ac125
import
{
Http
,
Util
}
from
'@/utils'
;
import
EntityService
from
'../entity-service'
;
/**
* 采购单服务对象基类
*
* @export
* @class PSServiceBase
* @extends {EntityServie}
*/
export
default
class
PSServiceBase
extends
EntityService
{
/**
* Creates an instance of PSServiceBase.
*
* @param {*} [opts={}]
* @memberof PSServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
/**
* 初始化基础数据
*
* @memberof PSServiceBase
*/
public
initBasicData
(){
this
.
APPLYDEKEY
=
'ps'
;
this
.
APPDEKEY
=
'psid'
;
this
.
APPDENAME
=
'ps'
;
this
.
APPDETEXT
=
'psname'
;
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
get
(
`/ps/
${
context
.
ps
}
/select`
,
isloading
);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/ps/
${
context
.
ps
}
`
,
isloading
);
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/ps/
${
context
.
ps
}
`
,
data
,
isloading
);
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
data
[
this
.
APPDEKEY
]
=
null
;
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/ps`
,
data
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/ps/
${
context
.
ps
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/ps/getdraft`
,
isloading
);
res
.
data
.
ps
=
data
.
ps
;
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/ps/
${
context
.
ps
}
/checkkey`
,
data
,
isloading
);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/ps/
${
context
.
ps
}
`
,
isloading
);
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/ps/fetchdefault`
,
tempData
,
isloading
);
}
}
\ No newline at end of file
app_Web/src/service/ps/ps-service.ts
0 → 100644
浏览文件 @
868ac125
import
{
Http
,
Util
}
from
'@/utils'
;
import
PSServiceBase
from
'./ps-service-base'
;
/**
* 采购单服务对象
*
* @export
* @class PSService
* @extends {PSServiceBase}
*/
export
default
class
PSService
extends
PSServiceBase
{
/**
* Creates an instance of PSService.
*
* @param {*} [opts={}]
* @memberof PSService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_Web/src/uiservice/ps/ps-ui-service-base.ts
0 → 100644
浏览文件 @
868ac125
import
{
Environment
}
from
'@/environments/environment'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
PSService
from
'@/service/ps/ps-service'
;
/**
* 采购单UI服务对象基类
*
* @export
* @class PSUIServiceBase
*/
export
default
class
PSUIServiceBase
extends
UIService
{
/**
* 是否支持工作流
*
* @memberof PSUIServiceBase
*/
protected
isEnableWorkflow
:
boolean
=
false
;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof PSUIServiceBase
*/
protected
dataService
:
PSService
=
new
PSService
();
/**
* 所有关联视图
*
* @memberof PSUIServiceBase
*/
protected
allViewMap
:
Map
<
string
,
Object
>
=
new
Map
();
/**
* 状态值
*
* @memberof PSUIServiceBase
*/
protected
stateValue
:
number
=
0
;
/**
* 状态属性
*
* @memberof PSUIServiceBase
*/
protected
stateField
:
string
=
""
;
/**
* 主状态属性集合
*
* @memberof PSUIServiceBase
*/
protected
mainStateFields
:
Array
<
any
>
=
[];
/**
* 主状态集合Map
*
* @memberof PSUIServiceBase
*/
protected
allDeMainStateMap
:
Map
<
string
,
string
>
=
new
Map
();
/**
* Creates an instance of PSUIServiceBase.
*
* @param {*} [opts={}]
* @memberof PSUIServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
}
/**
* 初始化视图Map
*
* @memberof PSUIServiceBase
*/
public
initViewMap
(){
}
/**
* 初始化主状态集合
*
* @memberof PSUIServiceBase
*/
public
initDeMainStateMap
(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof PSUIServiceBase
*/
public
async
getRDAppView
(
srfkey
:
string
,
isEnableWorkflow
:
boolean
){
this
.
isEnableWorkflow
=
isEnableWorkflow
;
// 进行数据查询
let
result
:
any
=
await
this
.
dataService
.
Get
({
ps
:
srfkey
});
const
curData
:
any
=
result
.
data
;
//判断当前数据模式,默认为true,todo
const
iRealDEModel
:
boolean
=
true
;
let
bDataInWF
:
boolean
=
false
;
let
bWFMode
:
any
=
false
;
// 计算数据模式
if
(
this
.
isEnableWorkflow
)
{
bDataInWF
=
await
this
.
dataService
.
testDataInWF
({
stateValue
:
this
.
stateValue
,
stateField
:
this
.
stateField
},
curData
);
if
(
bDataInWF
)
{
bDataInWF
=
true
;
bWFMode
=
await
this
.
dataService
.
testUserExistWorklist
(
null
,
curData
);
}
}
let
strPDTViewParam
:
string
=
await
this
.
getDESDDEViewPDTParam
(
curData
,
bDataInWF
,
bWFMode
);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return
this
.
allViewMap
.
get
(
strPDTViewParam
);
}
/**
* 获取实际的数据类型
*
* @memberof PSUIServiceBase
*/
protected
getRealDEType
(
entity
:
any
){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof PSUIServiceBase
*/
protected
async
getDESDDEViewPDTParam
(
curData
:
any
,
bDataInWF
:
boolean
,
bWFMode
:
boolean
){
let
strPDTParam
:
string
=
''
;
if
(
bDataInWF
)
{
// 判断数据是否在流程中
}
//多表单,todo
const
isEnableMultiForm
:
boolean
=
false
;
const
multiFormDEField
:
string
|
null
=
null
;
if
(
isEnableMultiForm
&&
multiFormDEField
)
{
const
objFormValue
:
string
=
curData
[
multiFormDEField
];
if
(
!
Environment
.
isAppMode
){
return
'MOBEDITVIEW'
+
objFormValue
;
}
return
'EDITVIEW'
+
objFormValue
;
}
if
(
!
Environment
.
isAppMode
){
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`MOBEDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'MOBEDITVIEW:'
;
}
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`EDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'EDITVIEW:'
;
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof PSUIServiceBase
*/
protected
async
getDEMainStateTag
(
curData
:
any
){
if
(
this
.
mainStateFields
.
length
===
0
)
return
null
;
this
.
mainStateFields
.
forEach
((
singleMainField
:
any
)
=>
{
if
(
!
(
singleMainField
in
curData
)){
console
.
error
(
`当前数据对象不包含属性singleMainField,可能会发生错误`
);
}
})
let
strTag
:
String
=
""
;
for
(
let
i
=
0
;
i
<=
1
;
i
++
)
{
let
strTag
:
string
=
(
curData
[
this
.
mainStateFields
[
0
]])?(
i
==
0
)
?
curData
[
this
.
mainStateFields
[
0
]]
:
""
:
""
;
if
(
this
.
mainStateFields
.
length
>=
2
)
{
for
(
let
j
=
0
;
j
<=
1
;
j
++
)
{
let
strTag2
:
string
=
(
curData
[
this
.
mainStateFields
[
1
]])?
`
${
strTag
}
__
${(
j
==
0
)
?
curData
[
this
.
mainStateFields
[
1
]]
:
""
}
`
:
strTag
;
if
(
this
.
mainStateFields
.
length
>=
3
)
{
for
(
let
k
=
0
;
k
<=
1
;
k
++
)
{
let
strTag3
:
string
=
(
curData
[
this
.
mainStateFields
[
2
]])?
`
${
strTag2
}
__
${(
k
==
0
)
?
curData
[
this
.
mainStateFields
[
2
]]
:
""
}
`
:
strTag2
;
// 判断是否存在
return
this
.
allDeMainStateMap
.
get
(
strTag3
);
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag2
);
}
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag
);
}
}
return
null
;
}
}
\ No newline at end of file
app_Web/src/uiservice/ps/ps-ui-service.ts
0 → 100644
浏览文件 @
868ac125
import
PSUIServiceBase
from
'./ps-ui-service-base'
;
/**
* 采购单UI服务对象
*
* @export
* @class PSUIService
*/
export
default
class
PSUIService
extends
PSUIServiceBase
{
/**
* Creates an instance of PSUIService.
*
* @param {*} [opts={}]
* @memberof PSUIService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_Web/src/uiservice/ui-service-register.ts
浏览文件 @
868ac125
...
...
@@ -45,6 +45,7 @@ export class UIServiceRegister {
this
.
allUIService
.
set
(
'im'
,
()
=>
import
(
'@/uiservice/im/im-ui-service'
));
this
.
allUIService
.
set
(
'bc'
,
()
=>
import
(
'@/uiservice/bc/bc-ui-service'
));
this
.
allUIService
.
set
(
'org'
,
()
=>
import
(
'@/uiservice/org/org-ui-service'
));
this
.
allUIService
.
set
(
'ps'
,
()
=>
import
(
'@/uiservice/ps/ps-ui-service'
));
this
.
allUIService
.
set
(
'orgdept'
,
()
=>
import
(
'@/uiservice/org-dept/org-dept-ui-service'
));
this
.
allUIService
.
set
(
'fj'
,
()
=>
import
(
'@/uiservice/fj/fj-ui-service'
));
}
...
...
im-app/im-app-web/src/main/java/com/ibiz/web/ps/controller/PSController.java
0 → 100644
浏览文件 @
868ac125
package
com
.
ibiz
.
web
.
ps
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.PageRequest
;
import
com.ibiz.web.ps.service.PSService
;
import
com.ibiz.web.ps.domain.PS
;
import
com.ibiz.web.ps.filter.*
;
@RestController
@RequestMapping
(
value
=
""
)
public
class
PSController
{
@Autowired
PSService
psservice
;
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ps/{ps_id}"
)
@PreAuthorize
(
"@ps_pms.check(#ps_id,'READ')"
)
public
ResponseEntity
<
PS
>
get
(
@PathVariable
(
"ps_id"
)
String
ps_id
)
{
PS
ps
=
psservice
.
get
(
ps_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ps
);
}
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ps/{ps_id}"
)
@PreAuthorize
(
"@ps_pms.check(#ps_id,'UPDATE')"
)
public
ResponseEntity
<
PS
>
update
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
{
PS
ps2
=
psservice
.
update
(
ps_id
,
ps
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ps2
);
}
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/api/ps/{ps_id}"
)
@PreAuthorize
(
"@ps_pms.check(#ps_id,'UPDATE')"
)
public
ResponseEntity
<
PS
>
api_update
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
{
PS
ps2
=
psservice
.
update
(
ps_id
,
ps
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ps2
);
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ps"
)
@PreAuthorize
(
"@ps_pms.check('CREATE')"
)
public
ResponseEntity
<
PS
>
create
(
@RequestBody
PS
ps
)
{
PS
ps2
=
psservice
.
create
(
ps
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ps2
);
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ps/{ps_id}/save"
)
@PreAuthorize
(
"@ps_pms.check(#ps_id,'')"
)
public
ResponseEntity
<
PS
>
save
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
{
PS
ps2
=
psservice
.
save
(
ps_id
,
ps
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ps2
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ps/getdraft"
)
@PreAuthorize
(
"@ps_pms.check('CREATE')"
)
public
ResponseEntity
<
PS
>
getDraft
()
{
//PS ps = psservice.getDraft( ps_id);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
new
PS
());
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ps/checkkey"
)
@PreAuthorize
(
"@ps_pms.check('')"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
PS
ps
)
{
boolean
b
=
psservice
.
checkKey
(
ps
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
b
);
}
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ps/{ps_id}"
)
@PreAuthorize
(
"@ps_pms.check(#ps_id,'DELETE')"
)
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"ps_id"
)
String
ps_id
)
{
boolean
b
=
psservice
.
remove
(
ps_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
b
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ps/fetchdefault"
)
@PreAuthorize
(
"@ps_pms.check('READ')"
)
public
ResponseEntity
<
List
<
PS
>>
fetchDefault
(
PSSearchContext
searchContext
,
Pageable
pageable
)
{
Page
<
PS
>
page
=
psservice
.
fetchDefault
(
searchContext
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
pageable
.
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
pageable
.
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
page
.
getTotalElements
()))
.
body
(
page
.
getContent
());
}
}
im-app/im-app-web/src/main/java/com/ibiz/web/ps/domain/PS.java
0 → 100644
浏览文件 @
868ac125
package
com
.
ibiz
.
web
.
ps
.
domain
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
java.util.ArrayList
;
import
com.fasterxml.jackson.annotation.JsonAutoDetect
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
/**
* 应用实体[采购单]
*/
public
class
PS
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 建立时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
private
Timestamp
createDate
;
@JsonIgnore
private
boolean
createDateDirtyFlag
;
/**
* 采购单名称
*/
private
String
pSName
;
@JsonIgnore
private
boolean
pSNameDirtyFlag
;
/**
* 建立人
*/
private
String
createMan
;
@JsonIgnore
private
boolean
createManDirtyFlag
;
/**
* 采购单标识
*/
private
String
pSId
;
@JsonIgnore
private
boolean
pSIdDirtyFlag
;
/**
* 更新时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
private
Timestamp
updateDate
;
@JsonIgnore
private
boolean
updateDateDirtyFlag
;
/**
* 更新人
*/
private
String
updateMan
;
@JsonIgnore
private
boolean
updateManDirtyFlag
;
/**
* IMSTATE
*/
private
String
imstate
;
@JsonIgnore
private
boolean
imstateDirtyFlag
;
/**
* 获取 [建立时间]
*/
@JsonProperty
(
"createdate"
)
public
Timestamp
getCreateDate
(){
return
this
.
createDate
;
}
/**
* 设置 [建立时间]
*/
@JsonProperty
(
"createdate"
)
public
void
setCreateDate
(
Timestamp
createDate
){
this
.
createDate
=
createDate
;
this
.
createDateDirtyFlag
=
true
;
}
/**
* 获取 [建立时间]脏标记
*/
@JsonIgnore
public
boolean
getCreateDateDirtyFlag
(){
return
this
.
createDateDirtyFlag
;
}
/**
* 获取 [采购单名称]
*/
@JsonProperty
(
"psname"
)
public
String
getPSName
(){
return
this
.
pSName
;
}
/**
* 设置 [采购单名称]
*/
@JsonProperty
(
"psname"
)
public
void
setPSName
(
String
pSName
){
this
.
pSName
=
pSName
;
this
.
pSNameDirtyFlag
=
true
;
}
/**
* 获取 [采购单名称]脏标记
*/
@JsonIgnore
public
boolean
getPSNameDirtyFlag
(){
return
this
.
pSNameDirtyFlag
;
}
/**
* 获取 [建立人]
*/
@JsonProperty
(
"createman"
)
public
String
getCreateMan
(){
return
this
.
createMan
;
}
/**
* 设置 [建立人]
*/
@JsonProperty
(
"createman"
)
public
void
setCreateMan
(
String
createMan
){
this
.
createMan
=
createMan
;
this
.
createManDirtyFlag
=
true
;
}
/**
* 获取 [建立人]脏标记
*/
@JsonIgnore
public
boolean
getCreateManDirtyFlag
(){
return
this
.
createManDirtyFlag
;
}
/**
* 获取 [采购单标识]
*/
@JsonProperty
(
"psid"
)
public
String
getPSId
(){
return
this
.
pSId
;
}
/**
* 设置 [采购单标识]
*/
@JsonProperty
(
"psid"
)
public
void
setPSId
(
String
pSId
){
this
.
pSId
=
pSId
;
this
.
pSIdDirtyFlag
=
true
;
}
/**
* 获取 [采购单标识]脏标记
*/
@JsonIgnore
public
boolean
getPSIdDirtyFlag
(){
return
this
.
pSIdDirtyFlag
;
}
/**
* 获取 [更新时间]
*/
@JsonProperty
(
"updatedate"
)
public
Timestamp
getUpdateDate
(){
return
this
.
updateDate
;
}
/**
* 设置 [更新时间]
*/
@JsonProperty
(
"updatedate"
)
public
void
setUpdateDate
(
Timestamp
updateDate
){
this
.
updateDate
=
updateDate
;
this
.
updateDateDirtyFlag
=
true
;
}
/**
* 获取 [更新时间]脏标记
*/
@JsonIgnore
public
boolean
getUpdateDateDirtyFlag
(){
return
this
.
updateDateDirtyFlag
;
}
/**
* 获取 [更新人]
*/
@JsonProperty
(
"updateman"
)
public
String
getUpdateMan
(){
return
this
.
updateMan
;
}
/**
* 设置 [更新人]
*/
@JsonProperty
(
"updateman"
)
public
void
setUpdateMan
(
String
updateMan
){
this
.
updateMan
=
updateMan
;
this
.
updateManDirtyFlag
=
true
;
}
/**
* 获取 [更新人]脏标记
*/
@JsonIgnore
public
boolean
getUpdateManDirtyFlag
(){
return
this
.
updateManDirtyFlag
;
}
/**
* 获取 [IMSTATE]
*/
@JsonProperty
(
"imstate"
)
public
String
getImstate
(){
return
this
.
imstate
;
}
/**
* 设置 [IMSTATE]
*/
@JsonProperty
(
"imstate"
)
public
void
setImstate
(
String
imstate
){
this
.
imstate
=
imstate
;
this
.
imstateDirtyFlag
=
true
;
}
/**
* 获取 [IMSTATE]脏标记
*/
@JsonIgnore
public
boolean
getImstateDirtyFlag
(){
return
this
.
imstateDirtyFlag
;
}
}
im-app/im-app-web/src/main/java/com/ibiz/web/ps/feign/PSFeignClient.java
0 → 100644
浏览文件 @
868ac125
package
com
.
ibiz
.
web
.
ps
.
feign
;
import
java.util.List
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
com.ibiz.web.ps.domain.PS
;
import
com.ibiz.web.ps.filter.*
;
public
interface
PSFeignClient
{
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/web/ps/{ps_id}"
)
public
PS
get
(
@PathVariable
(
"ps_id"
)
String
ps_id
)
;
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/web/ps/{ps_id}"
)
public
PS
update
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
;
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/web/ps"
)
public
PS
create
(
@RequestBody
PS
ps
)
;
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/web/ps/{ps_id}/save"
)
public
PS
save
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
;
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/web/ps/{ps_id}/getdraft"
)
public
PS
getDraft
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
;
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/web/ps/checkkey"
)
public
Boolean
checkKey
(
@RequestBody
PS
ps
)
;
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/web/ps/{ps_id}"
)
public
Boolean
remove
(
@PathVariable
(
"ps_id"
)
String
ps_id
)
;
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/web/ps/fetchdefault"
)
public
Page
<
PS
>
fetchDefault
(
PSSearchContext
searchContext
)
;
}
im-app/im-app-web/src/main/java/com/ibiz/web/ps/filter/PSSearchContext.java
0 → 100644
浏览文件 @
868ac125
package
com
.
ibiz
.
web
.
ps
.
filter
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
lombok.Data
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ibiz.util.SearchContext
;
@Data
public
class
PSSearchContext
extends
SearchContext
implements
Serializable
{
public
String
n_psname_like
;
//[采购单名称]
}
\ No newline at end of file
im-app/im-app-web/src/main/java/com/ibiz/web/ps/service/PSService.java
0 → 100644
浏览文件 @
868ac125
package
com
.
ibiz
.
web
.
ps
.
service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient
;
import
org.springframework.stereotype.Service
;
import
feign.Client
;
import
feign.Contract
;
import
feign.Feign
;
import
feign.codec.Decoder
;
import
feign.codec.Encoder
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
com.ibiz.util.feign.suport.SearchContextFeignEncode
;
import
com.ibiz.web.ps.domain.PS
;
import
com.ibiz.web.ps.filter.*
;
import
com.ibiz.web.ps.feign.PSFeignClient
;
import
com.ibiz.web.WebApplication.WebClientProperties
;
import
com.ibiz.util.feign.FeignRequestInterceptor
;
@Service
public
class
PSService
{
PSFeignClient
client
;
@Autowired
public
PSService
(
Decoder
decoder
,
Encoder
encoder
,
Client
client
,
Contract
contract
,
FeignRequestInterceptor
feignRequestInterceptor
,
WebClientProperties
webClientProperties
)
{
if
(
webClientProperties
.
getServiceId
()!=
null
)
{
Feign
.
Builder
nameBuilder
=
Feign
.
builder
()
.
client
(
client
)
.
encoder
(
new
SearchContextFeignEncode
(
encoder
))
.
decoder
(
decoder
)
.
contract
(
contract
)
.
requestInterceptor
(
feignRequestInterceptor
)
;
this
.
client
=
nameBuilder
.
target
(
PSFeignClient
.
class
,
"http://"
+
webClientProperties
.
getServiceId
()
+
"/"
)
;
}
else
if
(
webClientProperties
.
getServiceUrl
()!=
null
)
{
if
(
client
instanceof
LoadBalancerFeignClient
)
{
client
=
((
LoadBalancerFeignClient
)
client
).
getDelegate
();
}
Feign
.
Builder
nameBuilder
=
Feign
.
builder
()
.
client
(
client
)
.
encoder
(
new
SearchContextFeignEncode
(
encoder
))
.
decoder
(
decoder
)
.
contract
(
contract
)
.
requestInterceptor
(
feignRequestInterceptor
)
;
this
.
client
=
nameBuilder
.
target
(
PSFeignClient
.
class
,
"http://"
+
webClientProperties
.
getServiceUrl
()
+
"/"
)
;
}
}
public
PS
get
(
String
ps_id
)
{
return
client
.
get
(
ps_id
);
}
public
PS
update
(
String
ps_id
,
PS
ps
)
{
return
client
.
update
(
ps_id
,
ps
);
}
public
PS
create
(
PS
ps
)
{
return
client
.
create
(
ps
);
}
public
PS
save
(
String
ps_id
,
PS
ps
)
{
return
client
.
save
(
ps_id
,
ps
);
}
public
PS
getDraft
(
String
ps_id
,
PS
ps
)
{
return
client
.
getDraft
(
ps_id
,
ps
);
}
public
boolean
checkKey
(
PS
ps
)
{
return
client
.
checkKey
(
ps
);
}
public
boolean
remove
(
String
ps_id
)
{
return
client
.
remove
(
ps_id
);
}
public
Page
<
PS
>
fetchDefault
(
PSSearchContext
searchContext
)
{
return
client
.
fetchDefault
(
searchContext
);
}
}
im-app/im-app-web/src/main/java/com/ibiz/web/security/permission/ps/PSPermission.java
0 → 100644
浏览文件 @
868ac125
package
com
.
ibiz
.
web
.
security
.
permission
.
ps
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.PageRequest
;
import
com.ibiz.web.ps.service.PSService
;
import
com.ibiz.web.ps.domain.PS
;
@Component
(
"ps_pms"
)
public
class
PSPermission
{
@Autowired
PSService
psservice
;
public
boolean
check
(
String
action
){
return
true
;
}
public
boolean
check
(
String
ps_id
,
String
action
){
return
true
;
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录