错误提示问题

pull/10/head
zhaoyu 2024-01-24 16:32:13 +08:00
parent fd28a121da
commit f85199b58c
11 changed files with 148 additions and 65 deletions

View File

@ -38,7 +38,7 @@ public class MkmjAreaController extends BaseController {
@RequestMapping(value="/add")
@RequiresPermissions("mkmjArea:add")
@ResponseBody
public ReturnMap add() throws Exception{
public Object add() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 添加时间
@ -57,7 +57,7 @@ public class MkmjAreaController extends BaseController {
@RequestMapping(value="/delete")
@RequiresPermissions("mkmjArea:del")
@ResponseBody
public ReturnMap delete() throws Exception{
public Object delete() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
return mkmjAreaService.delete(pd);
@ -70,7 +70,7 @@ public class MkmjAreaController extends BaseController {
@RequestMapping(value="/edit")
@RequiresPermissions("mkmjArea:edit")
@ResponseBody
public ReturnMap edit() throws Exception{
public Object edit() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人

View File

@ -39,7 +39,7 @@ public class MkmjAreaGateController extends BaseController {
@RequestMapping(value="/add")
@RequiresPermissions("mkmjArea:add")
@ResponseBody
public ReturnMap add() throws Exception{
public Object add() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 添加时间
@ -58,7 +58,7 @@ public class MkmjAreaGateController extends BaseController {
@RequestMapping(value="/delete")
@RequiresPermissions("mkmjArea:del")
@ResponseBody
public ReturnMap delete() throws Exception{
public Object delete() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
return mkmjAreaGateService.delete(pd);
@ -71,7 +71,7 @@ public class MkmjAreaGateController extends BaseController {
@RequestMapping(value="/edit")
@RequiresPermissions("mkmjArea:edit")
@ResponseBody
public ReturnMap edit() throws Exception{
public Object edit() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
@ -126,13 +126,9 @@ public class MkmjAreaGateController extends BaseController {
@RequestMapping(value="/savePosition")
@ResponseBody
public Object savePosition() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
mkmjAreaGateService.savePosition(pd); //根据ID读取
map.put("result", errInfo);
return map;
return mkmjAreaGateService.savePosition(pd); //根据ID读取
}
}

View File

@ -40,7 +40,7 @@ public class MkmjGateVideoController extends BaseController {
@RequestMapping(value="/add")
@RequiresPermissions("mkmjArea:add")
@ResponseBody
public ReturnMap add() throws Exception{
public Object add() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 添加时间
@ -59,7 +59,7 @@ public class MkmjGateVideoController extends BaseController {
@RequestMapping(value="/delete")
@RequiresPermissions("mkmjArea:del")
@ResponseBody
public ReturnMap delete() throws Exception{
public Object delete() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
return mkmjGateVideoService.delete(pd);
@ -72,7 +72,7 @@ public class MkmjGateVideoController extends BaseController {
@RequestMapping(value="/edit")
@RequiresPermissions("mkmjArea:edit")
@ResponseBody
public ReturnMap edit() throws Exception{
public Object edit() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人

View File

@ -60,5 +60,12 @@ public interface MkmjGateVideoMapper {
* @param pd
*/
void savePosition(PageData pd);
/**.
* id
* @param pageData
* @return
*/
PageData findByOnly(PageData pageData);
}

View File

@ -18,19 +18,19 @@ public interface MkmjAreaGateService {
* @param pd
* @throws Exception
*/
public ReturnMap save(PageData pd)throws Exception;
public Object save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public ReturnMap delete(PageData pd)throws Exception;
public Object delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public ReturnMap edit(PageData pd)throws Exception;
public Object edit(PageData pd)throws Exception;
/**
* @param page
@ -54,13 +54,13 @@ public interface MkmjAreaGateService {
* @param ArrayDATA_IDS
* @throws Exception
*/
public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception;
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception;
/**
*
* @param pd
* @return
*/
ReturnMap savePosition(PageData pd);
Object savePosition(PageData pd);
}

View File

@ -18,19 +18,19 @@ public interface MkmjAreaService {
* @param pd
* @throws Exception
*/
public ReturnMap save(PageData pd)throws Exception;
public Object save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public ReturnMap delete(PageData pd)throws Exception;
public Object delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public ReturnMap edit(PageData pd)throws Exception;
public Object edit(PageData pd)throws Exception;
/**
* @param page

View File

@ -18,19 +18,19 @@ public interface MkmjGateVideoService {
* @param pd
* @throws Exception
*/
public ReturnMap save(PageData pd)throws Exception;
public Object save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public ReturnMap delete(PageData pd)throws Exception;
public Object delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public ReturnMap edit(PageData pd)throws Exception;
public Object edit(PageData pd)throws Exception;
/**
* @param page
@ -54,13 +54,13 @@ public interface MkmjGateVideoService {
* @param ArrayDATA_IDS
* @throws Exception
*/
public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception;
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception;
/**
*
* @param pd
* @return
*/
ReturnMap savePosition(PageData pd);
Object savePosition(PageData pd);
}

View File

@ -11,7 +11,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
@ -30,45 +32,56 @@ public class MkmjAreaGateServiceImpl implements MkmjAreaGateService {
* @param pd
* @throws Exception
*/
public ReturnMap save(PageData pd)throws Exception{
ReturnMap returnMap = new ReturnMap();
public Object save(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
//保存校验名称不重复
PageData pageData = mkmjAreaGateMapper.findByOnly(pd);
//查询不到重复数据 开始走业务
if(ObjectUtils.isEmpty(pageData)){
pd.put("AREA_GATE_ID", UuidUtil.get32UUID());
}else {
returnMap.error("名称已存在,请修改后重新提交");
return returnMap;
map.put("result", "fail");
map.put("msg", "名称已存在,请修改后重新提交");
return map;
}
mkmjAreaGateMapper.save(pd);
return returnMap.ok("保存成功");
map.put("result", errInfo);
map.put("msg", "保存成功");
return map;
}
/**
* @param pd
* @throws Exception
*/
public ReturnMap delete(PageData pd)throws Exception{
ReturnMap returnMap = new ReturnMap();
public Object delete(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
mkmjAreaGateMapper.delete(pd);
return returnMap.ok("删除成功");
map.put("result", errInfo);
map.put("msg", "删除成功");
return map;
}
/**
* @param pd
* @throws Exception
*/
public ReturnMap edit(PageData pd)throws Exception{
ReturnMap returnMap = new ReturnMap();
public Object edit(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pageData = mkmjAreaGateMapper.findByOnly(pd);
//查询不到重复数据 开始走业务
if(!ObjectUtils.isEmpty(pageData)){
returnMap.error("名称已存在,请修改后重新提交");
return returnMap;
map.put("result", "fail");
map.put("msg", "名称已存在,请修改后重新提交");
return map;
}
mkmjAreaGateMapper.edit(pd);
return returnMap.ok("编辑成功");
map.put("result", errInfo);
map.put("msg", "编辑成功");
return map;
}
/**
@ -99,16 +112,23 @@ public class MkmjAreaGateServiceImpl implements MkmjAreaGateService {
* @param ArrayDATA_IDS
* @throws Exception
*/
public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception{
ReturnMap returnMap = new ReturnMap();
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
mkmjAreaGateMapper.deleteAll(ArrayDATA_IDS);
return returnMap.ok("删除成功");
map.put("result", errInfo);
map.put("msg", "删除成功");
return map;
}
@Override
public ReturnMap savePosition(PageData pd) {
public Object savePosition(PageData pd) {
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
mkmjAreaGateMapper.savePosition(pd);
return ReturnMap.ok("定位成功");
map.put("result", errInfo);
map.put("msg", "定位成功");
return map;
}
}

View File

@ -12,7 +12,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
@ -34,51 +36,71 @@ public class MkmjAreaServiceImpl implements MkmjAreaService {
* @param pd
* @throws Exception
*/
public ReturnMap save(PageData pd)throws Exception{
public Object save(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
//保存校验名称不重复
PageData pageData = mkmjAreaMapper.findByOnly(pd);
//查询不到重复数据 开始走业务
if(ObjectUtils.isEmpty(pageData)){
pd.put("AREA_ID", UuidUtil.get32UUID());
}else {
return ReturnMap.error("名称已存在,请修改后重新提交");
map.put("result", "fail");
map.put("msg", "名称已存在,请修改后重新提交");
return map;
}
mkmjAreaMapper.save(pd);
return ReturnMap.ok("保存成功");
map.put("result", errInfo);
map.put("msg", "保存成功");
return map;
}
/**
* @param pd
* @throws Exception
*/
public ReturnMap delete(PageData pd)throws Exception{
public Object delete(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
//校验区域下是否还存在区域 存在则不让删除
List<PageData> childList = mkmjAreaMapper.findByChild(pd);
if(childList.size()>0){
return ReturnMap.error("当前区域还存在下级区域,请删除当前区域的所有下级区域后进行删除");
map.put("result", "fail");
map.put("msg", "当前区域还存在下级区域,请删除当前区域的所有下级区域后进行删除");
return map;
}
//校验区域下是否存在闸机,存在则不让删除
List<PageData> gateList = mkmjAreaGateMapper.listAll(pd);
if(gateList.size()>0){
return ReturnMap.error("当前区域还存在闸机,请删除当前区域的所有闸机后进行删除");
map.put("result", "fail");
map.put("msg", "当前区域还存在闸机,请删除当前区域的所有闸机后进行删除");
return map;
}
//两个校验都不存在 则可以删除
mkmjAreaMapper.delete(pd);
return ReturnMap.ok("删除成功");
map.put("result", errInfo);
map.put("msg", "删除成功");
return map;
}
/**
* @param pd
* @throws Exception
*/
public ReturnMap edit(PageData pd)throws Exception{
public Object edit(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pageData = mkmjAreaMapper.findByOnly(pd);
//查询不到重复数据 开始走业务
if(!ObjectUtils.isEmpty(pageData)){
return ReturnMap.error("名称已存在,请修改后重新提交");
map.put("result", "fail");
map.put("msg", "名称已存在,请修改后重新提交");
return map;
}
mkmjAreaMapper.edit(pd);
return ReturnMap.ok("编辑成功");
map.put("result", errInfo);
map.put("msg", "编辑成功");
return map;
}
/**

View File

@ -13,7 +13,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
@ -32,28 +34,47 @@ public class MkmjGateVideServiceImpl implements MkmjGateVideoService {
* @param pd
* @throws Exception
*/
public ReturnMap save(PageData pd)throws Exception{
public Object save(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pageData = mkmjGateVideoMapper.findByOnly(pd);
if(ObjectUtils.isEmpty(pageData)){
pd.put("GATE_VIDEO_ID",UuidUtil.get32UUID());
}else {
map.put("result", "fail");
map.put("msg", "当前闸机以绑定该摄像头,无法在此绑定");
return map;
}
mkmjGateVideoMapper.save(pd);
return ReturnMap.ok("保存成功");
map.put("result", errInfo);
map.put("msg", "保存成功");
return map;
}
/**
* @param pd
* @throws Exception
*/
public ReturnMap delete(PageData pd)throws Exception{
public Object delete(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
mkmjGateVideoMapper.delete(pd);
return ReturnMap.ok("删除成功");
map.put("result", errInfo);
map.put("msg", "删除成功");
return map;
}
/**
* @param pd
* @throws Exception
*/
public ReturnMap edit(PageData pd)throws Exception{
public Object edit(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
mkmjGateVideoMapper.edit(pd);
return ReturnMap.ok("编辑成功");
map.put("result", errInfo);
map.put("msg", "编辑成功");
return map;
}
/**
@ -84,16 +105,20 @@ public class MkmjGateVideServiceImpl implements MkmjGateVideoService {
* @param ArrayDATA_IDS
* @throws Exception
*/
public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception{
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception{
ReturnMap ReturnMap = new ReturnMap();
mkmjGateVideoMapper.deleteAll(ArrayDATA_IDS);
return ReturnMap.ok("删除成功");
}
@Override
public ReturnMap savePosition(PageData pd) {
public Object savePosition(PageData pd) {
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
mkmjGateVideoMapper.savePosition(pd);
return ReturnMap.ok("定位成功");
map.put("result", errInfo);
map.put("msg", "定位成功");
return map;
}
}

View File

@ -164,4 +164,17 @@
where
GATE_VIDEO_ID = #{GATE_VIDEO_ID}
</update>
<!-- 校验名称是否重复 -->
<select id="findByOnly" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.ISDELETE = '0'
AND f.PLATFORMVIDEOMANAGEMENT_ID = #{PLATFORMVIDEOMANAGEMENT_ID}
AND f.AREA_GATE_ID = #{AREA_GATE_ID}
</select>
</mapper>