Commit 24a5fe27 authored by 廖旭伟's avatar 廖旭伟

终端我的填单记录去重

parent 82c00ed5
Pipeline #2982 canceled with stages
......@@ -132,7 +132,17 @@ public class TerminalController extends BaseJsonBodyController {
try {
if(StringUtils.isNotEmpty(query.getMobile())||StringUtils.isNotEmpty(query.getIdCard())) {
PageInfo pageInfo = this.buildPageInfo(query);
this.buildPermisionSql(query);
if(CollectionUtils.isEmpty(query.getOrderColList())){
query.setOrderColList(Arrays.asList(new OrderCol("createTime", OrderCol.DESCENDING)));
}
List<UserFillHistoryEntity> listAll = userFillHistoryService.find(query);
List<Long> materialId = new ArrayList<>();
for(UserFillHistoryEntity entity:listAll){
if(!materialId.contains(entity.getMaterialId())){
materialId.add(entity.getMaterialId());
}
}
query.setMaterialIdList(materialId);
Result<UserFillHistoryEntity> result = userFillHistoryService.find(query, pageInfo, this.getContext());
model.put("data", result.getList());
model.put("pageInfo", result.getPageInfo());
......@@ -179,13 +189,6 @@ public class TerminalController extends BaseJsonBodyController {
model.put("pageInfo", pageInfo);
}
protected void buildPermisionSql(UserFillHistoryEntity query) {
String sql = (String)this.request.getAttribute("DATA_PERMISSION_SEARCH_SQL");
if (!ObjectUtils.isEmpty(sql)) {
query.setPermissionSql(sql);
}
}
public static void main(String[] args) {
try {
......
......@@ -19,5 +19,6 @@ public class UserFillHistoryVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/** 材料id列表 */
private List <Long> materialIdList;
}
\ 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