[#462] getServiceAvailableTimeIntervals 获取可用时间问题

Migrated from Redmine #462 | Author: 刚 宋
Status: New | Priority: High, I’m very impatient | Created: 2020-01-07


我在某一个服务中添加了预定订单,比如我给A服务添加了一个13:00到14:00的订单,我在获取其他服务的可用时间时怎么也没有了13:00-14:00这一时间段,不是应该只有A服务才没有吗
var availableTime = client.getServiceAvailableTimeIntervals(dateFrom,dateTo,eventId,unitId,0);
返回结果如下
{“2020-01-07”:{“1”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“2”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“3”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“4”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“5”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“6”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“7”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}]}}
事实上我只有eventId为7的那个服务才有一个订单
这是怎么回事

Redmine Admin wrote:

Please write your question in English

刚 宋 wrote:

I added a reservation order to a service. For example, I added an order from 13:00 to 14:00 to A service. When I got the available time of other services, I didn’t have the period from 13:00 to 14:00. Shouldn’t it be only A service?

I use

client.book (7,unitId,clientId,“2020-01-07”,“13:00:00”,“2020-01-07”,“14:00:00”,0);

var availableTime = client.getServiceAvailableTimeIntervals(“2020-01-07”,“2020-01-07”,[1,2,3,4,5,6,7],unitId,0);

return:
{“2020-01-07”:{“1”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“2”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“3”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“4”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“5”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“6”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}],“7”:[{“from”:“10:00:00”,“to”:“13:00:00”},{“from”:“14:00:00”,“to”:“24:00:00”}]}}

Other services should be available from 13:00 to 14:00, but now they don’t

Redmine Admin wrote:

you booked service provider (unitId) which may do other services as well. You need to have special service provider for each service if you need other services to be available from 13:00 to 14:00

刚 宋 wrote:

Can’t multiple services be booked separately under one service provider

Redmine Admin wrote:

yes of course, you need to check how many clients at same time this provider may handle (in provider’s settings). By default it is set to 1 which means if one service booked then this time is not available anymore

刚 宋 wrote:

We set up 1 client
return
{“2020-01-09”:{“1”:[{“from”:“10:00:00”,“to”:“12:00:00”},{“from”:“13:00:00”,“to”:“24:00:00”}],“2”:[{“from”:“10:00:00”,“to”:“12:00:00”},{“from”:“13:00:00”,“to”:“24:00:00”}],“3”:[{“from”:“10:00:00”,“to”:“12:00:00”},{“from”:“13:00:00”,“to”:“24:00:00”}]}}

We set up 2 clients
return
{“2020-01-09”:{“1”:[{“from”:“10:00:00”,“to”:“24:00:00”}],“2”:[{“from”:“10:00:00”,“to”:“24:00:00”}],“3”:[{“from”:“10:00:00”,“to”:“24:00:00”}]}}

We now need a service provider with multiple services. If a service is ordered, this time will continue to be available for other services
such as
{“2020-01-09”:{“1”:[{“from”:“10:00:00”,“to”:“12:00:00”},{“from”:“13:00:00”,“to”:“24:00:00”}],“2”:[{“from”:“10:00:00”,“to”:“24:00:00”}],“3”:[{“from”:“10:00:00”,“to”:“24:00:00”}]}}

What should we do?

Redmine Admin wrote:

You need multiple slots per provider OR different provider for each service