|
|
@@ -1154,4 +1154,33 @@ public class WbsTreePrivateController extends BladeController {
|
|
|
IPage<TreeNodeVOByTabType> page = wbsTreePrivateService.tabTypeLazyTreeByProject(Condition.getPage(query), parentId, projectId, titleName);
|
|
|
return R.data(page);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置/取消 表单默认隐藏
|
|
|
+ */
|
|
|
+ @GetMapping("/showTable")
|
|
|
+ @ApiOperationSupport(order = 41)
|
|
|
+ @ApiOperation(value = "设置/取消 表单默认隐藏", notes = "传入表单的pKeyId")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "pKeyId", value = "表单的pKeyId", required = true)})
|
|
|
+ public R<Boolean> showTable(Long pKeyId) {
|
|
|
+ if (pKeyId == null) {
|
|
|
+ return R.fail("参数错误");
|
|
|
+ }
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().select(WbsTreePrivate::getPKeyId, WbsTreePrivate::getDefaultConceal, WbsTreePrivate::getProjectId)
|
|
|
+ .eq(WbsTreePrivate::getPKeyId, pKeyId).ne(WbsTreePrivate::getType, 1));
|
|
|
+ if (wbsTreePrivate == null) {
|
|
|
+ return R.fail("选择的表单不存在");
|
|
|
+ }
|
|
|
+ int isDefaultConceal = 0;
|
|
|
+ if (wbsTreePrivate.getDefaultConceal() == null || wbsTreePrivate.getDefaultConceal() == 0) {
|
|
|
+ isDefaultConceal = 1;
|
|
|
+ }
|
|
|
+ boolean update = wbsTreePrivateService.update(Wrappers.<WbsTreePrivate>lambdaUpdate().eq(WbsTreePrivate::getPKeyId, pKeyId).set(WbsTreePrivate::getDefaultConceal, isDefaultConceal).set(WbsTreePrivate::getIsBussShow, isDefaultConceal + 1));
|
|
|
+ if ( update) {
|
|
|
+ jdbcTemplate.execute("update m_wbs_tree_contract set is_buss_show = " + (isDefaultConceal + 1) + " where is_deleted = 0 and is_type_private_pid = " + pKeyId + " and project_id = " + wbsTreePrivate.getProjectId());
|
|
|
+ }
|
|
|
+ return R.data(update);
|
|
|
+ }
|
|
|
}
|