Commit edc0727d by huluobin

update

parent 5ee9a4c4
......@@ -746,13 +746,13 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
ScheduleManageCommand scheduleManageDTO = cmd.getScheduleManageDTO();
cmd.getScheduleManageDTO().getScheduleServeDTOList().forEach(scheduleServeCommand -> {
if (scheduleServeCommand.getMainServeId() == null) {
BaseServe baseServe = baseServeMapper.selectById(scheduleServeCommand.getServeId());
List<ScheduleServe> typeConflictScheduleServe = scheduleServeMapper.selectConflictType(
scheduleServeCommand.getId(),
scheduleManageDTO.getScheduledUser(),
scheduleManageDTO.getArriveTime(),
baseServe.getType());
baseServe.getSchTypeId());
if (ListUtil.isNotEmpty(typeConflictScheduleServe)) {
throw new RRException("同类型服务一天只能预约一次");
}
......
......@@ -7,15 +7,9 @@ import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* Created by yinyong on 2018/10/17.
*/
public interface ScheduleServeMapper extends BaseMapper<ScheduleServe> {
List<ScheduleServe> selectConflictType(@Param("scheduleServeId") Integer scheduleServeId,
@Param("scheduledUser") Integer scheduledUser,
List<ScheduleServe> selectConflictType(@Param("scheduledUser") Integer scheduledUser,
@Param("days") Date days,
@Param("serveTypeName") String serveTypeName);
@Param("schTypeId") Integer schTypeId);
}
......@@ -7,13 +7,12 @@
SELECT t1.*
from scheduled_serve t1
LEFT JOIN scheduled_manage t2 on t1.sch_id = t2.id
LEFT JOIN base_serve t3 on t1.serve_type
LEFT JOIN base_serve t3 on t1.serve_id = t3.id
where t2.scheduled_user = #{scheduledUser}
and t1.serve_type = #{serveTypeName}
and t3.sch_type_id = #{schTypeId}
and TO_DAYS(t1.start_time) = TO_DAYS(#{days})
and t1.main_serve_id is null
and t2.`status` = 1
and t1.id != #{scheduleServeId}
</select>
</mapper>
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