Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
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
王衍超
cloud-fb
Commits
64bba6ca
Commit
64bba6ca
authored
Jun 24, 2021
by
高晓磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
散客预警人员修改添加&场站的合同依赖去掉&违规类型修改为取值name
parent
738a6cfd
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
79 additions
and
24 deletions
+79
-24
RetailInfoServiceImpl.java
...yst/dinas/biz/internal/service/RetailInfoServiceImpl.java
+15
-6
WarningServiceImpl.java
...main/java/com/xyst/dinas/biz/warn/WarningServiceImpl.java
+30
-4
WarningService.java
.../java/com/xyst/dinas/biz/warn/service/WarningService.java
+3
-1
RetailInfoController.java
...ain/java/com/xyst/dinas/biz/web/RetailInfoController.java
+6
-1
StationController.java
...c/main/java/com/xyst/dinas/biz/web/StationController.java
+0
-4
WarnSettingController.java
...in/java/com/xyst/dinas/biz/web/WarnSettingController.java
+17
-0
ProductionLineViolation.mk
...odel/com/xyst/dinas/safe/query/ProductionLineViolation.mk
+1
-1
ShipViolation.mk
...src/main/model/com/xyst/dinas/safe/query/ShipViolation.mk
+2
-2
StaffViolation.mk
...rc/main/model/com/xyst/dinas/safe/query/StaffViolation.mk
+1
-1
ProductionLineViolation.jmx
...ces/com/xyst/dinas/safe/query/ProductionLineViolation.jmx
+1
-1
ShipViolation.jmx
...ain/resources/com/xyst/dinas/safe/query/ShipViolation.jmx
+2
-2
StaffViolation.jmx
...in/resources/com/xyst/dinas/safe/query/StaffViolation.jmx
+1
-1
No files found.
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/service/RetailInfoServiceImpl.java
View file @
64bba6ca
...
...
@@ -3,6 +3,7 @@ package com.xyst.dinas.biz.internal.service;
import
com.beecode.bap.attachment.common.Page
;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.bcp.type.json.JSONObjectUtils
;
import
com.beecode.inz.basis.service.WarehouseUserService
;
import
com.beecode.inz.common.BaseConstants
;
import
com.xyst.dinas.biz.constant.RetailInfoConstant
;
import
com.xyst.dinas.biz.dao.DinasTypeDao
;
...
...
@@ -10,12 +11,11 @@ import com.xyst.dinas.biz.dao.RetailInfoDao;
import
com.xyst.dinas.biz.processor.RetailInfoBuyAmountWarningCalculate
;
import
com.xyst.dinas.biz.processor.RetailInfoBuyCountWarningCalculate
;
import
com.xyst.dinas.biz.service.RetailInfoService
;
import
com.xyst.dinas.biz.warn.BaseBusinessWarn
;
import
com.xyst.dinas.biz.warn.WarnSetting
;
import
com.xyst.dinas.biz.warn.WarnSettingEntity
;
import
com.xyst.dinas.biz.warn.WarnTargetTypeEnum
;
import
com.xyst.dinas.biz.warn.*
;
import
com.xyst.dinas.biz.warn.service.WarningService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -23,6 +23,7 @@ import java.math.BigDecimal;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
RetailInfoServiceImpl
implements
RetailInfoService
{
...
...
@@ -34,6 +35,9 @@ public class RetailInfoServiceImpl implements RetailInfoService {
private
DinasTypeDao
dinasTypeDao
;
@Autowired
private
WarningService
warningService
;
@Autowired
private
WarehouseUserService
warehouseUserService
;
@Override
public
Page
<
KObject
>
queryByPaging
(
Page
<
KObject
>
page
,
Integer
retailInfoStatus
)
throws
Exception
{
...
...
@@ -78,6 +82,7 @@ public class RetailInfoServiceImpl implements RetailInfoService {
}
else
{
setWarningSettingEntity
(
newKobject
,
uuid
,
RetailInfoConstant
.
RETAIL_INFO_WARN_BUY_COUNT
,
RetailInfoConstant
.
RETAIL_INFO_BUY_COUNT_WARNING_CALCULATOR
,
templateCount
.
getMax
(),
false
,
true
);
}
//购买重量预警
//查询场站是否有对应的预警模板
templateCount
=
warningService
.
queryOneWarnSettingsByMemoAndType
(
RetailInfoConstant
.
RETAIL_INFO_WARN_BUY_AMOUNT
,
station
.
toString
(),
"template"
);
...
...
@@ -95,6 +100,7 @@ public class RetailInfoServiceImpl implements RetailInfoService {
}
private
WarnSettingEntity
setWarningSettingEntity
(
KObject
kObject
,
UUID
uuid
,
String
target
,
String
warnCalculator
,
String
max
,
boolean
isTemplate
,
boolean
isOpen
)
{
String
stationId
=
kObject
.
get
(
"station"
).
getString
(
BaseConstants
.
ID
);
WarnSettingEntity
warnSettingEntity
=
new
WarnSettingEntity
();
warnSettingEntity
.
setBillType
(
RetailInfoConstant
.
RETAIL_INFO_WARN_BILL_TYPE
);
warnSettingEntity
.
setBillId
(
uuid
);
...
...
@@ -103,7 +109,7 @@ public class RetailInfoServiceImpl implements RetailInfoService {
warnSettingEntity
.
setTargetType
(
WarnTargetTypeEnum
.
INT_TYPE
.
name
());
warnSettingEntity
.
setOpen
(
isOpen
);
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"stationId"
,
kObject
.
get
(
"station"
).
getString
(
BaseConstants
.
ID
)
);
stringStringHashMap
.
put
(
"stationId"
,
stationId
);
if
(
isTemplate
){
stringStringHashMap
.
put
(
"template"
,
"template"
);
}
else
{
...
...
@@ -111,6 +117,8 @@ public class RetailInfoServiceImpl implements RetailInfoService {
stringStringHashMap
.
put
(
"retailInfoName"
,
kObject
.
getString
(
"retailInfoName"
));
}
warnSettingEntity
.
setMemo
(
JSONObjectUtils
.
toJson
(
stringStringHashMap
).
toString
());
List
<
KObject
>
allByStationId
=
warehouseUserService
.
getAllByStationId
(
UUID
.
fromString
(
stationId
));
warnSettingEntity
.
setPersonnel
(
allByStationId
.
stream
().
map
(
a
->
a
.
getString
(
"id"
)).
toArray
(
String
[]::
new
));
warnSettingEntity
.
setWarnCalculator
(
warnCalculator
);
warningService
.
insertWarnSettingToIsNotice
(
warnSettingEntity
,
false
);
return
warnSettingEntity
;
...
...
@@ -127,6 +135,8 @@ public class RetailInfoServiceImpl implements RetailInfoService {
}
}
@Override
public
KObject
getById
(
UUID
id
)
{
return
retailInfoDao
.
load
(
id
);
...
...
@@ -177,7 +187,6 @@ public class RetailInfoServiceImpl implements RetailInfoService {
@Override
public
Long
selectBuyCountByIdCard
(
String
idCard
,
UUID
uuid
)
{
return
retailInfoDao
.
selectBuyCountByIdCard
(
idCard
,
uuid
);
}
...
...
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/warn/WarningServiceImpl.java
View file @
64bba6ca
...
...
@@ -2,8 +2,11 @@ package com.xyst.dinas.biz.warn;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.beecode.inz.basis.service.WarehouseUserService
;
import
com.xyst.dinas.biz.constant.RetailInfoConstant
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.lang.Nullable
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -25,6 +28,8 @@ public class WarningServiceImpl implements WarningService {
@Autowired
private
WarnSettingDao
warnSettingDao
;
@Autowired
private
WarehouseUserService
warehouseUserService
;
/**
* 新增预警设置<br/>
...
...
@@ -281,7 +286,8 @@ public class WarningServiceImpl implements WarningService {
}
@Override
public
void
updateRetailInfoWarnSettingAllByTypeAndMemo
(
String
target
,
String
toString
,
Double
max
)
{
public
void
updateRetailInfoWarnSettingAllByTypeAndMemo
(
String
target
,
String
toString
,
Double
max
,
List
<
KObject
>
allWarehouseUserByStationId
)
{
String
stationUserIds
=
allWarehouseUserByStationId
.
stream
().
map
(
a
->
a
.
getString
(
"id"
)).
collect
(
Collectors
.
joining
(
","
));
List
<?>
objects
=
warnSettingDao
.
queryWarnSettingsListByMemoAndType
(
target
,
toString
);
if
(
objects
.
size
()
<
1
)
{
String
warnCalculator
;
...
...
@@ -298,14 +304,34 @@ public class WarningServiceImpl implements WarningService {
Assert
.
notNull
(
uuid
,
"The warSettingId must not be null"
);
KObject
warSettingIdObj
=
warnSettingDao
.
queryWarnSettingById
(
uuid
);
warSettingIdObj
.
set
(
WarnSettingConstant
.
max
,
max
);
warSettingIdObj
.
set
(
WarnSettingConstant
.
personnel
,
stationUserIds
);
warnSettingDao
.
update
(
warSettingIdObj
);
//修改后触发预警
BaseBusinessWarn
baseBusinessWarn
=
new
BaseBusinessWarn
(
uuid
);
baseBusinessWarn
.
warn
(
fals
e
);
baseBusinessWarn
.
warn
(
tru
e
);
}
}
@Override
public
void
updateRetailInfoWarnSettingPersonnelByStationId
(
UUID
stationId
){
List
<
KObject
>
allWarehouseUserByStationId
=
warehouseUserService
.
getAllByStationId
(
stationId
);
String
[]
stationUserIds
=
allWarehouseUserByStationId
.
stream
().
map
(
a
->
a
.
getString
(
"id"
)).
toArray
(
String
[]::
new
);
List
<
KObject
>
objects
=
(
List
<
KObject
>)
warnSettingDao
.
queryWarnSettingsListByMemoAndType
(
RetailInfoConstant
.
RETAIL_INFO_WARN_BUY_AMOUNT
,
stationId
.
toString
());
if
(!
CollectionUtils
.
isEmpty
(
objects
)){
List
<
KObject
>
objects1
=
(
List
<
KObject
>)
warnSettingDao
.
queryWarnSettingsListByMemoAndType
(
RetailInfoConstant
.
RETAIL_INFO_WARN_BUY_COUNT
,
stationId
.
toString
());
objects
.
addAll
(
objects1
);
}
for
(
KObject
o
:
objects
)
{
o
.
set
(
WarnSettingConstant
.
personnel
,
stationUserIds
);
warnSettingDao
.
update
(
o
);
}
}
private
void
setRetailInfoWarningSettingTemplateEntity
(
String
stationId
,
UUID
billId
,
String
target
,
String
warnCalculator
,
Double
max
)
{
WarnSettingEntity
warnSettingEntity
=
new
WarnSettingEntity
();
warnSettingEntity
.
setBillType
(
RetailInfoConstant
.
RETAIL_INFO_WARN_BILL_TYPE
);
...
...
@@ -316,14 +342,14 @@ public class WarningServiceImpl implements WarningService {
}
else
if
(
target
.
equals
(
RetailInfoConstant
.
RETAIL_INFO_WARN_BUY_COUNT
)){
warnSettingEntity
.
setTargetType
(
WarnTargetTypeEnum
.
INT_TYPE
.
name
());
}
warnSettingEntity
.
setOpen
(
fals
e
);
warnSettingEntity
.
setOpen
(
tru
e
);
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"stationId"
,
stationId
);
stringStringHashMap
.
put
(
"template"
,
"template"
);
warnSettingEntity
.
setMax
(
max
+
""
);
warnSettingEntity
.
setMemo
(
JSONObjectUtils
.
toJson
(
stringStringHashMap
).
toString
());
warnSettingEntity
.
setWarnCalculator
(
warnCalculator
);
insertWarnSettingToIsNotice
(
warnSettingEntity
,
fals
e
);
insertWarnSettingToIsNotice
(
warnSettingEntity
,
tru
e
);
}
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/warn/service/WarningService.java
View file @
64bba6ca
...
...
@@ -103,5 +103,7 @@ public interface WarningService {
WarnSetting
queryOneWarnSettingsByMemoAndType
(
String
target
,
String
...
memo
);
void
updateRetailInfoWarnSettingAllByTypeAndMemo
(
String
target
,
String
toString
,
Double
max
);
void
updateRetailInfoWarnSettingPersonnelByStationId
(
UUID
stationId
);
void
updateRetailInfoWarnSettingAllByTypeAndMemo
(
String
target
,
String
toString
,
Double
max
,
List
<
KObject
>
stationUsers
);
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/RetailInfoController.java
View file @
64bba6ca
...
...
@@ -5,6 +5,7 @@ import com.beecode.bap.attachment.common.Page;
import
com.beecode.bcp.type.KClass
;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.bcp.type.json.JSONObjectUtils
;
import
com.beecode.inz.basis.service.WarehouseUserService
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.beecode.nlib.utils.StringUtils
;
import
com.xyst.dinas.biz.constant.RetailInfoConstant
;
...
...
@@ -16,6 +17,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.UUID
;
/**
...
...
@@ -32,6 +34,8 @@ public class RetailInfoController {
private
RetailInfoService
retailInfoService
;
@Autowired
private
WarningService
warningService
;
@Autowired
private
WarehouseUserService
warehouseUserService
;
@RequestMapping
(
value
=
"list/page"
,
method
=
RequestMethod
.
GET
)
public
ResponseObj
getListPage
(
...
...
@@ -137,7 +141,8 @@ public class RetailInfoController {
if
(
StringUtils
.
isEmpty
(
target
)){
return
ResponseObj
.
error
(
400
,
"指标错误"
);
}
warningService
.
updateRetailInfoWarnSettingAllByTypeAndMemo
(
target
,
stationId
.
toString
(),
Double
.
parseDouble
(
max
));
List
<
KObject
>
allWarehouseUserByStationId
=
warehouseUserService
.
getAllByStationId
(
stationId
);
warningService
.
updateRetailInfoWarnSettingAllByTypeAndMemo
(
target
,
stationId
.
toString
(),
Double
.
parseDouble
(
max
),
allWarehouseUserByStationId
);
return
ResponseObj
.
success
();
}
...
...
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/StationController.java
View file @
64bba6ca
...
...
@@ -7,7 +7,6 @@ import com.beecode.bcp.type.KObject;
import
com.beecode.bcp.type.json.JSONObjectUtils
;
import
com.beecode.inz.basis.service.WarehouseUserService
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.beecode.inz.common.service.ContractService
;
import
com.beecode.nlib.utils.StringUtils
;
import
com.xyst.dinas.biz.constant.StationConstant
;
import
com.xyst.dinas.biz.service.StationService
;
...
...
@@ -35,9 +34,6 @@ public class StationController {
@Autowired
private
WarehouseUserService
warehouseUserService
;
@Autowired
private
ContractService
contractService
;
@RequestMapping
(
value
=
"list/page"
,
method
=
RequestMethod
.
GET
)
public
ResponseObj
getListPage
(
...
...
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/WarnSettingController.java
View file @
64bba6ca
...
...
@@ -92,4 +92,21 @@ public class WarnSettingController {
return
ResponseObj
.
success
(
"查询成功"
,
personnel
);
}
/**
* 修改散户预警设置的人员
* @param stationId 场站id
* @return
*/
@PostMapping
(
"/warnsetting/updateRetailInfoWarnSettingPersonnelByStationId/{stationId}"
)
public
ResponseObj
updateWaringSettingPersonnel
(
@PathVariable
(
"stationId"
)
UUID
stationId
){
if
(
stationId
==
null
){
return
ResponseObj
.
error
(
400
,
"'id' must be not null!"
);
}
warningService
.
updateRetailInfoWarnSettingPersonnelByStationId
(
stationId
);
return
ResponseObj
.
success
(
"修改成功"
);
}
}
backend/xyst.dinas.safe/src/main/model/com/xyst/dinas/safe/query/ProductionLineViolation.mk
View file @
64bba6ca
...
...
@@ -61,7 +61,7 @@
<description></description>
</field>
<field title='违规类型名称'>
<name>violationType.
typeN
ame</name>
<name>violationType.
n
ame</name>
<type>string</type>
<ref>
<type></type>
...
...
backend/xyst.dinas.safe/src/main/model/com/xyst/dinas/safe/query/ShipViolation.mk
View file @
64bba6ca
...
...
@@ -48,13 +48,13 @@
<name>violationType.id</name>
<type>uuid</type>
<ref>
<type>
一般引用
</type>
<type></type>
<name>com.xyst.dinas.safe.datamodel.ViolationType</name>
</ref>
<description></description>
</field>
<field title='违规类型名称'>
<name>violationType.
typeN
ame</name>
<name>violationType.
n
ame</name>
<type>string</type>
<ref>
<type></type>
...
...
backend/xyst.dinas.safe/src/main/model/com/xyst/dinas/safe/query/StaffViolation.mk
View file @
64bba6ca
...
...
@@ -42,7 +42,7 @@
<description></description>
</field>
<field title='违规类型名称'>
<name>violationType.
typeN
ame</name>
<name>violationType.
n
ame</name>
<type>string</type>
<ref>
<type></type>
...
...
backend/xyst.dinas.safe/src/main/resources/com/xyst/dinas/safe/query/ProductionLineViolation.jmx
View file @
64bba6ca
...
...
@@ -71,7 +71,7 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>
violationType.
typeN
ame
</m:name>
<m:name>
violationType.
n
ame
</m:name>
<m:title>
违规类型名称
</m:title>
<m:type>
string
</m:type>
<m:ref>
...
...
backend/xyst.dinas.safe/src/main/resources/com/xyst/dinas/safe/query/ShipViolation.jmx
View file @
64bba6ca
...
...
@@ -56,12 +56,12 @@
<m:type>
uuid
</m:type>
<m:ref>
<m:name>
com.xyst.dinas.safe.datamodel.ViolationType
</m:name>
<m:type>
一般引用
</m:type>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>
violationType.
typeN
ame
</m:name>
<m:name>
violationType.
n
ame
</m:name>
<m:title>
违规类型名称
</m:title>
<m:type>
string
</m:type>
<m:ref>
...
...
backend/xyst.dinas.safe/src/main/resources/com/xyst/dinas/safe/query/StaffViolation.jmx
View file @
64bba6ca
...
...
@@ -51,7 +51,7 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>
violationType.
typeN
ame
</m:name>
<m:name>
violationType.
n
ame
</m:name>
<m:title>
违规类型名称
</m:title>
<m:type>
string
</m:type>
<m:ref>
...
...
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