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

bug fix

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