接口联调
This commit is contained in:
parent
d2442c4236
commit
fd65a7d693
|
|
@ -14,7 +14,7 @@ public enum ExceptionEnum {
|
||||||
PARAM_NULL(1001, "导入数据为空"),
|
PARAM_NULL(1001, "导入数据为空"),
|
||||||
TO_PARAM_NULL(1007, "参数为空"),
|
TO_PARAM_NULL(1007, "参数为空"),
|
||||||
NAME_DUPLICATE(1002, "名称重复,请重新输入"),
|
NAME_DUPLICATE(1002, "名称重复,请重新输入"),
|
||||||
ID_CARD_DUPLICATE(1007, "身份证号码重复,请重新输入"),
|
ID_CARD_DUPLICATE(1009, "身份证号码重复,请重新输入"),
|
||||||
IMPORT_TO_DATABASE(1003, "该表单中存在相同名称的数据,请修改后重新提交"),
|
IMPORT_TO_DATABASE(1003, "该表单中存在相同名称的数据,请修改后重新提交"),
|
||||||
SUCCESS(200, "操作成功"),
|
SUCCESS(200, "操作成功"),
|
||||||
SAVE_TO_DATABASE(500, "新增保存失败,请联系管理员"),
|
SAVE_TO_DATABASE(500, "新增保存失败,请联系管理员"),
|
||||||
|
|
@ -22,6 +22,7 @@ public enum ExceptionEnum {
|
||||||
INVALID_ID_CARD_FORMAT(1004, "身份证号格式不正确"),
|
INVALID_ID_CARD_FORMAT(1004, "身份证号格式不正确"),
|
||||||
UN_BIND_TO_DATABASE(500, "解散失败,请联系管理员"),
|
UN_BIND_TO_DATABASE(500, "解散失败,请联系管理员"),
|
||||||
EXISTENCE_OF_MEMBERS(1005, "班组中还存在成员,无法解散"),
|
EXISTENCE_OF_MEMBERS(1005, "班组中还存在成员,无法解散"),
|
||||||
|
EXISTENCE_OF_HELMET(1008, "该班组人员绑定相关安全帽,无法解散"),
|
||||||
EXISTENCE_OF_BIND(1006, "该人员还绑定相关设备,无法移出"),
|
EXISTENCE_OF_BIND(1006, "该人员还绑定相关设备,无法移出"),
|
||||||
UPDATE_TO_DATABASE(500, "修改失败,请联系管理员"),
|
UPDATE_TO_DATABASE(500, "修改失败,请联系管理员"),
|
||||||
BIND_TO_DATABASE(500, "人员设备绑定失败,请联系管理员"),
|
BIND_TO_DATABASE(500, "人员设备绑定失败,请联系管理员"),
|
||||||
|
|
|
||||||
|
|
@ -131,5 +131,12 @@ public interface TbTeamMapper {
|
||||||
* @param proId 工程id
|
* @param proId 工程id
|
||||||
*/
|
*/
|
||||||
List<TeamJoinPersonVo> getTeamJoinPersonListByProId(@Param("proId") Integer proId);
|
List<TeamJoinPersonVo> getTeamJoinPersonListByProId(@Param("proId") Integer proId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备id查询班组id
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Long selectByDevId(Long id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员管理(TbPeople)表服务实现类
|
* 人员管理(TbPeople)表服务实现类
|
||||||
|
|
@ -80,6 +82,17 @@ public class TbPeopleServiceImpl implements TbPeopleService {
|
||||||
people.setRelPhone(Sm4Utils.decode(people.getRelPhone()));
|
people.setRelPhone(Sm4Utils.decode(people.getRelPhone()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// 使用流对条件进行过滤
|
||||||
|
Stream<TbPeople> stream = peopleList.stream();
|
||||||
|
if (tbPeople.getRelName() != null) {
|
||||||
|
stream = stream.filter(people -> StringUtils.contains(people.getRelName(), tbPeople.getRelName()));
|
||||||
|
}
|
||||||
|
if (tbPeople.getSex() != null) {
|
||||||
|
stream = stream.filter(people -> people.getSex().equals(tbPeople.getSex()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收集过滤后的结果
|
||||||
|
peopleList = stream.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
return peopleList;
|
return peopleList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,11 @@ public class TbTeamServiceImpl implements TbTeamService {
|
||||||
if (tbTeamDao.getList(id).size() > 0) {
|
if (tbTeamDao.getList(id).size() > 0) {
|
||||||
return AjaxResult.error(ExceptionEnum.EXISTENCE_OF_MEMBERS.getCode(), ExceptionEnum.EXISTENCE_OF_MEMBERS.getMsg());
|
return AjaxResult.error(ExceptionEnum.EXISTENCE_OF_MEMBERS.getCode(), ExceptionEnum.EXISTENCE_OF_MEMBERS.getMsg());
|
||||||
}
|
}
|
||||||
|
//根据id查询该班组长是否绑定安全帽,绑定则不允许解散
|
||||||
|
Long devId = tbTeamDao.selectByDevId(id);
|
||||||
|
if (devId != null) {
|
||||||
|
return AjaxResult.error(ExceptionEnum.EXISTENCE_OF_HELMET.getCode(), ExceptionEnum.EXISTENCE_OF_HELMET.getMsg());
|
||||||
|
}
|
||||||
int result = tbTeamDao.updateById(id);
|
int result = tbTeamDao.updateById(id);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
return AjaxResult.success(ExceptionEnum.SUCCESS.getMsg(), result);
|
return AjaxResult.success(ExceptionEnum.SUCCESS.getMsg(), result);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import com.bonus.base.mapper.TbDeviceMapper;
|
||||||
import com.bonus.base.mapper.TbProDepartMapper;
|
import com.bonus.base.mapper.TbProDepartMapper;
|
||||||
import com.bonus.base.mapper.TbProjectMapper;
|
import com.bonus.base.mapper.TbProjectMapper;
|
||||||
import com.bonus.base.mapper.TbTeamMapper;
|
import com.bonus.base.mapper.TbTeamMapper;
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.screen.mapper.TbDeviceDataRecord;
|
import com.bonus.screen.mapper.TbDeviceDataRecord;
|
||||||
import com.bonus.screen.vo.*;
|
import com.bonus.screen.vo.*;
|
||||||
|
|
@ -111,6 +113,9 @@ public class ProjectViewServiceImpl {
|
||||||
List<TeamJoinPersonVo> teamList = new ArrayList<>();
|
List<TeamJoinPersonVo> teamList = new ArrayList<>();
|
||||||
|
|
||||||
for (TeamJoinPersonVo teamJoinPersonVo : teamPersonList) {
|
for (TeamJoinPersonVo teamJoinPersonVo : teamPersonList) {
|
||||||
|
if (StringUtils.isNotBlank(teamJoinPersonVo.getPeoplePhone())) {
|
||||||
|
teamJoinPersonVo.setPeoplePhone(Sm4Utils.decode(teamJoinPersonVo.getPeoplePhone()));
|
||||||
|
}
|
||||||
// 查找是否已有此班组
|
// 查找是否已有此班组
|
||||||
TeamJoinPersonVo isExist = findTeamById(teamList, teamJoinPersonVo.getTeamId());
|
TeamJoinPersonVo isExist = findTeamById(teamList, teamJoinPersonVo.getTeamId());
|
||||||
// NEW一个 TeamJoinPersonVo 对象
|
// NEW一个 TeamJoinPersonVo 对象
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,6 @@
|
||||||
WHERE tt.id = #{id}
|
WHERE tt.id = #{id}
|
||||||
ORDER BY delFlag
|
ORDER BY delFlag
|
||||||
</if>
|
</if>
|
||||||
<if test="relName != null and relName != ''">
|
|
||||||
and tp.rel_name like concat('%',#{relName},'%')
|
|
||||||
</if>
|
|
||||||
<if test="sex != null">
|
|
||||||
and tp.sex = #{sex}
|
|
||||||
</if>
|
|
||||||
/**
|
/**
|
||||||
* 班组长条件筛选,一个班组长只可带领一个组,班组员条件筛选,一个组员只可在一个班组
|
* 班组长条件筛选,一个班组长只可带领一个组,班组员条件筛选,一个组员只可在一个班组
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -245,5 +245,15 @@
|
||||||
ORDER BY
|
ORDER BY
|
||||||
t.id, p.id;
|
t.id, p.id;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByDevId" resultType="java.lang.Long">
|
||||||
|
SELECT
|
||||||
|
tp.dev_id
|
||||||
|
FROM
|
||||||
|
tb_people tp
|
||||||
|
LEFT JOIN tb_team tt ON tp.id = tt.rel_id
|
||||||
|
WHERE
|
||||||
|
tt.id = #{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue