中台-小程序配置页面-新增 修改接口 加验证机构是否存在
This commit is contained in:
parent
b8366bb7b4
commit
7ea6567863
@ -70,6 +70,13 @@ public class SysAppController extends BaseController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public ResponseObject add(@RequestBody SysApp sysApp) {
|
public ResponseObject add(@RequestBody SysApp sysApp) {
|
||||||
try {
|
try {
|
||||||
|
// 先判断机构名称是否重复
|
||||||
|
SysApp s1 = new SysApp();
|
||||||
|
s1.setOrgId(sysApp.getOrgId());
|
||||||
|
Long aLong = sysAppService.queryCount(s1);
|
||||||
|
if (aLong>0){
|
||||||
|
return getFailureResult(500,"机构名称已经存在");
|
||||||
|
}
|
||||||
SysLog sysLog =new SysLog();
|
SysLog sysLog =new SysLog();
|
||||||
sysLog.setSystemName("2");
|
sysLog.setSystemName("2");
|
||||||
sysLog.setMoudle("小程序配置");
|
sysLog.setMoudle("小程序配置");
|
||||||
@ -88,6 +95,13 @@ public class SysAppController extends BaseController {
|
|||||||
@PutMapping
|
@PutMapping
|
||||||
public ResponseObject edit(@RequestBody SysApp sysApp) {
|
public ResponseObject edit(@RequestBody SysApp sysApp) {
|
||||||
try {
|
try {
|
||||||
|
// 先判断机构名称是否重复
|
||||||
|
SysApp s1= new SysApp();
|
||||||
|
s1.setOrgId(sysApp.getOrgId());
|
||||||
|
Long aLong = sysAppService.queryCount(s1);
|
||||||
|
if (aLong>0){
|
||||||
|
return getFailureResult(500,"机构名称已经存在");
|
||||||
|
}
|
||||||
SysLog sysLog =new SysLog();
|
SysLog sysLog =new SysLog();
|
||||||
sysLog.setSystemName("2");
|
sysLog.setSystemName("2");
|
||||||
sysLog.setMoudle("小程序配置");
|
sysLog.setMoudle("小程序配置");
|
||||||
|
@ -67,6 +67,9 @@ legal_representative_id,legal_representative_contact,app_status,create_time,crea
|
|||||||
select count(1)
|
select count(1)
|
||||||
from sys_app
|
from sys_app
|
||||||
<where>
|
<where>
|
||||||
|
<if test="orgId != null and orgId != ''">
|
||||||
|
and org_id = #{orgId}
|
||||||
|
</if>
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
and id = #{id}
|
and id = #{id}
|
||||||
</if>
|
</if>
|
||||||
|
@ -30,7 +30,9 @@ public interface SysAppService {
|
|||||||
* @return 查询结果
|
* @return 查询结果
|
||||||
*/
|
*/
|
||||||
IPage<SysApp> queryByPage(@Param("page") Page page, SysApp sysApp);
|
IPage<SysApp> queryByPage(@Param("page") Page page, SysApp sysApp);
|
||||||
|
// 根据机构名称查询
|
||||||
|
|
||||||
|
Long queryCount(SysApp sysApp);
|
||||||
/**
|
/**
|
||||||
* 新增数据
|
* 新增数据
|
||||||
*
|
*
|
||||||
|
@ -50,6 +50,12 @@ public class SysAppServiceImpl implements SysAppService {
|
|||||||
return this.sysAppMapper.queryAllByLimit(page, sysApp);
|
return this.sysAppMapper.queryAllByLimit(page, sysApp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long queryCount(SysApp sysApp) {
|
||||||
|
long count = sysAppMapper.count(sysApp);
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增数据
|
* 新增数据
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user