fix: 代码生成 review todo 修改
This commit is contained in:
parent
b7ab10305f
commit
c26c4414b4
|
@ -65,7 +65,7 @@ public class Demo01ContactController {
|
||||||
@Operation(summary = "批量删除示例联系人")
|
@Operation(summary = "批量删除示例联系人")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:demo01-contact:delete')")
|
@PreAuthorize("@ss.hasPermission('infra:demo01-contact:delete')")
|
||||||
public CommonResult<Boolean> deleteDemo0iContactList(@RequestParam("ids") List<Long> ids) {
|
public CommonResult<Boolean> deleteDemo0iContactList(@RequestParam("ids") List<Long> ids) {
|
||||||
demo01ContactService.deleteDemo0iContactListByIds(ids);
|
demo01ContactService.deleteDemo0iContactList(ids);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,7 @@ public class Demo03StudentErpController {
|
||||||
@Operation(summary = "批量删除学生")
|
@Operation(summary = "批量删除学生")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||||
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
||||||
// TODO @puhui999:deleteDemo03StudentList
|
demo03StudentErpService.deleteDemo03StudentList(ids);
|
||||||
demo03StudentErpService.deleteDemo03StudentListByIds(ids);
|
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +141,7 @@ public class Demo03StudentErpController {
|
||||||
@Operation(summary = "批量删除学生课程")
|
@Operation(summary = "批量删除学生课程")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||||
public CommonResult<Boolean> deleteDemo03CourseList(@RequestParam("ids") List<Long> ids) {
|
public CommonResult<Boolean> deleteDemo03CourseList(@RequestParam("ids") List<Long> ids) {
|
||||||
demo03StudentErpService.deleteDemo03CourseListByIds(ids);
|
demo03StudentErpService.deleteDemo03CourseList(ids);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +193,7 @@ public class Demo03StudentErpController {
|
||||||
@Operation(summary = "批量删除学生班级")
|
@Operation(summary = "批量删除学生班级")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||||
public CommonResult<Boolean> deleteDemo03GradeList(@RequestParam("ids") List<Long> ids) {
|
public CommonResult<Boolean> deleteDemo03GradeList(@RequestParam("ids") List<Long> ids) {
|
||||||
demo03StudentErpService.deleteDemo03GradeListByIds(ids);
|
demo03StudentErpService.deleteDemo03GradeList(ids);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class Demo03StudentInnerController {
|
||||||
@Operation(summary = "批量删除学生")
|
@Operation(summary = "批量删除学生")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||||
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
||||||
demo03StudentInnerService.deleteDemo03StudentListByIds(ids);
|
demo03StudentInnerService.deleteDemo03StudentList(ids);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class Demo03StudentNormalController {
|
||||||
@Operation(summary = "批量删除学生")
|
@Operation(summary = "批量删除学生")
|
||||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||||
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
||||||
demo03StudentNormalService.deleteDemo03StudentListByIds(ids);
|
demo03StudentNormalService.deleteDemo03StudentList(ids);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public interface Demo01ContactService {
|
||||||
*
|
*
|
||||||
* @param ids 编号
|
* @param ids 编号
|
||||||
*/
|
*/
|
||||||
void deleteDemo0iContactListByIds(List<Long> ids);
|
void deleteDemo0iContactList(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得示例联系人
|
* 获得示例联系人
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class Demo01ContactServiceImpl implements Demo01ContactService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteDemo0iContactListByIds(List<Long> ids) {
|
public void deleteDemo0iContactList(List<Long> ids) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateDemo01ContactExists(ids);
|
validateDemo01ContactExists(ids);
|
||||||
// 删除
|
// 删除
|
||||||
|
|
|
@ -45,7 +45,7 @@ public interface Demo03StudentErpService {
|
||||||
*
|
*
|
||||||
* @param ids 编号
|
* @param ids 编号
|
||||||
*/
|
*/
|
||||||
void deleteDemo03StudentListByIds(List<Long> ids);
|
void deleteDemo03StudentList(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得学生
|
* 获得学生
|
||||||
|
@ -101,7 +101,7 @@ public interface Demo03StudentErpService {
|
||||||
*
|
*
|
||||||
* @param ids 编号
|
* @param ids 编号
|
||||||
*/
|
*/
|
||||||
void deleteDemo03CourseListByIds(List<Long> ids);
|
void deleteDemo03CourseList(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得学生课程
|
* 获得学生课程
|
||||||
|
@ -149,7 +149,7 @@ public interface Demo03StudentErpService {
|
||||||
*
|
*
|
||||||
* @param ids 编号
|
* @param ids 编号
|
||||||
*/
|
*/
|
||||||
void deleteDemo03GradeListByIds(List<Long> ids);
|
void deleteDemo03GradeList(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得学生班级
|
* 获得学生班级
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteDemo03StudentListByIds(List<Long> ids) {
|
public void deleteDemo03StudentList(List<Long> ids) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateDemo03StudentExists(ids);
|
validateDemo03StudentExists(ids);
|
||||||
// 删除
|
// 删除
|
||||||
|
@ -134,7 +134,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteDemo03CourseListByIds(List<Long> ids) {
|
public void deleteDemo03CourseList(List<Long> ids) {
|
||||||
// 删除
|
// 删除
|
||||||
demo03CourseErpMapper.deleteByIds(ids);
|
demo03CourseErpMapper.deleteByIds(ids);
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteDemo03GradeListByIds(List<Long> ids) {
|
public void deleteDemo03GradeList(List<Long> ids) {
|
||||||
// 删除
|
// 删除
|
||||||
demo03GradeErpMapper.deleteByIds(ids);
|
demo03GradeErpMapper.deleteByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public interface Demo03StudentInnerService {
|
||||||
*
|
*
|
||||||
* @param ids 编号
|
* @param ids 编号
|
||||||
*/
|
*/
|
||||||
void deleteDemo03StudentListByIds(List<Long> ids);
|
void deleteDemo03StudentList(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得学生
|
* 获得学生
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class Demo03StudentInnerServiceImpl implements Demo03StudentInnerService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteDemo03StudentListByIds(List<Long> ids) {
|
public void deleteDemo03StudentList(List<Long> ids) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateDemo03StudentExists(ids);
|
validateDemo03StudentExists(ids);
|
||||||
// 删除
|
// 删除
|
||||||
|
|
|
@ -44,7 +44,7 @@ public interface Demo03StudentNormalService {
|
||||||
*
|
*
|
||||||
* @param ids 编号
|
* @param ids 编号
|
||||||
*/
|
*/
|
||||||
void deleteDemo03StudentListByIds(List<Long> ids);
|
void deleteDemo03StudentList(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得学生
|
* 获得学生
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalServic
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteDemo03StudentListByIds(List<Long> ids) {
|
public void deleteDemo03StudentList(List<Long> ids) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateDemo03StudentExists(ids);
|
validateDemo03StudentExists(ids);
|
||||||
// 删除
|
// 删除
|
||||||
|
|
|
@ -65,10 +65,13 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||||
#end
|
#end
|
||||||
// 插入
|
// 插入
|
||||||
#if ($voType == 10)
|
#if ($voType == 10)
|
||||||
## TODO @puhui999:insert 也要加下 clean。万一前端乱传递,哈哈哈。这个就是 do 模式的缺点;(只在 do 模式下);看看主子表,是不是也可能存在,insert 的时候;
|
|
||||||
${table.className}DO ${classNameVar} = BeanUtils.toBean(createReqVO, ${table.className}DO.class);
|
${table.className}DO ${classNameVar} = BeanUtils.toBean(createReqVO, ${table.className}DO.class);
|
||||||
#end
|
|
||||||
${classNameVar}Mapper.insert(${classNameVar});
|
${classNameVar}Mapper.insert(${classNameVar});
|
||||||
|
#else
|
||||||
|
${saveReqVOVar}.clean() // 清理掉创建、更新时间等相关属性值
|
||||||
|
${classNameVar}Mapper.insert(${saveReqVOVar});
|
||||||
|
#end
|
||||||
|
|
||||||
## 特殊:主子表专属逻辑(非 ERP 模式)
|
## 特殊:主子表专属逻辑(非 ERP 模式)
|
||||||
#if ( $subTables && $subTables.size() > 0 && $table.templateType != 11 )
|
#if ( $subTables && $subTables.size() > 0 && $table.templateType != 11 )
|
||||||
|
|
||||||
|
@ -112,6 +115,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||||
${table.className}DO updateObj = BeanUtils.toBean(updateReqVO, ${table.className}DO.class);
|
${table.className}DO updateObj = BeanUtils.toBean(updateReqVO, ${table.className}DO.class);
|
||||||
${classNameVar}Mapper.updateById(updateObj);
|
${classNameVar}Mapper.updateById(updateObj);
|
||||||
#else
|
#else
|
||||||
|
${updateReqVOVar}.clean() // 清理掉创建、更新时间等相关属性值
|
||||||
${classNameVar}Mapper.updateById(${updateReqVOVar});
|
${classNameVar}Mapper.updateById(${updateReqVOVar});
|
||||||
#end
|
#end
|
||||||
## 特殊:主子表专属逻辑(非 ERP 模式)
|
## 特殊:主子表专属逻辑(非 ERP 模式)
|
||||||
|
@ -320,6 +324,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||||
}
|
}
|
||||||
// 插入
|
// 插入
|
||||||
#end
|
#end
|
||||||
|
${subClassNameVar}.clean() // 清理掉创建、更新时间等相关属性值
|
||||||
${subClassNameVars.get($index)}Mapper.insert(${subClassNameVar});
|
${subClassNameVars.get($index)}Mapper.insert(${subClassNameVar});
|
||||||
return ${subClassNameVar}.getId();
|
return ${subClassNameVar}.getId();
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,6 @@ export function export${simpleClassName}(params: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
## 特殊:主子表专属逻辑
|
## 特殊:主子表专属逻辑
|
||||||
## TODO @puhui999:下面这块缩进调整了,会乱掉么?
|
|
||||||
#foreach ($subTable in $subTables)
|
#foreach ($subTable in $subTables)
|
||||||
#set ($index = $foreach.count - 1)
|
#set ($index = $foreach.count - 1)
|
||||||
#set ($subSimpleClassName = $subSimpleClassNames.get($index))
|
#set ($subSimpleClassName = $subSimpleClassNames.get($index))
|
||||||
|
@ -115,54 +114,54 @@ export function export${simpleClassName}(params: any) {
|
||||||
|
|
||||||
// ==================== 子表($subTable.classComment) ====================
|
// ==================== 子表($subTable.classComment) ====================
|
||||||
|
|
||||||
## 情况一:MASTER_ERP 时,需要分查询页子表
|
## 情况一:MASTER_ERP 时,需要分查询页子表
|
||||||
#if ( $table.templateType == 11 )
|
#if ( $table.templateType == 11 )
|
||||||
/** 获得${subTable.classComment}分页 */
|
/** 获得${subTable.classComment}分页 */
|
||||||
export function get${subSimpleClassName}Page(params: PageParam) {
|
export function get${subSimpleClassName}Page(params: PageParam) {
|
||||||
return requestClient.get<PageResult<${simpleClassName}Api.${subSimpleClassName}>>(`${baseURL}/${subSimpleClassName_strikeCase}/page`, { params });
|
return requestClient.get<PageResult<${simpleClassName}Api.${subSimpleClassName}>>(`${baseURL}/${subSimpleClassName_strikeCase}/page`, { params });
|
||||||
}
|
}
|
||||||
## 情况二:非 MASTER_ERP 时,需要列表查询子表
|
## 情况二:非 MASTER_ERP 时,需要列表查询子表
|
||||||
#else
|
#else
|
||||||
#if ( $subTable.subJoinMany )
|
#if ( $subTable.subJoinMany )
|
||||||
/** 获得${subTable.classComment}列表 */
|
/** 获得${subTable.classComment}列表 */
|
||||||
export function get${subSimpleClassName}ListBy${SubJoinColumnName}(${subJoinColumn.javaField}: number) {
|
export function get${subSimpleClassName}ListBy${SubJoinColumnName}(${subJoinColumn.javaField}: number) {
|
||||||
return requestClient.get<${simpleClassName}Api.${subSimpleClassName}[]>(`${baseURL}/${subSimpleClassName_strikeCase}/list-by-${subJoinColumn_strikeCase}?${subJoinColumn.javaField}=${${subJoinColumn.javaField}}`);
|
return requestClient.get<${simpleClassName}Api.${subSimpleClassName}[]>(`${baseURL}/${subSimpleClassName_strikeCase}/list-by-${subJoinColumn_strikeCase}?${subJoinColumn.javaField}=${${subJoinColumn.javaField}}`);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/** 获得${subTable.classComment} */
|
/** 获得${subTable.classComment} */
|
||||||
export function get${subSimpleClassName}By${SubJoinColumnName}(${subJoinColumn.javaField}: number) {
|
export function get${subSimpleClassName}By${SubJoinColumnName}(${subJoinColumn.javaField}: number) {
|
||||||
return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get-by-${subJoinColumn_strikeCase}?${subJoinColumn.javaField}=${${subJoinColumn.javaField}}`);
|
return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get-by-${subJoinColumn_strikeCase}?${subJoinColumn.javaField}=${${subJoinColumn.javaField}}`);
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
## 特殊:MASTER_ERP 时,支持单个的新增、修改、删除操作
|
## 特殊:MASTER_ERP 时,支持单个的新增、修改、删除操作
|
||||||
#if ( $table.templateType == 11 )
|
#if ( $table.templateType == 11 )
|
||||||
/** 新增${subTable.classComment} */
|
/** 新增${subTable.classComment} */
|
||||||
export function create${subSimpleClassName}(data: ${simpleClassName}Api.${subSimpleClassName}) {
|
export function create${subSimpleClassName}(data: ${simpleClassName}Api.${subSimpleClassName}) {
|
||||||
return requestClient.post(`${baseURL}/${subSimpleClassName_strikeCase}/create`, data);
|
return requestClient.post(`${baseURL}/${subSimpleClassName_strikeCase}/create`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改${subTable.classComment} */
|
/** 修改${subTable.classComment} */
|
||||||
export function update${subSimpleClassName}(data: ${simpleClassName}Api.${subSimpleClassName}) {
|
export function update${subSimpleClassName}(data: ${simpleClassName}Api.${subSimpleClassName}) {
|
||||||
return requestClient.put(`${baseURL}/${subSimpleClassName_strikeCase}/update`, data);
|
return requestClient.put(`${baseURL}/${subSimpleClassName_strikeCase}/update`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除${subTable.classComment} */
|
/** 删除${subTable.classComment} */
|
||||||
export function delete${subSimpleClassName}(id: number) {
|
export function delete${subSimpleClassName}(id: number) {
|
||||||
return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete?id=${id}`);
|
return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ($deleteBatchEnable)
|
#if ($deleteBatchEnable)
|
||||||
/** 批量删除${subTable.classComment} */
|
/** 批量删除${subTable.classComment} */
|
||||||
export function delete${subSimpleClassName}List(ids: number[]) {
|
export function delete${subSimpleClassName}List(ids: number[]) {
|
||||||
return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete-list?ids=${ids.join(',')}`)
|
return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete-list?ids=${ids.join(',')}`)
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
/** 获得${subTable.classComment} */
|
/** 获得${subTable.classComment} */
|
||||||
export function get${subSimpleClassName}(id: number) {
|
export function get${subSimpleClassName}(id: number) {
|
||||||
return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get?id=${id}`);
|
return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get?id=${id}`);
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue