Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_platformV2
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_platformV2
Commits
007f54de
Commit
007f54de
authored
Dec 19, 2023
by
李小惠
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://gitlab.sothing.top/843502640/jyzb_platformV2
into develop-lxh
parents
9261ff87
5240b5de
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
505 行增加
和
31 行删除
+505
-31
InventoryExceptionEnum.java
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/InventoryExceptionEnum.java
+1
-0
pom.xml
jyzb-biz/pom.xml
+6
-0
ApplicationController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/ApplicationController.java
+3
-2
BussinessController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/BussinessController.java
+3
-3
BussinessInventoryController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/BussinessInventoryController.java
+9
-8
CabinetBoxController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetBoxController.java
+2
-2
CabinetController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetController.java
+10
-9
DestoryUnitController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/DestoryUnitController.java
+5
-5
EsLog.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/EsLog.java
+165
-0
ESRecordManager.java
jyzb-biz/src/main/java/com/junmp/jyzb/logManager/ESRecordManager.java
+167
-0
EsLogManager.java
jyzb-biz/src/main/java/com/junmp/jyzb/logManager/EsLogManager.java
+55
-0
EsLogService.java
jyzb-biz/src/main/java/com/junmp/jyzb/logManager/service/EsLogService.java
+22
-0
EsLogServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/logManager/service/impl/EsLogServiceImpl.java
+22
-0
EsLogMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/EsLogMapper.java
+19
-0
BussinessInventoryService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/BussinessInventoryService.java
+1
-1
BussinessInventoryServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/BussinessInventoryServiceImpl.java
+15
-1
没有找到文件。
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/InventoryExceptionEnum.java
View file @
007f54de
...
...
@@ -10,6 +10,7 @@ public enum InventoryExceptionEnum implements IExceptionEnum {
INVENTORY_BEYOND_STOCK
(
CommonConstant
.
DEFAULT_BIZ_ERROR_CODE
,
"填写的报废的装备数量大于实际能进行报废的数量"
),
BROKENNUM_BEYOND_STOCK
(
CommonConstant
.
DEFAULT_BIZ_ERROR_CODE
,
"审核中的数量已存在最大可报废数量,现提交失败"
),
ORDER_NOT_EXIST
(
CommonConstant
.
DEFAULT_BIZ_ERROR_CODE
,
"盘点单据不存在"
),
ORDER_HAS_START
(
CommonConstant
.
DEFAULT_BIZ_ERROR_CODE
,
"单据已经开始,请勿重复操作"
),
;
/**
* 错误编码
...
...
jyzb-biz/pom.xml
View file @
007f54de
...
...
@@ -138,5 +138,11 @@
<version>
3.5.2
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.junmp.v2
</groupId>
<artifactId>
v2-log-db
</artifactId>
<version>
1.0.0
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
jyzb-biz/src/main/java/com/junmp/jyzb/controller/ApplicationController.java
View file @
007f54de
...
...
@@ -23,20 +23,21 @@ import javax.annotation.Resource;
@RestController
@Slf4j
@RequestMapping
(
"/SoftUpdate"
)
@Api
(
tags
=
"软件应用管理模块"
)
public
class
ApplicationController
{
@Resource
private
ApplicationService
applicationService
;
//获取应用信息的分页
@PostMapping
(
"/GetAllUpdateCfg
"
)
@PostMapping
(
path
=
"/GetAllUpdateCfg"
,
name
=
"获取应用信息的分页
"
)
@ApiOperation
(
"获取应用信息的分页"
)
public
ApiRes
<
PageResult
<
Application
>>
GetAllUpdateCfg
(
@RequestBody
ApplicationReq
req
){
return
ApiRes
.
success
(
applicationService
.
GetAllUpdateCfg
(
req
));
}
//新增或者修改应用信息
@PostMapping
(
"/AddOrUpdateCfg
"
)
@PostMapping
(
path
=
"/AddOrUpdateCfg"
,
name
=
"新增应用信息
"
)
@ApiOperation
(
"新增应用信息"
)
public
ApiRes
<
String
>
AddOrUpdateCfg
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
ApplicationReq
req
){
return
ApiRes
.
success
(
applicationService
.
AddOrUpdateCfg
(
req
));
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/BussinessController.java
View file @
007f54de
...
...
@@ -33,7 +33,7 @@ public class BussinessController {
//创建业务单
@PostMapping
(
"/AddBussinessOrder
"
)
@PostMapping
(
path
=
"/AddBussinessOrder"
,
name
=
"创建业务单
"
)
@ApiOperation
(
"创建业务单"
)
public
ApiRes
<
String
>
AddBussinessOrder
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
UpdateBusFormReq
req
){
...
...
@@ -42,13 +42,13 @@ public class BussinessController {
//查看业务单(可以条件查询)
@PostMapping
(
"/showBussinessOrder
"
)
@PostMapping
(
path
=
"/showBussinessOrder"
,
name
=
"查看业务单
"
)
@ApiOperation
(
"查看业务单"
)
public
ApiRes
<
PageResult
<
BusForm
>>
showBussinessOrder
(
@RequestBody
QueryBusFormReq
req
){
return
ApiRes
.
success
(
busFormService
.
showBussinessOrder
(
req
));
}
//根据业务单id查询出入库单据
@PostMapping
(
"/showOrderByBusOrderId
"
)
@PostMapping
(
path
=
"/showOrderByBusOrderId"
,
name
=
"根据业务单id查询出入库单据
"
)
@ApiOperation
(
"根据业务单id查询出入库单据"
)
public
ApiRes
<
Object
>
showOrderByBusOrderId
(
@RequestBody
QueryBusFormReq
req
){
return
ApiRes
.
success
(
busFormService
.
showOrderByBusOrderId
(
req
));
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/BussinessInventoryController.java
View file @
007f54de
...
...
@@ -32,7 +32,7 @@ public class BussinessInventoryController {
private
BussinessInventoryService
BussinessInventoryService
;
//盘库申请
@PostMapping
(
"/AddStocktake
"
)
@PostMapping
(
path
=
"/AddStocktake"
,
name
=
"盘库申请
"
)
@ApiOperation
(
"盘库申请"
)
public
ApiRes
<
String
>
AddStocktake
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
UpdateInventoryReq
req
){
//判断是否有工作流id,如果有则将状态进行修改
...
...
@@ -48,7 +48,8 @@ public class BussinessInventoryController {
}
//盘库申请
@PostMapping
(
"/Check"
)
@PostMapping
(
path
=
"/Check"
,
name
=
"预览盘点单"
)
@ApiOperation
(
"预览盘点单"
)
public
ApiRes
<
BussinessInventoryDto
>
Check
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
BussinessInventoryReq
req
){
//判断是否有工作流id,如果有则将状态进行修改
...
...
@@ -56,35 +57,35 @@ public class BussinessInventoryController {
return
ApiRes
.
success
(
BussinessInventoryService
.
Check
(
req
));
}
//开始盘点,已废弃
@PostMapping
(
"/Start
"
)
@PostMapping
(
path
=
"/Start"
,
name
=
"开始盘点
"
)
@ApiOperation
(
"开始盘点"
)
public
ApiRes
<
Boolean
>
Start
(
@RequestBody
Bussiness
InventoryReq
req
){
public
ApiRes
<
Boolean
>
Start
(
@RequestBody
Upload
InventoryReq
req
){
//判断是否有工作流id,如果有则将状态进行修改
return
ApiRes
.
success
(
BussinessInventoryService
.
Start
(
req
));
}
//查询列表
@PostMapping
(
"/GetPage
"
)
@PostMapping
(
path
=
"/GetPage"
,
name
=
"查询列表
"
)
@ApiOperation
(
"查询列表"
)
public
ApiRes
<
PageResult
<
BussinessInventory
>>
GetPage
(
@RequestBody
BussinessInventoryReq
req
){
//判断是否有工作流id,如果有则将状态进行修改
return
ApiRes
.
success
(
BussinessInventoryService
.
GetPage
(
req
));
}
//盘库申请
@PostMapping
(
"/GetById
"
)
@PostMapping
(
path
=
"/GetById"
,
name
=
"查询详情
"
)
@ApiOperation
(
"查询详情"
)
public
ApiRes
<
BussinessInventoryDto
>
GetById
(
@RequestBody
BussinessInventoryReq
req
){
//判断是否有工作流id,如果有则将状态进行修改
return
ApiRes
.
success
(
BussinessInventoryService
.
GetDetailById
(
req
));
}
//盘库申请
@PostMapping
(
"/UploadStock
"
)
@PostMapping
(
path
=
"/UploadStock"
,
name
=
"上传盘点记录
"
)
@ApiOperation
(
"上传盘点记录"
)
public
ApiRes
<
Boolean
>
UploadStock
(
@RequestBody
UploadInventoryReq
req
){
//判断是否有工作流id,如果有则将状态进行修改
return
ApiRes
.
success
(
BussinessInventoryService
.
UploadStock
(
req
));
}
//盘库申请
@PostMapping
(
"/UseOrFinished
"
)
@PostMapping
(
path
=
"/UseOrFinished"
,
name
=
"确认结果/结束盘点
"
)
@ApiOperation
(
"确认结果/结束盘点"
)
public
ApiRes
<
Boolean
>
UseOrFinished
(
@RequestBody
UploadInventoryReq
req
){
//判断是否有工作流id,如果有则将状态进行修改
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetBoxController.java
View file @
007f54de
...
...
@@ -24,14 +24,14 @@ public class CabinetBoxController {
@Resource
private
CabinetBoxService
cabinetBoxService
;
//添加箱门信息
@PostMapping
(
"/AddBoxInfo
"
)
@PostMapping
(
path
=
"/AddBoxInfo"
,
name
=
"添加箱门信息
"
)
@ApiOperation
(
"添加箱门信息"
)
public
ApiRes
<
String
>
AddOrUpdateBoxInfo
(
@RequestBody
UpdateCabinetReq
req
){
return
ApiRes
.
success
(
cabinetBoxService
.
AddOrUpdateBoxInfo
(
req
));
}
//添加箱门信息
@PostMapping
(
"/DeleteBox
"
)
@PostMapping
(
path
=
"/DeleteBox"
,
name
=
"添加箱门信息
"
)
@ApiOperation
(
"删除箱门"
)
public
ApiRes
<
String
>
DeleteBox
(
@RequestBody
@Validated
(
ValidationApi
.
delete
.
class
)
UpdateCabinetReq
req
){
return
ApiRes
.
success
(
cabinetBoxService
.
DeleteBox
(
req
));
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetController.java
View file @
007f54de
...
...
@@ -35,14 +35,14 @@ public class CabinetController {
private
CabinetBoxService
cabinetBoxService
;
@PostMapping
(
"/AddCabinetInfo
"
)
@PostMapping
(
path
=
"/AddCabinetInfo"
,
name
=
"添加单警柜信息
"
)
@ApiOperation
(
"添加单警柜信息"
)
public
ApiRes
<
String
>
addCabinetInfo
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
UpdateCabinetReq
req
){
String
cabinetId
=
cabinetService
.
addCabinetInfo
(
req
);
return
ApiRes
.
success
(
cabinetId
);
}
@PostMapping
(
"/ErrorState
"
)
@PostMapping
(
path
=
"/ErrorState"
,
name
=
"单警柜状态变更
"
)
@ApiOperation
(
"单警柜状态变更"
)
public
ApiRes
<
Boolean
>
ChangeCabinetState
(
@RequestBody
UpdateCabinetReq
req
)
{
boolean
result
=
cabinetService
.
ChangeCabinetState
(
req
);
...
...
@@ -53,13 +53,13 @@ public class CabinetController {
}
@PostMapping
(
"/DeleteCabinetInfo
"
)
@PostMapping
(
path
=
"/DeleteCabinetInfo"
,
name
=
"删除单警柜信息
"
)
@ApiOperation
(
"删除单警柜信息"
)
public
ApiRes
<
Boolean
>
deleteCabinetInfo
(
@RequestBody
@Validated
(
ValidationApi
.
delete
.
class
)
UpdateCabinetReq
req
)
{
return
ApiRes
.
success
(
cabinetService
.
deleteCabinetInfo
(
req
));
}
@PostMapping
(
"/UpdateCabinetServer
"
)
@PostMapping
(
path
=
"/UpdateCabinetServer"
,
name
=
"修改单警柜信息,平台使用
"
)
@ApiOperation
(
"修改单警柜信息,平台使用"
)
public
ApiRes
<
Boolean
>
UpdateCabinetServer
(
@RequestBody
UpdateCabinetReq
req
)
{
boolean
result
=
cabinetService
.
updateCabinetInfo
(
req
);
...
...
@@ -69,7 +69,8 @@ public class CabinetController {
return
ApiRes
.
success
(
result
);
}
@PostMapping
(
"/UpdateCabinetClient"
)
@PostMapping
(
path
=
"/UpdateCabinetClient"
,
name
=
"修改单警柜信息,警柜使用"
)
@ApiOperation
(
"修改单警柜信息,警柜使用"
)
public
ApiRes
<
Boolean
>
UpdateCabinetClient
(
@RequestBody
UpdateCabinetReq
req
)
{
boolean
result
=
cabinetService
.
updateCabinetInfo
(
req
);
...
...
@@ -80,7 +81,7 @@ public class CabinetController {
}
//通过单警柜id查询单个箱门及其箱门信息
@PostMapping
(
"/ShowOneCabinet
"
)
@PostMapping
(
path
=
"/ShowOneCabinet"
,
name
=
"查询单个单警柜及其箱门信息
"
)
@ApiOperation
(
"查询单个单警柜及其箱门信息"
)
public
ApiRes
<
CabinetDto
>
showOneCabinet
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
CabinetReq
req
){
return
ApiRes
.
success
(
cabinetService
.
showOneCabinet
(
req
));
...
...
@@ -88,7 +89,7 @@ public class CabinetController {
//根据组织机构id查询出单警柜的详细信息(list)
@PostMapping
(
"/ShowCabinetList
"
)
@PostMapping
(
path
=
"/ShowCabinetList"
,
name
=
"查询单警柜列表
"
)
@ApiOperation
(
"查询单警柜列表"
)
public
ApiRes
<
List
<
CabinetDto
>>
showCabinetList
(
@RequestBody
CabinetReq
req
){
List
<
CabinetDto
>
allCabinetList
=
cabinetService
.
getAllCabinetList
(
req
);
...
...
@@ -96,7 +97,7 @@ public class CabinetController {
}
//根据组织机构id查询出单警柜的详细信息(page)
@PostMapping
(
"/ShowCabinetPage
"
)
@PostMapping
(
path
=
"/ShowCabinetPage"
,
name
=
"查询单警柜列表
"
)
@ApiOperation
(
"查询单警柜列表"
)
public
ApiRes
<
PageResult
<
CabinetDto
>>
ShowCabinetPage
(
@RequestBody
CabinetReq
req
){
return
ApiRes
.
success
(
cabinetService
.
ShowCabinetPage
(
req
));
...
...
@@ -114,7 +115,7 @@ public class CabinetController {
// return ApiRes.success(result);
// }
@PostMapping
(
"/SearchOrgI
d"
)
@PostMapping
(
path
=
"/SearchOrgId"
,
name
=
"根据单警柜id查询组织机构i
d"
)
@ApiOperation
(
"/根据单警柜id查询组织机构id"
)
public
ApiRes
<
Long
>
SearchOrgId
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
CabinetReq
req
){
return
ApiRes
.
success
(
cabinetService
.
SearchOrgId
(
req
));
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/DestoryUnitController.java
View file @
007f54de
...
...
@@ -29,34 +29,34 @@ public class DestoryUnitController {
private
DestoryUnitService
destoryUnitService
;
//创建报废/销毁单位
@PostMapping
(
"/AddDestoryUnit
"
)
@PostMapping
(
path
=
"/AddDestoryUnit"
,
name
=
"创建报废/销毁单位
"
)
@ApiOperation
(
"创建报废/销毁单位"
)
public
ApiRes
<
String
>
addDestoryUnit
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
DestoryUnitReq
req
){
return
ApiRes
.
success
(
destoryUnitService
.
addDestoryUnit
(
req
));
}
//修改报废/销毁单位
@PostMapping
(
"/UpdateDestoryUnit
"
)
@PostMapping
(
path
=
"/UpdateDestoryUnit"
,
name
=
"修改报废/销毁单位
"
)
@ApiOperation
(
"修改报废/销毁单位"
)
public
ApiRes
<
Boolean
>
updateDestoryUnit
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
DestoryUnitReq
req
){
return
ApiRes
.
success
(
destoryUnitService
.
updateDestoryUnit
(
req
));
}
//查询报废/销毁单位(list)
@PostMapping
(
"/ShowDestoryUnitList
"
)
@PostMapping
(
path
=
"/ShowDestoryUnitList"
,
name
=
"查询报废/销毁单位(list)
"
)
@ApiOperation
(
"查询报废/销毁单位(list)"
)
public
ApiRes
<
List
<
DestoryUnit
>>
showDestoryUnitList
(
@RequestBody
DestoryUnitReq
req
){
return
ApiRes
.
success
(
destoryUnitService
.
showDestoryUnitList
(
req
));
}
//查询报废/销毁单位(page)
@PostMapping
(
"/ShowDestoryUnitPage
"
)
@PostMapping
(
path
=
"/ShowDestoryUnitPage"
,
name
=
"修改报废/销毁单位(page)
"
)
@ApiOperation
(
"修改报废/销毁单位(page)"
)
public
ApiRes
<
PageResult
<
DestoryUnit
>>
showDestoryUnitPage
(
@RequestBody
DestoryUnitReq
req
){
return
ApiRes
.
success
(
destoryUnitService
.
showDestoryUnitPage
(
req
));
}
//删除报废/销毁单位
@PostMapping
(
"/DelDestoryUnit
"
)
@PostMapping
(
path
=
"/DelDestoryUnit"
,
name
=
"修改报废/销毁单位
"
)
@ApiOperation
(
"修改报废/销毁单位"
)
public
ApiRes
<
Boolean
>
delDestoryUnit
(
@RequestBody
DestoryUnitReq
req
){
return
ApiRes
.
success
(
destoryUnitService
.
delDestoryUnit
(
req
));
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/EsLog.java
0 → 100644
View file @
007f54de
package
com
.
junmp
.
jyzb
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.junmp.v2.db.api.entity.BaseEntity
;
import
org.springframework.data.elasticsearch.annotations.Document
;
@TableName
(
"sys_log"
)
@Document
(
indexName
=
"sys_log"
,
shards
=
1
,
replicas
=
1
)
public
class
EsLog
extends
BaseEntity
{
@TableId
(
value
=
"log_id"
,
type
=
IdType
.
ASSIGN_ID
)
private
Long
logId
;
@TableField
(
"log_name"
)
private
String
logName
;
@TableField
(
"log_content"
)
private
String
logContent
;
@TableField
(
"app_name"
)
private
String
appName
;
@TableField
(
"log_type"
)
private
Integer
logType
;
@TableField
(
"request_url"
)
private
String
requestUrl
;
@TableField
(
"request_params"
)
private
String
requestParams
;
@TableField
(
"request_result"
)
private
String
requestResult
;
@TableField
(
"server_ip"
)
private
String
serverIp
;
@TableField
(
"client_ip"
)
private
String
clientIp
;
@TableField
(
"user_id"
)
private
Long
userId
;
@TableField
(
"http_method"
)
private
String
httpMethod
;
@TableField
(
"client_browser"
)
private
String
clientBrowser
;
@TableField
(
"client_os"
)
private
String
clientOs
;
public
EsLog
()
{
}
public
Long
getLogId
()
{
return
this
.
logId
;
}
public
String
getLogName
()
{
return
this
.
logName
;
}
public
String
getLogContent
()
{
return
this
.
logContent
;
}
public
String
getAppName
()
{
return
this
.
appName
;
}
public
Integer
getLogType
()
{
return
this
.
logType
;
}
public
String
getRequestUrl
()
{
return
this
.
requestUrl
;
}
public
String
getRequestParams
()
{
return
this
.
requestParams
;
}
public
String
getRequestResult
()
{
return
this
.
requestResult
;
}
public
String
getServerIp
()
{
return
this
.
serverIp
;
}
public
String
getClientIp
()
{
return
this
.
clientIp
;
}
public
Long
getUserId
()
{
return
this
.
userId
;
}
public
String
getHttpMethod
()
{
return
this
.
httpMethod
;
}
public
String
getClientBrowser
()
{
return
this
.
clientBrowser
;
}
public
String
getClientOs
()
{
return
this
.
clientOs
;
}
public
void
setLogId
(
final
Long
logId
)
{
this
.
logId
=
logId
;
}
public
void
setLogName
(
final
String
logName
)
{
this
.
logName
=
logName
;
}
public
void
setLogContent
(
final
String
logContent
)
{
this
.
logContent
=
logContent
;
}
public
void
setAppName
(
final
String
appName
)
{
this
.
appName
=
appName
;
}
public
void
setLogType
(
final
Integer
logType
)
{
this
.
logType
=
logType
;
}
public
void
setRequestUrl
(
final
String
requestUrl
)
{
this
.
requestUrl
=
requestUrl
;
}
public
void
setRequestParams
(
final
String
requestParams
)
{
this
.
requestParams
=
requestParams
;
}
public
void
setRequestResult
(
final
String
requestResult
)
{
this
.
requestResult
=
requestResult
;
}
public
void
setServerIp
(
final
String
serverIp
)
{
this
.
serverIp
=
serverIp
;
}
public
void
setClientIp
(
final
String
clientIp
)
{
this
.
clientIp
=
clientIp
;
}
public
void
setUserId
(
final
Long
userId
)
{
this
.
userId
=
userId
;
}
public
void
setHttpMethod
(
final
String
httpMethod
)
{
this
.
httpMethod
=
httpMethod
;
}
public
void
setClientBrowser
(
final
String
clientBrowser
)
{
this
.
clientBrowser
=
clientBrowser
;
}
public
void
setClientOs
(
final
String
clientOs
)
{
this
.
clientOs
=
clientOs
;
}
public
String
toString
()
{
return
"SysLog(logId="
+
this
.
getLogId
()
+
", logName="
+
this
.
getLogName
()
+
", logContent="
+
this
.
getLogContent
()
+
", appName="
+
this
.
getAppName
()
+
", logType="
+
this
.
getLogType
()
+
", requestUrl="
+
this
.
getRequestUrl
()
+
", requestParams="
+
this
.
getRequestParams
()
+
", requestResult="
+
this
.
getRequestResult
()
+
", serverIp="
+
this
.
getServerIp
()
+
", clientIp="
+
this
.
getClientIp
()
+
", userId="
+
this
.
getUserId
()
+
", httpMethod="
+
this
.
getHttpMethod
()
+
", clientBrowser="
+
this
.
getClientBrowser
()
+
", clientOs="
+
this
.
getClientOs
()
+
")"
;
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/logManager/ESRecordManager.java
0 → 100644
View file @
007f54de
package
com
.
junmp
.
jyzb
.
logManager
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.junmp.jyzb.logManager.service.EsLogService
;
import
com.junmp.v2.log.api.LogRecordApi
;
import
com.junmp.v2.log.api.bean.dto.LogRecordDto
;
import
com.junmp.v2.log.api.thread.LogManagerPool
;
import
com.junmp.v2.log.db.entity.SysLog
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Queue
;
import
java.util.TimerTask
;
import
java.util.concurrent.ConcurrentLinkedQueue
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.stream.Collectors
;
public
class
ESRecordManager
implements
LogRecordApi
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
com
.
junmp
.
v2
.
log
.
db
.
DbLogRecordManager
.
class
);
private
final
EsLogService
esService
;
private
final
LogManagerPool
logManagerPool
;
private
final
LogRefreshManager
logRefreshManager
;
public
ESRecordManager
(
LogManagerPool
logManagerPool
,
EsLogService
esService
)
{
this
.
logManagerPool
=
logManagerPool
;
this
.
esService
=
esService
;
this
.
logRefreshManager
=
new
ESRecordManager
.
LogRefreshManager
();
this
.
logRefreshManager
.
start
();
}
public
void
add
(
LogRecordDto
logRecord
)
{
if
(
null
!=
logRecord
)
{
this
.
addBatch
(
CollectionUtil
.
list
(
false
,
new
LogRecordDto
[]{
logRecord
}));
}
}
public
void
addAsync
(
final
LogRecordDto
logRecord
)
{
this
.
logManagerPool
.
executeLog
(
new
TimerTask
()
{
public
void
run
()
{
ESRecordManager
.
this
.
logRefreshManager
.
putLog
(
logRecord
);
}
});
}
public
void
addBatch
(
List
<
LogRecordDto
>
logRecords
)
{
if
(!
ObjectUtil
.
isEmpty
(
logRecords
))
{
List
<
SysLog
>
sysLogList
=
(
List
)
logRecords
.
stream
().
map
((
dto
)
->
{
SysLog
sysLog
=
new
SysLog
();
BeanUtil
.
copyProperties
(
dto
,
sysLog
,
new
String
[
0
]);
if
(
StrUtil
.
isEmpty
(
sysLog
.
getLogName
()))
{
sysLog
.
setLogName
(
"API接口日志记录"
);
}
if
(
StrUtil
.
isEmpty
(
sysLog
.
getAppName
()))
{
sysLog
.
setAppName
(
"none-app-name"
);
}
return
sysLog
;
}).
collect
(
Collectors
.
toList
());
if
(
ObjectUtil
.
isNotEmpty
(
sysLogList
))
{
// this.esService.saveBatch(sysLogList);
}
}
}
class
LogRefreshManager
extends
Thread
{
private
final
long
sleepTime
;
private
final
int
maxCount
;
private
final
AtomicLong
refreshMark
=
new
AtomicLong
();
public
AtomicInteger
count
=
new
AtomicInteger
(
0
);
private
final
Queue
<
LogRecordDto
>
queue
=
new
ConcurrentLinkedQueue
();
public
LogRefreshManager
()
{
this
.
sleepTime
=
3000L
;
this
.
maxCount
=
300
;
}
public
LogRefreshManager
(
long
sleepTime
)
{
this
.
sleepTime
=
sleepTime
;
this
.
maxCount
=
300
;
}
public
LogRefreshManager
(
int
maxCount
)
{
this
.
sleepTime
=
3000L
;
this
.
maxCount
=
maxCount
;
}
public
LogRefreshManager
(
long
sleepTime
,
int
maxCount
)
{
this
.
sleepTime
=
sleepTime
;
this
.
maxCount
=
maxCount
;
}
public
void
putLog
(
LogRecordDto
record
)
{
int
queueDataCount
=
this
.
count
.
get
();
if
(
queueDataCount
==
0
)
{
this
.
refreshMark
.
getAndSet
(
System
.
currentTimeMillis
());
}
if
(
queueDataCount
<
this
.
maxCount
*
2
)
{
this
.
queue
.
offer
(
record
);
this
.
count
.
incrementAndGet
();
}
}
private
void
refresh
()
{
this
.
refreshMark
.
getAndSet
(
System
.
currentTimeMillis
());
int
num
=
this
.
count
.
getAndSet
(
0
);
List
<
LogRecordDto
>
cacheAll
=
new
ArrayList
(
num
);
for
(
int
i
=
0
;
i
<
num
;
++
i
)
{
LogRecordDto
item
=
(
LogRecordDto
)
this
.
queue
.
poll
();
if
(
null
==
item
)
{
break
;
}
cacheAll
.
add
(
item
);
}
// if (null != cacheAll && cacheAll.size() > 0) {
// this.addBatch(cacheAll);
// }
}
private
void
timing
()
{
long
currentTimeMillis
=
System
.
currentTimeMillis
();
if
(
this
.
refreshMark
.
get
()
+
this
.
sleepTime
<=
currentTimeMillis
&&
this
.
count
.
get
()
>
0
)
{
this
.
refresh
();
}
}
private
void
listener
()
{
if
(
this
.
count
.
get
()
>=
this
.
maxCount
)
{
this
.
refresh
();
}
}
public
void
run
()
{
try
{
while
(
true
)
{
this
.
listener
();
this
.
timing
();
TimeUnit
.
MILLISECONDS
.
sleep
(
10L
);
}
}
catch
(
InterruptedException
var2
)
{
if
(
ESRecordManager
.
log
.
isDebugEnabled
())
{
var2
.
printStackTrace
();
}
ESRecordManager
.
log
.
error
(
var2
.
getMessage
());
}
}
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/logManager/EsLogManager.java
0 → 100644
View file @
007f54de
package
com
.
junmp
.
jyzb
.
logManager
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.junmp.v2.db.api.page.PageResult
;
import
com.junmp.v2.log.api.LogManagerApi
;
import
com.junmp.v2.log.api.bean.dto.LogRecordDto
;
import
com.junmp.v2.log.api.bean.req.LogRequest
;
import
com.junmp.v2.log.db.entity.SysLog
;
import
com.junmp.v2.log.db.service.SysLogService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.annotation.Resource
;
import
java.util.*
;
public
class
EsLogManager
implements
LogManagerApi
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
EsLogManager
.
class
);
@Resource
private
SysLogService
sysLogService
;
public
EsLogManager
()
{
}
public
List
<
LogRecordDto
>
findList
(
LogRequest
request
)
{
List
<
SysLog
>
sysLogList
=
this
.
sysLogService
.
findList
(
request
);
List
<
LogRecordDto
>
dtoList
=
CollUtil
.
newArrayList
(
new
LogRecordDto
[
0
]);
BeanUtil
.
copyProperties
(
sysLogList
,
dtoList
,
new
String
[
0
]);
return
dtoList
;
}
public
PageResult
<
LogRecordDto
>
findPage
(
LogRequest
request
)
{
return
this
.
sysLogService
.
getLogPage
(
request
);
}
public
void
del
(
LogRequest
request
)
{
this
.
sysLogService
.
del
(
request
);
}
public
void
clearLog
(
LogRequest
request
)
{
if
(
ObjectUtil
.
isNotNull
(
request
)
&&
ObjectUtil
.
isNotNull
(
request
.
getLogType
()))
{
this
.
sysLogService
.
clearLogByDate
(
request
);
}
}
public
LogRecordDto
detail
(
LogRequest
request
)
{
SysLog
detail
=
this
.
sysLogService
.
detail
(
request
);
LogRecordDto
dto
=
new
LogRecordDto
();
BeanUtil
.
copyProperties
(
detail
,
dto
,
new
String
[
0
]);
return
dto
;
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/logManager/service/EsLogService.java
0 → 100644
View file @
007f54de
package
com
.
junmp
.
jyzb
.
logManager
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.api.bean.dto.ESTypeDto
;
import
com.junmp.jyzb.api.bean.dto.EquipmentTreeDto
;
import
com.junmp.jyzb.api.bean.dto.EquipmentTypeDto
;
import
com.junmp.jyzb.api.bean.query.QueryEquipmentTypeReq
;
import
com.junmp.jyzb.api.bean.req.UpdateEquipmentTypeReq
;
import
com.junmp.jyzb.entity.EquipmentType
;
import
com.junmp.jyzb.entity.EsLog
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
java.io.IOException
;
import
java.util.List
;
public
interface
EsLogService
extends
IService
<
EsLog
>
{
Object
addEs
();
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/logManager/service/impl/EsLogServiceImpl.java
0 → 100644
View file @
007f54de
package
com
.
junmp
.
jyzb
.
logManager
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.junmp.jyzb.entity.EquipmentType
;
import
com.junmp.jyzb.entity.EsLog
;
import
com.junmp.jyzb.logManager.service.EsLogService
;
import
com.junmp.jyzb.mapper.EquipmentTypeMapper
;
import
com.junmp.jyzb.mapper.EsLogMapper
;
import
com.junmp.jyzb.service.EquipmentTypeService
;
import
org.springframework.stereotype.Service
;
@Service
public
class
EsLogServiceImpl
extends
ServiceImpl
<
EsLogMapper
,
EsLog
>
implements
EsLogService
{
@Override
public
Object
addEs
()
{
return
null
;
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/EsLogMapper.java
0 → 100644
View file @
007f54de
package
com
.
junmp
.
jyzb
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.junmp.jyzb.entity.EquipmentType
;
import
com.junmp.jyzb.entity.EsLog
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
EsLogMapper
extends
BaseMapper
<
EsLog
>
{
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/service/BussinessInventoryService.java
View file @
007f54de
...
...
@@ -24,7 +24,7 @@ public interface BussinessInventoryService extends IService<BussinessInventory>
BussinessInventoryDto
Check
(
BussinessInventoryReq
req
);
Boolean
Start
(
Bussiness
InventoryReq
req
);
Boolean
Start
(
Upload
InventoryReq
req
);
PageResult
<
BussinessInventory
>
GetPage
(
BussinessInventoryReq
req
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/BussinessInventoryServiceImpl.java
View file @
007f54de
...
...
@@ -274,9 +274,23 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
//开始盘点
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
Boolean
Start
(
Bussiness
InventoryReq
req
)
{
public
Boolean
Start
(
Upload
InventoryReq
req
)
{
String
orderId
=
req
.
getOrderId
();
BussinessInventory
bi
=
this
.
getById
(
orderId
);
if
(
bi
.
getInventoryState
().
equals
(
"running"
))
{
throw
new
ServiceException
(
InventoryExceptionEnum
.
ORDER_HAS_START
);
}
List
<
BussinessDetail
>
BDList
=
new
ArrayList
<>();
for
(
EquipmentListDto
bd:
req
.
getEquipmentList
())
{
BussinessDetail
bdInsert
=
new
BussinessDetail
();
bdInsert
.
setInventoryId
(
Long
.
valueOf
(
req
.
getOrderId
()));
BeanPlusUtil
.
copyProperties
(
bd
,
bdInsert
);
bdInsert
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
BDList
.
add
(
bdInsert
);
}
bussinessInventoryDetailService
.
saveBatch
(
BDList
);
if
(
bi
!=
null
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论