|
@@ -4315,20 +4315,31 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
|
|
@ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
|
|
})
|
|
})
|
|
- public R rmTabDataInfo(Long pkeyId) {
|
|
|
|
- WbsTreeContract wbsInfo = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
- .eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
|
-
|
|
|
|
- if (wbsInfo != null) {
|
|
|
|
- String tabName = wbsInfo.getInitTableName();
|
|
|
|
- if (StringUtils.isNotEmpty(tabName)) {
|
|
|
|
- String delSql = "delete from " + tabName + " where p_key_id = " + pkeyId;
|
|
|
|
- jdbcTemplate.execute(delSql);
|
|
|
|
|
|
+ public R rmTabDataInfo(Long pkeyId,Integer type) {
|
|
|
|
+ if(type==1){
|
|
|
|
+ WbsTreeContract wbsInfo = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
+ .eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
|
+ if (wbsInfo != null) {
|
|
|
|
+ String tabName = wbsInfo.getInitTableName();
|
|
|
|
+ if (StringUtils.isNotEmpty(tabName)) {
|
|
|
|
+ String delSql = "delete from " + tabName + " where p_key_id = " + pkeyId;
|
|
|
|
+ jdbcTemplate.execute(delSql);
|
|
|
|
+ } else {
|
|
|
|
+ return R.fail("获取InitTableName失败!");
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- return R.fail("获取InitTableName失败!");
|
|
|
|
|
|
+ return R.fail("获取数据失败!");
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ String sql="select * from m_wbs_tree_contract where p_id=(select p_id from m_wbs_tree_contract where p_key_id= "+pkeyId+")";
|
|
|
|
+ List<WbsTreeContract> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
|
+ for (WbsTreeContract wbsTreeContract : list) {
|
|
|
|
+ String tabName = wbsTreeContract.getInitTableName();
|
|
|
|
+ if (StringUtils.isNotEmpty(tabName)) {
|
|
|
|
+ String delSql = "delete from " + tabName + " where p_key_id = " + wbsTreeContract.getPKeyId();
|
|
|
|
+ jdbcTemplate.execute(delSql);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- return R.fail("获取数据失败!");
|
|
|
|
}
|
|
}
|
|
return R.data("成功!");
|
|
return R.data("成功!");
|
|
}
|
|
}
|