基础管理调试
This commit is contained in:
parent
3b608b044c
commit
5134b35193
|
|
@ -43,7 +43,6 @@ public class TbBdDeviceRecordController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult queryByPage(TbBdDeviceRecord record) {
|
public AjaxResult queryByPage(TbBdDeviceRecord record) {
|
||||||
startPage();
|
|
||||||
List<TbBdDeviceRecord> list = tbBdDeviceRecordService.getAll(record);
|
List<TbBdDeviceRecord> list = tbBdDeviceRecordService.getAll(record);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class TbWarnConfigController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult queryByPage(TbWarnConfig tbWarnConfig) {
|
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));
|
return AjaxResult.success(tbWarnConfigService.getAll(tbWarnConfig));
|
||||||
}
|
}
|
||||||
startPage();
|
startPage();
|
||||||
|
|
|
||||||
|
|
@ -115,5 +115,12 @@ public interface TbTeamMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<TbPeople> selectList(Long id);
|
List<TbPeople> selectList(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据名称查询
|
||||||
|
* @param tbTeam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
TbTeam selectByName(TbTeam tbTeam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ public class TbProDepartServiceImpl implements TbProDepartService {
|
||||||
if (tbProDepart == null) {
|
if (tbProDepart == null) {
|
||||||
return AjaxResult.error(ExceptionEnum.TO_PARAM_NULL.getCode(), ExceptionEnum.TO_PARAM_NULL.getMsg());
|
return AjaxResult.error(ExceptionEnum.TO_PARAM_NULL.getCode(), ExceptionEnum.TO_PARAM_NULL.getMsg());
|
||||||
}
|
}
|
||||||
//名称重复性校验,一个地区内不能重复
|
//名称重复性校验
|
||||||
TbProDepart depart = tbProDepartDao.selectByName(tbProDepart);
|
TbProDepart depart = tbProDepartDao.selectByName(tbProDepart);
|
||||||
if (depart != null) {
|
if (depart != null) {
|
||||||
return AjaxResult.error(ExceptionEnum.NAME_DUPLICATE.getCode(), ExceptionEnum.NAME_DUPLICATE.getMsg());
|
return AjaxResult.error(ExceptionEnum.NAME_DUPLICATE.getCode(), ExceptionEnum.NAME_DUPLICATE.getMsg());
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import javax.annotation.Resource;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班组管理(TbTeam)表服务实现类
|
* 班组管理(TbTeam)表服务实现类
|
||||||
|
|
@ -109,6 +110,11 @@ public class TbTeamServiceImpl implements TbTeamService {
|
||||||
if (tbTeam == null) {
|
if (tbTeam == null) {
|
||||||
return AjaxResult.error(ExceptionEnum.TO_PARAM_NULL.getCode(), ExceptionEnum.TO_PARAM_NULL.getMsg());
|
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;
|
int result = 0;
|
||||||
//单纯添加班组成员
|
//单纯添加班组成员
|
||||||
if (tbTeam.getId() != null && CollectionUtils.isNotEmpty(tbTeam.getIdList())) {
|
if (tbTeam.getId() != null && CollectionUtils.isNotEmpty(tbTeam.getIdList())) {
|
||||||
|
|
@ -147,6 +153,13 @@ public class TbTeamServiceImpl implements TbTeamService {
|
||||||
if (tbTeam == null || tbTeam.getId() == null) {
|
if (tbTeam == null || tbTeam.getId() == null) {
|
||||||
return AjaxResult.error(ExceptionEnum.TO_PARAM_NULL.getCode(), ExceptionEnum.TO_PARAM_NULL.getMsg());
|
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;
|
int result = 0;
|
||||||
//修改时可能重新添加表单,根据id先将tb_people表中team_id字段置为null
|
//修改时可能重新添加表单,根据id先将tb_people表中team_id字段置为null
|
||||||
result += tbTeamDao.updatePeople(tbTeam.getId());
|
result += tbTeamDao.updatePeople(tbTeam.getId());
|
||||||
|
|
|
||||||
|
|
@ -79,12 +79,9 @@
|
||||||
update_time as updateTime, update_user as updateUser, del_flag as delFlag
|
update_time as updateTime, update_user as updateUser, del_flag as delFlag
|
||||||
from tb_pro_depart
|
from tb_pro_depart
|
||||||
where del_flag = '0'
|
where del_flag = '0'
|
||||||
<if test="departName != null and departName != ''">
|
<if test="departName != null and departName != ''">
|
||||||
and depart_name = #{departName}
|
and depart_name = #{departName}
|
||||||
</if>
|
</if>
|
||||||
<if test="areaId != null and areaId != ''">
|
|
||||||
and area_id = #{areaId}
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--新增所有列-->
|
<!--新增所有列-->
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,14 @@
|
||||||
AND tt.id = #{id}
|
AND tt.id = #{id}
|
||||||
</select>
|
</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 id="insert" keyProperty="teamId" useGeneratedKeys="true">
|
||||||
INSERT INTO tb_team
|
INSERT INTO tb_team
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue