Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rop-dj-strategy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7cec9063
authored
Jan 08, 2026
by
春觉晓
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增批量插入/删除策略信息接口
1 parent
6410918b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
9 deletions
pom.xml
src/main/java/cn/com/glsx/dj/strategy/controller/StrategyInfoController.java
src/main/java/cn/com/glsx/dj/strategy/request/BatchInsertStrategyInfoRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/DeleteStrategyRequest.java
pom.xml
View file @
7cec906
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<dependency>
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
<groupId>
cn.com.glsx.dj
</groupId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<version>
5.
3
.0-SNAPSHOT
</version>
<version>
5.
6
.0-SNAPSHOT
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
src/main/java/cn/com/glsx/dj/strategy/controller/StrategyInfoController.java
View file @
7cec906
package
cn
.
com
.
glsx
.
dj
.
strategy
.
controller
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
controller
;
import
cn.com.glsx.dj.strategy.dto.BatchInsertStrategyInfo
;
import
cn.com.glsx.dj.strategy.model.StrategyInfo
;
import
cn.com.glsx.dj.strategy.model.StrategyInfo
;
import
cn.com.glsx.dj.strategy.remote.StrategyInfoRemote
;
import
cn.com.glsx.dj.strategy.remote.StrategyInfoRemote
;
import
cn.com.glsx.dj.strategy.request.BatchInsertStrategyInfoRequest
;
import
cn.com.glsx.dj.strategy.request.DeleteStrategyRequest
;
import
cn.com.glsx.dj.strategy.uitl.CommonUtil
;
import
cn.com.glsx.dj.strategy.uitl.CommonUtil
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
...
@@ -25,23 +28,47 @@ public class StrategyInfoController {
...
@@ -25,23 +28,47 @@ public class StrategyInfoController {
@Autowired
@Autowired
private
StrategyInfoRemote
strategyInfoRemote
;
private
StrategyInfoRemote
strategyInfoRemote
;
@ApiOperation
(
"创建策略"
)
@ApiOperation
(
"创建策略"
)
@ServiceMethod
(
method
=
"dj.api.strategy.info.create"
)
@ServiceMethod
(
method
=
"dj.api.strategy.info.batch.create"
)
public
RopResponse
<
List
<
StrategyInfo
>>
create
(
AbstractRopRequest
request
)
{
public
RopResponse
<
Boolean
>
batchCreate
(
BatchInsertStrategyInfoRequest
request
)
{
try
{
BatchInsertStrategyInfo
batchInsertStrategyInfo
=
CommonUtil
.
convertRequest
(
BatchInsertStrategyInfo
.
class
);
String
accountName
=
CommonUtil
.
getAccountName
();
String
accountName
=
CommonUtil
.
getAccountName
();
batchInsertStrategyInfo
.
setCreatedBy
(
accountName
);
RpcResponse
<
Boolean
>
response
=
strategyInfoRemote
.
batchCreate
(
batchInsertStrategyInfo
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"=====dj.api.strategy.info.batch.create rpcServiceException:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"=====dj.api.strategy.info.batch.create exception:{}"
,
e
.
getMessage
(),
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"删除策略"
)
@ServiceMethod
(
method
=
"dj.api.strategy.info.delete"
)
public
RopResponse
<
Boolean
>
delete
(
DeleteStrategyRequest
request
)
{
try
{
try
{
log
.
info
(
"=====创建策略 accountName:{}"
,
accountName
);
String
accountName
=
CommonUtil
.
getAccountName
();
RpcResponse
<
List
<
StrategyInfo
>>
response
=
strategyInfoRemote
.
getStrategyInfoById
(
1
);
StrategyInfo
strategyInfo
=
CommonUtil
.
convertRequest
(
StrategyInfo
.
class
);
strategyInfo
.
setUpdatedBy
(
accountName
);
RpcResponse
<
Boolean
>
response
=
strategyInfoRemote
.
delete
(
strategyInfo
);
if
(
response
.
hasError
())
{
if
(
response
.
hasError
())
{
log
.
error
(
"=====查询策略失败 error:{}"
,
response
.
getError
());
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
}
return
RopResponse
.
success
(
response
.
getResult
());
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"=====
AI助理-账号管理-新建账号
rpcServiceException:{}"
,
e
.
getMessage
());
log
.
error
(
"=====
dj.api.strategy.info.delete
rpcServiceException:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"=====
AI助理-账号管理-新建账号
exception:{}"
,
e
.
getMessage
(),
e
);
log
.
error
(
"=====
dj.api.strategy.info.delete
exception:{}"
,
e
.
getMessage
(),
e
);
return
RopResponse
.
error
(
"查询AI助理-账号管理-新建账号 失败"
);
return
RopResponse
.
error
(
e
.
getMessage
()
);
}
}
}
}
...
...
src/main/java/cn/com/glsx/dj/strategy/request/BatchInsertStrategyInfoRequest.java
0 → 100644
View file @
7cec906
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
cn.com.glsx.dj.strategy.dto.MerchantInfo
;
import
cn.com.glsx.dj.strategy.model.StrategyCourseRel
;
import
cn.com.glsx.dj.strategy.model.StrategyInfo
;
import
cn.com.glsx.dj.strategy.model.StrategyRecordingRel
;
import
cn.com.glsx.dj.strategy.model.StrategyStaffRel
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Data
public
class
BatchInsertStrategyInfoRequest
extends
AbstractRopRequest
{
@NotEmpty
(
message
=
"商户列表不能为空"
)
@ApiModelProperty
(
notes
=
"商户列表"
,
required
=
true
)
private
List
<
MerchantInfo
>
merchantList
;
@NotNull
(
message
=
"策略信息不能为空"
)
@ApiModelProperty
(
notes
=
"策略信息"
,
required
=
true
)
private
StrategyInfo
strategyInfo
;
@ApiModelProperty
(
notes
=
"人员列表"
)
private
List
<
StrategyStaffRel
>
staffList
;
@ApiModelProperty
(
notes
=
"课程列表"
)
private
List
<
StrategyCourseRel
>
courseList
;
@ApiModelProperty
(
notes
=
"录音列表"
)
private
List
<
StrategyRecordingRel
>
recordingList
;
}
src/main/java/cn/com/glsx/dj/strategy/request/DeleteStrategyRequest.java
0 → 100644
View file @
7cec906
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@Data
public
class
DeleteStrategyRequest
extends
AbstractRopRequest
{
/**
* 策略id
*/
@NotNull
(
message
=
"策略id不能为空"
)
@ApiModelProperty
(
notes
=
"策略id"
,
required
=
true
)
private
Integer
id
;
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment