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
204f80b8
Commit
204f80b8
authored
Nov 14, 2025
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
b67f861b
2ad763e7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
22 deletions
+58
-22
OpenApiControllerAop.java
...om/yeejoin/amos/api/openapi/aop/OpenApiControllerAop.java
+5
-2
OpenapiBizTokenMapper.java
.../amos/api/openapi/face/orm/dao/OpenapiBizTokenMapper.java
+7
-3
CylinderService.java
...eejoin/amos/api/openapi/face/service/CylinderService.java
+6
-7
OpenapiBizTokenService.java
...amos/api/openapi/face/service/OpenapiBizTokenService.java
+28
-7
application-vb.properties
...data-openapi/src/main/resources/application-vb.properties
+8
-2
BizDataChangeController.java
...oot/module/jg/biz/controller/BizDataChangeController.java
+2
-0
IdxBizJgUseInfo.java
...join/amos/boot/module/ymt/api/entity/IdxBizJgUseInfo.java
+2
-1
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/aop/OpenApiControllerAop.java
View file @
204f80b8
...
@@ -68,12 +68,15 @@ public class OpenApiControllerAop {
...
@@ -68,12 +68,15 @@ public class OpenApiControllerAop {
private
void
fillRequestContext
(
String
token
)
{
private
void
fillRequestContext
(
String
token
)
{
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
token
);
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
token
);
if
(
ValidationUtil
.
isEmpty
(
redisTemplate
.
opsForValue
().
get
(
tokenKey
)))
{
throw
new
AuthException
(
"错误的token."
);
}
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
if
(
null
==
bizTokenModel
)
{
if
(
null
==
bizTokenModel
)
{
throw
new
AuthException
(
"请求未包含认证信息."
);
throw
new
AuthException
(
"请求未包含认证信息."
);
}
}
String
product
=
bizTokenModel
.
get
Product
();
String
product
=
bizTokenModel
.
get
AppId
();
// 使用appId作为每个对接单位的product
String
appKey
=
bizTokenModel
.
getAppKey
();
String
appKey
=
bizTokenModel
.
getAppKey
();
RequestContext
.
setToken
(
token
);
RequestContext
.
setToken
(
token
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setProduct
(
product
);
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/orm/dao/OpenapiBizTokenMapper.java
View file @
204f80b8
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
orm
.
dao
;
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
orm
.
dao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiBizToken
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiBizToken
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
*
*
...
@@ -31,4 +31,7 @@ public interface OpenapiBizTokenMapper extends BaseMapper<OpenapiBizToken> {
...
@@ -31,4 +31,7 @@ public interface OpenapiBizTokenMapper extends BaseMapper<OpenapiBizToken> {
@Select
(
"select DEVELOPER_AGENCY from iot_openapi_biz_token where DEVELOPER_AGENCY is not null AND DATA_TYPE = 'cyl' group by DEVELOPER_AGENCY"
)
@Select
(
"select DEVELOPER_AGENCY from iot_openapi_biz_token where DEVELOPER_AGENCY is not null AND DATA_TYPE = 'cyl' group by DEVELOPER_AGENCY"
)
public
List
<
String
>
getServiceList
();
public
List
<
String
>
getServiceList
();
@Select
(
"select use_unit_code, use_unit from amos_tzs_biz.tz_base_enterprise_info where app_id = '${appId}'"
)
Map
<
String
,
String
>
queryUnitInfoByAppId
(
@Param
(
"appId"
)
String
appId
);
}
}
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/CylinderService.java
View file @
204f80b8
...
@@ -8,8 +8,6 @@ import com.yeejoin.amos.api.openapi.face.model.*;
...
@@ -8,8 +8,6 @@ import com.yeejoin.amos.api.openapi.face.model.*;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderFillingInfoRepository
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderFillingInfoRepository
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.CylinderFillingMessageEntity
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.CylinderFillingMessageEntity
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingInfoDto
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingInfoDto
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
...
@@ -72,16 +70,17 @@ public class CylinderService {
...
@@ -72,16 +70,17 @@ public class CylinderService {
@DSTransactional
@DSTransactional
public
void
cylinderFillingHandler
(
String
fillingData
)
throws
MqttException
{
public
void
cylinderFillingHandler
(
String
fillingData
)
throws
MqttException
{
String
token
=
RequestContext
.
getToken
();
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
RequestContext
.
getToken
());
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
if
(
ValidationUtil
.
isEmpty
(
this
.
redisTemplate
.
opsForValue
().
get
(
tokenKey
)))
{
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
token
);
return
;
}
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
this
.
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
BizTokenModel
bizTokenModel
=
(
BizTokenModel
)
this
.
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
JSONObject
jsonobject
=
JSONObject
.
fromObject
(
fillingData
);
JSONObject
jsonobject
=
JSONObject
.
fromObject
(
fillingData
);
CylinderFillingMessageEntity
cylinderFillingMessageEntity
=
new
CylinderFillingMessageEntity
();
CylinderFillingMessageEntity
cylinderFillingMessageEntity
=
new
CylinderFillingMessageEntity
();
cylinderFillingMessageEntity
.
setTime
(
simpleDateFormat
.
format
(
new
Date
()));
cylinderFillingMessageEntity
.
setTime
(
simpleDateFormat
.
format
(
new
Date
()));
cylinderFillingMessageEntity
.
setFillingCompanyName
(
me
.
getCompanys
().
get
(
0
).
get
CompanyName
());
cylinderFillingMessageEntity
.
setFillingCompanyName
(
bizTokenModel
.
getApi
CompanyName
());
cylinderFillingMessageEntity
.
setFillingCompanyCode
(
me
.
getCompanys
().
get
(
0
).
get
CompanyCode
());
cylinderFillingMessageEntity
.
setFillingCompanyCode
(
bizTokenModel
.
getApi
CompanyCode
());
cylinderFillingMessageEntity
.
setAppId
(
cylinderFillingService
.
getAppId
());
cylinderFillingMessageEntity
.
setAppId
(
cylinderFillingService
.
getAppId
());
cylinderFillingMessageEntity
.
setRawData
(
fillingData
);
cylinderFillingMessageEntity
.
setRawData
(
fillingData
);
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/OpenapiBizTokenService.java
View file @
204f80b8
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
face
.
service
;
import
cn.hutool.core.map.MapUtil
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
import
com.yeejoin.amos.api.openapi.constant.Constant
;
import
com.yeejoin.amos.api.openapi.face.model.BizTokenModel
;
import
com.yeejoin.amos.api.openapi.face.model.BizTokenModel
;
import
com.yeejoin.amos.api.openapi.face.model.OpenapiBizTokenModel
;
import
com.yeejoin.amos.api.openapi.face.model.OpenapiBizTokenModel
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.OpenapiBizTokenMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.OpenapiBizTokenMapper
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiBizToken
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiBizToken
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.component.robot.SystemUserInfo
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -16,10 +18,12 @@ import org.springframework.data.redis.core.RedisTemplate;
...
@@ -16,10 +18,12 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
...
@@ -36,6 +40,12 @@ public class OpenapiBizTokenService extends BaseService<OpenapiBizTokenModel, Op
...
@@ -36,6 +40,12 @@ public class OpenapiBizTokenService extends BaseService<OpenapiBizTokenModel, Op
@Autowired
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
AmosRequestContext
amosRequestContext
;
@Autowired
SystemUserInfo
systemUserInfo
;
public
static
final
String
DEFAULT_PASSWORD
=
"a1234560"
;
public
static
final
String
DEFAULT_PASSWORD
=
"a1234560"
;
public
List
<
String
>
getServiceList
()
{
public
List
<
String
>
getServiceList
()
{
...
@@ -43,21 +53,32 @@ public class OpenapiBizTokenService extends BaseService<OpenapiBizTokenModel, Op
...
@@ -43,21 +53,32 @@ public class OpenapiBizTokenService extends BaseService<OpenapiBizTokenModel, Op
}
}
public
String
getByAppId
(
String
appId
)
{
public
String
getByAppId
(
String
appId
)
{
Map
<
String
,
String
>
unitInfo
=
baseMapper
.
queryUnitInfoByAppId
(
appId
);
if
(
ValidationUtil
.
isEmpty
(
unitInfo
))
{
throw
new
RuntimeException
(
"未找到对接单位信息"
);
}
String
unitCode
=
MapUtil
.
getStr
(
unitInfo
,
"use_unit_code"
);
String
unitName
=
MapUtil
.
getStr
(
unitInfo
,
"use_unit"
);
IdPasswordAuthModel
idPasswordAuthModel
=
new
IdPasswordAuthModel
();
IdPasswordAuthModel
idPasswordAuthModel
=
new
IdPasswordAuthModel
();
idPasswordAuthModel
.
setLoginId
(
appId
);
// 使用机器人登录:采用不同的product获取token
idPasswordAuthModel
.
setPassword
(
DesUtil
.
encode
(
DEFAULT_PASSWORD
,
Constant
.
PASSWORD_ENCODE_KEY
));
idPasswordAuthModel
.
setLoginId
(
amosRequestContext
.
getUserName
());
idPasswordAuthModel
.
setPassword
(
DesUtil
.
encode
(
systemUserInfo
.
getPassword
(),
Constant
.
PASSWORD_ENCODE_KEY
));
BizTokenModel
bizTokenModel
=
new
BizTokenModel
();
BizTokenModel
bizTokenModel
=
new
BizTokenModel
();
bizTokenModel
.
setAppId
(
appId
);
bizTokenModel
.
setAppId
(
appId
);
RequestContext
.
setProduct
(
bizTokenModel
.
getProduct
()
);
RequestContext
.
setProduct
(
appId
);
RequestContext
.
setAppKey
(
bizTokenModel
.
getAppKey
());
RequestContext
.
setAppKey
(
bizTokenModel
.
getAppKey
());
FeignClientResult
<
HashMap
<
String
,
Object
>>
responseModel
=
Privilege
.
authClient
.
idpassword
(
idPasswordAuthModel
);
FeignClientResult
<
HashMap
<
String
,
Object
>>
responseModel
=
Privilege
.
authClient
.
idpassword
(
idPasswordAuthModel
);
HashMap
<
String
,
Object
>
authModel
=
responseModel
.
getResult
();
HashMap
<
String
,
Object
>
authModel
=
responseModel
.
getResult
();
String
token
=
(
String
)
authModel
.
get
(
"token"
);
String
token
=
(
String
)
authModel
.
get
(
"token"
);
bizTokenModel
.
setToken
(
token
);
bizTokenModel
.
setToken
(
token
);
RequestContext
.
setToken
(
token
);
RequestContext
.
setToken
(
token
);
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
// AgencyUserModel user = Privilege.agencyUserClient.getme().getResult();
bizTokenModel
.
setApiCompanyCode
(
user
.
getCompanys
().
get
(
0
).
getCompanyCode
());
// 当前一个人只能有一个单位
// bizTokenModel.setApiCompanyCode(user.getCompanys().get(0).getCompanyCode()); // 当前一个人只能有一个单位
bizTokenModel
.
setApiCompanyName
(
user
.
getCompanys
().
get
(
0
).
getCompanyName
());
// 当前一个人只能有一个单位
// bizTokenModel.setApiCompanyName(user.getCompanys().get(0).getCompanyName()); // 当前一个人只能有一个单位
// 调整为从业务表根据appId查询单位信息
bizTokenModel
.
setApiCompanyCode
(
unitCode
);
bizTokenModel
.
setApiCompanyName
(
unitName
);
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
token
);
String
tokenKey
=
Redis
.
genKey
(
Constant
.
TOKEN_PREFIX
,
token
);
this
.
redisTemplate
.
opsForValue
().
set
(
tokenKey
,
bizTokenModel
);
this
.
redisTemplate
.
opsForValue
().
set
(
tokenKey
,
bizTokenModel
);
return
token
;
return
token
;
...
...
amos-boot-data/amos-boot-data-openapi/src/main/resources/application-vb.properties
View file @
204f80b8
...
@@ -67,4 +67,10 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
...
@@ -67,4 +67,10 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
## ES properties:
## ES properties:
elasticsearch.username
=
elastic
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
elasticsearch.password
=
a123456
spring.elasticsearch.rest.uris
=
http://172.16.10.243:9200
spring.elasticsearch.rest.uris
=
http://172.16.10.243:9200
\ No newline at end of file
spring.servlet.multipart.max-file-size
=
100MB
spring.servlet.multipart.max-request-size
=
100MB
feign.client.config.default.connect-timeout
=
600000
feign.client.config.default.read-timeout
=
600000
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/BizDataChangeController.java
View file @
204f80b8
...
@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.component.event.RestEventTrigger
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
@@ -87,6 +88,7 @@ public class BizDataChangeController extends BaseController {
...
@@ -87,6 +88,7 @@ public class BizDataChangeController extends BaseController {
secondParamValue
=
"CQ"
secondParamValue
=
"CQ"
)
)
})
})
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
public
ResponseModel
<
String
>
saveV2
(
@ApiParam
(
value
=
"设备或者装置唯一标识"
)
@RequestParam
String
bizId
,
public
ResponseModel
<
String
>
saveV2
(
@ApiParam
(
value
=
"设备或者装置唯一标识"
)
@RequestParam
String
bizId
,
@ApiParam
(
required
=
true
,
value
=
"单据编号或者record"
)
@RequestParam
String
applyNo
,
@ApiParam
(
required
=
true
,
value
=
"单据编号或者record"
)
@RequestParam
String
applyNo
,
@ApiParam
(
required
=
true
,
value
=
"业务类型"
)
@PathVariable
String
bizType
,
@ApiParam
(
required
=
true
,
value
=
"业务类型"
)
@PathVariable
String
bizType
,
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgUseInfo.java
View file @
204f80b8
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
entity
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
entity
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
...
@@ -224,7 +225,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity implements IBaseChangeData {
...
@@ -224,7 +225,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity implements IBaseChangeData {
/**
/**
* 创建时间
* 创建时间
*/
*/
@TableField
(
"\"CREATE_DATE\""
)
@TableField
(
value
=
"\"CREATE_DATE\""
,
fill
=
FieldFill
.
INSERT
)
private
Date
createDate
;
private
Date
createDate
;
/**
/**
...
...
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