Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
relation
Commits
6e5dd7ca
Commit
6e5dd7ca
authored
Aug 11, 2025
by
zhuxiang
Browse files
增加公共账户逻辑
parent
a7ae1554
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/controller/PublicAccountController.java
0 → 100644
View file @
6e5dd7ca
package
com.platform.controller
;
import
com.platform.model.entity.PublicAccountEntity
;
import
com.platform.model.resp.Result
;
import
com.platform.service.PublicAccountService
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
@RestController
@RequestMapping
(
"/public/account"
)
public
class
PublicAccountController
extends
BaseController
{
@Resource
private
PublicAccountService
publicAccountService
;
@PostMapping
(
"/set"
)
public
Result
set
(
@RequestBody
PublicAccountEntity
publicAccountEntity
)
{
try
{
return
toAjax
(
publicAccountService
.
save
(
publicAccountEntity
));
}
catch
(
DuplicateKeyException
e
)
{
return
Result
.
fail
(
"该账户已是公共账户"
);
}
}
}
src/main/java/com/platform/mapper/PublicAccountMapper.java
0 → 100644
View file @
6e5dd7ca
package
com.platform.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.platform.model.entity.PublicAccountEntity
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
PublicAccountMapper
extends
BaseMapper
<
PublicAccountEntity
>
{
}
src/main/java/com/platform/model/entity/PublicAccountEntity.java
0 → 100644
View file @
6e5dd7ca
package
com.platform.model.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
@Data
@TableName
(
"public_account"
)
public
class
PublicAccountEntity
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
int
id
;
private
int
caseId
;
private
String
accountName
;
}
src/main/java/com/platform/service/PublicAccountService.java
0 → 100644
View file @
6e5dd7ca
package
com.platform.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.platform.model.entity.PublicAccountEntity
;
import
java.util.List
;
public
interface
PublicAccountService
extends
IService
<
PublicAccountEntity
>
{
List
<
PublicAccountEntity
>
queryByCaseId
(
int
caseId
);
}
src/main/java/com/platform/service/impl/CaseServiceImpl.java
View file @
6e5dd7ca
This diff is collapsed.
Click to expand it.
src/main/java/com/platform/service/impl/PublicAccountServiceImpl.java
0 → 100644
View file @
6e5dd7ca
package
com.platform.service.impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.platform.mapper.PublicAccountMapper
;
import
com.platform.model.entity.PublicAccountEntity
;
import
com.platform.service.PublicAccountService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author wujipeng
* @version 1.0
* @create 2025-08-05 20:16
*/
@Service
public
class
PublicAccountServiceImpl
extends
ServiceImpl
<
PublicAccountMapper
,
PublicAccountEntity
>
implements
PublicAccountService
{
@Override
public
List
<
PublicAccountEntity
>
queryByCaseId
(
int
caseId
)
{
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
PublicAccountEntity
>()
.
eq
(
PublicAccountEntity:
:
getCaseId
,
caseId
));
}
}
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