Commit 52c20b14 authored by 赵啸非's avatar 赵啸非

修复部分sqlXml生成缺陷

parent 87eae6d2
package com.mortals.xhx.module.project.web;
import com.mortals.framework.exception.AppException;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,8 +24,6 @@ import java.util.List;
@RequestMapping("project")
public class ProjectController extends BaseCRUDJsonMappingController<ProjectService,ProjectForm,ProjectEntity,Long> {
@Autowired
private ParamService paramService;
@Autowired
private UploadService uploadService;
......@@ -38,6 +37,11 @@ public class ProjectController extends BaseCRUDJsonMappingController<ProjectServ
super.init(request, response, form, model, context);
}
@Override
protected void doListBefore(HttpServletRequest request, HttpServletResponse response, ProjectForm form, Map<String, Object> model, Context context) throws AppException {
super.doListBefore(request, response, form, model, context);
}
/**
* 工程文件下载
......
......@@ -77,9 +77,9 @@ public class ${ClassName}ServiceImpl extends ${Service}<${ClassName}Dao, ${Class
private void fillSubData(List<${ClassName}Entity> list) {
List<${pkColumn.javaType}> idList = list.stream().map(i -> i.get${pkColumn.javaField?cap_first}()).collect(Collectors.toList());
if(ObjectUtils.isEmpty(idList))return;
${subClassName}Query ${subclassName}Query = new ${subClassName}Query();
${subclassName}Query.set${subTableFkClassName}List(idList);
Map<${pkColumn.javaType}, List<${subClassName}Entity>> ${subclassName}ListMap = ${subclassName}Service.find(${subclassName}Query).stream().collect(Collectors.groupingBy(${subClassName}Entity::get${subTableFkClassName}));
Map<${pkColumn.javaType}, List<${subClassName}Entity>> ${subclassName}ListMap = ${subclassName}Service
.find(new ${subClassName}Query().${subTableFkClassName}List(idList)).parallelStream()
.collect(Collectors.groupingBy(${subClassName}Entity::get${subTableFkClassName}));
list.forEach(item -> item.set${subClassName}List(${subclassName}ListMap.get(item.get${pkColumn.javaField?cap_first}())));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment