Commit cceb7ef0 by huluobin

update

parent 889fae8b
......@@ -144,5 +144,5 @@ public interface ScheduleManageService extends IService<ScheduleManage> {
String scheduleDate,
List<Integer> serveIdList) throws ParseException;
StoreTechnician queryLeisureTechnician(Integer departmentId, Integer serveId, LocalDateTime serveStartTime, LocalDateTime serveEndTime) throws ParseException;
List<StoreTechnician> queryLeisureTechnician(Integer departmentId, Integer serveId, LocalDateTime serveStartTime, LocalDateTime serveEndTime) throws ParseException;
}
......@@ -809,7 +809,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServeList.forEach(orderServe -> {
OrderComment orderComment = orderCommentMapper.selectOne(new LambdaQueryWrapper<OrderComment>().eq(OrderComment::getOrderId, id)
.eq(OrderComment::getOrderServeId, orderServe.getId()));
List<Integer> technicianIds = Lists.newArrayList(orderServe.getTechnicianIds().split(",")).stream().map(Integer::valueOf).collect(Collectors.toList());
List<Integer> technicianIds = Lists.newArrayList(orderServe.getTechnicianId().split(",")).stream().map(Integer::valueOf).collect(Collectors.toList());
List<StoreTechnician> storeTechnicianList = storeTechnicianMapper.selectBatchIds(technicianIds);
orderServe.setListTechnicianManage(storeTechnicianList);
});
......
......@@ -204,15 +204,19 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
}
@Override
public StoreTechnician queryLeisureTechnician(Integer departmentId, Integer serveId, LocalDateTime serveStartTime, LocalDateTime serveEndTime) throws ParseException {
public List<StoreTechnician> queryLeisureTechnician(Integer departmentId, Integer serveId, LocalDateTime serveStartTime, LocalDateTime serveEndTime) throws ParseException {
List<StoreTechnicianQuery> storeTechnicianQueryList = this.storeTechnicianQueryList(null, departmentId, serveStartTime.toLocalDate().toString(), Lists.newArrayList(serveId));
Period servePeriod = new Period(serveStartTime.toInstant(ZoneOffset.of("+8")).toEpochMilli(),
serveEndTime.toInstant(ZoneOffset.of("+8")).toEpochMilli());
StoreTechnicianQuery query = storeTechnicianQueryList.stream().filter(storeTechnicianQuery -> !storeTechnicianQuery.getPeriodList().stream().map(period -> period.conflict(servePeriod))
.collect(Collectors.toList()).contains(true))
.findAny().orElse(new StoreTechnicianQuery());
StoreTechnician storeTechnician = storeTechnicianMapper.selectById(query.getTechnicianId());
return storeTechnician;
List<Integer> technicianIds = storeTechnicianQueryList.stream().filter(storeTechnicianQuery ->
!storeTechnicianQuery.getPeriodList().stream().map(period -> period.conflict(servePeriod))
.collect(Collectors.toList()).contains(true))
.map(StoreTechnicianQuery::getTechnicianId)
.collect(Collectors.toList());
if (ListUtil.isNotEmpty(technicianIds)) {
return storeTechnicianMapper.selectBatchIds(technicianIds);
}
return Lists.newArrayList();
}
......@@ -1533,9 +1537,29 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
leisureScheduleServe.getLongitude().toString()));
leisureScheduleServe.setDateTime(LocalDateTime.of(leisureScheduleServe.getWeekDate(), leisureScheduleServe.getTimeNode()));
});
List<LeisureScheduleServe> list = page.getRecords().stream()
.peek(leisureScheduleServe -> {
try {
leisureScheduleServe.setStoreTechnicianList(this.queryLeisureTechnician(leisureScheduleServe));
} catch (ParseException e) {
throw new RRException(e.getMessage());
}
})
.filter(leisureScheduleServe -> ListUtil.isNotEmpty(leisureScheduleServe.getStoreTechnicianList()))
.collect(Collectors.toList());
page.setRecords(list);
return page;
}
private List<StoreTechnician> queryLeisureTechnician(LeisureScheduleServe leisureScheduleServe) throws ParseException {
BaseServe baseServe = baseServeMapper.selectById(leisureScheduleServe.getServeId());
LocalDateTime startTime = leisureScheduleServe.getDateTime();
LocalDateTime endTime = startTime.plusMinutes(baseServe.getServiceDuration()).plusMinutes(60);
List<StoreTechnician> storeTechnicianList = this.queryLeisureTechnician(leisureScheduleServe.getDepartmentId(), baseServe.getId(), startTime, endTime);
return storeTechnicianList;
}
/**
* 参数补全
*
......
......@@ -76,6 +76,8 @@ public class OrderServe implements Serializable {
private BigDecimal servePrice;
@ApiModelProperty("服务分类")
private String serveType;
private Integer serveTypeId;
/**
* 预约款式vo
*/
......
package com.gogirl.dto;
import com.gogirl.domain.store.store.StoreTechnician;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
@Data
public class LeisureScheduleServe {
......@@ -33,4 +35,6 @@ public class LeisureScheduleServe {
private Double distance;
private LocalDateTime dateTime;
private List<StoreTechnician> storeTechnicianList;
}
......@@ -100,8 +100,7 @@ public class OrderManageController {
@ApiOperation(value = "查询订单")
@GetMapping(value = "/customer/ordermanage/queryOrderForDetail")
public JsonResult<OrderManageDTO> customerQueryOrderForDetail(@RequestParam Integer id,
@RequestParam Integer filterMainServe) {
public JsonResult<OrderManageDTO> customerQueryOrderForDetail(@RequestParam Integer id) {
OrderManage orderManage = orderManageService.queryOrder(id);
return JsonResult.success(orderManageDTOAssembler.apply(orderManage));
}
......
......@@ -239,8 +239,8 @@ public class ScheduleManageController {
@PostMapping("/customer/queryLeisureTechnician")
public JsonResult<StoreTechnician> queryLeisureTechnician(@RequestBody QueryLeisureTechnicianReq req) throws ParseException {
StoreTechnician storeTechnician = scheduleManageService.queryLeisureTechnician(req.getDepartmentId(), req.getServeId(), req.getStartTime(), req.getEndTime());
return JsonResult.success(storeTechnician);
scheduleManageService.queryLeisureTechnician(req.getDepartmentId(), req.getServeId(), req.getStartTime(), req.getEndTime());
return JsonResult.success();
}
......
......@@ -16,6 +16,9 @@ public class StoreTechnicianQuery implements Serializable {
* 美甲师的不可用时间段
*/
List<Period> periodList;
/**
* 美甲师id
*/
private Integer technicianId;
private String name;
private String picturePath;
......
......@@ -11,7 +11,7 @@
GROUP BY t1.id
HAVING count(t1.id) > 0
and t1.has_index_show = 1
order by index_sort ASC
order by t1.index_sort ASC
</select>
<select id="queryServeFeatures" resultType="com.gogirl.domain.product.serve.BaseFeatures">
......@@ -23,10 +23,10 @@
and t1.has_index_show = 1
and t3.has_purchase_show = 1
<if test="typeId != null">
and t.type_id = #{typeId}
and t3.type_id = #{typeId}
</if>
GROUP BY t1.id
HAVING count(t1.id) >0
order by index_sort ASC
order by t1.index_sort ASC
</select>
</mapper>
\ 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