|
@@ -630,48 +630,48 @@ public class ApsProductDetailServiceImpl extends ServiceImpl<ApsProductDetailDao
|
|
|
String alloy = orderDetail.getAlloy();
|
|
|
String alloystatus = orderDetail.getAlloystatus();
|
|
|
|
|
|
-// List<GetOldTechnicalRequirementRes> apsProductDetailDoList = this.baseMapper.selectMyList(technicalRequirementId, orderDetail.getId(), alloy, alloystatus, orderProductTypeId);
|
|
|
- List<GetOldTechnicalRequirementRes> list1 = this.baseMapper.selectMyList1(technicalRequirementId, orderDetail.getId(), customId, alloy);
|
|
|
- List<GetOldTechnicalRequirementRes> list2 = this.baseMapper.selectMyList2(technicalRequirementId, orderDetail.getId(), customId, alloystatus);
|
|
|
- List<GetOldTechnicalRequirementRes> list3 = this.baseMapper.selectMyList3(technicalRequirementId, orderDetail.getId(), customId, orderProductTypeId);
|
|
|
-
|
|
|
- //合并三个list
|
|
|
- List<GetOldTechnicalRequirementRes> apsProductDetailDoList = new LinkedList<>();
|
|
|
- apsProductDetailDoList.addAll(list1);
|
|
|
- apsProductDetailDoList.addAll(list2);
|
|
|
- apsProductDetailDoList.addAll(list3);
|
|
|
- apsProductDetailDoList = apsProductDetailDoList.stream().distinct().collect(Collectors.toList());
|
|
|
-
|
|
|
- List<GetOldTechnicalRequirementRes> list = new LinkedList<>();
|
|
|
- for (GetOldTechnicalRequirementRes vo : apsProductDetailDoList) {
|
|
|
- int score = 0;
|
|
|
- if (ObjectUtil.isNotEmpty(vo.getAlloy()) && vo.getAlloy().equals(alloy)) {
|
|
|
- score += 10;
|
|
|
- }
|
|
|
- if (ObjectUtil.isNotEmpty(vo.getAlloystatus()) && vo.getAlloystatus().equals(alloystatus)) {
|
|
|
- score += 1;
|
|
|
- }
|
|
|
- if (ObjectUtil.isNotEmpty(vo.getOrderproducttypeid()) && vo.getOrderproducttypeid().equals(orderProductTypeId)) {
|
|
|
- score += 100;
|
|
|
- }
|
|
|
- vo.setScore(score);
|
|
|
- list.add(vo);
|
|
|
- }
|
|
|
-
|
|
|
- list.sort((a, b) -> {
|
|
|
- if (a.getScore() > b.getScore()) {
|
|
|
- return -1;
|
|
|
- } else if (a.getScore() < b.getScore()) {
|
|
|
- return 1;
|
|
|
- } else {//分数相同时,按照创建时间倒序
|
|
|
- return b.getCreatedate().compareTo(a.getCreatedate());
|
|
|
- }
|
|
|
- });
|
|
|
- GetOldTechnicalRequirementRes res = null;
|
|
|
- if (ObjectUtil.isNotEmpty(list)) {
|
|
|
- res = list.get(0);
|
|
|
- }
|
|
|
- return R.ok(res);
|
|
|
+ GetOldTechnicalRequirementRes apsProductDetailDo = this.baseMapper.selectMyList(technicalRequirementId, orderDetail.getId(), alloy, alloystatus, orderProductTypeId);
|
|
|
+// List<GetOldTechnicalRequirementRes> list1 = this.baseMapper.selectMyList1(technicalRequirementId, orderDetail.getId(), customId, alloy);
|
|
|
+// List<GetOldTechnicalRequirementRes> list2 = this.baseMapper.selectMyList2(technicalRequirementId, orderDetail.getId(), customId, alloystatus);
|
|
|
+// List<GetOldTechnicalRequirementRes> list3 = this.baseMapper.selectMyList3(technicalRequirementId, orderDetail.getId(), customId, orderProductTypeId);
|
|
|
+//
|
|
|
+// //合并三个list
|
|
|
+// List<GetOldTechnicalRequirementRes> apsProductDetailDoList = new LinkedList<>();
|
|
|
+// apsProductDetailDoList.addAll(list1);
|
|
|
+// apsProductDetailDoList.addAll(list2);
|
|
|
+// apsProductDetailDoList.addAll(list3);
|
|
|
+// apsProductDetailDoList = apsProductDetailDoList.stream().distinct().collect(Collectors.toList());
|
|
|
+//
|
|
|
+// List<GetOldTechnicalRequirementRes> list = new LinkedList<>();
|
|
|
+// for (GetOldTechnicalRequirementRes vo : apsProductDetailDoList) {
|
|
|
+// int score = 0;
|
|
|
+// if (ObjectUtil.isNotEmpty(vo.getAlloy()) && vo.getAlloy().equals(alloy)) {
|
|
|
+// score += 10;
|
|
|
+// }
|
|
|
+// if (ObjectUtil.isNotEmpty(vo.getAlloystatus()) && vo.getAlloystatus().equals(alloystatus)) {
|
|
|
+// score += 1;
|
|
|
+// }
|
|
|
+// if (ObjectUtil.isNotEmpty(vo.getOrderproducttypeid()) && vo.getOrderproducttypeid().equals(orderProductTypeId)) {
|
|
|
+// score += 100;
|
|
|
+// }
|
|
|
+// vo.setScore(score);
|
|
|
+// list.add(vo);
|
|
|
+// }
|
|
|
+//
|
|
|
+// list.sort((a, b) -> {
|
|
|
+// if (a.getScore() > b.getScore()) {
|
|
|
+// return -1;
|
|
|
+// } else if (a.getScore() < b.getScore()) {
|
|
|
+// return 1;
|
|
|
+// } else {//分数相同时,按照创建时间倒序
|
|
|
+// return b.getCreatedate().compareTo(a.getCreatedate());
|
|
|
+// }
|
|
|
+// });
|
|
|
+// GetOldTechnicalRequirementRes res = null;
|
|
|
+// if (ObjectUtil.isNotEmpty(list)) {
|
|
|
+// res = list.get(0);
|
|
|
+// }
|
|
|
+ return R.ok(apsProductDetailDo);
|
|
|
}
|
|
|
|
|
|
|