中台-小程序配置页面-新增 修改接口 加验证机构是否存在

This commit is contained in:
zhaotianfeng 2024-09-18 16:48:09 +08:00
parent b8366bb7b4
commit 7ea6567863
4 changed files with 25 additions and 0 deletions

View File

@ -70,6 +70,13 @@ public class SysAppController extends BaseController {
@PostMapping
public ResponseObject add(@RequestBody SysApp sysApp) {
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.setSystemName("2");
sysLog.setMoudle("小程序配置");
@ -88,6 +95,13 @@ public class SysAppController extends BaseController {
@PutMapping
public ResponseObject edit(@RequestBody SysApp sysApp) {
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.setSystemName("2");
sysLog.setMoudle("小程序配置");

View File

@ -67,6 +67,9 @@ legal_representative_id,legal_representative_contact,app_status,create_time,crea
select count(1)
from sys_app
<where>
<if test="orgId != null and orgId != ''">
and org_id = #{orgId}
</if>
<if test="id != null">
and id = #{id}
</if>

View File

@ -30,7 +30,9 @@ public interface SysAppService {
* @return 查询结果
*/
IPage<SysApp> queryByPage(@Param("page") Page page, SysApp sysApp);
// 根据机构名称查询
Long queryCount(SysApp sysApp);
/**
* 新增数据
*

View File

@ -50,6 +50,12 @@ public class SysAppServiceImpl implements SysAppService {
return this.sysAppMapper.queryAllByLimit(page, sysApp);
}
@Override
public Long queryCount(SysApp sysApp) {
long count = sysAppMapper.count(sysApp);
return count;
}
/**
* 新增数据
*