diff --git a/bonus-modules/bonus-app/src/main/java/com/bonus/app/mapper/AppEquipmentReqMapper.java b/bonus-modules/bonus-app/src/main/java/com/bonus/app/mapper/AppEquipmentReqMapper.java
index 88c3f7b..1bf4d4d 100644
--- a/bonus-modules/bonus-app/src/main/java/com/bonus/app/mapper/AppEquipmentReqMapper.java
+++ b/bonus-modules/bonus-app/src/main/java/com/bonus/app/mapper/AppEquipmentReqMapper.java
@@ -115,4 +115,13 @@ public interface AppEquipmentReqMapper {
* @date 2024/8/7 14:53
*/
Long getTeamLeader(EquipmentReqDataVo vo);
+
+ /**
+ * 判断班组是否已经解散
+ * @param teamId
+ * @return int
+ * @author cwchen
+ * @date 2024/8/19 10:04
+ */
+ int isTeamDissolve(Long teamId);
}
diff --git a/bonus-modules/bonus-app/src/main/java/com/bonus/app/service/impl/AppEquipmentReqServiceImpl.java b/bonus-modules/bonus-app/src/main/java/com/bonus/app/service/impl/AppEquipmentReqServiceImpl.java
index 9c4fcb6..af06d7f 100644
--- a/bonus-modules/bonus-app/src/main/java/com/bonus/app/service/impl/AppEquipmentReqServiceImpl.java
+++ b/bonus-modules/bonus-app/src/main/java/com/bonus/app/service/impl/AppEquipmentReqServiceImpl.java
@@ -58,6 +58,11 @@ public class AppEquipmentReqServiceImpl implements IAppEquipmentReqService {
if(!isDepartRoleCode){
return AjaxResult.error("非项目部角色,无领用设备权限");
}
+ // 判断班组是否已经解散
+ int isTeamDissolve = mapper.isTeamDissolve(vo.getTeamId());
+ if(isTeamDissolve == 0){
+ return AjaxResult.error("该班组已解散,无法领用设备");
+ }
if (CollectionUtils.isEmpty(vo.getList())) {
return AjaxResult.error("领用设备不能为空");
}
@@ -130,7 +135,7 @@ public class AppEquipmentReqServiceImpl implements IAppEquipmentReqService {
mapper.updateReturnDeviceData(dto,1);
}else if(Objects.equals(dto.getDevType(), BusinessConstants.AQM)){
// 设备类型为安全帽时,判断是否全部归还
- int result = mapper.isAllDeviceReturn(dto,1);
+ int result = mapper.isAllDeviceReturn(dto,2);
if(result > 0){
return AjaxResult.error("班组人员未归还安全帽设备");
}
diff --git a/bonus-modules/bonus-app/src/main/resources/mapper/AppEquipmentReqMapper.xml b/bonus-modules/bonus-app/src/main/resources/mapper/AppEquipmentReqMapper.xml
index 190e112..fb90465 100644
--- a/bonus-modules/bonus-app/src/main/resources/mapper/AppEquipmentReqMapper.xml
+++ b/bonus-modules/bonus-app/src/main/resources/mapper/AppEquipmentReqMapper.xml
@@ -72,37 +72,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
tdub.dev_id AS devId,
tdub.dev_type AS devType,
tdu.remarks,
- td.dev_code AS devCode,
- td.dev_name AS devName,
- tdub.ly_time AS lyTime,
- tdub.gh_time AS ghTime,
- sdd.dict_label AS deviceTypeName,
- twt.team_name AS teamName,
- twt.team_leader AS teamLeader,
- twt.leader_phone AS leaderPhone,
- tpp.power_name AS powerName,
- tp.pro_name AS proName,
- tpd.depart_name AS departName,
- tp.depart_id AS departId
- FROM tb_dev_use tdu
- LEFT JOIN t_work_team twt ON tdu.team_id = twt.team_id AND twt.del_flag = 0
- LEFT JOIN tb_project_power tpp ON tpp.id = tdu.gt_id AND tpp.del_flag = 0
- LEFT JOIN tb_project tp ON tp.id = tdu.pro_id AND tp.del_flag = 0
- LEFT JOIN tb_project_depart tpd ON tpd.id = tp.depart_id AND tpd.del_flag = 0
- LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
- LEFT JOIN tb_device td ON tdub.dev_id = td.id AND td.del_flag = 0
- LEFT JOIN sys_dict_data sdd ON td.dev_type = sdd.dict_value AND sdd.dict_type = 'sys_device_type'
- WHERE tdu.del_flag = 0 AND tdub.dev_type NOT IN ('shx')
-
- AND td.dev_type = #{devType}
-
- UNION ALL
- SELECT tdub.id,
- tdub.dev_id AS devId,
- tdub.dev_type AS devType,
- tdu.remarks,
- tsb.box_code AS devCode,
- tsb.box_name AS devName,
+ tdub.dev_code AS devCode,
+ tdub.dev_name AS devName,
tdub.ly_time AS lyTime,
tdub.gh_time AS ghTime,
sdd.dict_label AS deviceTypeName,
@@ -120,10 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN tb_project_depart tpd ON tpd.id = tp.depart_id AND tpd.del_flag = 0
LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
LEFT JOIN sys_dict_data sdd ON tdub.dev_type = sdd.dict_value AND sdd.dict_type = 'sys_device_type'
- LEFT JOIN tb_sh_box tsb ON tdub.dev_id = tsb.id AND tsb.del_flag = 0
- WHERE tdu.del_flag = 0 AND tdub.dev_type = 'shx'
-
- AND tsb.id = -1
+ WHERE tdu.del_flag = 0
+
+ AND tdub.dev_type = #{devType}
) a
@@ -143,10 +113,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND INSTR(a.devCode,#{devCode}) > 0
- AND DATE_FORMAT(a.lyTime,'%y%m%d') BETWEEN #{lyTime} AND #{lyTime}
+ AND DATE_FORMAT(a.lyTime,'%Y-%m-%d') BETWEEN #{lyTime} AND #{lyTime}
- AND DATE_FORMAT(a.ghTime,'%y%m%d') BETWEEN #{ghTime} AND #{ghTime}
+ AND DATE_FORMAT(a.ghTime,'%Y-%m-%d') BETWEEN #{ghTime} AND #{ghTime}
AND a.departId = -1
@@ -178,10 +148,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
\ No newline at end of file