Commit ad414632 authored by 赵啸非's avatar 赵啸非

添加材料列表根据材料名称去重

parent 59e1b4ff
......@@ -434,14 +434,14 @@ public class MatterDatumEntity extends MatterDatumVo {
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getMaterialName().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof MatterDatumEntity) {
MatterDatumEntity tmp = (MatterDatumEntity) obj;
if (this.getId() == tmp.getId()) {
if (this.getMaterialName() == tmp.getMaterialName()) {
return true;
}
}
......
......@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 事项申请材料
......@@ -58,4 +59,21 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
entity.setDatumFileList(matterDatumFileEntities);
return super.viewAfter(id, model, entity, context);
}
/**
* @param query
* @param model
* @param context
* @return
* @throws AppException
*/
@Override
protected int doListAfter(MatterDatumEntity query, Map<String, Object> model, Context context) throws AppException {
List<MatterDatumEntity> matterDatumEntities = (List<MatterDatumEntity>) model.get(KEY_RESULT_DATA);
//去重复
List<MatterDatumEntity> collect = matterDatumEntities.stream().distinct().collect(Collectors.toList());
model.put(KEY_RESULT_DATA,collect);
return super.doListAfter(query, model, context);
}
}
\ No newline at end of file
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