|
|
|
|
@ -9,6 +9,7 @@ import com.enjoy.common.core.constant.HttpStatus;
|
|
|
|
|
import com.enjoy.common.core.web.page.TableDataInfo;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
@ -37,6 +38,7 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|
|
|
|
private InternationalizationService internationalizationService;
|
|
|
|
|
/**
|
|
|
|
|
* 分页
|
|
|
|
|
* return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo pageList(Query${entityName}VO query${entityName}VO){
|
|
|
|
|
@ -71,8 +73,38 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|
|
|
|
rspData.setTotal(0);
|
|
|
|
|
return rspData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 全部
|
|
|
|
|
* return
|
|
|
|
|
*/
|
|
|
|
|
public AjaxResult listAll(){
|
|
|
|
|
List<${entityName}DTO> list=new ArrayList();
|
|
|
|
|
QueryWrapper<${entityName}> queryWrapper=new QueryWrapper();
|
|
|
|
|
List<${entityName}> dbEntityList = this.list(queryWrapper);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(dbEntityList)) {
|
|
|
|
|
dbEntityList.stream().forEach(entity->{
|
|
|
|
|
${entityName}DTO ${uncap_first}DTO=new ${entityName}DTO();
|
|
|
|
|
BeanHkUtils.copyProperties(entity,${uncap_first}DTO);
|
|
|
|
|
list.add(${uncap_first}DTO);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取详情信息
|
|
|
|
|
* return
|
|
|
|
|
*/
|
|
|
|
|
public AjaxResult get${entityName}Detail(String id){
|
|
|
|
|
${entityName}DTO ${uncap_first}DTO=new ${entityName}DTO();
|
|
|
|
|
${uncap_first}DTO =(${entityName}DTO) BeanHkUtils.copyProperties(this.getById(id),${uncap_first}DTO);
|
|
|
|
|
return AjaxResult.success(${uncap_first}DTO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增
|
|
|
|
|
* @param add${entityName}PVO
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult save${entityName}PVO(Add${entityName}PVO add${entityName}PVO){
|
|
|
|
|
@ -83,6 +115,7 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 编辑
|
|
|
|
|
* @param edit${entityName}PVO
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult modify${entityName}PVO(Edit${entityName}PVO edit${entityName}PVO){
|
|
|
|
|
@ -91,4 +124,32 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|
|
|
|
this.updateById(${uncap_first});
|
|
|
|
|
return AjaxResult.success("编辑成功!");
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 删除
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult delete${entityName}(String id){
|
|
|
|
|
UpdateWrapper<${entityName}> updateWrapper=new UpdateWrapper();
|
|
|
|
|
updateWrapper.set("del_flag","1");
|
|
|
|
|
updateWrapper.eq("id",id);
|
|
|
|
|
this.update(updateWrapper);
|
|
|
|
|
return AjaxResult.success("删除成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量删除
|
|
|
|
|
* @param ids
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult delete${entityName}(List<String> ids){
|
|
|
|
|
if(!CollectionUtil.isNotEmpty(ids)){
|
|
|
|
|
return AjaxResult.error("id不可为空");
|
|
|
|
|
}
|
|
|
|
|
UpdateWrapper<${entityName}> updateWrapper=new UpdateWrapper();
|
|
|
|
|
updateWrapper.set("del_flag","1");
|
|
|
|
|
updateWrapper.in("id",ids);
|
|
|
|
|
this.update(updateWrapper);
|
|
|
|
|
return AjaxResult.success("删除成功!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|