Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
f9acd47f
Commit
f9acd47f
authored
Jun 01, 2024
by
刘凡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增:气瓶信息同步方法
parent
b8a08602
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
7 deletions
+72
-7
SyncCylinderDataService.java
...mos/api/openapi/face/service/SyncCylinderDataService.java
+16
-1
TmCylinderFillingExamineService.java
...openapi/face/service/TmCylinderFillingExamineService.java
+15
-1
TmCylinderFillingRecordService.java
.../openapi/face/service/TmCylinderFillingRecordService.java
+11
-1
TmCylinderFillingService.java
...os/api/openapi/face/service/TmCylinderFillingService.java
+7
-2
TmCylinderInspectionService.java
...api/openapi/face/service/TmCylinderInspectionService.java
+11
-1
TmCylinderTagsService.java
.../amos/api/openapi/face/service/TmCylinderTagsService.java
+12
-1
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/SyncCylinderDataService.java
View file @
f9acd47f
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
...
...
@@ -12,7 +13,6 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderInfo
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnitVideo
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderFillingCheckMapper
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderFillingExamineMapper
;
...
...
@@ -81,4 +81,19 @@ public class SyncCylinderDataService
List
<
CylinderInfo
>
cylinderUnitList
=
Bean
.
toModels
(
cylinderInfoDto
,
CylinderInfo
.
class
);
cylinderInfoMapper
.
saveOrUpdateBatch
(
cylinderUnitList
);
}
public
void
syncCylinderFillingExamine
(
List
<
CylinderFillingExamineDto
>
cylinderFillingExamineDto
)
{
}
public
void
syncCylinderFillingRecord
(
List
<
CylinderFillingRecordDto
>
cylinderFillingRecordDtos
)
{
}
public
void
syncCylinderInspection
(
List
<
CylinderInspectionDto
>
cylinderInspectionDto
)
{
}
public
void
syncCylinderTag
(
List
<
CylinderTagsDto
>
cylinderTagsDtos
)
{
}
public
void
syncCylinderInfo
(
List
<
CylinderInfoDto
>
cylinderInfoDtos
)
{
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderFillingExamineService.java
View file @
f9acd47f
...
...
@@ -4,12 +4,16 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.List
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingExamineDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -34,12 +38,16 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.TmCylinderFillingExamine;
public
class
TmCylinderFillingExamineService
extends
BaseService
<
TmCylinderFillingExamineModel
,
TmCylinderFillingExamine
,
TmCylinderFillingExamineMapper
>
{
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
String
createCylinderFillingExamine
(
List
<
TmCylinderFillingExamineModel
>
model
)
{
// TODO Auto-generated method stub
if
(
ValidationUtil
.
isEmpty
(
model
))
throw
new
BadRequest
(
"液化气体气瓶充装信息审核为空."
);
syncCylinderFillingExamine
(
model
);
for
(
TmCylinderFillingExamineModel
cylinderFillingExamineModel
:
model
)
{
cylinderFillingExamineModel
.
setRecDate
(
new
Date
());
cylinderFillingExamineModel
.
setAppId
(
getAppId
());
...
...
@@ -53,4 +61,10 @@ public class TmCylinderFillingExamineService extends BaseService<TmCylinderFilli
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
return
bizTokenModel
.
getAppId
();
}
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
private
void
syncCylinderFillingExamine
(
List
<
TmCylinderFillingExamineModel
>
model
)
{
List
<
CylinderFillingExamineDto
>
cylinderFillingExamineDto
=
Bean
.
toModels
(
model
,
CylinderFillingExamineDto
.
class
);
syncCylinderDataService
.
syncCylinderFillingExamine
(
cylinderFillingExamineDto
);
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderFillingRecordService.java
View file @
f9acd47f
...
...
@@ -11,6 +11,8 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderFillingRecordRepository
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingRecordDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingRecordDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderFillingRecordMapper
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -21,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
...
...
@@ -49,13 +52,15 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
@Autowired
ESCylinderFillingRecordRepository
esCylinderFillingRecordRepository
;
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
String
createCylinderFilling
(
List
<
TmCylinderFillingRecordModel
>
model
)
{
// TODO Auto-generated method stub
// if (ValidationUtil.isEmpty(model))
// throw new BadRequest("气瓶标签信息为空.");
syncCylinderFilling
(
model
);
for
(
TmCylinderFillingRecordModel
cylinderFillingRecordModel
:
model
)
{
cylinderFillingRecordModel
.
setRecDate
(
new
Date
());
cylinderFillingRecordModel
.
setAppId
(
getAppId
());
...
...
@@ -64,6 +69,11 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
return
"OK"
;
}
private
void
syncCylinderFilling
(
List
<
TmCylinderFillingRecordModel
>
model
)
{
List
<
CylinderFillingRecordDto
>
cylinderFillingRecordDtos
=
Bean
.
toModels
(
model
,
CylinderFillingRecordDto
.
class
);
syncCylinderDataService
.
syncCylinderFillingRecord
(
cylinderFillingRecordDtos
);
}
private
String
getAppId
()
{
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
RequestContext
.
getToken
());
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderFillingService.java
View file @
f9acd47f
...
...
@@ -4,12 +4,15 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.List
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
...
...
@@ -32,12 +35,14 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.TmCylinderFilling;
public
class
TmCylinderFillingService
extends
BaseService
<
TmCylinderFillingModel
,
TmCylinderFilling
,
TmCylinderFillingMapper
>
{
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
String
createCylinderFillingBefore
(
List
<
TmCylinderFillingModel
>
model
)
{
// TODO Auto-generated method stub
// if (ValidationUtil.isEmpty(model))
// throw new BadRequest("气瓶标签信息为空.");
for
(
TmCylinderFillingModel
cylinderFillingModel
:
model
)
{
cylinderFillingModel
.
setRecDate
(
new
Date
());
cylinderFillingModel
.
setAppId
(
getAppId
());
...
...
@@ -46,11 +51,11 @@ public class TmCylinderFillingService extends BaseService<TmCylinderFillingModel
return
"OK"
;
}
private
String
getAppId
()
{
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
RequestContext
.
getToken
());
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
return
bizTokenModel
.
getAppId
();
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderInspectionService.java
View file @
f9acd47f
...
...
@@ -4,12 +4,15 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -34,11 +37,13 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.TmCylinderInspection;
public
class
TmCylinderInspectionService
extends
BaseService
<
TmCylinderInspectionModel
,
TmCylinderInspection
,
TmCylinderInspectionMapper
>
{
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
String
createCylinderInspection
(
List
<
TmCylinderInspectionModel
>
model
)
{
if
(
ValidationUtil
.
isEmpty
(
model
))
throw
new
BadRequest
(
"气瓶检验信息为空."
);
syncCylinderInspectionModel
(
model
);
for
(
TmCylinderInspectionModel
cylinderInspectionModel
:
model
)
{
cylinderInspectionModel
.
setRecDate
(
new
Date
());
cylinderInspectionModel
.
setAppId
(
getAppId
());
...
...
@@ -47,6 +52,11 @@ public class TmCylinderInspectionService extends BaseService<TmCylinderInspectio
return
"OK"
;
}
private
void
syncCylinderInspectionModel
(
List
<
TmCylinderInspectionModel
>
model
)
{
List
<
CylinderInspectionDto
>
cylinderUnitDto
=
Bean
.
toModels
(
model
,
CylinderInspectionDto
.
class
);
syncCylinderDataService
.
syncCylinderInspection
(
cylinderUnitDto
);
}
private
String
getAppId
()
{
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
RequestContext
.
getToken
());
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderTagsService.java
View file @
f9acd47f
...
...
@@ -4,12 +4,15 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderTagsDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -34,12 +37,15 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.TmCylinderTags;
public
class
TmCylinderTagsService
extends
BaseService
<
TmCylinderTagsModel
,
TmCylinderTags
,
TmCylinderTagsMapper
>
{
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
String
createCylinderTag
(
List
<
TmCylinderTagsModel
>
model
)
{
// TODO Auto-generated method stub
if
(
ValidationUtil
.
isEmpty
(
model
))
throw
new
BadRequest
(
"气瓶标签信息为空."
);
syncCylinderTag
(
model
);
for
(
TmCylinderTagsModel
cylinderTagsModel
:
model
)
{
cylinderTagsModel
.
setRecDate
(
new
Date
());
cylinderTagsModel
.
setAppId
(
getAppId
());
...
...
@@ -48,6 +54,11 @@ public class TmCylinderTagsService extends BaseService<TmCylinderTagsModel, TmCy
return
"OK"
;
}
private
void
syncCylinderTag
(
List
<
TmCylinderTagsModel
>
model
)
{
List
<
CylinderTagsDto
>
cylinderTagsDtos
=
Bean
.
toModels
(
model
,
CylinderTagsDto
.
class
);
syncCylinderDataService
.
syncCylinderTag
(
cylinderTagsDtos
);
}
private
String
getAppId
()
{
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
RequestContext
.
getToken
());
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
...
...
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