基础管理调试

This commit is contained in:
mashuai 2024-09-19 13:16:07 +08:00
parent 3b608b044c
commit 5134b35193
7 changed files with 31 additions and 7 deletions

View File

@ -43,7 +43,6 @@ public class TbBdDeviceRecordController extends BaseController {
*/
@GetMapping("/list")
public AjaxResult queryByPage(TbBdDeviceRecord record) {
startPage();
List<TbBdDeviceRecord> list = tbBdDeviceRecordService.getAll(record);
return AjaxResult.success(list);
}

View File

@ -42,7 +42,7 @@ public class TbWarnConfigController extends BaseController {
*/
@GetMapping("/list")
public AjaxResult queryByPage(TbWarnConfig tbWarnConfig) {
if (tbWarnConfig.getIsAll() != null && tbWarnConfig.getIsAll() == 1) {
if (tbWarnConfig.getIsAll() != null && tbWarnConfig.getIsAll() == 0) {
return AjaxResult.success(tbWarnConfigService.getAll(tbWarnConfig));
}
startPage();

View File

@ -115,5 +115,12 @@ public interface TbTeamMapper {
* @return
*/
List<TbPeople> selectList(Long id);
/**
* 根据名称查询
* @param tbTeam
* @return
*/
TbTeam selectByName(TbTeam tbTeam);
}

View File

@ -86,7 +86,7 @@ public class TbProDepartServiceImpl implements TbProDepartService {
if (tbProDepart == null) {
return AjaxResult.error(ExceptionEnum.TO_PARAM_NULL.getCode(), ExceptionEnum.TO_PARAM_NULL.getMsg());
}
//名称重复性校验一个地区内不能重复
//名称重复性校验
TbProDepart depart = tbProDepartDao.selectByName(tbProDepart);
if (depart != null) {
return AjaxResult.error(ExceptionEnum.NAME_DUPLICATE.getCode(), ExceptionEnum.NAME_DUPLICATE.getMsg());

View File

@ -23,6 +23,7 @@ import javax.annotation.Resource;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 班组管理(TbTeam)表服务实现类
@ -109,6 +110,11 @@ public class TbTeamServiceImpl implements TbTeamService {
if (tbTeam == null) {
return AjaxResult.error(ExceptionEnum.TO_PARAM_NULL.getCode(), ExceptionEnum.TO_PARAM_NULL.getMsg());
}
// 名称重复性校验
TbTeam team = tbTeamDao.selectByName(tbTeam);
if (team != null) {
return AjaxResult.error(ExceptionEnum.NAME_DUPLICATE.getCode(), ExceptionEnum.NAME_DUPLICATE.getMsg());
}
int result = 0;
//单纯添加班组成员
if (tbTeam.getId() != null && CollectionUtils.isNotEmpty(tbTeam.getIdList())) {
@ -147,6 +153,13 @@ public class TbTeamServiceImpl implements TbTeamService {
if (tbTeam == null || tbTeam.getId() == null) {
return AjaxResult.error(ExceptionEnum.TO_PARAM_NULL.getCode(), ExceptionEnum.TO_PARAM_NULL.getMsg());
}
// 名称重复性校验
TbTeam team = tbTeamDao.selectByName(tbTeam);
if (team != null) {
if (!Objects.equals(tbTeam.getId(), tbTeam.getId())) {
return AjaxResult.error(ExceptionEnum.NAME_DUPLICATE.getCode(), ExceptionEnum.NAME_DUPLICATE.getMsg());
}
}
int result = 0;
//修改时可能重新添加表单根据id先将tb_people表中team_id字段置为null
result += tbTeamDao.updatePeople(tbTeam.getId());

View File

@ -82,9 +82,6 @@
<if test="departName != null and departName != ''">
and depart_name = #{departName}
</if>
<if test="areaId != null and areaId != ''">
and area_id = #{areaId}
</if>
</select>
<!--新增所有列-->

View File

@ -119,6 +119,14 @@
AND tt.id = #{id}
</select>
<select id="selectByName" resultType="com.bonus.base.domain.TbTeam">
select id, team_name, rel_id, rel_name, rel_phone, pro_id, pro_name, create_time, create_user, update_time,
js_time, update_user, del_flag from tb_team
where
del_flag = '0' and
team_name = #{teamName}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="teamId" useGeneratedKeys="true">
INSERT INTO tb_team