周计划子项禁止删除

This commit is contained in:
zhanglipeng 2021-09-05 16:53:26 +08:00
parent 54518511d2
commit 64471c4c8b
6 changed files with 45 additions and 9 deletions

View File

@ -102,7 +102,7 @@
v-show="isShow"
>填充</el-button
>
<el-button
<!-- <el-button
type="danger"
icon="el-icon-delete"
size="mini"
@ -111,7 +111,7 @@
v-hasPermi="['benyi:themeweekplan:remove']"
v-show="isShow"
>删除</el-button
>
> -->
</div>
<el-table
@ -168,7 +168,7 @@
v-show="isShow"
>填充</el-button
>
<el-button
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@ -176,7 +176,7 @@
v-hasPermi="['benyi:themeweekplan:remove']"
v-show="isShow"
>删除</el-button
>
> -->
</template>
</el-table-column>
</el-table>

View File

@ -112,11 +112,11 @@ public class ByThemeWeekplanController extends BaseController {
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
AjaxResult ajax=AjaxResult.success();
ByThemeWeekplan byThemeWeekplan=byThemeWeekplanService.selectByThemeWeekplanById(id);
AjaxResult ajax = AjaxResult.success();
ByThemeWeekplan byThemeWeekplan = byThemeWeekplanService.selectByThemeWeekplanById(id);
ajax.put(AjaxResult.DATA_TAG, byThemeWeekplan);
ajax.put("classname",byClassService.selectByClassById(byThemeWeekplan.getClassid()).getBjmc());
ajax.put("createusername",userService.selectUserById(byThemeWeekplan.getCreateuserid()).getNickName());
ajax.put("classname", byClassService.selectByClassById(byThemeWeekplan.getClassid()).getBjmc());
ajax.put("createusername", userService.selectUserById(byThemeWeekplan.getCreateuserid()).getNickName());
return ajax;
}
@ -134,7 +134,7 @@ public class ByThemeWeekplanController extends BaseController {
String bjtypeNew = byClassService.selectByClassById(classId).getBjtype();
if (bjtypeNew.equals("1")) {
return AjaxResult.error("当前班级为托班,无法创建计划");
}else {
} else {
//判断当前班级是否创建月计划
ByThemeMonthplan byThemeMonthplan = new ByThemeMonthplan();
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
@ -224,6 +224,10 @@ public class ByThemeWeekplanController extends BaseController {
@Log(title = "主题整合周计划(根据月计划明细)", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
//先删除子项
for (int i = 0; i < ids.length; i++) {
byThemeWeekplanitemService.deleteByThemeWeekplanitemByPId(ids[i]);
}
return toAjax(byThemeWeekplanService.deleteByThemeWeekplanByIds(ids));
}

View File

@ -58,4 +58,12 @@ public interface ByThemeWeekplanitemMapper {
* @return 结果
*/
public int deleteByThemeWeekplanitemByIds(Long[] ids);
/**
* 删除主题整合周计划明细信息
*
* @param pid 主题周计划主键
* @return 结果
*/
public int deleteByThemeWeekplanitemByPId(String pid);
}

View File

@ -58,4 +58,13 @@ public interface IByThemeWeekplanitemService {
* @return 结果
*/
public int deleteByThemeWeekplanitemById(Long id);
/**
* 删除主题整合周计划明细信息
*
* @param pid 主题周计划主键
* @return 结果
*/
public int deleteByThemeWeekplanitemByPId(String pid);
}

View File

@ -87,4 +87,15 @@ public class ByThemeWeekplanitemServiceImpl implements IByThemeWeekplanitemServi
public int deleteByThemeWeekplanitemById(Long id) {
return byThemeWeekplanitemMapper.deleteByThemeWeekplanitemById(id);
}
/**
* 删除主题整合周计划明细信息
*
* @param pid 主题周计划主键
* @return 结果
*/
@Override
public int deleteByThemeWeekplanitemByPId(String pid) {
return byThemeWeekplanitemMapper.deleteByThemeWeekplanitemByPId(pid);
}
}

View File

@ -92,6 +92,10 @@
delete from by_theme_weekplanitem where id = #{id}
</delete>
<delete id="deleteByThemeWeekplanitemByPId" parameterType="String">
delete from by_theme_weekplanitem where wpid = #{wpid}
</delete>
<delete id="deleteByThemeWeekplanitemByIds" parameterType="String">
delete from by_theme_weekplanitem where id in
<foreach item="id" collection="array" open="(" separator="," close=")">