|
|
@ -263,6 +263,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
|
SchBasePoint schBasePoint = schBasePoints.get(0); |
|
|
|
schBasePoint.setVehicle_code(vehicleCode); |
|
|
|
schBasePoint.setIs_lock(true); |
|
|
|
update(Wrappers.lambdaUpdate(SchBasePoint.class) |
|
|
|
.eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) |
|
|
|
.set(SchBasePoint::getIs_lock, true)); |
|
|
|
return schBasePoint; |
|
|
|
} |
|
|
|
SchBasePoint schBasePoint1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code)).get(0); |
|
|
@ -280,6 +283,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
|
SchBasePoint schBasePoint = schBasePoints1.get(0); |
|
|
|
schBasePoint.setVehicle_code(vehicleCode); |
|
|
|
schBasePoint.setIs_lock(true); |
|
|
|
update(Wrappers.lambdaUpdate(SchBasePoint.class) |
|
|
|
.eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) |
|
|
|
.set(SchBasePoint::getIs_lock, true)); |
|
|
|
return schBasePoint; |
|
|
|
} |
|
|
|
return null; |
|
|
@ -492,6 +498,27 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
|
return pointMapper.selectJobDevice(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<OrderMater> selectOrder(String regionCode) { |
|
|
|
Assert.notBlank(regionCode, "工序不能为空"); |
|
|
|
Param dueDate = iSysParamService.findByCode("due_date"); |
|
|
|
String s = null; |
|
|
|
if (dueDate != null && StringUtils.isNotEmpty(dueDate.getValue())) { |
|
|
|
s = DateUtil.offsetDay(new Date(), Integer.parseInt(dueDate.getValue())).toDateStr(); |
|
|
|
} |
|
|
|
List<OrderMater> structList = pointMapper.getStructList(regionCode, null, s); |
|
|
|
List<OrderMater> collect = structList.stream().collect(Collectors.groupingBy( |
|
|
|
OrderMater::getVehicle_code, |
|
|
|
Collectors.collectingAndThen( |
|
|
|
Collectors.maxBy(Comparator.comparing(OrderMater::getDue_date)), |
|
|
|
Optional::get |
|
|
|
) |
|
|
|
)).values() |
|
|
|
.stream() |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return collect; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<OrderMater> getStructList(String region_code, String vehicle_type) { |
|
|
|
//1.查询的结果一个托盘有多个800,PC需要怎么展示?
|
|
|
@ -506,15 +533,23 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch |
|
|
|
List<OrderMater> collect = structList.stream().collect(Collectors.groupingBy( |
|
|
|
OrderMater::getVehicle_code, |
|
|
|
Collectors.collectingAndThen( |
|
|
|
Collectors.maxBy(Comparator.comparing(OrderMater::getDue_date)), |
|
|
|
Collectors.minBy(Comparator.comparing(OrderMater::getDue_date)), |
|
|
|
Optional::get |
|
|
|
) |
|
|
|
)).values() |
|
|
|
.stream() |
|
|
|
.collect(Collectors.toList()); |
|
|
|
collect = collect.stream().sorted(Comparator.comparingLong(order -> getTime(order.getDue_date()))).collect(Collectors.toList()); |
|
|
|
return collect; |
|
|
|
} |
|
|
|
|
|
|
|
private Long getTime(String dateString){ |
|
|
|
String pattern = "yyyy-MM-dd HH:mm:ss"; |
|
|
|
java.util.Date date = DateUtil.parse(dateString, pattern); |
|
|
|
long timestamp = date.getTime(); |
|
|
|
return timestamp; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW) |
|
|
|
public SchBasePoint selectEmpVehicleByRegionCode(String region_code, String... vehicleType) { |
|
|
|