|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package ${bussiPackage}.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.enjoy.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.enjoy.oqc.utils.BeanHkUtils;
|
|
|
|
|
import com.enjoy.oqc.utils.CollectionUtil;
|
|
|
|
|
import com.enjoy.common.core.i18n.InternationalizationService;
|
|
|
|
|
import com.enjoy.common.core.constant.Constants;
|
|
|
|
|
import com.enjoy.common.core.constant.HttpStatus;
|
|
|
|
@ -18,6 +20,8 @@ import ${bussiPackage}.dto.${entityName}DTO;
|
|
|
|
|
import ${bussiPackage}.vo.Query${entityName}VO;
|
|
|
|
|
import ${bussiPackage}.mapper.${entityName}Mapper;
|
|
|
|
|
import ${bussiPackage}.service.I${entityName}Service;
|
|
|
|
|
import ${bussiPackage}.vo.Add${entityName}PVO;
|
|
|
|
|
import ${bussiPackage}.vo.Edit${entityName}PVO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -47,7 +51,7 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|
|
|
|
</#if>
|
|
|
|
|
</#list>
|
|
|
|
|
List<${entityName}> dbEntityList = this.list(queryWrapper);
|
|
|
|
|
if(dbEntityList!=null &&dbEntityList.size()>0){
|
|
|
|
|
if (CollectionUtil.isNotEmpty(dbEntityList)) {
|
|
|
|
|
dbEntityList.stream().forEach(entity->{
|
|
|
|
|
${entityName}DTO ${uncap_first}DTO=new ${entityName}DTO();
|
|
|
|
|
BeanHkUtils.copyProperties(entity,${uncap_first}DTO);
|
|
|
|
@ -58,9 +62,33 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|
|
|
|
rspData.setRows(list);
|
|
|
|
|
rspData.setMsg(internationalizationService.getMessage(Constants.QUERY_SUCCESS));
|
|
|
|
|
rspData.setTotal(new PageInfo(list).getTotal());
|
|
|
|
|
return rspData;
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
log.error("获取 分页异常:",e);
|
|
|
|
|
}
|
|
|
|
|
rspData.setCode(HttpStatus.BAD_REQUEST);
|
|
|
|
|
rspData.setMsg(internationalizationService.getMessage(Constants.OPERATION_ERROR));
|
|
|
|
|
rspData.setTotal(0);
|
|
|
|
|
return rspData;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 新增
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult save${entityName}PVO(Add${entityName}PVO add${entityName}PVO){
|
|
|
|
|
${entityName} ${uncap_first}=new ${entityName}();
|
|
|
|
|
${uncap_first} =(${entityName}) BeanHkUtils.copyProperties(add${entityName}PVO,${uncap_first});
|
|
|
|
|
this.save(${uncap_first});
|
|
|
|
|
return AjaxResult.success("新增成功!");
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 编辑
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult modify${entityName}PVO(Edit${entityName}PVO edit${entityName}PVO){
|
|
|
|
|
${entityName} ${uncap_first}=new ${entityName}();
|
|
|
|
|
${uncap_first} =(${entityName}) BeanHkUtils.copyProperties(edit${entityName}PVO,${uncap_first});
|
|
|
|
|
this.updateById(${uncap_first});
|
|
|
|
|
return AjaxResult.success("编辑成功!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|