bug修复
This commit is contained in:
parent
7985bd903a
commit
a5e28a3ea2
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class PmSubComController extends BaseController {
|
|||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("公司下面存在未删除的分公司");
|
||||
return error("分公司下面存在未删除的项目部");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -37,4 +37,11 @@ public interface PmPostTypeMapper {
|
|||
* @return
|
||||
*/
|
||||
List<PmPostType> selectPostTypeListAll(PmPostType pmPostType);
|
||||
|
||||
/**
|
||||
* 查看是否绑定人员
|
||||
* @param pmPostType
|
||||
* @return
|
||||
*/
|
||||
int countNumByTypeId(PmPostType pmPostType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue