Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
鲁鑫
topsun-bpm
Commits
a5d0e06e
Commit
a5d0e06e
authored
Jul 08, 2024
by
刘学辉
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
33acc4de
9d7fe8f8
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
929 additions
and
68 deletions
+929
-68
epChangeFormDetail.js
...rc/main/webapp/biz/topsun/ep/change/epChangeFormDetail.js
+47
-8
epChangeFormDetail.jsp
...c/main/webapp/biz/topsun/ep/change/epChangeFormDetail.jsp
+4
-3
costReimbursement.js
...app/biz/topsun/sap/costReimbursement/costReimbursement.js
+12
-12
sapPermitDetail.js
.../src/main/webapp/biz/topsun/sap/permit/sapPermitDetail.js
+1
-0
suppliersDataDetail.js
...in/webapp/biz/topsun/sap/suppliers/suppliersDataDetail.js
+25
-25
suppliersDataDetail.jsp
...n/webapp/biz/topsun/sap/suppliers/suppliersDataDetail.jsp
+2
-2
EpChangeForm.java
...java/com/huigou/topsun/ep/change/domain/EpChangeForm.java
+6
-0
EpResourceSearchController.java
...igou/topsun/ep/controller/EpResourceSearchController.java
+9
-0
EpApplication.java
...ava/com/huigou/topsun/ep/epApplication/EpApplication.java
+2
-0
EpApplicationImpl.java
...uigou/topsun/ep/epApplication/impl/EpApplicationImpl.java
+30
-14
EpSaleOrderApplicationImpl.java
...ep/order/application/impl/EpSaleOrderApplicationImpl.java
+5
-2
EpSaleOrderCancelApplicationImpl.java
...er/application/impl/EpSaleOrderCancelApplicationImpl.java
+5
-2
EpSaleOrderCancelVo.java
...huigou/topsun/ep/order/domain/vo/EpSaleOrderCancelVo.java
+5
-0
EpSaleOrderVo.java
...a/com/huigou/topsun/ep/order/domain/vo/EpSaleOrderVo.java
+5
-0
NonProducePickApplicationImpl.java
...ePick/application/impl/NonProducePickApplicationImpl.java
+24
-0
Org.java
...in/java/com/huigou/uasp/bmp/opm/domain/model/org/Org.java
+747
-0
No files found.
topsun-xt/src/main/webapp/biz/topsun/ep/change/epChangeFormDetail.js
View file @
a5d0e06e
...
...
@@ -27,14 +27,37 @@ function bindEvent(){
$
(
'#pd'
).
searchbox
({
type
:
"system"
,
name
:
"queryPd"
,
checkbox
:
true
,
checkboxIndex
:
"productCode"
,
textIndex
:
"productName"
,
valueIndex
:
"productCode"
,
getParam
:
function
(
item
)
{
return
{
filterValue
:
$
(
"#brandCode"
).
val
()
}
},
onChange
:
function
(
value
,
data
)
{
$
(
'#pd'
).
val
(
data
.
productCode
);
$
(
'#productName'
).
val
(
data
.
productName
);
$
(
'#pd'
).
val
(
value
.
value
);
$
(
'#productName'
).
val
(
value
.
text
);
}
});
$
(
'#process'
).
searchbox
({
type
:
"system"
,
name
:
"queryProductAndBom"
,
// checkbox:true,
// checkboxIndex:"process",
// textIndex:"material,",
// valueIndex:"process",
// idIndex:"productionSolutionId",
getParam
:
function
(
item
)
{
return
{
filterValue
:
$
(
'#pd'
).
val
()
}
},
onChange
:
function
(
value
,
data
)
{
$
(
'#process'
).
val
(
data
.
process
);
$
(
'#material'
).
val
(
value
.
material
);
$
(
'#productionSolutionId'
).
val
(
value
.
productionSolutionId
);
}
});
...
...
@@ -60,17 +83,32 @@ function loadGrid() {
});
gridManager
=
UICtrl
.
grid
(
"#maingrid"
,
{
columns
:
[
{
display
:
"部门"
,
name
:
"deptName"
,
width
:
200
,
minWidth
:
100
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"dynamic"
,
getEditor
:
function
(
row
)
{
var
org
=
"return { type:'tree',data:{name:'org',filter:'ogn',getParam:function(){return {orgRoot:'orgRoot',orgKindId:'ogn'};}},textField:'deptName',valueField:'deptId' }"
;
org
=
(
new
Function
(
org
))();
return
org
;
}
}
},
{
display
:
"部门"
,
name
:
"dept
Name
"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
display
:
"部门"
,
name
:
"dept
Id
"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'tree'
,
required
:
true
,
data
:
{
name
:
'org'
,
filter
:
'dpt'
,
minWidth
:
250
filter
:
'ogn,dpt'
,
minWidth
:
250
,
getParam
:
function
(){
return
{
orgRoot
:
"orgRoot"
,
orgKindId
:
"ogn,dpt"
}
},
textField
:
'deptName'
},
textField
:
'deptId'
}
},
{
...
...
@@ -78,13 +116,14 @@ function loadGrid() {
editor
:
{
type
:
'tree'
,
required
:
true
,
checkbox
:
true
,
data
:
{
name
:
'org'
,
filter
:
'psm'
,
minWidth
:
250
},
textField
:
'executor'
,
//valueField: 'userCode
'
valueField
:
'executorId
'
}
},
{
...
...
topsun-xt/src/main/webapp/biz/topsun/ep/change/epChangeFormDetail.jsp
View file @
a5d0e06e
...
...
@@ -42,13 +42,14 @@
<x:inputC
name=
"pd"
required=
"true"
label=
"产品代号"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"10"
wrapper=
"select"
/>
</div>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"productName"
required=
"true"
label=
"产品名称"
labelCol=
"2"
fieldCol=
"10"
/>
<x:inputC
name=
"productName"
required=
"true"
label=
"产品名称"
labelCol=
"2"
fieldCol=
"10"
readonly=
"true"
/>
</div>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"process"
required=
"true"
label=
"制程工艺"
labelCol=
"2"
fieldCol=
"10"
/>
<x:inputC
name=
"process"
required=
"true"
label=
"制程工艺"
labelCol=
"2"
fieldCol=
"10"
wrapper=
"select"
/>
<x:hidden
name=
"productionSolutionId"
/>
</div>
<div
class=
"hg-form-row"
>
<x:textareaC
name=
"material"
required=
"true"
label=
"原材料"
labelCol=
"2"
fieldCol=
"10"
rows=
"3"
/>
<x:textareaC
name=
"material"
required=
"true"
label=
"原材料"
labelCol=
"2"
fieldCol=
"10"
rows=
"3"
readonly=
"true"
/>
</div>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"others"
required=
"true"
label=
"其他"
labelCol=
"2"
fieldCol=
"10"
/>
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/costReimbursement/costReimbursement.js
View file @
a5d0e06e
...
...
@@ -387,10 +387,10 @@ var tableArray = [
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
editor
:
{
mask
:
'nnnnnnnnn.nn'
,
type
:
'text'
}
//
editor: {
//
mask: 'nnnnnnnnn.nn',
//
type: 'text'
//
}
},
{
display
:
"税额(审批-本位币)"
,
...
...
@@ -399,10 +399,10 @@ var tableArray = [
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
editor
:
{
mask
:
'nnnnnnnnn.nn'
,
type
:
'text'
}
//
editor: {
//
mask: 'nnnnnnnnn.nn',
//
type: 'text'
//
}
},
{
display
:
"含税金额(审批-本位币)"
,
...
...
@@ -411,10 +411,10 @@ var tableArray = [
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
editor
:
{
mask
:
'nnnnnnnnn.nn'
,
type
:
'text'
}
//
editor: {
//
mask: 'nnnnnnnnn.nn',
//
type: 'text'
//
}
},
{
display
:
"是否付款"
,
name
:
"zepPay"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/permit/sapPermitDetail.js
View file @
a5d0e06e
...
...
@@ -44,6 +44,7 @@ function bindEvent(){
$
(
"#applyPersonName"
).
orgTree
({
checkbox
:
false
,
tree
:{
autoCheckboxEven
:
true
},
filter
:
'psm'
,
getParam
:
function
()
{
return
{
orgRoot
:
'orgRoot'
,
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/suppliers/suppliersDataDetail.js
View file @
a5d0e06e
...
...
@@ -527,9 +527,9 @@ function getExtendedData(processAction) {
}
extendedData
.
suppliersPayList
=
Public
.
encodeJSONURI
(
datas
);
}
var
_grid
=
UICtrl
.
getGridManager
(
'#sapSuppliersBuyerGrid'
);
if
(
_grid
)
{
var
rows
=
_grid
.
getData
();
var
buy
_grid
=
UICtrl
.
getGridManager
(
'#sapSuppliersBuyerGrid'
);
if
(
buy
_grid
)
{
var
rows
=
buy
_grid
.
getData
();
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
var
row
=
rows
[
i
];
if
(
row
.
Inco1
!=
""
&&
row
.
Inco2L
==
""
)
{
...
...
@@ -538,7 +538,7 @@ function getExtendedData(processAction) {
}
}
var
datas
=
DataUtil
.
getGridData
({
gridManager
:
_grid
,
gridManager
:
buy
_grid
,
isAllData
:
isAllData
});
if
(
!
datas
)
{
...
...
@@ -546,10 +546,10 @@ function getExtendedData(processAction) {
}
extendedData
.
suppliersBuyerList
=
Public
.
encodeJSONURI
(
datas
);
}
var
_grid
=
UICtrl
.
getGridManager
(
'#sapSuppliersBankGrid'
);
if
(
_grid
)
{
var
bank
_grid
=
UICtrl
.
getGridManager
(
'#sapSuppliersBankGrid'
);
if
(
bank
_grid
)
{
var
datas
=
DataUtil
.
getGridData
({
gridManager
:
_grid
,
gridManager
:
bank
_grid
,
isAllData
:
isAllData
});
if
(
!
datas
)
{
...
...
@@ -577,34 +577,34 @@ function checkConstraints(){
return
false
;
}
}
if
(
"cashier"
==
getSubProcUnitId
()
||
"finance"
==
getSubProcUnitId
()){
//付款信息
var
_grid
=
UICtrl
.
getGridManager
(
'#sapSuppliersPayGrid'
);
if
(
_grid
)
{
//银行信息
var
bank_grid
=
UICtrl
.
getGridManager
(
'#sapSuppliersBankGrid'
);
if
(
bank_grid
)
{
var
datas
=
DataUtil
.
getGridData
({
gridManager
:
_grid
,
gridManager
:
bank
_grid
,
isAllData
:
true
});
if
(
!
datas
)
{
return
false
;
}
if
(
isApproveProcUnit
()
&&
datas
.
length
==
0
&&
"2"
!=
getHandleResult
()){
Public
.
tip
(
"供应商付款
信息必填"
);
Public
.
tip
(
"供应商银行银行
信息必填"
);
return
false
;
}
}
//银行信息
var
_grid
=
UICtrl
.
getGridManager
(
'#sapSuppliersBankGrid'
);
if
(
_grid
)
{
if
(
"cashier"
==
getSubProcUnitId
()
||
"finance"
==
getSubProcUnitId
()){
//付款信息
var
pay_grid
=
UICtrl
.
getGridManager
(
'#sapSuppliersPayGrid'
);
if
(
pay_grid
)
{
var
datas
=
DataUtil
.
getGridData
({
gridManager
:
_grid
,
gridManager
:
pay
_grid
,
isAllData
:
true
});
if
(
!
datas
)
{
return
false
;
}
if
(
isApproveProcUnit
()
&&
datas
.
length
==
0
&&
"2"
!=
getHandleResult
()){
Public
.
tip
(
"供应商
银行银行
信息必填"
);
Public
.
tip
(
"供应商
付款
信息必填"
);
return
false
;
}
}
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/suppliers/suppliersDataDetail.jsp
View file @
a5d0e06e
...
...
@@ -64,7 +64,7 @@
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2"/>--%>
<x:inputC
name=
"land1Name"
label=
"国家"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
wrapper=
"select"
/>
<x:hidden
name=
"land1"
/>
<x:inputC
name=
"regionName"
label=
"地区"
labelCol=
"1"
fieldCol=
"2"
required=
"
tru
e"
wrapper=
"select"
/>
<x:inputC
name=
"regionName"
label=
"地区"
labelCol=
"1"
fieldCol=
"2"
required=
"
fals
e"
wrapper=
"select"
/>
<x:hidden
name=
"region"
/>
<x:inputC
name=
"city1"
label=
"城市"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
/>
...
...
@@ -100,7 +100,7 @@
<div
id=
"sapSuppliersBuyerGrid"
style=
"margin: 2px;"
></div>
<div
id=
"cashierGrid"
>
<div
class=
"blank_div clearfix"
></div>
<x:title
title=
"供应商
付款
信息"
name=
"group"
/>
<x:title
title=
"供应商
公司
信息"
name=
"group"
/>
<div
id=
"sapSuppliersPayGrid"
style=
"margin: 2px;"
></div>
<div
class=
"blank_div clearfix"
></div>
<x:title
title=
"供应商银行银行信息"
name=
"group"
/>
...
...
topsun/src/main/java/com/huigou/topsun/ep/change/domain/EpChangeForm.java
View file @
a5d0e06e
...
...
@@ -108,6 +108,12 @@ public class EpChangeForm extends FlowBillAbstractEntity {
@Column
(
name
=
"changed_others"
)
private
String
changedOthers
;
/**
* 版本id
*/
@Column
(
name
=
"production_solution_id"
)
private
String
productionSolutionId
;
@Override
protected
String
getCodeRuleId
()
{
return
"epChangeForm"
;
...
...
topsun/src/main/java/com/huigou/topsun/ep/controller/EpResourceSearchController.java
View file @
a5d0e06e
...
...
@@ -42,4 +42,13 @@ public class EpResourceSearchController {
mapList
=
epApplication
.
queryEpPd
(
filterValue
);
return
sapDictionaryApplication
.
initEasySearchModel
(
mapList
,
param
,
sdo
);
}
@EasySearch
(
queryName
=
"queryProductAndBom"
)
public
Map
<
String
,
Object
>
queryProductAndBom
(
SDO
sdo
)
throws
IOException
{
String
param
=
sdo
.
getString
(
"paramValue"
);
String
filterValue
=
sdo
.
getString
(
"filterValue"
);
List
<
Map
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
mapList
=
epApplication
.
queryProductAndBom
(
filterValue
);
return
sapDictionaryApplication
.
initEasySearchModel
(
mapList
,
param
,
sdo
);
}
}
topsun/src/main/java/com/huigou/topsun/ep/epApplication/EpApplication.java
View file @
a5d0e06e
...
...
@@ -12,4 +12,6 @@ public interface EpApplication {
List
<
Map
<
String
,
String
>>
queryEpBrand
(
String
brandName
);
List
<
Map
<
String
,
String
>>
queryEpPd
(
String
brandCode
);
List
<
Map
<
String
,
String
>>
queryProductAndBom
(
String
itemCode
);
}
topsun/src/main/java/com/huigou/topsun/ep/epApplication/impl/EpApplicationImpl.java
View file @
a5d0e06e
package
com
.
huigou
.
topsun
.
ep
.
epApplication
.
impl
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.topsun.ep.epApplication.EpApplication
;
import
com.huigou.topsun.sap.common.HttpClient
;
import
com.huigou.topsun.sap.common.domain.SapResult
;
import
com.huigou.topsun.util.SAPUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* @Auther: xin.lu
...
...
@@ -34,12 +29,12 @@ public class EpApplicationImpl implements EpApplication {
String
message
=
""
;
try
{
String
executeForEp
=
httpClient
.
executeForEp
(
map
,
"md/brand/queryAllEnableBrand"
);
Map
<
String
,
String
>
resultMap
=
JSONObject
.
parseObject
(
executeForEp
,
Map
.
class
);
if
(
"200"
.
equals
(
resultMap
.
get
(
"code"
)))
{
Map
<
String
,
Object
>
resultMap
=
JSONObject
.
parseObject
(
executeForEp
,
Map
.
class
);
if
(
"200"
.
equals
(
resultMap
.
get
(
"code"
)
.
toString
()
))
{
ObjectMapper
objectMapper
=
SAPUtils
.
objectMapper
();
mapList
=
objectMapper
.
readValue
(
com
.
huigou
.
util
.
JSONUtil
.
toString
(
resultMap
.
get
(
"data"
)),
new
TypeReference
<
List
<
Map
<
String
,
String
>>>()
{});
}
else
{
message
=
resultMap
.
get
(
"msg"
);
message
=
(
String
)
resultMap
.
get
(
"msg"
);
}
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"查询品牌出错:"
+
message
);
...
...
@@ -50,21 +45,42 @@ public class EpApplicationImpl implements EpApplication {
@Override
public
List
<
Map
<
String
,
String
>>
queryEpPd
(
String
brandCode
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"brandCode"
,
brandCode
);
//
map.put("brandCode",brandCode);
List
<
Map
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
String
message
=
""
;
try
{
String
executeForEp
=
httpClient
.
executeForEp
(
map
,
"md/md
item/queryProductByBrandCode"
);
Map
<
String
,
String
>
resultMap
=
JSONObject
.
parseObject
(
executeForEp
,
Map
.
class
);
if
(
"200"
.
equals
(
resultMap
.
get
(
"code"
)))
{
String
executeForEp
=
httpClient
.
executeForEp
(
map
,
"md/md
Item/queryProductByBrandCode?brandCode="
+
brandCode
);
Map
<
String
,
Object
>
resultMap
=
JSONObject
.
parseObject
(
executeForEp
,
Map
.
class
);
if
(
"200"
.
equals
(
resultMap
.
get
(
"code"
)
.
toString
()
))
{
ObjectMapper
objectMapper
=
SAPUtils
.
objectMapper
();
mapList
=
objectMapper
.
readValue
(
com
.
huigou
.
util
.
JSONUtil
.
toString
(
resultMap
.
get
(
"data"
)),
new
TypeReference
<
List
<
Map
<
String
,
String
>>>()
{});
}
else
{
message
=
resultMap
.
get
(
"msg"
);
message
=
(
String
)
resultMap
.
get
(
"msg"
);
}
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"查询产品出错:"
+
message
);
}
return
mapList
;
}
@Override
public
List
<
Map
<
String
,
String
>>
queryProductAndBom
(
String
itemCode
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//map.put("brandCode",brandCode);
List
<
Map
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
String
message
=
""
;
try
{
String
executeForEp
=
httpClient
.
executeForEp
(
map
,
"md/mdItem/queryProductAndBomByItemCode?itemCode="
+
itemCode
);
Map
<
String
,
Object
>
resultMap
=
JSONObject
.
parseObject
(
executeForEp
,
Map
.
class
);
if
(
"200"
.
equals
(
resultMap
.
get
(
"code"
).
toString
()))
{
ObjectMapper
objectMapper
=
SAPUtils
.
objectMapper
();
mapList
=
objectMapper
.
readValue
(
com
.
huigou
.
util
.
JSONUtil
.
toString
(
resultMap
.
get
(
"data"
)),
new
TypeReference
<
List
<
Map
<
String
,
String
>>>()
{});
}
else
{
message
=(
String
)
resultMap
.
get
(
"msg"
);
}
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"查询制程工艺、原材料出错:"
+
message
);
}
return
mapList
;
}
}
topsun/src/main/java/com/huigou/topsun/ep/order/application/impl/EpSaleOrderApplicationImpl.java
View file @
a5d0e06e
...
...
@@ -25,6 +25,7 @@ import com.huigou.topsun.sap.common.domain.SapResult;
import
com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.operator.OperatorApplication
;
import
com.huigou.uasp.bmp.opm.domain.model.org.Org
;
import
com.huigou.uasp.bpm.FlowBroker
;
import
com.huigou.uasp.bpm.ProcessAction
;
import
com.huigou.uasp.bpm.ProcessStartModel
;
...
...
@@ -205,8 +206,10 @@ public class EpSaleOrderApplicationImpl extends FlowBroker implements EpSaleOrde
BeanUtil
.
copyProperties
(
epSaleOrderVo
,
epSaleOrder
);
//初始化用户信息
String
createdById
=
SystemCache
.
getParameter
(
"adminPersonId"
,
String
.
class
);
Operator
operator
=
operatorApplication
.
createOperatorByPersonMemberId
(
createdById
);
String
personCode
=
epSaleOrderVos
.
get
(
0
).
getPersonCode
();
Org
org
=
orgApplication
.
loadMainOrgByLoginName
(
personCode
);
//String createdById = SystemCache.getParameter("adminPersonId", String.class);
Operator
operator
=
operatorApplication
.
createOperatorByPersonMemberId
(
org
.
getId
());
epSaleOrder
.
setDefaultValues
(
new
OrgUnit
(
operator
.
getFullId
(),
operator
.
getFullName
()));
Map
<
String
,
Object
>
formData
=
BeanUtil
.
beanToMap
(
epSaleOrder
);
...
...
topsun/src/main/java/com/huigou/topsun/ep/order/application/impl/EpSaleOrderCancelApplicationImpl.java
View file @
a5d0e06e
...
...
@@ -24,6 +24,7 @@ import com.huigou.topsun.sap.common.domain.EpResult;
import
com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.operator.OperatorApplication
;
import
com.huigou.uasp.bmp.opm.domain.model.org.Org
;
import
com.huigou.uasp.bpm.FlowBroker
;
import
com.huigou.uasp.bpm.ProcessAction
;
import
com.huigou.uasp.bpm.ProcessStartModel
;
...
...
@@ -204,8 +205,10 @@ public class EpSaleOrderCancelApplicationImpl extends FlowBroker implements EpSa
BeanUtil
.
copyProperties
(
epSaleOrderCancelVo
,
epSaleOrderCancel
);
//初始化用户信息
String
createdById
=
SystemCache
.
getParameter
(
"adminPersonId"
,
String
.
class
);
Operator
operator
=
operatorApplication
.
createOperatorByPersonMemberId
(
createdById
);
String
personCode
=
epSaleOrderCancelVos
.
get
(
0
).
getPersonCode
();
Org
org
=
orgApplication
.
loadMainOrgByLoginName
(
personCode
);
//String createdById = SystemCache.getParameter("adminPersonId", String.class);
Operator
operator
=
operatorApplication
.
createOperatorByPersonMemberId
(
org
.
getId
());
epSaleOrderCancel
.
setDefaultValues
(
new
OrgUnit
(
operator
.
getFullId
(),
operator
.
getFullName
()));
Map
<
String
,
Object
>
formData
=
BeanUtil
.
beanToMap
(
epSaleOrderCancel
);
...
...
topsun/src/main/java/com/huigou/topsun/ep/order/domain/vo/EpSaleOrderCancelVo.java
View file @
a5d0e06e
...
...
@@ -14,6 +14,11 @@ import java.util.List;
*/
@Data
public
class
EpSaleOrderCancelVo
implements
Serializable
{
/**
* 创建人
*/
@JsonProperty
(
"personCode"
)
private
String
personCode
;
/**
* 订单类型
*/
...
...
topsun/src/main/java/com/huigou/topsun/ep/order/domain/vo/EpSaleOrderVo.java
View file @
a5d0e06e
...
...
@@ -13,6 +13,11 @@ import java.util.List;
*/
@Data
public
class
EpSaleOrderVo
implements
Serializable
{
/**
* 创建人
*/
@JsonProperty
(
"personCode"
)
private
String
personCode
;
/**
* 订单类型
*/
...
...
topsun/src/main/java/com/huigou/topsun/sap/nonProducePick/application/impl/NonProducePickApplicationImpl.java
View file @
a5d0e06e
...
...
@@ -15,6 +15,7 @@ import com.huigou.topsun.sap.nonProducePick.domain.query.NonProducePickQueryRequ
import
com.huigou.topsun.sap.nonProducePick.repository.NonProducePickRepository
;
import
com.huigou.topsun.sap.nonProducePick.vo.NonProducePickItemVo
;
import
com.huigou.topsun.sap.nonProducePick.vo.NonProducePickVo
;
import
com.huigou.topsun.sap.purchase.domain.SapPurchase
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bpm.FlowBroker
;
import
com.huigou.util.ClassHelper
;
...
...
@@ -209,4 +210,27 @@ public class NonProducePickApplicationImpl extends FlowBroker implements NonProd
nonProducePickRepository
.
save
(
nonProducePick
);
}
}
/**
* 设置任务名称
*/
@Override
protected
void
setTaskDescription
(
DelegateTask
delegateTask
)
{
String
bizId
=
delegateTask
.
getExecution
().
getProcessBusinessKey
();
delegateTask
.
setDescription
(
this
.
getApprovalSubjectName
(
bizId
));
}
/**
* 获取任务标题
*
* @param bizId
* @return
*/
private
String
getApprovalSubjectName
(
String
bizId
)
{
NonProducePick
producePick
=
this
.
nonProducePickRepository
.
findOne
(
bizId
);
//查询 单据日期
String
fillinDateStr
=
DateUtil
.
getDateFormat
(
"yyyy-MM-dd HH:mm:ss"
,
producePick
.
getFillinDate
());
//设置标题
return
String
.
format
(
"%s-%s(%s)"
,
"其他物品领发料"
,
producePick
.
getBillCode
(),
fillinDateStr
);
}
}
topsun/src/main/java/com/huigou/uasp/bmp/opm/domain/model/org/Org.java
0 → 100644
View file @
a5d0e06e
package
com
.
huigou
.
uasp
.
bmp
.
opm
.
domain
.
model
.
org
;
import
com.huigou.annotation.JsonIgnore
;
import
com.huigou.context.OrgNode
;
import
com.huigou.data.domain.listener.VersionListener
;
import
com.huigou.domain.IdentifiedEntity
;
import
com.huigou.domain.ValidStatus
;
import
com.huigou.exception.ApplicationException
;
import
com.huigou.uasp.bmp.opm.OpmUtil
;
import
com.huigou.uasp.bmp.opm.domain.model.access.Role
;
import
com.huigou.util.CommonUtil
;
import
com.huigou.util.StringUtil
;
import
com.huigou.util.Util
;
import
org.apache.commons.beanutils.BeanUtils
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.Collection
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
/**
* 组织
*
* @author gongmm
*/
@Entity
@Table
(
name
=
"SA_OPOrg"
)
@EntityListeners
({
VersionListener
.
class
})
public
class
Org
implements
IdentifiedEntity
,
Serializable
{
private
static
final
long
serialVersionUID
=
-
4359439039376343018L
;
public
static
final
String
ORG_ROOT_ID
=
"orgRoot"
;
@Id
private
String
id
;
/**
* 实体版本号
*/
private
Long
version
;
/**
* 父节点ID
*/
@Column
(
name
=
"parent_id"
)
private
String
parentId
;
/**
* ID全路径
*/
@Column
(
name
=
"full_id"
,
length
=
1024
)
private
String
fullId
;
/**
* 名称全路径
*/
@Column
(
name
=
"full_name"
,
length
=
1024
)
private
String
fullName
;
private
Integer
sequence
;
/**
* 编码
*/
private
String
code
;
/**
* 名称
*/
private
String
name
;
/**
* 状态
*/
private
Integer
status
;
/**
* 组织机构类型
*/
@ManyToOne
()
@JoinColumn
(
name
=
"type_id"
)
private
OrgType
orgType
;
/**
* 全面名称
*/
@Column
(
name
=
"long_name"
)
private
String
longName
;
/**
* 组织节点类型
*/
@Column
(
name
=
"org_kind_id"
,
nullable
=
false
)
private
String
orgKindId
;
/**
* 部门级别
*/
@Column
(
name
=
"dept_level"
)
private
String
deptLevel
;
/**
* 人员
*/
@ManyToOne
()
@JoinColumn
(
name
=
"person_id"
)
private
Person
person
;
/**
* 描述
*/
private
String
description
;
/**
* 编码全路径
*/
@Column
(
name
=
"full_code"
,
nullable
=
false
)
private
String
fullCode
;
/**
* 排序号全路径
*/
@Column
(
name
=
"full_sequence"
,
nullable
=
false
)
private
String
fullSequence
;
/**
* 组件机构类别全路径
*/
@Column
(
name
=
"full_org_kind_id"
,
nullable
=
false
)
private
String
fullOrgKindId
;
/**
* 是否虚拟组织
*/
@Column
(
name
=
"is_virtual"
)
private
Integer
isVirtual
;
/**
* 公司ID
*/
@Column
(
name
=
"org_id"
)
private
String
orgId
;
/**
* 公司编码
*/
@Column
(
name
=
"org_code"
)
private
String
orgCode
;
/**
* 公司名称
*/
@Column
(
name
=
"org_name"
)
private
String
orgName
;
/**
* 部门ID
*/
@Column
(
name
=
"dept_id"
)
private
String
deptId
;
/**
* 部门编码
*/
@Column
(
name
=
"dept_code"
)
private
String
deptCode
;
/**
* 部门名称
*/
@Column
(
name
=
"dept_name"
)
private
String
deptName
;
/**
* 岗位ID
*/
@Column
(
name
=
"position_id"
)
private
String
positionId
;
/**
* 岗位编码
*/
@Column
(
name
=
"position_code"
)
private
String
positionCode
;
/**
* 岗位名称
*/
@Column
(
name
=
"position_name"
)
private
String
positionName
;
@Column
(
name
=
"tenant_id"
)
private
String
tenantId
;
@ManyToMany
(
cascade
=
CascadeType
.
ALL
)
@JoinTable
(
name
=
"SA_OPAuthorize"
,
joinColumns
=
{
@JoinColumn
(
name
=
"org_id"
,
referencedColumnName
=
"id"
)
},
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"role_id"
,
referencedColumnName
=
"id"
)
})
private
List
<
Role
>
roles
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
)
@JoinColumn
(
name
=
"org_id"
)
private
List
<
OrgProperty
>
orgProperties
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
Long
getVersion
()
{
return
this
.
version
;
}
public
void
setVersion
(
Long
version
)
{
this
.
version
=
version
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
String
parentId
)
{
this
.
parentId
=
parentId
;
}
public
String
getFullId
()
{
return
fullId
;
}
public
void
setFullId
(
String
fullId
)
{
this
.
fullId
=
fullId
;
}
public
String
getFullName
()
{
return
fullName
;
}
public
void
setFullName
(
String
fullName
)
{
this
.
fullName
=
fullName
;
}
public
Integer
getSequence
()
{
return
sequence
;
}
public
void
setSequence
(
Integer
sequence
)
{
this
.
sequence
=
sequence
;
}
@JsonIgnore
public
OrgType
getOrgType
()
{
return
orgType
;
}
@JsonIgnore
public
void
setOrgType
(
OrgType
orgType
)
{
this
.
orgType
=
orgType
;
}
public
String
getDeptLevel
()
{
return
deptLevel
;
}
public
void
setDeptLevel
(
String
deptLevel
)
{
this
.
deptLevel
=
deptLevel
;
}
public
String
getLongName
()
{
return
longName
;
}
public
void
setLongName
(
String
longName
)
{
this
.
longName
=
longName
;
}
public
String
getOrgKindId
()
{
return
orgKindId
;
}
public
void
setOrgKindId
(
String
orgKindId
)
{
this
.
orgKindId
=
orgKindId
;
}
@JsonIgnore
public
Person
getPerson
()
{
return
person
;
}
@JsonIgnore
public
void
setPerson
(
Person
person
)
{
this
.
person
=
person
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getFullCode
()
{
return
fullCode
;
}
public
void
setFullCode
(
String
fullCode
)
{
this
.
fullCode
=
fullCode
;
}
public
String
getFullSequence
()
{
return
fullSequence
;
}
public
void
setFullSequence
(
String
fullSequence
)
{
this
.
fullSequence
=
fullSequence
;
}
public
String
getFullOrgKindId
()
{
return
fullOrgKindId
;
}
public
void
setFullOrgKindId
(
String
fullOrgKindId
)
{
this
.
fullOrgKindId
=
fullOrgKindId
;
}
public
Integer
getIsVirtual
()
{
return
isVirtual
;
}
public
void
setIsVirtual
(
Integer
isVirtual
)
{
this
.
isVirtual
=
isVirtual
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getOrgCode
()
{
return
orgCode
;
}
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
public
String
getOrgName
()
{
return
orgName
;
}
public
void
setOrgName
(
String
orgName
)
{
this
.
orgName
=
orgName
;
}
public
String
getDeptId
()
{
return
deptId
;
}
public
void
setDeptId
(
String
deptId
)
{
this
.
deptId
=
deptId
;
}
public
String
getDeptCode
()
{
return
deptCode
;
}
public
void
setDeptCode
(
String
deptCode
)
{
this
.
deptCode
=
deptCode
;
}
public
String
getDeptName
()
{
return
deptName
;
}
public
void
setDeptName
(
String
deptName
)
{
this
.
deptName
=
deptName
;
}
public
String
getPositionId
()
{
return
positionId
;
}
public
void
setPositionId
(
String
positionId
)
{
this
.
positionId
=
positionId
;
}
public
String
getPositionCode
()
{
return
positionCode
;
}
public
void
setPositionCode
(
String
positionCode
)
{
this
.
positionCode
=
positionCode
;
}
public
String
getPositionName
()
{
return
positionName
;
}
public
void
setPositionName
(
String
positionName
)
{
this
.
positionName
=
positionName
;
}
public
String
getTenantId
()
{
return
tenantId
;
}
public
void
setTenantId
(
String
tenantId
)
{
this
.
tenantId
=
tenantId
;
}
@JsonIgnore
public
String
getTenantField_
()
{
return
"tenantId"
;
}
@JsonIgnore
public
String
getTenantId_
()
{
return
tenantId
;
}
@JsonIgnore
public
List
<
Role
>
getRoles
()
{
return
roles
;
}
public
void
setRoles
(
List
<
Role
>
roles
)
{
this
.
roles
=
roles
;
}
@JsonIgnore
public
List
<
OrgProperty
>
getOrgProperties
()
{
return
orgProperties
;
}
@JsonIgnore
public
void
setOrgProperties
(
List
<
OrgProperty
>
orgProperties
)
{
this
.
orgProperties
=
orgProperties
;
}
/**
* 构建冗余数据
*/
public
void
buildRedundantData
(
Org
parent
)
{
buildFullInfo
(
parent
);
buildOrgNodeData
();
}
@JsonIgnore
public
OrgNodeKind
getOrgKind
()
{
return
OrgNodeKind
.
fromValue
(
orgKindId
);
}
@JsonIgnore
public
ValidStatus
getValidStatus
()
{
return
ValidStatus
.
fromId
(
this
.
getStatus
());
}
private
void
buildOrgNodeData
()
{
String
[]
orgIds
=
this
.
getFullId
().
substring
(
1
).
split
(
"/"
);
String
[]
orgCodes
=
this
.
getFullCode
().
substring
(
1
).
split
(
"/"
);
String
[]
orgNames
=
this
.
getFullName
().
substring
(
1
).
split
(
"/"
);
String
[]
orgKindIds
=
this
.
getFullOrgKindId
().
substring
(
1
).
split
(
"/"
);
Util
.
check
(
orgIds
.
length
==
orgCodes
.
length
&&
orgIds
.
length
==
orgNames
.
length
&&
orgIds
.
length
==
orgKindIds
.
length
,
"调用“buildOrgIdNameExtInfo”出错,参数长度不等。"
);
int
deptLevel
=
0
;
int
orgLevel
=
0
;
for
(
int
i
=
orgIds
.
length
-
1
;
i
>=
0
;
i
--)
{
if
(
orgIds
[
i
].
endsWith
(
OrgNode
.
ORGAN
))
{
orgLevel
++;
if
(
orgLevel
==
1
)
{
this
.
setOrgId
(
orgIds
[
i
].
replace
(
"."
+
OrgNode
.
ORGAN
,
""
));
this
.
setOrgCode
(
orgCodes
[
i
]);
this
.
setOrgName
(
orgNames
[
i
]);
}
}
else
if
(
orgKindIds
[
i
].
equalsIgnoreCase
(
OrgNode
.
DEPT
))
{
deptLevel
++;
if
(
deptLevel
==
1
)
{
this
.
setDeptId
(
orgIds
[
i
].
replace
(
"."
+
OrgNode
.
DEPT
,
""
));
this
.
setDeptCode
(
orgCodes
[
i
]);
this
.
setDeptName
(
orgNames
[
i
]);
}
}
else
if
(
orgIds
[
i
].
endsWith
(
OrgNode
.
POSITION
))
{
this
.
setPositionId
(
orgIds
[
i
].
replace
(
"."
+
OrgNode
.
POSITION
,
""
));
this
.
setPositionCode
(
orgCodes
[
i
]);
this
.
setPositionName
(
orgNames
[
i
]);
}
}
}
private
void
buildFullInfo
(
Org
parent
)
{
String
sequence
=
CommonUtil
.
lpad
(
3
,
this
.
getSequence
());
String
fullId
=
OpmUtil
.
createFileFullName
(
parent
==
null
?
""
:
parent
.
getFullId
(),
this
.
getId
(),
getOrgKindId
());
String
fullCode
=
OpmUtil
.
createFileFullName
(
parent
==
null
?
""
:
parent
.
getFullCode
(),
getCode
(),
""
);
String
fullName
=
OpmUtil
.
createFileFullName
(
parent
==
null
?
""
:
parent
.
getFullName
(),
getName
(),
""
);
String
fullSequence
=
OpmUtil
.
createFileFullName
(
parent
==
null
?
""
:
parent
.
getFullSequence
(),
sequence
,
""
);
String
fullOrgKindId
=
OpmUtil
.
createFileFullName
(
parent
==
null
?
""
:
parent
.
getFullOrgKindId
(),
getOrgKindId
(),
""
);
setFullId
(
fullId
);
setFullCode
(
fullCode
);
setFullName
(
fullName
);
setFullSequence
(
fullSequence
);
setFullOrgKindId
(
fullOrgKindId
);
}
private
void
checkOrgKindRule
(
Org
parent
,
String
operateKind
)
{
// 公司+ -->部门+ --岗位 -->人员
// 公司+-->项目组织分类+ -->项目组织--> 分组 -->人员-->职能角色
// 公司+-->项目组织分类+ -->销售团队--> 部门+ -->人员
if
(
parent
==
null
)
{
Util
.
check
(
OrgNodeKind
.
OGN
.
equals
(
this
.
getOrgKind
()),
"%s失败,组织根下只能创机构节点。"
,
new
Object
[]
{
operateKind
});
}
else
{
// 组织层级判断
Util
.
check
(
this
.
getOrgKind
().
getLevel
()
>=
parent
.
getOrgKind
().
getLevel
(),
"%s失败,“%s”的上级组织不能是“%s”!"
,
new
Object
[]
{
operateKind
,
getOrgKind
().
getDisplayName
(),
parent
.
getOrgKind
()
.
getDisplayName
()
});
// 公司下面只能建机构、部门、项目分类(文件夹)
if
(
OrgNodeKind
.
OGN
.
equals
(
parent
.
getOrgKind
()))
{
Util
.
check
(
OrgNodeKind
.
OGN
.
equals
(
this
.
getOrgKind
())
||
OrgNodeKind
.
DPT
.
equals
(
this
.
getOrgKind
())
||
OrgNodeKind
.
FLD
.
equals
(
this
.
getOrgKind
()),
"%s失败,机构下不能建“%s”。"
,
new
Object
[]
{
operateKind
,
this
.
getOrgKind
().
getDisplayName
()
});
}
// 部门下面只能建部门和岗位
else
if
(
OrgNodeKind
.
DPT
.
equals
(
parent
.
getOrgKind
()))
{
Util
.
check
(
OrgNodeKind
.
DPT
.
equals
(
this
.
getOrgKind
())
||
OrgNodeKind
.
POS
.
equals
(
this
.
getOrgKind
()),
"%s失败,部门下不能建“%s”。"
,
new
Object
[]
{
operateKind
,
this
.
getOrgKind
().
getDisplayName
()
});
}
// 岗位只能建人员
else
if
(
OrgNodeKind
.
POS
.
equals
(
parent
.
getOrgKind
()))
{
Util
.
check
(
OrgNodeKind
.
PSM
.
equals
(
this
.
getOrgKind
()),
"%s失败,岗位下不能建“%s”。"
,
new
Object
[]
{
operateKind
,
this
.
getOrgKind
().
getDisplayName
()
});
}
// 项目组织分类下项目组织分类或项目组织
else
if
(
OrgNodeKind
.
FLD
.
equals
(
parent
.
getOrgKind
()))
{
Util
.
check
(
OrgNodeKind
.
FLD
.
equals
(
this
.
getOrgKind
())
||
OrgNodeKind
.
PRJ
.
equals
(
this
.
getOrgKind
()),
"%s失败,项目组织分类下不能建“%s”。"
,
new
Object
[]
{
operateKind
,
this
.
getOrgKind
().
getDisplayName
()
});
}
// 项目组织下只能建分组
else
if
(
OrgNodeKind
.
PRJ
.
equals
(
parent
.
getOrgKind
()))
{
// Util.check(OrgNodeKind.GRP.equals(this.getOrgKind()) || OrgNodeKind.STM.equals(this.getOrgKind()), "%s失败,项目组织下不能建“%s”。",
// new Object[] { operateKind, this.getOrgKind().getDisplayName() });
}
// 销售团队下只能建部门
// else if (OrgNodeKind.stm.equals(parent.getOrgKind())) {
// Util.check(OrgNodeKind.dpt.equals(this.getOrgKind()), "%s失败,项目组织下不能建“%s”。", new Object[] { operateKind, this.getOrgKind().getDisplayName() });
// }
// 分组下只能建人员
// else if (OrgNodeKind.grp.equals(parent.getOrgKind())) {
// Util.check(OrgNodeKind.psm.equals(this.getOrgKind()), "%s失败,分组下不能建“%s”。", new Object[] { operateKind, this.getOrgKind().getDisplayName() });
// }
// 人员下只能建职能角色
// else if (OrgKind.psm.equals(parent.getOrgKind())) {
// Util.check(OrgKind.fun.equals(this.getOrgKind()), "%s失败,人员下不能建“%s”。", new Object[] { operateKind, this.getOrgKind().getDisplayName() });
// }
}
}
/**
* 验证状态规则
*
* @param parent
* @param operateKind
*/
public
void
checkStatusRule
(
Org
parent
,
String
operateKind
)
{
if
(
parent
!=
null
)
{
Util
.
check
(
this
.
getValidStatus
().
getId
()
<=
parent
.
getValidStatus
().
getId
(),
"%s失败,上级组织:“%s”的状态是“%s”,下级组织:“%s”的状态不能是“%s”。"
,
new
Object
[]
{
operateKind
,
parent
.
getName
(),
parent
.
getValidStatus
().
getDisplayName
(),
this
.
getName
(),
this
.
getValidStatus
().
getDisplayName
()
});
}
}
/**
* 验证组织ID合法性
*/
private
void
checkOrgId
()
{
Util
.
check
(
Util
.
isNotEmptyString
(
this
.
getId
()),
"标识不能为空。"
,
new
Object
[
0
]);
Util
.
check
((
this
.
getId
().
indexOf
(
'/'
)
<
0
)
&&
(
this
.
getId
().
indexOf
(
'@'
)
<
0
)
&&
(
this
.
getId
().
indexOf
(
'.'
)
<
0
)
&&
(
this
.
getId
().
indexOf
(
'%'
)
<
0
),
"无效的标识“%s”,不能包含字符“/”、“@”、“.”、“%%”。"
,
new
Object
[]
{
this
.
getId
()
});
}
/**
* 验证组织编码的合法性
*
* @param code
* 组织编码
*/
private
void
checkOrgCode
()
{
Util
.
check
(
Util
.
isNotEmptyString
(
this
.
getCode
()),
"编码“%s”不能为空。"
,
new
Object
[]
{
this
.
getCode
()
});
Util
.
check
((
this
.
getCode
().
indexOf
(
'/'
)
<
0
)
&&
(
this
.
getCode
().
indexOf
(
'%'
)
<
0
)
&&
(
this
.
getCode
().
indexOf
(
','
)
<
0
),
"无效的编码“%s”,不能包含字符“/”、“%%”、“,”。"
,
new
Object
[]
{
this
.
getCode
()
});
}
/**
* 验证组织名称合法性
*
* @param name
* 组织名称
*/
private
void
checkOrgName
()
{
Util
.
check
(
Util
.
isNotEmptyString
(
this
.
getName
()),
"名称“%s”不能为空。"
,
new
Object
[]
{
this
.
getName
()
});
Util
.
check
((
this
.
getName
().
indexOf
(
'/'
)
<
0
)
&&
(
this
.
getName
().
indexOf
(
'%'
)
<
0
)
&&
(
this
.
getName
().
indexOf
(
','
)
<
0
),
"无效的名称“%s”,不能包含字符“/”、“%%”、“,”。"
,
new
Object
[]
{
this
.
getName
()
});
}
private
void
checkNamedValidity
()
{
if
(!
OrgNodeKind
.
PSM
.
equals
(
this
.
getOrgKind
()))
{
this
.
checkOrgId
();
}
this
.
checkOrgCode
();
this
.
checkOrgName
();
}
public
void
checkConstraints
(
Org
parent
,
Org
other
,
String
operateKind
)
{
checkNamedValidity
();
checkOrgKindRule
(
parent
,
operateKind
);
checkStatusRule
(
parent
,
operateKind
);
if
(
other
!=
null
)
{
if
(
this
.
getCode
().
equalsIgnoreCase
(
other
.
getCode
()))
{
throw
new
ApplicationException
(
"编码不能重复。"
);
}
if
(
this
.
getName
().
equalsIgnoreCase
(
other
.
getName
()))
{
//throw new ApplicationException("名称不能重复。");
}
}
}
/**
* 删除角色
*
* @param ids
* 角色ID列表
*/
public
void
removeRoles
(
List
<
String
>
roleIds
)
{
for
(
Iterator
<
Role
>
iter
=
this
.
getRoles
().
iterator
();
iter
.
hasNext
();)
{
if
(
roleIds
.
contains
(
iter
.
next
().
getId
()))
{
iter
.
remove
();
}
}
}
/**
* 构建角色实体列表
*
* @param inputRoles
* @retu
*/
public
void
buildRoles
(
List
<
Role
>
inputRoles
)
{
List
<
Role
>
roles
=
this
.
getRoles
();
if
(
roles
==
null
)
{
this
.
setRoles
(
inputRoles
);
return
;
}
boolean
found
;
for
(
Role
input
:
inputRoles
)
{
found
=
false
;
for
(
Role
role
:
roles
)
{
if
(
input
.
equals
(
role
))
{
found
=
true
;
break
;
}
}
if
(!
found
)
{
roles
.
add
(
input
);
}
}
}
public
void
fromMap
(
Map
<
String
,
Object
>
params
)
{
try
{
BeanUtils
.
populate
(
this
,
params
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
}
@Override
@JsonIgnore
public
boolean
isNew
()
{
return
StringUtil
.
isBlank
(
this
.
id
);
}
@JsonIgnore
public
boolean
isRootChild
()
{
return
ORG_ROOT_ID
.
equals
(
this
.
parentId
);
}
@Override
public
void
setUpdateFields_
(
Collection
<
String
>
names
)
{
// TODO Auto-generated method stub
}
// @Override
// public void setUpdateFields_(String... updateFields) {
// // TODO Auto-generated method stub
// }
public
void
reviseProperties
()
{
if
(
isVirtual
==
null
)
{
isVirtual
=
0
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment