Commit 78239ed7 authored by 史志龙's avatar 史志龙

Merge branch 'dev-szl' into 'dev'

针对导入的数据进行排序页面查询返回 --shizhilong

See merge request !19
parents e8061385 c6a0611a
...@@ -101,7 +101,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -101,7 +101,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
List<MovementCourse> listResult = movementCourseService.lambdaQuery() List<MovementCourse> listResult = movementCourseService.lambdaQuery()
.eq(ObjectUtil.isNotEmpty(id), MovementCourse::getMovementMasterId, id) .eq(ObjectUtil.isNotEmpty(id), MovementCourse::getMovementMasterId, id)
.eq(MovementCourse::getDelFlag, "0") .eq(MovementCourse::getDelFlag, "0")
.orderByAsc(MovementCourse::getCreateTime) .orderByAsc(MovementCourse::getSort)
.list(); .list();
List<MovementCourseVO> resultList = new ArrayList<>(); List<MovementCourseVO> resultList = new ArrayList<>();
if (listResult != null) { if (listResult != null) {
...@@ -125,13 +125,16 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -125,13 +125,16 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
.eq(ObjectUtil.isNotEmpty(movementMasterId), MovementCourseInfo::getMovementMasterId, movementMasterId) .eq(ObjectUtil.isNotEmpty(movementMasterId), MovementCourseInfo::getMovementMasterId, movementMasterId)
.eq(ObjectUtil.isNotEmpty(movementCourseId), MovementCourseInfo::getMovementCourseId, movementCourseId) .eq(ObjectUtil.isNotEmpty(movementCourseId), MovementCourseInfo::getMovementCourseId, movementCourseId)
.eq(MovementCourseInfo::getDelFlag, "0") .eq(MovementCourseInfo::getDelFlag, "0")
.orderByDesc(MovementCourseInfo::getTrackCode) .orderByAsc(MovementCourseInfo::getInfoSort)
.list(); .list();
//初始化最终返回的集合 //初始化最终返回的集合
List<MovementCourseInfoOneVO> resultList = new ArrayList<>(); List<MovementCourseInfoOneVO> resultList = new ArrayList<>();
if (listResult != null && listResult.size() > 0) { if (listResult != null && listResult.size() > 0) {
//获取去重后的项目名称的集合 //获取去重后的项目名称的集合
Set<String> trackCodeList = listResult.stream().map(MovementCourseInfo::getTrackCode).collect(Collectors.toSet()); Set<String> trackCodeList1 = listResult.stream().map(MovementCourseInfo::getTrackCode).collect(Collectors.toSet());
List<String> trackCodeList = trackCodeList1.stream().collect(Collectors.toList());
//针对轨号进行倒序排序
Collections.reverse(trackCodeList);
for (String code : trackCodeList) { for (String code : trackCodeList) {
//初始化最终返回的对象 //初始化最终返回的对象
MovementCourseInfoOneVO resultModel = new MovementCourseInfoOneVO(); MovementCourseInfoOneVO resultModel = new MovementCourseInfoOneVO();
...@@ -290,6 +293,10 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -290,6 +293,10 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
// 如果做完了一个解析就跳过 // 如果做完了一个解析就跳过
MovementCourse movementCourse = new MovementCourse(); MovementCourse movementCourse = new MovementCourse();
List<MovementCourseInfo> resultList = new ArrayList<>(); List<MovementCourseInfo> resultList = new ArrayList<>();
//初始化里程排序
int sort = 0;
//初始化轨号排序
int infoSort = 0;
for (int i = 0; i < column; i++) { for (int i = 0; i < column; i++) {
skipColumnNum++; skipColumnNum++;
if (ObjectUtil.isEmpty(startingAndEndingMileageStr)) { if (ObjectUtil.isEmpty(startingAndEndingMileageStr)) {
...@@ -368,6 +375,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -368,6 +375,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
if (ObjectUtil.isNotEmpty(longExtent)) { if (ObjectUtil.isNotEmpty(longExtent)) {
movementCourse.setLongExtent(new BigDecimal(longExtent)); movementCourse.setLongExtent(new BigDecimal(longExtent));
} }
sort ++;
courseId = IdWorker.get32UUID(); courseId = IdWorker.get32UUID();
movementCourse.setId(courseId); movementCourse.setId(courseId);
movementCourse.setDelFlag("0"); movementCourse.setDelFlag("0");
...@@ -376,6 +384,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -376,6 +384,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
movementCourse.setCreateBy(realname); movementCourse.setCreateBy(realname);
movementCourse.setUpdateBy(realname); movementCourse.setUpdateBy(realname);
movementCourse.setRemark(remark); movementCourse.setRemark(remark);
movementCourse.setSort(sort);
movementCourseService.save(movementCourse); movementCourseService.save(movementCourse);
} }
} }
...@@ -388,7 +397,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -388,7 +397,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
continue; continue;
} }
if (ObjectUtil.isNotEmpty(courseId)) { if (ObjectUtil.isNotEmpty(courseId)) {
infoSort ++;
MovementCourseInfo movementCourseInfo = new MovementCourseInfo(); MovementCourseInfo movementCourseInfo = new MovementCourseInfo();
movementCourseInfo.setId(IdWorker.get32UUID()); movementCourseInfo.setId(IdWorker.get32UUID());
movementCourseInfo.setDelFlag("0"); movementCourseInfo.setDelFlag("0");
...@@ -398,6 +407,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -398,6 +407,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
movementCourseInfo.setUpdateTime(new Date()); movementCourseInfo.setUpdateTime(new Date());
movementCourseInfo.setCreateBy(realname); movementCourseInfo.setCreateBy(realname);
movementCourseInfo.setUpdateBy(realname); movementCourseInfo.setUpdateBy(realname);
movementCourseInfo.setInfoSort(infoSort);
//获取轨号 //获取轨号
List<Object> trackCodeList = rowRecords.get(6); List<Object> trackCodeList = rowRecords.get(6);
String trackCode = trackCodeList.get(i).toString().trim(); String trackCode = trackCodeList.get(i).toString().trim();
...@@ -472,6 +482,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -472,6 +482,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
longExtent = ""; longExtent = "";
remark = ""; remark = "";
courseId = ""; courseId = "";
infoSort = 0;
movementCourse = new MovementCourse(); movementCourse = new MovementCourse();
} }
} }
......
package org.jeecg.modules.checkData.equipmentCheckData.dto; package org.jeecg.modules.checkData.equipmentCheckData.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -65,5 +66,7 @@ public class MovementCourseDTO { ...@@ -65,5 +66,7 @@ public class MovementCourseDTO {
@ApiModelProperty("是否删除(0:未删除;1:已删除)") @ApiModelProperty("是否删除(0:未删除;1:已删除)")
private String delFlag; private String delFlag;
@ApiModelProperty("排序")
private Integer sort;
} }
package org.jeecg.modules.checkData.equipmentCheckData.dto; package org.jeecg.modules.checkData.equipmentCheckData.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -71,5 +72,6 @@ public class MovementCourseInfoDTO { ...@@ -71,5 +72,6 @@ public class MovementCourseInfoDTO {
@ApiModelProperty("是否删除(0:未删除;1:已删除)") @ApiModelProperty("是否删除(0:未删除;1:已删除)")
private String delFlag; private String delFlag;
@ApiModelProperty("导入顺序")
private Integer infoSort;
} }
...@@ -94,5 +94,8 @@ public class MovementCourse implements Serializable { ...@@ -94,5 +94,8 @@ public class MovementCourse implements Serializable {
@TableField("del_flag") @TableField("del_flag")
private String delFlag; private String delFlag;
@ApiModelProperty("排序")
@TableField("sort")
private Integer sort;
} }
...@@ -102,5 +102,8 @@ public class MovementCourseInfo implements Serializable { ...@@ -102,5 +102,8 @@ public class MovementCourseInfo implements Serializable {
@TableField("del_flag") @TableField("del_flag")
private String delFlag; private String delFlag;
@ApiModelProperty("导入顺序")
@TableField("info_sort")
private Integer infoSort;
} }
...@@ -77,5 +77,6 @@ public class MovementCourseInfoVO { ...@@ -77,5 +77,6 @@ public class MovementCourseInfoVO {
@ApiModelProperty("是否删除(0:未删除;1:已删除)") @ApiModelProperty("是否删除(0:未删除;1:已删除)")
private String delFlag; private String delFlag;
@ApiModelProperty("导入顺序")
private Integer infoSort;
} }
...@@ -71,5 +71,6 @@ public class MovementCourseVO { ...@@ -71,5 +71,6 @@ public class MovementCourseVO {
@ApiModelProperty("是否删除(0:未删除;1:已删除)") @ApiModelProperty("是否删除(0:未删除;1:已删除)")
private String delFlag; private String delFlag;
@ApiModelProperty("排序")
private Integer sort;
} }
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