bug修复

This commit is contained in:
马三炮 2025-09-05 13:15:17 +08:00
parent 7985bd903a
commit a5e28a3ea2
5 changed files with 22 additions and 2 deletions

View File

@ -78,7 +78,12 @@ public class PmPostTypeController extends BaseController{
@SysLog(title = "工种类型管理", businessType = OperaType.UPDATE, logType = 0, module = "工种类型管理->工种类型删除")
public AjaxResult delPostType(@Validated @RequestBody PmPostType pmPostType) {
try {
return toAjax(pmPostTypeService.delPostType(pmPostType));
int res = pmPostTypeService.delPostType(pmPostType);
if (res>0){
return toAjax(res);
}else {
return error("工种已绑定人员");
}
} catch (Exception e) {
logger.error(e.toString(), e);
}

View File

@ -80,7 +80,7 @@ public class PmSubComController extends BaseController {
if (res>0){
return toAjax(res);
}else {
return error("公司下面存在未删除的分公司");
return error("分公司下面存在未删除的项目部");
}
} catch (Exception e) {

View File

@ -37,4 +37,11 @@ public interface PmPostTypeMapper {
* @return
*/
List<PmPostType> selectPostTypeListAll(PmPostType pmPostType);
/**
* 查看是否绑定人员
* @param pmPostType
* @return
*/
int countNumByTypeId(PmPostType pmPostType);
}

View File

@ -62,6 +62,11 @@ public class PmPostTypeServiceImpl implements PmPostTypeService {
*/
@Override
public int delPostType(PmPostType pmPostType) {
//查询是否绑定人员
int count = pmPostTypeMapper.countNumByTypeId(pmPostType);
if (count>0){
return 0;
}
return pmPostTypeMapper.delPostType(pmPostType);
}

View File

@ -48,4 +48,7 @@
AND post_name LIKE CONCAT('%', #{postName}, '%')
</if>
</select>
<select id="countNumByTypeId" resultType="java.lang.Integer">
select count(1) from bm_worker_ein_msg where post_id = #{id} and is_active='1'
</select>
</mapper>