提交 47435cd0 编写于 作者: sq3536's avatar sq3536

bug fix

上级 777a5d74
...@@ -428,10 +428,13 @@ public class EntityModel extends BaseModel { ...@@ -428,10 +428,13 @@ public class EntityModel extends BaseModel {
{ {
for(RelationshipModel rel:this.getReferences()) for(RelationshipModel rel:this.getReferences())
{ {
if(((PSDER1NImpl)rel.getDer()).getPSDER1NDEFieldMaps()==null)
continue;
if(rel.getRelEntity().getStorage().equals("NONE")) if(rel.getRelEntity().getStorage().equals("NONE"))
continue; continue;
if(!(rel.getDer() instanceof PSDER1NImpl))
continue;
if(((PSDER1NImpl)rel.getDer()).getPSDER1NDEFieldMaps()==null)
continue;
for(IPSDER1NDEFieldMap derField : ((PSDER1NImpl)rel.getDer()).getPSDER1NDEFieldMaps()) for(IPSDER1NDEFieldMap derField : ((PSDER1NImpl)rel.getDer()).getPSDER1NDEFieldMaps())
{ {
if(derField.getMapType().equals("COUNT") || derField.getMapType().equals("SUM") if(derField.getMapType().equals("COUNT") || derField.getMapType().equals("SUM")
...@@ -618,7 +621,7 @@ public class EntityModel extends BaseModel { ...@@ -618,7 +621,7 @@ public class EntityModel extends BaseModel {
if(der.getMajorPSDataEntity().getKeyPSDEField()!=null) if(der.getMajorPSDataEntity().getKeyPSDEField()!=null)
{ {
LookupModel lookupModel = new LookupModel().setRelationid(der.getId()) LookupModel lookupModel = new LookupModel().setRelationid(der.getId())
.setFieldname(this.getKeyField().getName()).setCodeName(this.getKeyField().getCodeName()) .setFieldname(this.getDataEntity().getMajorPSDEField().getName()).setCodeName(this.getDataEntity().getMajorPSDEField().getCodeName())
.setReffieldname(der.getMajorPSDataEntity().getKeyPSDEField().getName()).setRefCodeName(der.getMajorPSDataEntity().getKeyPSDEField().getCodeName()); .setReffieldname(der.getMajorPSDataEntity().getKeyPSDEField().getName()).setRefCodeName(der.getMajorPSDataEntity().getKeyPSDEField().getCodeName());
rel.addLookup(lookupModel); rel.addLookup(lookupModel);
} }
......
...@@ -236,19 +236,19 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam ...@@ -236,19 +236,19 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
if(!ObjectUtils.isEmpty(key)) if(!ObjectUtils.isEmpty(key))
keys.add(key); keys.add(key);
}); });
List<{{entity.codeName}}> create=new ArrayList<>(); List<{{entity.codeName}}> _create=new ArrayList<>();
List<{{entity.codeName}}> update=new ArrayList<>(); List<{{entity.codeName}}> _update=new ArrayList<>();
list.forEach(et-> { list.forEach(et-> {
Serializable key = et.get{{pascalCase entity.keyField.codeName}}(); Serializable key = et.get{{pascalCase entity.keyField.codeName}}();
if(keys.contains(key)) if(keys.contains(key))
update.add(et); _update.add(et);
else else
create.add(et); _create.add(et);
}); });
List rtList=new ArrayList<>(); List rtList=new ArrayList<>();
if(update.size()>0 && (!{{camelCase entity.codeName}}Service.updateBatch(update))) if(_update.size()>0 && (!{{camelCase entity.codeName}}Service.updateBatch(_update)))
return false; return false;
if(create.size()>0 && (!{{camelCase entity.codeName}}Service.createBatch(create))) if(_create.size()>0 && (!{{camelCase entity.codeName}}Service.createBatch(_create)))
return false; return false;
return true; return true;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册