APP领用管理
This commit is contained in:
parent
0d817ced28
commit
722dcbfa45
|
|
@ -35,6 +35,9 @@ public class BusinessConstants {
|
|||
public final static String TEAM = "team";
|
||||
/** 项目部角色*/
|
||||
public final static String DEPART = "depart";
|
||||
/** 在施状态值*/
|
||||
public final static Integer WORK_STATUS = 0;
|
||||
|
||||
|
||||
public final static Integer CELL_1 = 1;
|
||||
public final static Integer CELL_2 = 2;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class TeamPeopleVo {
|
|||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 施工状态 0 未施工 1在施
|
||||
* 施工状态 1 未施工 0在施
|
||||
*/
|
||||
private Integer workStatus;
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class TeamMgeController extends BaseController {
|
|||
|
||||
// @RequiresPermissions("basic:team:del")
|
||||
@PostMapping("delTeam")
|
||||
@SysLog(title = "班组管理", businessType = OperaType.QUERY, logType = 0, module = "基础管理->班组管理", details = "bian班组")
|
||||
@SysLog(title = "班组管理", businessType = OperaType.QUERY, logType = 0, module = "基础管理->班组管理", details = "删除班组")
|
||||
public AjaxResult delTeam(@RequestBody BraceletParamsDto dto) {
|
||||
return service.delTeam(dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,4 +150,6 @@ public interface TeamMgeMapper {
|
|||
* @date 2024/7/17 18:37
|
||||
*/
|
||||
List<TeamPeopleVo> getWorkPersonList(BraceletParamsDto dto);
|
||||
|
||||
int existworkPerson(BraceletParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,14 @@ public class TeamMgeServiceImpl implements ITeamMgeService {
|
|||
TeamVo teamVo = new TeamVo();
|
||||
teamVo.setTeamId(dto.getId());
|
||||
// 班组下有在施工人员,无法删除
|
||||
List<TeamPeopleVo> workPersonList = getWorkPersonList(dto);
|
||||
if(CollectionUtils.isNotEmpty(workPersonList)){
|
||||
for (TeamPeopleVo teamPeopleVo : workPersonList) {
|
||||
if(Objects.equals(teamPeopleVo.getWorkStatus(), BusinessConstants.WORK_STATUS)){
|
||||
return AjaxResult.error("班组下有施工中人员,无法解散班组");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 清空班组下的人员
|
||||
mapper.updatePersonsByTeamId(teamVo);
|
||||
mapper.dissolutionTeam(dto);
|
||||
|
|
@ -202,4 +210,5 @@ public class TeamMgeServiceImpl implements ITeamMgeService {
|
|||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
twt.team_status AS teamStatus,
|
||||
twt.create_time AS createTime,
|
||||
tp.pro_name AS proName,
|
||||
twt.pro_id AS proId
|
||||
twt.pro_id AS proId,
|
||||
twt.js_time AS jsTime
|
||||
FROM t_work_team twt
|
||||
LEFT JOIN tb_project tp ON twt.pro_id = tp.id AND twt.del_flag = 0
|
||||
WHERE twt.del_flag = 0
|
||||
|
|
@ -92,11 +93,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getWorkNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
FROM tb_people tp
|
||||
WHERE team_id = #{teamId} AND del_flag = 0
|
||||
INNER JOIN tb_bracelet tb ON tp.id = tb.bid_id AND tb.del_flag = 0
|
||||
WHERE tp.team_id = #{teamId} AND tp.del_flag = 0
|
||||
UNION ALL
|
||||
SELECT COUNT(*)
|
||||
FROM tb_people tp
|
||||
WHERE team_id = #{teamId} AND del_flag = 0
|
||||
LEFT JOIN tb_bracelet tb ON tp.id = tb.bid_id AND tb.del_flag = 0
|
||||
WHERE tp.team_id = #{teamId} AND tb.id IS NULL AND tp.del_flag = 0
|
||||
</select>
|
||||
<!--判断班组名称是否存在-->
|
||||
<select id="isExist" resultType="java.lang.Integer">
|
||||
|
|
@ -145,8 +148,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tp.id_card AS idCard,
|
||||
tp.phone,
|
||||
tp.sex,
|
||||
0 AS workStatus
|
||||
IF(tb.id IS NULL,1,0) AS workStatus,
|
||||
tb.sh_code AS braceletCode
|
||||
FROM tb_people tp
|
||||
LEFT JOIN tb_bracelet tb ON tp.id = tb.bid_id AND tb.del_flag = 0
|
||||
WHERE tp.team_id = #{teamId} AND tp.del_flag = 0
|
||||
<if test="name != null and name!=''">
|
||||
AND INSTR(tp.name,#{name}) > 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue