完善注释,增加删除功能
parent
1ef4975539
commit
39919fc6bd
|
@ -27,9 +27,9 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* 主数据表头控制器
|
||||
*
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-06
|
||||
|
@ -112,9 +112,9 @@ public class SpTableManagerController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 主数据表头修改
|
||||
* 主数据表头修改+表字段明细修改
|
||||
*
|
||||
* @param record 平台表对象
|
||||
* @param record 平台表对象,表明细集合
|
||||
* @return 执行结果
|
||||
*/
|
||||
@ApiOperation("主数据表头修改")
|
||||
|
@ -142,6 +142,20 @@ public class SpTableManagerController extends BaseController {
|
|||
return Result.success(record.getId());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 级联删除主表头+明细
|
||||
*
|
||||
* @param req 请求参数
|
||||
* @return Result 执行结果
|
||||
*/
|
||||
@ApiOperation("级联删除主表头+明细")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "req", value = "表信息", defaultValue = "表信息")})
|
||||
@PostMapping("delete/by/tableNameId")
|
||||
@ResponseBody
|
||||
public Result deleteByTableNameId(SpTableManager req) throws Exception {
|
||||
iSpTableManagerService.removeById(req.getId());
|
||||
iSpTableManagerItemService.deleteItemBytableNameId(req.getId());
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
* 基础主数据,表明细控制器
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-06
|
||||
|
|
|
@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Param;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* 主数据表明细Mapper 接口
|
||||
*
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-06
|
||||
|
|
|
@ -7,9 +7,7 @@ import com.songpeng.sparchetype.basedata.entity.SpTableManagerItem;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
* 主数据表头Mapper 接口
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-06
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 主数据表明细服务类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 主数据表头服务类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 主数据表明细服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 主数据表头服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
|
|
|
@ -70,18 +70,18 @@
|
|||
}, {
|
||||
field: 'tableDesc', title: '业务描述', width: 130
|
||||
}, {
|
||||
field: 'createUsername', title: '创建用户', width: 130
|
||||
field: 'createUsername', title: '创建用户', width: 130
|
||||
}, {
|
||||
field: 'createTime', title: '创建时间', width: 160
|
||||
field: 'createTime', title: '创建时间', width: 160
|
||||
}, {
|
||||
field: 'updateUsername', title: '更改用户', width: 130
|
||||
field: 'updateUsername', title: '更改用户', width: 130
|
||||
}, {
|
||||
field: 'updateTime', title: '更改时间', width: 160
|
||||
field: 'updateTime', title: '更改时间', width: 160
|
||||
}, {
|
||||
field: 'isDeleted', title: '状态', width: 90, templet: function (records) {
|
||||
return spConfig.isDeletedDict[records.isDeleted];
|
||||
}
|
||||
}, {
|
||||
field: 'isDeleted', title: '状态', width: 90, templet: function (records) {
|
||||
return spConfig.isDeletedDict[records.isDeleted];
|
||||
}
|
||||
}, {
|
||||
fixed: 'right',
|
||||
field: 'operate',
|
||||
title: '操作',
|
||||
|
@ -163,12 +163,28 @@
|
|||
content: '${request.contextPath}/basedata/manager/add-or-update-ui'
|
||||
});
|
||||
}
|
||||
|
||||
// 删除
|
||||
if (obj.event === 'delete') {
|
||||
layer.confirm('确认要删除吗?', function (index) {
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
spUtil.ajax({
|
||||
url: '${request.contextPath}/basedata/manager/delete/by/tableNameId',
|
||||
async: false,
|
||||
type: 'POST',
|
||||
// 是否显示 loading
|
||||
showLoading: true,
|
||||
// 是否序列化参数
|
||||
serializable: false,
|
||||
// 参数
|
||||
data: {
|
||||
id : data.id
|
||||
},
|
||||
success: function (data) {
|
||||
tableIns.reload();
|
||||
layer.close(index);
|
||||
},
|
||||
error: function () {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue